Files
edgeever/apps/ios/EditorBundle/index.html
T
tianma-if 5124ef3539 fix(ios): image UX, editor stability, and create draft hygiene
Align iOS TipTap images with Android (width presets, ⋯ actions, WebP
compress, reliable preview). Persist contentJson so image width survives
detail/viewer; force shared WebView re-push and block late autosave so
new notes open empty. Long-press fullscreen image preview opens resource
actions on both iOS and Android.
2026-08-07 19:12:27 +08:00

3803 lines
3.8 MiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
/>
<title>EdgeEver Editor</title>
<script type="module" crossorigin>var i7e=Object.defineProperty;var a7e=(t,e,r)=>e in t?i7e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var jt=(t,e,r)=>a7e(t,typeof e!="symbol"?e+"":e,r);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();function Wa(t){this.content=t}Wa.prototype={constructor:Wa,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,r){var n=r&&r!=t?this.remove(r):this,i=n.find(t),a=n.content.slice();return i==-1?a.push(r||t,e):(a[i+1]=e,r&&(a[i]=r)),new Wa(a)},remove:function(t){var e=this.find(t);if(e==-1)return this;var r=this.content.slice();return r.splice(e,2),new Wa(r)},addToStart:function(t,e){return new Wa([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var r=this.remove(t).content.slice();return r.push(t,e),new Wa(r)},addBefore:function(t,e,r){var n=this.remove(e),i=n.content.slice(),a=n.find(t);return i.splice(a==-1?i.length:a,0,e,r),new Wa(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Wa.from(t),t.size?new Wa(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Wa.from(t),t.size?new Wa(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Wa.from(t);for(var r=0;r<t.content.length;r+=2)e=e.remove(t.content[r]);return e},toObject:function(){var t={};return this.forEach(function(e,r){t[e]=r}),t},get size(){return this.content.length>>1}};Wa.from=function(t){if(t instanceof Wa)return t;var e=[];if(t)for(var r in t)e.push(r,t[r]);return new Wa(e)};function wae(t,e,r){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:r;let i=t.child(n),a=e.child(n);if(i==a){r+=i.nodeSize;continue}if(!i.sameMarkup(a))return r;if(i.isText&&i.text!=a.text){let s=i.text,o=a.text,l=0;for(;s[l]==o[l];l++)r++;return l&&l<s.length&&l<o.length&&Sae(s.charCodeAt(l-1))&&kae(s.charCodeAt(l))&&r--,r}if(i.content.size||a.content.size){let s=wae(i.content,a.content,r+1);if(s!=null)return s}r+=i.nodeSize}}function Cae(t,e,r,n){for(let i=t.childCount,a=e.childCount;;){if(i==0||a==0)return i==a?null:{a:r,b:n};let s=t.child(--i),o=e.child(--a),l=s.nodeSize;if(s==o){r-=l,n-=l;continue}if(!s.sameMarkup(o))return{a:r,b:n};if(s.isText&&s.text!=o.text){let u=s.text,h=o.text,d=u.length,f=h.length;for(;d>0&&f>0&&u[d-1]==h[f-1];)d--,f--,r--,n--;return d&&f&&d<u.length&&Sae(u.charCodeAt(d-1))&&kae(u.charCodeAt(d))&&(r++,n++),{a:r,b:n}}if(s.content.size||o.content.size){let u=Cae(s.content,o.content,r-1,n-1);if(u)return u}r-=l,n-=l}}function kae(t){return t>=56320&&t<57344}function Sae(t){return t>=55296&&t<56320}class gt{constructor(e,r){if(this.content=e,this.size=r||0,r==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,r,n,i=0,a){for(let s=0,o=0;o<r;s++){let l=this.content[s],u=o+l.nodeSize;if(u>e&&n(l,i+o,a||null,s)!==!1&&l.content.size){let h=o+1;l.nodesBetween(Math.max(0,e-h),Math.min(l.content.size,r-h),n,i+h)}o=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,r,n,i){let a="",s=!0;return this.nodesBetween(e,r,(o,l)=>{let u=o.isText?o.text.slice(Math.max(e,l)-l,r-l):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&u||o.isTextblock)&&n&&(s?s=!1:a+=n),a+=u},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let r=this.lastChild,n=e.firstChild,i=this.content.slice(),a=0;for(r.isText&&r.sameMarkup(n)&&(i[i.length-1]=r.withText(r.text+n.text),a=1);a<e.content.length;a++)i.push(e.content[a]);return new gt(i,this.size+e.size)}cut(e,r=this.size){if(e==0&&r==this.size)return this;let n=[],i=0;if(r>e)for(let a=0,s=0;s<r;a++){let o=this.content[a],l=s+o.nodeSize;l>e&&((s<e||l>r)&&(o.isText?o=o.cut(Math.max(0,e-s),Math.min(o.text.length,r-s)):o=o.cut(Math.max(0,e-s-1),Math.min(o.content.size,r-s-1))),n.push(o),i+=o.nodeSize),s=l}return new gt(n,i)}cutByIndex(e,r){return e==r?gt.empty:e==0&&r==this.content.length?this:new gt(this.content.slice(e,r))}replaceChild(e,r){let n=this.content[e];if(n==r)return this;let i=this.content.slice(),a=this.size+r.nodeSize-n.nodeSize;return i[e]=r,new gt(i,a)}addToStart(e){return new gt([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new gt(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let r=0;r<this.content.length;r++)if(!this.content[r].eq(e.content[r]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let r=this.content[e];if(!r)throw new RangeError("Index "+e+" out of range for "+this);return r}maybeChild(e){return this.content[e]||null}forEach(e){for(let r=0,n=0;r<this.content.length;r++){let i=this.content[r];e(i,n,r),n+=i.nodeSize}}findDiffStart(e,r=0){return wae(this,e,r)}findDiffEnd(e,r=this.size,n=e.size){return Cae(this,e,r,n)}findIndex(e){if(e==0)return ZS(0,e);if(e==this.size)return ZS(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,n=0;;r++){let i=this.child(r),a=n+i.nodeSize;if(a>=e)return a==e?ZS(r+1,a):ZS(r,n);n=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,r){if(!r)return gt.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return gt.fromArray(r.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return gt.empty;let r,n=0;for(let i=0;i<e.length;i++){let a=e[i];n+=a.nodeSize,i&&a.isText&&e[i-1].sameMarkup(a)?(r||(r=e.slice(0,i)),r[r.length-1]=a.withText(r[r.length-1].text+a.text)):r&&r.push(a)}return new gt(r||e,n)}static from(e){if(!e)return gt.empty;if(e instanceof gt)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new gt([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}gt.empty=new gt([],0);const j7={index:0,offset:0};function ZS(t,e){return j7.index=t,j7.offset=e,j7}function l5(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let r=Array.isArray(t);if(Array.isArray(e)!=r)return!1;if(r){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!l5(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!l5(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let In=class JN{constructor(e,r){this.type=e,this.attrs=r}addToSet(e){let r,n=!1;for(let i=0;i<e.length;i++){let a=e[i];if(this.eq(a))return e;if(this.type.excludes(a.type))r||(r=e.slice(0,i));else{if(a.type.excludes(this.type))return e;!n&&a.type.rank>this.type.rank&&(r||(r=e.slice(0,i)),r.push(this),n=!0),r&&r.push(a)}}return r||(r=e.slice()),n||r.push(this),r}removeFromSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return e.slice(0,r).concat(e.slice(r+1));return e}isInSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return!0;return!1}eq(e){return this==e||this.type==e.type&&l5(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[r.type];if(!n)throw new RangeError(`There is no mark type ${r.type} in this schema`);let i=n.create(r.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,r){if(e==r)return!0;if(e.length!=r.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(r[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return JN.none;if(e instanceof JN)return[e];let r=e.slice();return r.sort((n,i)=>n.type.rank-i.type.rank),r}};In.none=[];class hC extends Error{}class $t{constructor(e,r,n){this.content=e,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,r){let n=Aae(this.content,e+this.openStart,r,this.openStart+1,this.openEnd+1);return n&&new $t(n,this.openStart,this.openEnd)}removeBetween(e,r){return new $t(Eae(this.content,e+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,r){if(!r)return $t.empty;let n=r.openStart||0,i=r.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new $t(gt.fromJSON(e,r.content),n,i)}static maxOpen(e,r=!0){let n=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.firstChild)n++;for(let a=e.lastChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.lastChild)i++;return new $t(e,n,i)}}$t.empty=new $t(gt.empty,0,0);function Eae(t,e,r){let{index:n,offset:i}=t.findIndex(e),a=t.maybeChild(n),{index:s,offset:o}=t.findIndex(r);if(i==e||a.isText){if(o!=r&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(r))}if(n!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(n,a.copy(Eae(a.content,e-i-1,r-i-1)))}function Aae(t,e,r,n,i,a){let{index:s,offset:o}=t.findIndex(e),l=t.maybeChild(s);if(o==e||l.isText)return a&&n<=0&&i<=0&&!a.canReplace(s,s,r)?null:t.cut(0,e).append(r).append(t.cut(e));let u=Aae(l.content,e-o-1,r,s==0?n-1:0,s==t.childCount-1?i-1:0,l);return u&&t.replaceChild(s,l.copy(u))}function s7e(t,e,r){if(r.openStart>t.depth)throw new hC("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new hC("Inconsistent open depths");return _ae(t,e,r,0)}function _ae(t,e,r,n){let i=t.index(n),a=t.node(n);if(i==e.index(n)&&n<t.depth-r.openStart){let s=_ae(t,e,r,n+1);return a.copy(a.content.replaceChild(i,s))}else if(r.content.size)if(!r.openStart&&!r.openEnd&&t.depth==n&&e.depth==n){let s=t.parent,o=s.content;return s0(s,o.cut(0,t.parentOffset).append(r.content).append(o.cut(e.parentOffset)))}else{let{start:s,end:o}=o7e(r,t);return s0(a,Lae(t,s,o,e,n))}else return s0(a,c5(t,e,n))}function Rae(t,e){if(!e.type.compatibleContent(t.type))throw new hC("Cannot join "+e.type.name+" onto "+t.type.name)}function eD(t,e,r){let n=t.node(r);return Rae(n,e.node(r)),n}function a0(t,e){let r=e.length-1;r>=0&&t.isText&&t.sameMarkup(e[r])?e[r]=t.withText(e[r].text+t.text):e.push(t)}function Tw(t,e,r,n){let i=(e||t).node(r),a=0,s=e?e.index(r):i.childCount;t&&(a=t.index(r),t.depth>r?a++:t.textOffset&&(a0(t.nodeAfter,n),a++));for(let o=a;o<s;o++)a0(i.child(o),n);e&&e.depth==r&&e.textOffset&&a0(e.nodeBefore,n)}function s0(t,e){if(!t.type.validContent(e))throw new hC("Invalid content for node "+t.type.name);return t.copy(e)}function Lae(t,e,r,n,i){let a=t.depth>i&&eD(t,e,i+1),s=n.depth>i&&eD(r,n,i+1),o=[];return Tw(null,t,i,o),a&&s&&e.index(i)==r.index(i)?(Rae(a,s),a0(s0(a,Lae(t,e,r,n,i+1)),o)):(a&&a0(s0(a,c5(t,e,i+1)),o),Tw(e,r,i,o),s&&a0(s0(s,c5(r,n,i+1)),o)),Tw(n,null,i,o),new gt(o)}function c5(t,e,r){let n=[];if(Tw(null,t,r,n),t.depth>r){let i=eD(t,e,r+1);a0(s0(i,c5(t,e,r+1)),n)}return Tw(e,null,r,n),new gt(n)}function o7e(t,e){let r=e.depth-t.openStart,i=e.node(r).copy(t.content);for(let a=r-1;a>=0;a--)i=e.node(a).copy(gt.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}class dC{constructor(e,r,n){this.pos=e,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,r=this.index(this.depth);if(r==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(r);return n?e.child(r).cut(n):i}get nodeBefore(){let e=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(e).cut(0,r):e==0?null:this.parent.child(e-1)}posAtIndex(e,r){r=this.resolveDepth(r);let n=this.path[r*3],i=r==0?0:this.path[r*3-1]+1;for(let a=0;a<e;a++)i+=n.child(a).nodeSize;return i}marks(){let e=this.parent,r=this.index();if(e.content.size==0)return In.none;if(this.textOffset)return e.child(r).marks;let n=e.maybeChild(r-1),i=e.maybeChild(r);if(!n){let o=n;n=i,i=o}let a=n.marks;for(var s=0;s<a.length;s++)a[s].type.spec.inclusive===!1&&(!i||!a[s].isInSet(i.marks))&&(a=a[s--].removeFromSet(a));return a}marksAcross(e){let r=this.parent.maybeChild(this.index());if(!r||!r.isInline)return null;let n=r.marks,i=e.parent.maybeChild(e.index());for(var a=0;a<n.length;a++)n[a].type.spec.inclusive===!1&&(!i||!n[a].isInSet(i.marks))&&(n=n[a--].removeFromSet(n));return n}sharedDepth(e){for(let r=this.depth;r>0;r--)if(this.start(r)<=e&&this.end(r)>=e)return r;return 0}blockRange(e=this,r){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!r||r(this.node(n))))return new u5(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let r=1;r<=this.depth;r++)e+=(e?"/":"")+this.node(r).type.name+"_"+this.index(r-1);return e+":"+this.parentOffset}static resolve(e,r){if(!(r>=0&&r<=e.content.size))throw new RangeError("Position "+r+" out of range");let n=[],i=0,a=r;for(let s=e;;){let{index:o,offset:l}=s.content.findIndex(a),u=a-l;if(n.push(s,o,i+l),!u||(s=s.child(o),s.isText))break;a=u-1,i+=l+1}return new dC(r,n,a)}static resolveCached(e,r){let n=dY.get(e);if(n)for(let a=0;a<n.elts.length;a++){let s=n.elts[a];if(s.pos==r)return s}else dY.set(e,n=new l7e);let i=n.elts[n.i]=dC.resolve(e,r);return n.i=(n.i+1)%c7e,i}}class l7e{constructor(){this.elts=[],this.i=0}}const c7e=12,dY=new WeakMap;class u5{constructor(e,r,n){this.$from=e,this.$to=r,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const u7e=Object.create(null);let Bd=class tD{constructor(e,r,n,i=In.none){this.type=e,this.attrs=r,this.marks=i,this.content=n||gt.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,r,n,i=0){this.content.nodesBetween(e,r,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,r,n,i){return this.content.textBetween(e,r,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,r,n){return this.type==e&&l5(this.attrs,r||e.defaultAttrs||u7e)&&In.sameSet(this.marks,n||In.none)}copy(e=null){return e==this.content?this:new tD(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new tD(this.type,this.attrs,this.content,e)}cut(e,r=this.content.size){return e==0&&r==this.content.size?this:this.copy(this.content.cut(e,r))}slice(e,r=this.content.size,n=!1){if(e==r)return $t.empty;let i=this.resolve(e),a=this.resolve(r),s=n?0:i.sharedDepth(r),o=i.start(s),u=i.node(s).content.cut(i.pos-o,a.pos-o);return new $t(u,i.depth-s,a.depth-s)}replace(e,r,n){return s7e(this.resolve(e),this.resolve(r),n)}nodeAt(e){for(let r=this;;){let{index:n,offset:i}=r.content.findIndex(e);if(r=r.maybeChild(n),!r)return null;if(i==e||r.isText)return r;e-=i+1}}childAfter(e){let{index:r,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(r),index:r,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:r,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(r),index:r,offset:n};let i=this.content.child(r-1);return{node:i,index:r-1,offset:n-i.nodeSize}}resolve(e){return dC.resolveCached(this,e)}resolveNoCache(e){return dC.resolve(this,e)}rangeHasMark(e,r,n){let i=!1;return r>e&&this.nodesBetween(e,r,a=>(n.isInSet(a.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Mae(this.marks,e)}contentMatchAt(e){let r=this.type.contentMatch.matchFragment(this.content,0,e);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(e,r,n=gt.empty,i=0,a=n.childCount){let s=this.contentMatchAt(e).matchFragment(n,i,a),o=s&&s.matchFragment(this.content,r);if(!o||!o.validEnd)return!1;for(let l=i;l<a;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,r,n,i){if(i&&!this.type.allowsMarks(i))return!1;let a=this.contentMatchAt(e).matchType(n),s=a&&a.matchFragment(this.content,r);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=In.none;for(let r=0;r<this.marks.length;r++){let n=this.marks[r];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!In.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(r=>r.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(r=>r.toJSON())),e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(e.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(r.text,n)}let i=gt.fromJSON(e,r.content),a=e.nodeType(r.type).create(r.attrs,i,n);return a.type.checkAttrs(a.attrs),a}};Bd.prototype.text=void 0;let h7e=class rD extends Bd{constructor(e,r,n,i){if(super(e,r,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Mae(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,r){return this.text.slice(e,r)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new rD(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new rD(this.type,this.attrs,e,this.marks)}cut(e=0,r=this.text.length){return e==0&&r==this.text.length?this:this.withText(this.text.slice(e,r))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Mae(t,e){for(let r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}class b0{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,r){let n=new d7e(e,r);if(n.next==null)return b0.empty;let i=Iae(n);n.next&&n.err("Unexpected trailing text");let a=b7e(v7e(i));return x7e(a,n),a}matchType(e){for(let r=0;r<this.next.length;r++)if(this.next[r].type==e)return this.next[r].next;return null}matchFragment(e,r=0,n=e.childCount){let i=this;for(let a=r;i&&a<n;a++)i=i.matchType(e.child(a).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:r}=this.next[e];if(!(r.isText||r.hasRequiredAttrs()))return r}return null}compatible(e){for(let r=0;r<this.next.length;r++)for(let n=0;n<e.next.length;n++)if(this.next[r].type==e.next[n].type)return!0;return!1}fillBefore(e,r=!1,n=0){let i=[this];function a(s,o){let l=s.matchFragment(e,n);if(l&&(!r||l.validEnd))return gt.from(o.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:h,next:d}=s.next[u];if(!(h.isText||h.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let f=a(d,o.concat(h));if(f)return f}}return null}return a(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let r=this.computeWrapping(e);return this.wrapCache.push(e,r),r}computeWrapping(e){let r=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),a=i.match;if(a.matchType(e)){let s=[];for(let o=i;o.type;o=o.via)s.push(o.type);return s.reverse()}for(let s=0;s<a.next.length;s++){let{type:o,next:l}=a.next[s];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in r)&&(!i.type||l.validEnd)&&(n.push({match:o.contentMatch,type:o,via:i}),r[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function r(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&r(n.next[i].next)}return r(this),e.map((n,i)=>{let a=i+(n.validEnd?"*":" ")+" ";for(let s=0;s<n.next.length;s++)a+=(s?", ":"")+n.next[s].type.name+"->"+e.indexOf(n.next[s].next);return a}).join(`
`)}}b0.empty=new b0(!0);class d7e{constructor(e,r){this.string=e,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Iae(t){let e=[];do e.push(f7e(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function f7e(t){let e=[];do e.push(p7e(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function p7e(t){let e=y7e(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=g7e(t,e);else break;return e}function fY(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function g7e(t,e){let r=fY(t),n=r;return t.eat(",")&&(t.next!="}"?n=fY(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:e}}function m7e(t,e){let r=t.nodeTypes,n=r[e];if(n)return[n];let i=[];for(let a in r){let s=r[a];s.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function y7e(t){if(t.eat("(")){let e=Iae(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=m7e(t,t.next).map(r=>(t.inline==null?t.inline=r.isInline:t.inline!=r.isInline&&t.err("Mixing inline and block content"),{type:"name",value:r}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function v7e(t){let e=[[]];return i(a(t,0),r()),e;function r(){return e.push([])-1}function n(s,o,l){let u={term:l,to:o};return e[s].push(u),u}function i(s,o){s.forEach(l=>l.to=o)}function a(s,o){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(a(u,o)),[]);if(s.type=="seq")for(let l=0;;l++){let u=a(s.exprs[l],o);if(l==s.exprs.length-1)return u;i(u,o=r())}else if(s.type=="star"){let l=r();return n(o,l),i(a(s.expr,l),l),[n(l)]}else if(s.type=="plus"){let l=r();return i(a(s.expr,o),l),i(a(s.expr,l),l),[n(l)]}else{if(s.type=="opt")return[n(o)].concat(a(s.expr,o));if(s.type=="range"){let l=o;for(let u=0;u<s.min;u++){let h=r();i(a(s.expr,l),h),l=h}if(s.max==-1)i(a(s.expr,l),l);else for(let u=s.min;u<s.max;u++){let h=r();n(l,h),i(a(s.expr,l),h),l=h}return[n(l)]}else{if(s.type=="name")return[n(o,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Nae(t,e){return e-t}function pY(t,e){let r=[];return n(e),r.sort(Nae);function n(i){let a=t[i];if(a.length==1&&!a[0].term)return n(a[0].to);r.push(i);for(let s=0;s<a.length;s++){let{term:o,to:l}=a[s];!o&&r.indexOf(l)==-1&&n(l)}}}function b7e(t){let e=Object.create(null);return r(pY(t,0));function r(n){let i=[];n.forEach(s=>{t[s].forEach(({term:o,to:l})=>{if(!o)return;let u;for(let h=0;h<i.length;h++)i[h][0]==o&&(u=i[h][1]);pY(t,l).forEach(h=>{u||i.push([o,u=[]]),u.indexOf(h)==-1&&u.push(h)})})});let a=e[n.join(",")]=new b0(n.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let o=i[s][1].sort(Nae);a.next.push({type:i[s][0],next:e[o.join(",")]||r(o)})}return a}}function x7e(t,e){for(let r=0,n=[t];r<n.length;r++){let i=n[r],a=!i.validEnd,s=[];for(let o=0;o<i.next.length;o++){let{type:l,next:u}=i.next[o];s.push(l.name),a&&!(l.isText||l.hasRequiredAttrs())&&(a=!1),n.indexOf(u)==-1&&n.push(u)}a&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Dae(t){let e=Object.create(null);for(let r in t){let n=t[r];if(!n.hasDefault)return null;e[r]=n.default}return e}function Oae(t,e){let r=Object.create(null);for(let n in t){let i=e&&e[n];if(i===void 0){let a=t[n];if(a.hasDefault)i=a.default;else throw new RangeError("No value supplied for attribute "+n)}r[n]=i}return r}function $ae(t,e,r,n){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${r} of type ${n}`);for(let i in t)t[i].validate&&t[i].validate(e[i])}function Pae(t,e){let r=Object.create(null);if(e)for(let n in e)r[n]=new w7e(t,n,e[n]);return r}let gY=class Bae{constructor(e,r,n){this.name=e,this.schema=r,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=Pae(e,n.attrs),this.defaultAttrs=Dae(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==b0.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Oae(this.attrs,e)}create(e=null,r,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Bd(this,this.computeAttrs(e),gt.from(r),In.setFrom(n))}createChecked(e=null,r,n){return r=gt.from(r),this.checkContent(r),new Bd(this,this.computeAttrs(e),r,In.setFrom(n))}createAndFill(e=null,r,n){if(e=this.computeAttrs(e),r=gt.from(r),r.size){let s=this.contentMatch.fillBefore(r);if(!s)return null;r=s.append(r)}let i=this.contentMatch.matchFragment(r),a=i&&i.fillBefore(gt.empty,!0);return a?new Bd(this,e,r.append(a),In.setFrom(n)):null}validContent(e){let r=this.contentMatch.matchFragment(e);if(!r||!r.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){$ae(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let r=0;r<e.length;r++)if(!this.allowsMarkType(e[r].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let r;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?r&&r.push(e[n]):r||(r=e.slice(0,n));return r?r.length?r:In.none:e}static compile(e,r){let n=Object.create(null);e.forEach((a,s)=>n[a]=new Bae(a,r,s));let i=r.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let a in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function T7e(t,e,r){let n=r.split("|");return i=>{let a=i===null?"null":typeof i;if(n.indexOf(a)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${t}, got ${a}`)}}class w7e{constructor(e,r,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?T7e(e,r,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class I6{constructor(e,r,n,i){this.name=e,this.rank=r,this.schema=n,this.spec=i,this.attrs=Pae(e,i.attrs),this.excluded=null;let a=Dae(this.attrs);this.instance=a?new In(this,a):null}create(e=null){return!e&&this.instance?this.instance:new In(this,Oae(this.attrs,e))}static compile(e,r){let n=Object.create(null),i=0;return e.forEach((a,s)=>n[a]=new I6(a,i++,r,s)),n}removeFromSet(e){for(var r=0;r<e.length;r++)e[r].type==this&&(e=e.slice(0,r).concat(e.slice(r+1)),r--);return e}isInSet(e){for(let r=0;r<e.length;r++)if(e[r].type==this)return e[r]}checkAttrs(e){$ae(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Fae{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let r=this.spec={};for(let i in e)r[i]=e[i];r.nodes=Wa.from(e.nodes),r.marks=Wa.from(e.marks||{}),this.nodes=gY.compile(this.spec.nodes,this),this.marks=I6.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let a=this.nodes[i],s=a.spec.content||"",o=a.spec.marks;if(a.contentMatch=n[s]||(n[s]=b0.parse(s,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!a.isInline||!a.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=a}a.markSet=o=="_"?null:o?mY(this,o.split(" ")):o==""||!a.inlineContent?[]:null}for(let i in this.marks){let a=this.marks[i],s=a.spec.excludes;a.excluded=s==null?[a]:s==""?[]:mY(this,s.split(" "))}this.nodeFromJSON=i=>Bd.fromJSON(this,i),this.markFromJSON=i=>In.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,r=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof gY){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(r,n,i)}text(e,r){let n=this.nodes.text;return new h7e(n,n.defaultAttrs,e,In.setFrom(r))}mark(e,r){return typeof e=="string"&&(e=this.marks[e]),e.create(r)}nodeType(e){let r=this.nodes[e];if(!r)throw new RangeError("Unknown node type: "+e);return r}}function mY(t,e){let r=[];for(let n=0;n<e.length;n++){let i=e[n],a=t.marks[i],s=a;if(a)r.push(a);else for(let o in t.marks){let l=t.marks[o];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&r.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return r}function C7e(t){return t.tag!=null}function k7e(t){return t.style!=null}class sh{constructor(e,r){this.schema=e,this.rules=r,this.tags=[],this.styles=[];let n=this.matchedStyles=[];r.forEach(i=>{if(C7e(i))this.tags.push(i);else if(k7e(i)){let a=/[^=]*/.exec(i.style)[0];n.indexOf(a)<0&&n.push(a),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let a=e.nodes[i.node];return a.contentMatch.matchType(a)})}parse(e,r={}){let n=new vY(this,r,!1);return n.addAll(e,In.none,r.from,r.to),n.finish()}parseSlice(e,r={}){let n=new vY(this,r,!0);return n.addAll(e,In.none,r.from,r.to),$t.maxOpen(n.finish())}matchTag(e,r,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let a=this.tags[i];if(A7e(e,a.tag)&&(a.namespace===void 0||e.namespaceURI==a.namespace)&&(!a.context||r.matchesContext(a.context))){if(a.getAttrs){let s=a.getAttrs(e);if(s===!1)continue;a.attrs=s||void 0}return a}}}matchStyle(e,r,n,i){for(let a=i?this.styles.indexOf(i)+1:0;a<this.styles.length;a++){let s=this.styles[a],o=s.style;if(!(o.indexOf(e)!=0||s.context&&!n.matchesContext(s.context)||o.length>e.length&&(o.charCodeAt(e.length)!=61||o.slice(e.length+1)!=r))){if(s.getAttrs){let l=s.getAttrs(r);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let r=[];function n(i){let a=i.priority==null?50:i.priority,s=0;for(;s<r.length;s++){let o=r[s];if((o.priority==null?50:o.priority)<a)break}r.splice(s,0,i)}for(let i in e.marks){let a=e.marks[i].spec.parseDOM;a&&a.forEach(s=>{n(s=bY(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let a=e.nodes[i].spec.parseDOM;a&&a.forEach(s=>{n(s=bY(s)),s.node||s.ignore||s.mark||(s.node=i)})}return r}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new sh(e,sh.schemaRules(e)))}}const zae={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},S7e={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Vae={ol:!0,ul:!0},fC=1,nD=2,ww=4;function yY(t,e,r){return e!=null?(e?fC:0)|(e==="full"?nD:0):t&&t.whitespace=="pre"?fC|nD:r&~ww}class QS{constructor(e,r,n,i,a,s){this.type=e,this.attrs=r,this.marks=n,this.solid=i,this.options=s,this.content=[],this.activeMarks=In.none,this.match=a||(s&ww?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(gt.from(e));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&fC)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let a=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-i[0].length))}}let r=gt.from(this.content);return!e&&this.match&&(r=r.append(this.match.fillBefore(gt.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!zae.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class vY{constructor(e,r,n){this.parser=e,this.options=r,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=r.topNode,a,s=yY(null,r.preserveWhitespace,0)|(n?ww:0);i?a=new QS(i.type,i.attrs,In.none,!0,r.topMatch||i.type.contentMatch,s):n?a=new QS(null,null,In.none,!0,null,s):a=new QS(e.schema.topNodeType,null,In.none,!0,null,s),this.nodes=[a],this.find=r.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,r){e.nodeType==3?this.addTextNode(e,r):e.nodeType==1&&this.addElement(e,r)}addTextNode(e,r){let n=e.nodeValue,i=this.top,a=i.options&nD?"full":this.localPreserveWS||(i.options&fC)>0,{schema:s}=this.parser;if(a==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(a)if(a==="full")n=n.replace(/\r\n?/g,`
`);else if(s.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(s.linebreakReplacement.create())){let o=n.split(/\r?\n|\r/);for(let l=0;l<o.length;l++)l&&this.insertNode(s.linebreakReplacement.create(),r,!0),o[l]&&this.insertNode(s.text(o[l]),r,!/\S/.test(o[l]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let o=i.content[i.content.length-1],l=e.previousSibling;(!o||l&&l.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(s.text(n),r,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,r,n){let i=this.localPreserveWS,a=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),o;Vae.hasOwnProperty(s)&&this.parser.normalizeLists&&E7e(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));e:if(l?l.ignore:S7e.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,r);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,h=this.needsBlock;if(zae.hasOwnProperty(s))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),u=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,r);break e}let d=l&&l.skip?r:this.readStyles(e,r);d&&this.addAll(e,d),u&&this.sync(a),this.needsBlock=h}else{let u=this.readStyles(e,r);u&&this.addElementByRule(e,l,u,l.consuming===!1?o:void 0)}this.localPreserveWS=i}leafFallback(e,r){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
`),r)}ignoreFallback(e,r){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),r,!0)}readStyles(e,r){let n=e.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let a=this.parser.matchedStyles[i],s=n.getPropertyValue(a);if(s)for(let o=void 0;;){let l=this.parser.matchStyle(a,s,this,o);if(!l)break;if(l.ignore)return null;if(l.clearMark?r=r.filter(u=>!l.clearMark(u)):r=r.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)o=l;else break}}return r}addElementByRule(e,r,n,i){let a,s;if(r.node)if(s=this.parser.schema.nodes[r.node],s.isLeaf)this.insertNode(s.create(r.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let l=this.enter(s,r.attrs||null,n,r.preserveWhitespace);l&&(a=!0,n=l)}else{let l=this.parser.schema.marks[r.mark];n=n.concat(l.create(r.attrs))}let o=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(r.getContent)this.findInside(e),r.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n,!1));else{let l=e;typeof r.contentElement=="string"?l=e.querySelector(r.contentElement):typeof r.contentElement=="function"?l=r.contentElement(e):r.contentElement&&(l=r.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}a&&this.sync(o)&&this.open--}addAll(e,r,n,i){let a=n||0;for(let s=n?e.childNodes[n]:e.firstChild,o=i==null?null:e.childNodes[i];s!=o;s=s.nextSibling,++a)this.findAtPoint(e,a),this.addDOM(s,r);this.findAtPoint(e,a)}findPlace(e,r,n){let i,a;for(let s=this.open,o=0;s>=0;s--){let l=this.nodes[s],u=l.findWrapping(e);if(u&&(!i||i.length>u.length+o)&&(i=u,a=l,!u.length))break;if(l.solid){if(n)break;o+=2}}if(!i)return null;this.sync(a);for(let s=0;s<i.length;s++)r=this.enterInner(i[s],null,r,!1);return r}insertNode(e,r,n){if(e.isInline&&this.needsBlock&&!this.top.type){let a=this.textblockFromContext();a&&(r=this.enterInner(a,null,r))}let i=this.findPlace(e,r,n);if(i){this.closeExtra();let a=this.top;a.match&&(a.match=a.match.matchType(e.type));let s=In.none;for(let o of i.concat(e.marks))(a.type?a.type.allowsMarkType(o.type):xY(o.type,e.type))&&(s=o.addToSet(s));return a.content.push(e.mark(s)),!0}return!1}enter(e,r,n,i){let a=this.findPlace(e.create(r),n,!1);return a&&(a=this.enterInner(e,r,n,!0,i)),a}enterInner(e,r,n,i=!1,a){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let o=yY(e,a,s.options);s.options&ww&&s.content.length==0&&(o|=ww);let l=In.none;return n=n.filter(u=>(s.type?s.type.allowsMarkType(u.type):xY(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new QS(e,r,l,i,null,o)),this.open++,n}closeExtra(e=!1){let r=this.nodes.length-1;if(r>this.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let r=this.open;r>=0;r--){if(this.nodes[r]==e)return this.open=r,!0;this.localPreserveWS&&(this.nodes[r].options|=fC)}return!1}get currentPos(){this.closeExtra();let e=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;r&&e++}return e}findAtPoint(e,r){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==r&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&(this.find[r].pos=this.currentPos)}findAround(e,r,n){if(e!=r&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&r.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&(this.find[r].pos=this.currentPos-(e.nodeValue.length-this.find[r].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let r=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),a=-(n?n.depth+1:0)+(i?0:1),s=(o,l)=>{for(;o>=0;o--){let u=r[o];if(u==""){if(o==r.length-1||o==0)continue;for(;l>=a;l--)if(s(o-1,l))return!0;return!1}else{let h=l>0||l==0&&i?this.nodes[l].type:n&&l>=a?n.node(l-a).type:null;if(!h||h.name!=u&&!h.isInGroup(u))return!1;l--}}return!0};return s(r.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let r=e.depth;r>=0;r--){let n=e.node(r).contentMatchAt(e.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}}function E7e(t){for(let e=t.firstChild,r=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&Vae.hasOwnProperty(n)&&r?(r.appendChild(e),e=r):n=="li"?r=e:n&&(r=null)}}function A7e(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function bY(t){let e={};for(let r in t)e[r]=t[r];return e}function xY(t,e){let r=e.schema.nodes;for(let n in r){let i=r[n];if(!i.allowsMarkType(t))continue;let a=[],s=o=>{a.push(o);for(let l=0;l<o.edgeCount;l++){let{type:u,next:h}=o.edge(l);if(u==e||a.indexOf(h)<0&&s(h))return!0}};if(s(i.contentMatch))return!0}}class Z0{constructor(e,r){this.nodes=e,this.marks=r}serializeFragment(e,r={},n){n||(n=JS(r).createDocumentFragment());let i=n,a=[];return e.forEach(s=>{if(a.length||s.marks.length){let o=0,l=0;for(;o<a.length&&l<s.marks.length;){let u=s.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(a[o][0])||u.type.spec.spanning===!1)break;o++,l++}for(;o<a.length;)i=a.pop()[1];for(;l<s.marks.length;){let u=s.marks[l++],h=this.serializeMark(u,s.isInline,r);h&&(a.push([u,i]),i.appendChild(h.dom),i=h.contentDOM||h.dom)}}i.appendChild(this.serializeNodeInner(s,r))}),n}serializeNodeInner(e,r){if(e.isText)return JS(r).createTextNode(e.text);let{dom:n,contentDOM:i}=I4(JS(r),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,r,i)}return n}serializeNode(e,r={}){let n=this.serializeNodeInner(e,r);for(let i=e.marks.length-1;i>=0;i--){let a=this.serializeMark(e.marks[i],e.isInline,r);a&&((a.contentDOM||a.dom).appendChild(n),n=a.dom)}return n}serializeMark(e,r,n={}){let i=this.marks[e.type.name];return i&&I4(JS(n),i(e,r),null,e.attrs)}static renderSpec(e,r,n=null,i){return typeof r=="string"?{dom:e.createTextNode(r)}:I4(e,r,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Z0(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let r=TY(e.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(e){return TY(e.marks)}}function TY(t){let e={};for(let r in t){let n=t[r].spec.toDOM;n&&(e[r]=n)}return e}function JS(t){return t.document||window.document}const wY=new WeakMap;function _7e(t){let e=wY.get(t);return e===void 0&&wY.set(t,e=R7e(t)),e}function R7e(t){let e=null;function r(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)r(n[i]);else for(let i in n)r(n[i])}return r(t),e}function I4(t,e,r,n){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let i=e[0],a;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(a=_7e(n))&&a.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(r=i.slice(0,s),i=i.slice(s+1));let o,l=r?t.createElementNS(r,i):t.createElement(i),u=e[1],h=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){h=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d=="style"&&l.style?l.style.cssText=u[d]:l.setAttribute(d,u[d])}}for(let d=h;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>h)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof f=="string")l.appendChild(t.createTextNode(f));else{let{dom:p,contentDOM:g}=I4(t,f,r,n);if(l.appendChild(p),g){if(o)throw new RangeError("Multiple content holes");o=g}}}return{dom:l,contentDOM:o}}const Gae=65535,Wae=Math.pow(2,16);function L7e(t,e){return t+e*Wae}function CY(t){return t&Gae}function M7e(t){return(t-(t&Gae))/Wae}const Hae=1,qae=2,N4=4,Uae=8;class iD{constructor(e,r,n){this.pos=e,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&Uae)>0}get deletedBefore(){return(this.delInfo&(Hae|N4))>0}get deletedAfter(){return(this.delInfo&(qae|N4))>0}get deletedAcross(){return(this.delInfo&N4)>0}}class Io{constructor(e,r=!1){if(this.ranges=e,this.inverted=r,!e.length&&Io.empty)return Io.empty}recover(e){let r=0,n=CY(e);if(!this.inverted)for(let i=0;i<n;i++)r+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+r+M7e(e)}mapResult(e,r=1){return this._map(e,r,!1)}map(e,r=1){return this._map(e,r,!0)}_map(e,r,n){let i=0,a=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[o+a],h=this.ranges[o+s],d=l+u;if(e<=d){let f=u?e==l?-1:e==d?1:r:r,p=l+i+(f<0?0:h);if(n)return p;let g=e==(r<0?l:d)?null:L7e(o/3,e-l),m=e==l?qae:e==d?Hae:N4;return(r<0?e!=l:e!=d)&&(m|=Uae),new iD(p,m,g)}i+=h-u}return n?e+i:new iD(e+i,0,null)}touches(e,r){let n=0,i=CY(r),a=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?n:0);if(l>e)break;let u=this.ranges[o+a],h=l+u;if(e<=h&&o==i*3)return!0;n+=this.ranges[o+s]-u}return!1}forEach(e){let r=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,a=0;i<this.ranges.length;i+=3){let s=this.ranges[i],o=s-(this.inverted?a:0),l=s+(this.inverted?0:a),u=this.ranges[i+r],h=this.ranges[i+n];e(o,o+u,l,l+h),a+=h-u}}invert(){return new Io(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Io.empty:new Io(e<0?[0,-e,0]:[0,0,e])}}Io.empty=new Io([]);class pC{constructor(e,r,n=0,i=e?e.length:0){this.mirror=r,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||r)}get maps(){return this._maps}slice(e=0,r=this.maps.length){return new pC(this._maps,this.mirror,e,r)}appendMap(e,r){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),r!=null&&this.setMirror(this._maps.length-1,r)}appendMapping(e){for(let r=0,n=this._maps.length;r<e._maps.length;r++){let i=e.getMirror(r);this.appendMap(e._maps[r],i!=null&&i<r?n+i:void 0)}}getMirror(e){if(this.mirror){for(let r=0;r<this.mirror.length;r++)if(this.mirror[r]==e)return this.mirror[r+(r%2?-1:1)]}}setMirror(e,r){this.mirror||(this.mirror=[]),this.mirror.push(e,r)}appendMappingInverted(e){for(let r=e.maps.length-1,n=this._maps.length+e._maps.length;r>=0;r--){let i=e.getMirror(r);this.appendMap(e._maps[r].invert(),i!=null&&i>r?n-i-1:void 0)}}invert(){let e=new pC;return e.appendMappingInverted(this),e}map(e,r=1){if(this.mirror)return this._map(e,r,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,r);return e}mapResult(e,r=1){return this._map(e,r,!1)}_map(e,r,n){let i=0;for(let a=this.from;a<this.to;a++){let s=this._maps[a],o=s.mapResult(e,r);if(o.recover!=null){let l=this.getMirror(a);if(l!=null&&l>a&&l<this.to){a=l,e=this._maps[l].recover(o.recover);continue}}i|=o.delInfo,e=o.pos}return n?e:new iD(e,i,null)}}const K7=Object.create(null);let bs=class{getMap(){return Io.empty}merge(e){return null}static fromJSON(e,r){if(!r||!r.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=K7[r.stepType];if(!n)throw new RangeError(`No step type ${r.stepType} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in K7)throw new RangeError("Duplicate use of step JSON ID "+e);return K7[e]=r,r.prototype.jsonID=e,r}};class qi{constructor(e,r){this.doc=e,this.failed=r}static ok(e){return new qi(e,null)}static fail(e){return new qi(null,e)}static fromReplace(e,r,n,i){try{return qi.ok(e.replace(r,n,i))}catch(a){if(a instanceof hC)return qi.fail(a.message);throw a}}}function wF(t,e,r){let n=[];for(let i=0;i<t.childCount;i++){let a=t.child(i);a.content.size&&(a=a.copy(wF(a.content,e,a))),a.isInline&&(a=e(a,r,i)),n.push(a)}return gt.fromArray(n)}class Ed extends bs{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),a=new $t(wF(r.content,(s,o)=>!s.isAtom||!o.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),r.openStart,r.openEnd);return qi.fromReplace(e,this.from,this.to,a)}invert(){return new ql(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new Ed(r.pos,n.pos,this.mark)}merge(e){return e instanceof Ed&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ed(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ed(r.from,r.to,e.markFromJSON(r.mark))}}bs.jsonID("addMark",Ed);class ql extends bs{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=new $t(wF(r.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),r.openStart,r.openEnd);return qi.fromReplace(e,this.from,this.to,n)}invert(){return new Ed(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new ql(r.pos,n.pos,this.mark)}merge(e){return e instanceof ql&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ql(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ql(r.from,r.to,e.markFromJSON(r.mark))}}bs.jsonID("removeMark",ql);class Ad extends bs{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return qi.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return qi.fromReplace(e,this.pos,this.pos+1,new $t(gt.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let i=0;i<r.marks.length;i++)if(!r.marks[i].isInSet(n))return new Ad(this.pos,r.marks[i]);return new Ad(this.pos,this.mark)}}return new x0(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new Ad(r.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ad(r.pos,e.markFromJSON(r.mark))}}bs.jsonID("addNodeMark",Ad);class x0 extends bs{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return qi.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.removeFromSet(r.marks));return qi.fromReplace(e,this.pos,this.pos+1,new $t(gt.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);return!r||!this.mark.isInSet(r.marks)?this:new Ad(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new x0(r.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new x0(r.pos,e.markFromJSON(r.mark))}}bs.jsonID("removeNodeMark",x0);class Vi extends bs{constructor(e,r,n,i=!1){super(),this.from=e,this.to=r,this.slice=n,this.structure=i}apply(e){return this.structure&&aD(e,this.from,this.to)?qi.fail("Structure replace would overwrite content"):qi.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Io([this.from,this.to-this.from,this.slice.size])}invert(e){return new Vi(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let r=e.mapResult(this.to,-1),n=this.from==this.to&&Vi.MAP_BIAS<0?r:e.mapResult(this.from,1);return n.deletedAcross&&r.deletedAcross?null:new Vi(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Vi)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let r=this.slice.size+e.slice.size==0?$t.empty:new $t(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Vi(this.from,this.to+(e.to-e.from),r,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let r=this.slice.size+e.slice.size==0?$t.empty:new $t(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Vi(e.from,this.to,r,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Vi(r.from,r.to,$t.fromJSON(e,r.slice),!!r.structure)}}Vi.MAP_BIAS=1;bs.jsonID("replace",Vi);class Ta extends bs{constructor(e,r,n,i,a,s,o=!1){super(),this.from=e,this.to=r,this.gapFrom=n,this.gapTo=i,this.slice=a,this.insert=s,this.structure=o}apply(e){if(this.structure&&(aD(e,this.from,this.gapFrom)||aD(e,this.gapTo,this.to)))return qi.fail("Structure gap-replace would overwrite content");let r=e.slice(this.gapFrom,this.gapTo);if(r.openStart||r.openEnd)return qi.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,r.content);return n?qi.fromReplace(e,this.from,this.to,n):qi.fail("Content does not fit in gap")}getMap(){return new Io([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let r=this.gapTo-this.gapFrom;return new Ta(this.from,this.from+this.slice.size+r,this.from+this.insert,this.from+this.insert+r,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?r.pos:e.map(this.gapFrom,-1),a=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return r.deletedAcross&&n.deletedAcross||i<r.pos||a>n.pos?null:new Ta(r.pos,n.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ta(r.from,r.to,r.gapFrom,r.gapTo,$t.fromJSON(e,r.slice),r.insert,!!r.structure)}}bs.jsonID("replaceAround",Ta);function aD(t,e,r){let n=t.resolve(e),i=r-e,a=n.depth;for(;i>0&&a>0&&n.indexAfter(a)==n.node(a).childCount;)a--,i--;if(i>0){let s=n.node(a).maybeChild(n.indexAfter(a));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function I7e(t,e,r,n){let i=[],a=[],s,o;t.doc.nodesBetween(e,r,(l,u,h)=>{if(!l.isInline)return;let d=l.marks;if(!n.isInSet(d)&&h.type.allowsMarkType(n.type)){let f=Math.max(u,e),p=Math.min(u+l.nodeSize,r),g=n.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(g)||(s&&s.to==f&&s.mark.eq(d[m])?s.to=p:i.push(s=new ql(f,p,d[m])));o&&o.to==f?o.to=p:a.push(o=new Ed(f,p,n))}}),i.forEach(l=>t.step(l)),a.forEach(l=>t.step(l))}function N7e(t,e,r,n){let i=[],a=0;t.doc.nodesBetween(e,r,(s,o)=>{if(!s.isInline)return;a++;let l=null;if(n instanceof I6){let u=s.marks,h;for(;h=n.isInSet(u);)(l||(l=[])).push(h),u=h.removeFromSet(u)}else n?n.isInSet(s.marks)&&(l=[n]):l=s.marks;if(l&&l.length){let u=Math.min(o+s.nodeSize,r);for(let h=0;h<l.length;h++){let d=l[h],f;for(let p=0;p<i.length;p++){let g=i[p];g.step==a-1&&d.eq(i[p].style)&&(f=g)}f?(f.to=u,f.step=a):i.push({style:d,from:Math.max(o,e),to:u,step:a})}}}),i.forEach(s=>t.step(new ql(s.from,s.to,s.style)))}function CF(t,e,r,n=r.contentMatch,i=!0){let a=t.doc.nodeAt(e),s=[],o=e+1;for(let l=0;l<a.childCount;l++){let u=a.child(l),h=o+u.nodeSize,d=n.matchType(u.type);if(!d)s.push(new Vi(o,h,$t.empty));else{n=d;for(let f=0;f<u.marks.length;f++)r.allowsMarkType(u.marks[f].type)||t.step(new ql(o,h,u.marks[f]));if(i&&u.isText&&r.whitespace!="pre"){let f,p=/\r?\n|\r/g,g;for(;f=p.exec(u.text);)g||(g=new $t(gt.from(r.schema.text(" ",r.allowedMarks(u.marks))),0,0)),s.push(new Vi(o+f.index,o+f.index+f[0].length,g))}}o=h}if(!n.validEnd){let l=n.fillBefore(gt.empty,!0);t.replace(o,o,new $t(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function D7e(t,e,r){return(e==0||t.canReplace(e,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function fx(t){let r=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth,i=0,a=0;;--n){let s=t.$from.node(n),o=t.$from.index(n)+i,l=t.$to.indexAfter(n)-a;if(n<t.depth&&s.canReplace(o,l,r))return n;if(n==0||s.type.spec.isolating||!D7e(s,o,l))break;o&&(i=1),l<s.childCount&&(a=1)}return null}function O7e(t,e,r){let{$from:n,$to:i,depth:a}=e,s=n.before(a+1),o=i.after(a+1),l=s,u=o,h=gt.empty,d=0;for(let g=a,m=!1;g>r;g--)m||n.index(g)>0?(m=!0,h=gt.from(n.node(g).copy(h)),d++):l--;let f=gt.empty,p=0;for(let g=a,m=!1;g>r;g--)m||i.after(g+1)<i.end(g)?(m=!0,f=gt.from(i.node(g).copy(f)),p++):u++;t.step(new Ta(l,u,s,o,new $t(h.append(f),d,p),h.size-d,!0))}function kF(t,e,r=null,n=t){let i=$7e(t,e),a=i&&P7e(n,e);return a?i.map(kY).concat({type:e,attrs:r}).concat(a.map(kY)):null}function kY(t){return{type:t,attrs:null}}function $7e(t,e){let{parent:r,startIndex:n,endIndex:i}=t,a=r.contentMatchAt(n).findWrapping(e);if(!a)return null;let s=a.length?a[0]:e;return r.canReplaceWith(n,i,s)?a:null}function P7e(t,e){let{parent:r,startIndex:n,endIndex:i}=t,a=r.child(n),s=e.contentMatch.findWrapping(a.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let u=n;l&&u<i;u++)l=l.matchType(r.child(u).type);return!l||!l.validEnd?null:s}function B7e(t,e,r){let n=gt.empty;for(let s=r.length-1;s>=0;s--){if(n.size){let o=r[s].type.contentMatch.matchFragment(n);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=gt.from(r[s].type.create(r[s].attrs,n))}let i=e.start,a=e.end;t.step(new Ta(i,a,i,a,new $t(n,0,0),r.length,!0))}function F7e(t,e,r,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=t.steps.length;t.doc.nodesBetween(e,r,(s,o)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(n,l)&&z7e(t.doc,t.mapping.slice(a).map(o),n)){let u=null;if(n.schema.linebreakReplacement){let p=n.whitespace=="pre",g=!!n.contentMatch.matchType(n.schema.linebreakReplacement);p&&!g?u=!1:!p&&g&&(u=!0)}u===!1&&Xae(t,s,o,a),CF(t,t.mapping.slice(a).map(o,1),n,void 0,u===null);let h=t.mapping.slice(a),d=h.map(o,1),f=h.map(o+s.nodeSize,1);return t.step(new Ta(d,f,d+1,f-1,new $t(gt.from(n.create(l,null,s.marks)),0,0),1,!0)),u===!0&&Yae(t,s,o,a),!1}})}function Yae(t,e,r,n){e.forEach((i,a)=>{if(i.isText){let s,o=/\r?\n|\r/g;for(;s=o.exec(i.text);){let l=t.mapping.slice(n).map(r+1+a+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function Xae(t,e,r,n){e.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(n).map(r+1+a);t.replaceWith(s,s+1,e.type.schema.text(`
`))}})}function z7e(t,e,r){let n=t.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,r)}function V7e(t,e,r,n,i){let a=t.doc.nodeAt(e);if(!a)throw new RangeError("No node at given position");r||(r=a.type);let s=r.create(n,null,i||a.marks);if(a.isLeaf)return t.replaceWith(e,e+a.nodeSize,s);if(!r.validContent(a.content))throw new RangeError("Invalid content for node type "+r.name);t.step(new Ta(e,e+a.nodeSize,e+1,e+a.nodeSize-1,new $t(gt.from(s),0,0),1,!0))}function oh(t,e,r=1,n){let i=t.resolve(e),a=i.depth-r,s=n&&n[n.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,h=r-2;u>a;u--,h--){let d=i.node(u),f=i.index(u);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),g=n&&n[h+1];g&&(p=p.replaceChild(0,g.type.create(g.attrs)));let m=n&&n[h]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let o=i.indexAfter(a),l=n&&n[0];return i.node(a).canReplaceWith(o,o,l?l.type:i.node(a+1).type)}function G7e(t,e,r=1,n){let i=t.doc.resolve(e),a=gt.empty,s=gt.empty;for(let o=i.depth,l=i.depth-r,u=r-1;o>l;o--,u--){a=gt.from(i.node(o).copy(a));let h=n&&n[u];s=gt.from(h?h.type.create(h.attrs,s):i.node(o).copy(s))}t.step(new Vi(e,e,new $t(a.append(s),r,r),!0))}function xf(t,e){let r=t.resolve(e),n=r.index();return jae(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function W7e(t,e){e.content.size||t.type.compatibleContent(e.type);let r=t.contentMatchAt(t.childCount),{linebreakReplacement:n}=t.type.schema;for(let i=0;i<e.childCount;i++){let a=e.child(i),s=a.type==n?t.type.schema.nodes.text:a.type;if(r=r.matchType(s),!r||!t.type.allowsMarks(a.marks))return!1}return r.validEnd}function jae(t,e){return!!(t&&e&&!t.isLeaf&&W7e(t,e))}function N6(t,e,r=-1){let n=t.resolve(e);for(let i=n.depth;;i--){let a,s,o=n.index(i);if(i==n.depth?(a=n.nodeBefore,s=n.nodeAfter):r>0?(a=n.node(i+1),o++,s=n.node(i).maybeChild(o)):(a=n.node(i).maybeChild(o-1),s=n.node(i+1)),a&&!a.isTextblock&&jae(a,s)&&n.node(i).canReplace(o,o+1))return e;if(i==0)break;e=r<0?n.before(i):n.after(i)}}function H7e(t,e,r){let n=null,{linebreakReplacement:i}=t.doc.type.schema,a=t.doc.resolve(e-r),s=a.node().type;if(i&&s.inlineContent){let h=s.whitespace=="pre",d=!!s.contentMatch.matchType(i);h&&!d?n=!1:!h&&d&&(n=!0)}let o=t.steps.length;if(n===!1){let h=t.doc.resolve(e+r);Xae(t,h.node(),h.before(),o)}s.inlineContent&&CF(t,e+r-1,s,a.node().contentMatchAt(a.index()),n==null);let l=t.mapping.slice(o),u=l.map(e-r);if(t.step(new Vi(u,l.map(e+r,-1),$t.empty,!0)),n===!0){let h=t.doc.resolve(u);Yae(t,h.node(),h.before(),t.steps.length)}return t}function q7e(t,e,r){let n=t.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),r))return e;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let a=n.index(i);if(n.node(i).canReplaceWith(a,a,r))return n.before(i+1);if(a>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let a=n.indexAfter(i);if(n.node(i).canReplaceWith(a,a,r))return n.after(i+1);if(a<n.node(i).childCount)return null}return null}function Kae(t,e,r){let n=t.resolve(e);if(!r.content.size)return e;let i=r.content;for(let a=0;a<r.openStart;a++)i=i.firstChild.content;for(let a=1;a<=(r.openStart==0&&r.size?2:1);a++)for(let s=n.depth;s>=0;s--){let o=s==n.depth?0:n.pos<=(n.start(s+1)+n.end(s+1))/2?-1:1,l=n.index(s)+(o>0?1:0),u=n.node(s),h=!1;if(a==1)h=u.canReplace(l,l,i);else{let d=u.contentMatchAt(l).findWrapping(i.firstChild.type);h=d&&u.canReplaceWith(l,l,d[0])}if(h)return o==0?n.pos:o<0?n.before(s+1):n.after(s+1)}return null}function D6(t,e,r=e,n=$t.empty){if(e==r&&!n.size)return null;let i=t.resolve(e),a=t.resolve(r);return Zae(i,a,n)?new Vi(e,r,n):new U7e(i,a,n).fit()}function Zae(t,e,r){return!r.openStart&&!r.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),r.content)}class U7e{constructor(e,r,n){this.$from=e,this.$to=r,this.unplaced=n,this.frontier=[],this.placed=gt.empty;for(let i=0;i<=e.depth;i++){let a=e.node(i);this.frontier.push({type:a.type,match:a.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=gt.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let a=this.placed,s=n.depth,o=i.depth;for(;s&&o&&a.childCount==1;)a=a.firstChild.content,s--,o--;let l=new $t(a,s,o);return e>-1?new Ta(n.pos,e,this.$to.pos,this.$to.end(),l,r):l.size||n.pos!=this.$to.pos?new Vi(n.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let r=this.unplaced.content,n=0,i=this.unplaced.openEnd;n<e;n++){let a=r.firstChild;if(r.childCount>1&&(i=0),a.type.spec.isolating&&i<=n){e=n;break}r=a.content}for(let r=1;r<=2;r++)for(let n=r==1?e:this.unplaced.openStart;n>=0;n--){let i,a=null;n?(a=Z7(this.unplaced.content,n-1).firstChild,i=a.content):i=this.unplaced.content;let s=i.firstChild;for(let o=this.depth;o>=0;o--){let{type:l,match:u}=this.frontier[o],h,d=null;if(r==1&&(s?u.matchType(s.type)||(d=u.fillBefore(gt.from(s),!1)):a&&l.compatibleContent(a.type)))return{sliceDepth:n,frontierDepth:o,parent:a,inject:d};if(r==2&&s&&(h=u.findWrapping(s.type)))return{sliceDepth:n,frontierDepth:o,parent:a,wrap:h};if(a&&u.matchType(a.type))break}}}openMore(){let{content:e,openStart:r,openEnd:n}=this.unplaced,i=Z7(e,r);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new $t(e,r+1,Math.max(n,i.size+r>=e.size-n?r+1:0)),!0)}dropNode(){let{content:e,openStart:r,openEnd:n}=this.unplaced,i=Z7(e,r);if(i.childCount<=1&&r>0){let a=e.size-r<=r+i.size;this.unplaced=new $t(NT(e,r-1,1),r-1,a?r-1:n)}else this.unplaced=new $t(NT(e,r,1),r,n)}placeNodes({sliceDepth:e,frontierDepth:r,parent:n,inject:i,wrap:a}){for(;this.depth>r;)this.closeFrontierNode();if(a)for(let m=0;m<a.length;m++)this.openFrontierNode(a[m]);let s=this.unplaced,o=n?n.content:s.content,l=s.openStart-e,u=0,h=[],{match:d,type:f}=this.frontier[r];if(i){for(let m=0;m<i.childCount;m++)h.push(i.child(m));d=d.matchFragment(i)}let p=o.size+e-(s.content.size-s.openEnd);for(;u<o.childCount;){let m=o.child(u),y=d.matchType(m.type);if(!y)break;u++,(u>1||l==0||m.content.size)&&(d=y,h.push(Qae(m.mark(f.allowedMarks(m.marks)),u==1?l:0,u==o.childCount?p:-1)))}let g=u==o.childCount;g||(p=-1),this.placed=DT(this.placed,r,gt.from(h)),this.frontier[r].match=d,g&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,y=o;m<p;m++){let v=y.lastChild;this.frontier.push({type:v.type,match:v.contentMatchAt(v.childCount)}),y=v.content}this.unplaced=g?e==0?$t.empty:new $t(NT(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new $t(NT(s.content,e,u),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],r;if(!e.type.isTextblock||!Q7(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(r=this.findCloseLevel(this.$to))&&r.depth==this.depth)return-1;let{depth:n}=this.$to,i=this.$to.after(n);for(;n>1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let r=Math.min(this.depth,e.depth);r>=0;r--){let{match:n,type:i}=this.frontier[r],a=r<e.depth&&e.end(r+1)==e.pos+(e.depth-(r+1)),s=Q7(e,r,i,n,a);if(s){for(let o=r-1;o>=0;o--){let{match:l,type:u}=this.frontier[o],h=Q7(e,o,u,l,!0);if(!h||h.childCount)continue e}return{depth:r,fit:s,move:a?e.doc.resolve(e.after(r+1)):e}}}}close(e){let r=this.findCloseLevel(e);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=DT(this.placed,r.depth,r.fit)),e=r.move;for(let n=r.depth+1;n<=e.depth;n++){let i=e.node(n),a=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,a)}return e}openFrontierNode(e,r=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=DT(this.placed,this.depth,gt.from(e.create(r,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let r=this.frontier.pop().match.fillBefore(gt.empty,!0);r.childCount&&(this.placed=DT(this.placed,this.frontier.length,r))}}function NT(t,e,r){return e==0?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(NT(t.firstChild.content,e-1,r)))}function DT(t,e,r){return e==0?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(DT(t.lastChild.content,e-1,r)))}function Z7(t,e){for(let r=0;r<e;r++)t=t.firstChild.content;return t}function Qae(t,e,r){if(e<=0)return t;let n=t.content;return e>1&&(n=n.replaceChild(0,Qae(n.firstChild,e-1,n.childCount==1?r-1:0))),e>0&&(n=t.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(t.type.contentMatch.matchFragment(n).fillBefore(gt.empty,!0)))),t.copy(n)}function Q7(t,e,r,n,i){let a=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==a.childCount&&!r.compatibleContent(a.type))return null;let o=n.fillBefore(a.content,!0,s);return o&&!Y7e(r,a.content,s)?o:null}function Y7e(t,e,r){for(let n=r;n<e.childCount;n++)if(!t.allowsMarks(e.child(n).marks))return!0;return!1}function X7e(t){return t.spec.defining||t.spec.definingForContent}function j7e(t,e,r,n){if(!n.size)return t.deleteRange(e,r);let i=t.doc.resolve(e),a=t.doc.resolve(r);if(Zae(i,a,n))return t.step(new Vi(e,r,n));let s=ese(i,a);s[s.length-1]==0&&s.pop();let o=-(i.depth+1);s.unshift(o);for(let f=i.depth,p=i.pos-1;f>0;f--,p--){let g=i.node(f).type.spec;if(g.defining||g.definingAsContext||g.isolating)break;s.indexOf(f)>-1?o=f:i.before(f)==p&&s.splice(1,0,-f)}let l=s.indexOf(o),u=[],h=n.openStart;for(let f=n.content,p=0;;p++){let g=f.firstChild;if(u.push(g),p==n.openStart)break;f=g.content}for(let f=h-1;f>=0;f--){let p=u[f],g=X7e(p.type);if(g&&!p.sameMarkup(i.node(Math.abs(o)-1)))h=f;else if(g||!p.type.isTextblock)break}for(let f=n.openStart;f>=0;f--){let p=(f+h+1)%(n.openStart+1),g=u[p];if(g)for(let m=0;m<s.length;m++){let y=s[(m+l)%s.length],v=!0;y<0&&(v=!1,y=-y);let T=i.node(y-1),b=i.index(y-1);if(T.canReplaceWith(b,b,g.type,g.marks))return t.replace(i.before(y),v?a.after(y):r,new $t(Jae(n.content,0,n.openStart,p),p,n.openEnd))}}let d=t.steps.length;for(let f=s.length-1;f>=0&&(t.replace(e,r,n),!(t.steps.length>d));f--){let p=s[f];p<0||(e=i.before(p),r=a.after(p))}}function Jae(t,e,r,n,i){if(e<r){let a=t.firstChild;t=t.replaceChild(0,a.copy(Jae(a.content,e+1,r,n,a)))}if(e>n){let a=i.contentMatchAt(0),s=a.fillBefore(t).append(t);t=s.append(a.matchFragment(s).fillBefore(gt.empty,!0))}return t}function K7e(t,e,r,n){if(!n.isInline&&e==r&&t.doc.resolve(e).parent.content.size){let i=q7e(t.doc,e,n.type);i!=null&&(e=r=i)}t.replaceRange(e,r,new $t(gt.from(n),0,0))}function Z7e(t,e,r){let n=t.doc.resolve(e),i=t.doc.resolve(r);if(n.parent.isTextblock&&i.parent.isTextblock&&n.start()!=i.start()&&n.parentOffset==0&&i.parentOffset==0){let s=n.sharedDepth(r),o=!1;for(let l=n.depth;l>s;l--)n.node(l).type.spec.isolating&&(o=!0);for(let l=i.depth;l>s;l--)i.node(l).type.spec.isolating&&(o=!0);if(!o){for(let l=n.depth;l>0&&e==n.start(l);l--)e=n.before(l);for(let l=i.depth;l>0&&r==i.start(l);l--)r=i.before(l);n=t.doc.resolve(e),i=t.doc.resolve(r)}}let a=ese(n,i);for(let s=0;s<a.length;s++){let o=a[s],l=s==a.length-1;if(l&&o==0||n.node(o).type.contentMatch.validEnd)return t.delete(n.start(o),i.end(o));if(o>0&&(l||n.node(o-1).canReplace(n.index(o-1),i.indexAfter(o-1))))return t.delete(n.before(o),i.after(o))}for(let s=1;s<=n.depth&&s<=i.depth;s++)if(e-n.start(s)==n.depth-s&&r>n.end(s)&&i.end(s)-r!=i.depth-s&&n.start(s-1)==i.start(s-1)&&n.node(s-1).canReplace(n.index(s-1),i.index(s-1)))return t.delete(n.before(s),r);t.delete(e,r)}function ese(t,e){let r=[],n=Math.min(t.depth,e.depth);for(let i=n;i>=0;i--){let a=t.start(i);if(a<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(a==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==a-1)&&r.push(i)}return r}class oy extends bs{constructor(e,r,n){super(),this.pos=e,this.attr=r,this.value=n}apply(e){let r=e.nodeAt(this.pos);if(!r)return qi.fail("No node at attribute step's position");let n=Object.create(null);for(let a in r.attrs)n[a]=r.attrs[a];n[this.attr]=this.value;let i=r.type.create(n,null,r.marks);return qi.fromReplace(e,this.pos,this.pos+1,new $t(gt.from(i),0,r.isLeaf?0:1))}getMap(){return Io.empty}invert(e){return new oy(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new oy(r.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.pos!="number"||typeof r.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new oy(r.pos,r.attr,r.value)}}bs.jsonID("attr",oy);class gC extends bs{constructor(e,r){super(),this.attr=e,this.value=r}apply(e){let r=Object.create(null);for(let i in e.attrs)r[i]=e.attrs[i];r[this.attr]=this.value;let n=e.type.create(r,e.content,e.marks);return qi.ok(n)}getMap(){return Io.empty}invert(e){return new gC(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new gC(r.attr,r.value)}}bs.jsonID("docAttr",gC);let pb=class extends Error{};pb=function t(e){let r=Error.call(this,e);return r.__proto__=t.prototype,r};pb.prototype=Object.create(Error.prototype);pb.prototype.constructor=pb;pb.prototype.name="TransformError";let SF=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new pC}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let r=this.maybeStep(e);if(r.failed)throw new pb(r.failed);return this}maybeStep(e){let r=e.apply(this.doc);return r.failed||this.addStep(e,r.doc),r}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,r=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let i=this.mapping.maps[n];n&&(e=i.map(e,1),r=i.map(r,-1)),i.forEach((a,s,o,l)=>{e=Math.min(e,o),r=Math.max(r,l)})}return e==1e9?null:{from:e,to:r}}addStep(e,r){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=r}replace(e,r=e,n=$t.empty){let i=D6(this.doc,e,r,n);return i&&this.step(i),this}replaceWith(e,r,n){return this.replace(e,r,new $t(gt.from(n),0,0))}delete(e,r){return this.replace(e,r,$t.empty)}insert(e,r){return this.replaceWith(e,e,r)}replaceRange(e,r,n){return j7e(this,e,r,n),this}replaceRangeWith(e,r,n){return K7e(this,e,r,n),this}deleteRange(e,r){return Z7e(this,e,r),this}lift(e,r){return O7e(this,e,r),this}join(e,r=1){return H7e(this,e,r),this}wrap(e,r){return B7e(this,e,r),this}setBlockType(e,r=e,n,i=null){return F7e(this,e,r,n,i),this}setNodeMarkup(e,r,n=null,i){return V7e(this,e,r,n,i),this}setNodeAttribute(e,r,n){return this.step(new oy(e,r,n)),this}setDocAttribute(e,r){return this.step(new gC(e,r)),this}addNodeMark(e,r){return this.step(new Ad(e,r)),this}removeNodeMark(e,r){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(r instanceof In)r.isInSet(n.marks)&&this.step(new x0(e,r));else{let i=n.marks,a,s=[];for(;a=r.isInSet(i);)s.push(new x0(e,a)),i=a.removeFromSet(i);for(let o=s.length-1;o>=0;o--)this.step(s[o])}return this}split(e,r=1,n){return G7e(this,e,r,n),this}addMark(e,r,n){return I7e(this,e,r,n),this}removeMark(e,r,n){return N7e(this,e,r,n),this}clearIncompatible(e,r,n){return CF(this,e,r,n),this}};const J7=Object.create(null);let Cr=class{constructor(e,r,n){this.$anchor=e,this.$head=r,this.ranges=n||[new tse(e.min(r),e.max(r))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let r=0;r<e.length;r++)if(e[r].$from.pos!=e[r].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,r=$t.empty){let n=r.content.lastChild,i=null;for(let o=0;o<r.openEnd;o++)i=n,n=n.lastChild;let a=e.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){let{$from:l,$to:u}=s[o],h=e.mapping.slice(a);e.replaceRange(h.map(l.pos),h.map(u.pos),o?$t.empty:r),o==0&&AY(e,a,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,r){let n=e.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){let{$from:s,$to:o}=i[a],l=e.mapping.slice(n),u=l.map(s.pos),h=l.map(o.pos);a?e.deleteRange(u,h):(e.replaceRangeWith(u,h,r),AY(e,n,r.isInline?-1:1))}}static findFrom(e,r,n=!1){let i=e.parent.inlineContent?new rr(e):fm(e.node(0),e.parent,e.pos,e.index(),r,n);if(i)return i;for(let a=e.depth-1;a>=0;a--){let s=r<0?fm(e.node(0),e.node(a),e.before(a+1),e.index(a),r,n):fm(e.node(0),e.node(a),e.after(a+1),e.index(a)+1,r,n);if(s)return s}return null}static near(e,r=1){return this.findFrom(e,r)||this.findFrom(e,-r)||new Do(e.node(0))}static atStart(e){return fm(e,e,0,0,1)||new Do(e)}static atEnd(e){return fm(e,e,e.content.size,e.childCount,-1)||new Do(e)}static fromJSON(e,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=J7[r.type];if(!n)throw new RangeError(`No selection type ${r.type} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in J7)throw new RangeError("Duplicate use of selection JSON ID "+e);return J7[e]=r,r.prototype.jsonID=e,r}getBookmark(){return rr.between(this.$anchor,this.$head).getBookmark()}};Cr.prototype.visible=!0;let tse=class{constructor(e,r){this.$from=e,this.$to=r}},SY=!1;function EY(t){!SY&&!t.parent.inlineContent&&(SY=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class rr extends Cr{constructor(e,r=e){EY(e),EY(r),super(e,r)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,r){let n=e.resolve(r.map(this.head));if(!n.parent.inlineContent)return Cr.near(n);let i=e.resolve(r.map(this.anchor));return new rr(i.parent.inlineContent?i:n,n)}replace(e,r=$t.empty){if(super.replace(e,r),r==$t.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof rr&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new O6(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,r){if(typeof r.anchor!="number"||typeof r.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new rr(e.resolve(r.anchor),e.resolve(r.head))}static create(e,r,n=r){let i=e.resolve(r);return new this(i,n==r?i:e.resolve(n))}static between(e,r,n){let i=e.pos-r.pos;if((!n||i)&&(n=i>=0?1:-1),!r.parent.inlineContent){let a=Cr.findFrom(r,n,!0)||Cr.findFrom(r,-n,!0);if(a)r=a.$head;else return Cr.near(r,n)}return e.parent.inlineContent||(i==0?e=r:(e=(Cr.findFrom(e,-n,!0)||Cr.findFrom(e,n,!0)).$anchor,e.pos<r.pos!=i<0&&(e=r))),new rr(e,r)}}Cr.jsonID("text",rr);class O6{constructor(e,r){this.anchor=e,this.head=r}map(e){return new O6(e.map(this.anchor),e.map(this.head))}resolve(e){return rr.between(e.resolve(this.anchor),e.resolve(this.head))}}class lr extends Cr{constructor(e){let r=e.nodeAfter,n=e.node(0).resolve(e.pos+r.nodeSize);super(e,n),this.node=r}map(e,r){let{deleted:n,pos:i}=r.mapResult(this.anchor),a=e.resolve(i);return n?Cr.near(a):new lr(a)}content(){return new $t(gt.from(this.node),0,0)}eq(e){return e instanceof lr&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new EF(this.anchor)}static fromJSON(e,r){if(typeof r.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new lr(e.resolve(r.anchor))}static create(e,r){return new lr(e.resolve(r))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}lr.prototype.visible=!1;Cr.jsonID("node",lr);class EF{constructor(e){this.anchor=e}map(e){let{deleted:r,pos:n}=e.mapResult(this.anchor);return r?new O6(n,n):new EF(n)}resolve(e){let r=e.resolve(this.anchor),n=r.nodeAfter;return n&&lr.isSelectable(n)?new lr(r):Cr.near(r)}}class Do extends Cr{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,r=$t.empty){if(r==$t.empty){e.delete(0,e.doc.content.size);let n=Cr.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,r)}toJSON(){return{type:"all"}}static fromJSON(e){return new Do(e)}map(e){return new Do(e)}eq(e){return e instanceof Do}getBookmark(){return Q7e}}Cr.jsonID("all",Do);const Q7e={map(){return this},resolve(t){return new Do(t)}};function fm(t,e,r,n,i,a=!1){if(e.inlineContent)return rr.create(t,r);for(let s=n-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let o=e.child(s);if(o.isAtom){if(!a&&lr.isSelectable(o))return lr.create(t,r-(i<0?o.nodeSize:0))}else{let l=fm(t,o,r+i,i<0?o.childCount:0,i,a);if(l)return l}r+=o.nodeSize*i}return null}function AY(t,e,r){let n=t.steps.length-1;if(n<e)return;let i=t.steps[n];if(!(i instanceof Vi||i instanceof Ta))return;let a=t.mapping.maps[n],s;a.forEach((o,l,u,h)=>{s==null&&(s=h)}),t.setSelection(Cr.near(t.doc.resolve(s),r))}const _Y=1,eE=2,RY=4;class J7e extends SF{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|_Y)&~eE,this.storedMarks=null,this}get selectionSet(){return(this.updated&_Y)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=eE,this}ensureMarks(e){return In.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&eE)>0}addStep(e,r){super.addStep(e,r),this.updated=this.updated&~eE,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,r=!0){let n=this.selection;return r&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||In.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,r,n){let i=this.doc.type.schema;if(r==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(n==null&&(n=r),!e)return this.deleteRange(r,n);let a=this.storedMarks;if(!a){let s=this.doc.resolve(r);a=n==r?s.marks():s.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(r,n,i.text(e,a)),!this.selection.empty&&this.selection.to==r+e.length&&this.setSelection(Cr.near(this.selection.$to)),this}}setMeta(e,r){return this.meta[typeof e=="string"?e:e.key]=r,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=RY,this}get scrolledIntoView(){return(this.updated&RY)>0}}function LY(t,e){return!e||!t?t:t.bind(e)}class OT{constructor(e,r,n){this.name=e,this.init=LY(r.init,n),this.apply=LY(r.apply,n)}}const eMe=[new OT("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new OT("selection",{init(t,e){return t.selection||Cr.atStart(e.doc)},apply(t){return t.selection}}),new OT("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,r,n){return n.selection.$cursor?t.storedMarks:null}}),new OT("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class eM{constructor(e,r){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=eMe.slice(),r&&r.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new OT(n.key,n.spec.state,n))})}}class Gm{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,r=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=r){let i=this.config.plugins[n];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let r=[e],n=this.applyInner(e),i=null;for(;;){let a=!1;for(let s=0;s<this.config.plugins.length;s++){let o=this.config.plugins[s];if(o.spec.appendTransaction){let l=i?i[s].n:0,u=i?i[s].state:this,h=l<r.length&&o.spec.appendTransaction.call(o,l?r.slice(l):r,u,n);if(h&&n.filterTransaction(h,s)){if(h.setMeta("appendedTransaction",e),!i){i=[];for(let d=0;d<this.config.plugins.length;d++)i.push(d<s?{state:n,n:r.length}:{state:this,n:0})}r.push(h),n=n.applyInner(h),a=!0}i&&(i[s]={state:n,n:r.length})}}if(!a)return{state:n,transactions:r}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let r=new Gm(this.config),n=this.config.fields;for(let i=0;i<n.length;i++){let a=n[i];r[a.name]=a.apply(e,this[a.name],this,r)}return r}get tr(){return new J7e(this)}static create(e){let r=new eM(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Gm(r);for(let i=0;i<r.fields.length;i++)n[r.fields[i].name]=r.fields[i].init(e,n);return n}reconfigure(e){let r=new eM(this.schema,e.plugins),n=r.fields,i=new Gm(r);for(let a=0;a<n.length;a++){let s=n[a].name;i[s]=this.hasOwnProperty(s)?this[s]:n[a].init(e,i)}return i}toJSON(e){let r={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(r.storedMarks=this.storedMarks.map(n=>n.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[n],a=i.spec.state;a&&a.toJSON&&(r[n]=a.toJSON.call(i,this[i.key]))}return r}static fromJSON(e,r,n){if(!r)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new eM(e.schema,e.plugins),a=new Gm(i);return i.fields.forEach(s=>{if(s.name=="doc")a.doc=Bd.fromJSON(e.schema,r.doc);else if(s.name=="selection")a.selection=Cr.fromJSON(a.doc,r.selection);else if(s.name=="storedMarks")r.storedMarks&&(a.storedMarks=r.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let l=n[o],u=l.spec.state;if(l.key==s.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(r,o)){a[s.name]=u.fromJSON.call(l,e,r[o],a);return}}a[s.name]=s.init(e,a)}}),a}}function rse(t,e,r){for(let n in t){let i=t[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=rse(i,e,{})),r[n]=i}return r}class Un{constructor(e){this.spec=e,this.props={},e.props&&rse(e.props,this,this.props),this.key=e.key?e.key.key:nse("plugin")}getState(e){return e[this.key]}}const tM=Object.create(null);function nse(t){return t in tM?t+"$"+ ++tM[t]:(tM[t]=0,t+"$")}class Ei{constructor(e="key"){this.key=nse(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ise=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function ase(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("backward",t):r.parentOffset>0)?null:r}const sse=(t,e,r)=>{let n=ase(t,r);if(!n)return!1;let i=AF(n);if(!i){let s=n.blockRange(),o=s&&fx(s);return o==null?!1:(e&&e(t.tr.lift(s,o).scrollIntoView()),!0)}let a=i.nodeBefore;if(gse(t,i,e,-1))return!0;if(n.parent.content.size==0&&(gb(a,"end")||lr.isSelectable(a)))for(let s=n.depth;;s--){let o=D6(t.doc,n.before(s),n.after(s),$t.empty);if(o&&o.slice.size<o.to-o.from){if(e){let l=t.tr.step(o);l.setSelection(gb(a,"end")?Cr.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):lr.create(l.doc,i.pos-a.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||n.node(s-1).childCount>1)break}return a.isAtom&&i.depth==n.depth-1?(e&&e(t.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},tMe=(t,e,r)=>{let n=ase(t,r);if(!n)return!1;let i=AF(n);return i?ose(t,i,e):!1},rMe=(t,e,r)=>{let n=cse(t,r);if(!n)return!1;let i=_F(n);return i?ose(t,i,e):!1};function ose(t,e,r){let n=e.nodeBefore,i=n,a=e.pos-1;for(;!i.isTextblock;a--){if(i.type.spec.isolating)return!1;let h=i.lastChild;if(!h)return!1;i=h}let s=e.nodeAfter,o=s,l=e.pos+1;for(;!o.isTextblock;l++){if(o.type.spec.isolating)return!1;let h=o.firstChild;if(!h)return!1;o=h}let u=D6(t.doc,a,l,$t.empty);if(!u||u.from!=a||u instanceof Vi&&u.slice.size>=l-a)return!1;if(r){let h=t.tr.step(u);h.setSelection(rr.create(h.doc,a)),r(h.scrollIntoView())}return!0}function gb(t,e,r=!1){for(let n=t;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(r&&n.childCount!=1)return!1}return!1}const lse=(t,e,r)=>{let{$head:n,empty:i}=t.selection,a=n;if(!i)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",t):n.parentOffset>0)return!1;a=AF(n)}let s=a&&a.nodeBefore;return!s||!lr.isSelectable(s)?!1:(e&&e(t.tr.setSelection(lr.create(t.doc,a.pos-s.nodeSize)).scrollIntoView()),!0)};function AF(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function cse(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)?null:r}const use=(t,e,r)=>{let n=cse(t,r);if(!n)return!1;let i=_F(n);if(!i)return!1;let a=i.nodeAfter;if(gse(t,i,e,1))return!0;if(n.parent.content.size==0&&(gb(a,"start")||lr.isSelectable(a))){let s=D6(t.doc,n.before(),n.after(),$t.empty);if(s&&s.slice.size<s.to-s.from){if(e){let o=t.tr.step(s);o.setSelection(gb(a,"start")?Cr.findFrom(o.doc.resolve(o.mapping.map(i.pos)),1):lr.create(o.doc,o.mapping.map(i.pos))),e(o.scrollIntoView())}return!0}}return a.isAtom&&i.depth==n.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},hse=(t,e,r)=>{let{$head:n,empty:i}=t.selection,a=n;if(!i)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)return!1;a=_F(n)}let s=a&&a.nodeAfter;return!s||!lr.isSelectable(s)?!1:(e&&e(t.tr.setSelection(lr.create(t.doc,a.pos)).scrollIntoView()),!0)};function _F(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let r=t.node(e);if(t.index(e)+1<r.childCount)return t.doc.resolve(t.after(e+1));if(r.type.spec.isolating)break}return null}const nMe=(t,e)=>{let r=t.selection,n=r instanceof lr,i;if(n){if(r.node.isTextblock||!xf(t.doc,r.from))return!1;i=r.from}else if(i=N6(t.doc,r.from,-1),i==null)return!1;if(e){let a=t.tr.join(i);n&&a.setSelection(lr.create(a.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(a.scrollIntoView())}return!0},iMe=(t,e)=>{let r=t.selection,n;if(r instanceof lr){if(r.node.isTextblock||!xf(t.doc,r.to))return!1;n=r.to}else if(n=N6(t.doc,r.to,1),n==null)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0},aMe=(t,e)=>{let{$from:r,$to:n}=t.selection,i=r.blockRange(n),a=i&&fx(i);return a==null?!1:(e&&e(t.tr.lift(i,a).scrollIntoView()),!0)},dse=(t,e)=>{let{$head:r,$anchor:n}=t.selection;return!r.parent.type.spec.code||!r.sameParent(n)?!1:(e&&e(t.tr.insertText(`
`).scrollIntoView()),!0)};function RF(t){for(let e=0;e<t.edgeCount;e++){let{type:r}=t.edge(e);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}const sMe=(t,e)=>{let{$head:r,$anchor:n}=t.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let i=r.node(-1),a=r.indexAfter(-1),s=RF(i.contentMatchAt(a));if(!s||!i.canReplaceWith(a,a,s))return!1;if(e){let o=r.after(),l=t.tr.replaceWith(o,o,s.createAndFill());l.setSelection(Cr.near(l.doc.resolve(o),1)),e(l.scrollIntoView())}return!0},fse=(t,e)=>{let r=t.selection,{$from:n,$to:i}=r;if(r instanceof Do||n.parent.inlineContent||i.parent.inlineContent)return!1;let a=RF(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(e){let s=(!n.parentOffset&&i.index()<i.parent.childCount?n:i).pos,o=t.tr.insert(s,a.createAndFill());o.setSelection(rr.create(o.doc,s+1)),e(o.scrollIntoView())}return!0},pse=(t,e)=>{let{$cursor:r}=t.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let a=r.before();if(oh(t.doc,a))return e&&e(t.tr.split(a).scrollIntoView()),!0}let n=r.blockRange(),i=n&&fx(n);return i==null?!1:(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)};function oMe(t){return(e,r)=>{if(e.selection instanceof lr&&e.selection.node.isBlock){let{$from:p}=e.selection;return!p.parentOffset||!oh(e.doc,p.pos)?!1:(r&&r(e.tr.split(p.pos).scrollIntoView()),!0)}if(!e.selection.$from.depth)return!1;let n=e.tr;!e.selection.empty&&(e.selection instanceof rr||e.selection instanceof Do)&&n.deleteSelection();let{$from:i}=n.selection,a=n.steps.length,s=[],o,l,u=!1,h=!1;for(let p=i.depth;;p--)if(i.node(p).isBlock){u=i.end(p)==i.pos+(i.depth-p),h=i.start(p)==i.pos-(i.depth-p),l=RF(i.node(p-1).contentMatchAt(i.indexAfter(p-1))),s.unshift(u&&l?{type:l}:null),o=p;break}else{if(p==1)return!1;s.unshift(null)}let d=i.pos,f=oh(n.doc,d,s.length,s);if(f||(s[0]=l?{type:l}:null,f=oh(n.doc,d,s.length,s)),!f)return!1;if(n.split(d,s.length,s),!u&&h&&i.node(o).type!=l){let p=n.mapping.slice(a),g=p.map(i.before(o)),m=n.doc.resolve(g);l&&i.node(o-1).canReplaceWith(m.index(),m.index()+1,l)&&n.setNodeMarkup(p.map(i.before(o)),l)}return r&&r(n.scrollIntoView()),!0}}const lMe=oMe(),cMe=(t,e)=>{let{$from:r,to:n}=t.selection,i,a=r.sharedDepth(n);return a==0?!1:(i=r.before(a),e&&e(t.tr.setSelection(lr.create(t.doc,i))),!0)};function uMe(t,e,r){let n=e.nodeBefore,i=e.nodeAfter,a=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(a-1,a)?(r&&r(t.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(a,a+1)||!(i.isTextblock||xf(t.doc,e.pos))?!1:(r&&r(t.tr.join(e.pos).scrollIntoView()),!0)}function gse(t,e,r,n){let i=e.nodeBefore,a=e.nodeAfter,s,o,l=i.type.spec.isolating||a.type.spec.isolating;if(!l&&uMe(t,e,r))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(s=(o=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&o.matchType(s[0]||a.type).validEnd){if(r){let p=e.pos+a.nodeSize,g=gt.empty;for(let v=s.length-1;v>=0;v--)g=gt.from(s[v].create(null,g));g=gt.from(i.copy(g));let m=t.tr.step(new Ta(e.pos-1,p,e.pos,p,new $t(g,1,0),s.length,!0)),y=m.doc.resolve(p+2*s.length);y.nodeAfter&&y.nodeAfter.type==i.type&&xf(m.doc,y.pos)&&m.join(y.pos),r(m.scrollIntoView())}return!0}let h=a.type.spec.isolating||n>0&&l?null:Cr.findFrom(e,1),d=h&&h.$from.blockRange(h.$to),f=d&&fx(d);if(f!=null&&f>=e.depth)return r&&r(t.tr.lift(d,f).scrollIntoView()),!0;if(u&&gb(a,"start",!0)&&gb(i,"end")){let p=i,g=[];for(;g.push(p),!p.isTextblock;)p=p.lastChild;let m=a,y=1;for(;!m.isTextblock;m=m.firstChild)y++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(r){let v=gt.empty;for(let b=g.length-1;b>=0;b--)v=gt.from(g[b].copy(v));let T=t.tr.step(new Ta(e.pos-g.length,e.pos+a.nodeSize,e.pos+y,e.pos+a.nodeSize-y,new $t(v,g.length,0),0,!0));r(T.scrollIntoView())}return!0}}return!1}function mse(t){return function(e,r){let n=e.selection,i=t<0?n.$from:n.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(r&&r(e.tr.setSelection(rr.create(e.doc,t<0?i.start(a):i.end(a)))),!0):!1}}const hMe=mse(-1),dMe=mse(1);function fMe(t,e=null){return function(r,n){let{$from:i,$to:a}=r.selection,s=i.blockRange(a),o=s&&kF(s,t,e);return o?(n&&n(r.tr.wrap(s,o).scrollIntoView()),!0):!1}}function MY(t,e=null){return function(r,n){let i=!1;for(let a=0;a<r.selection.ranges.length&&!i;a++){let{$from:{pos:s},$to:{pos:o}}=r.selection.ranges[a];r.doc.nodesBetween(s,o,(l,u)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let h=r.doc.resolve(u),d=h.index();i=h.parent.canReplaceWith(d,d+1,t)}})}if(!i)return!1;if(n){let a=r.tr;for(let s=0;s<r.selection.ranges.length;s++){let{$from:{pos:o},$to:{pos:l}}=r.selection.ranges[s];a.setBlockType(o,l,t,e)}n(a.scrollIntoView())}return!0}}function LF(...t){return function(e,r,n){for(let i=0;i<t.length;i++)if(t[i](e,r,n))return!0;return!1}}LF(ise,sse,lse);LF(ise,use,hse);LF(dse,fse,pse,lMe);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function pMe(t,e=null){return function(r,n){let{$from:i,$to:a}=r.selection,s=i.blockRange(a);if(!s)return!1;let o=n?r.tr:null;return gMe(o,s,t,e)?(n&&n(o.scrollIntoView()),!0):!1}}function gMe(t,e,r,n=null){let i=!1,a=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(r)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=s.resolve(e.start-2);a=new u5(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new u5(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let o=kF(a,r,n,e);return o?(t&&mMe(t,e,o,i,r),!0):!1}function mMe(t,e,r,n,i){let a=gt.empty;for(let h=r.length-1;h>=0;h--)a=gt.from(r[h].type.create(r[h].attrs,a));t.step(new Ta(e.start-(n?2:0),e.end,e.start,e.end,new $t(a,0,0),r.length,!0));let s=0;for(let h=0;h<r.length;h++)r[h].type==i&&(s=h+1);let o=r.length-s,l=e.start+r.length-(n?2:0),u=e.parent;for(let h=e.startIndex,d=e.endIndex,f=!0;h<d;h++,f=!1)!f&&oh(t.doc,l,o)&&(t.split(l,o),l+=2*o),l+=u.child(h).nodeSize;return t}function yMe(t){return function(e,r){let{$from:n,$to:i}=e.selection,a=n.blockRange(i,s=>s.childCount>0&&s.firstChild.type==t);return a?r?n.node(a.depth-1).type==t?vMe(e,r,t,a):bMe(e,r,a):!0:!1}}function vMe(t,e,r,n){let i=t.tr,a=n.end,s=n.$to.end(n.depth);a<s&&(i.step(new Ta(a-1,s,a,s,new $t(gt.from(r.create(null,n.parent.copy())),1,0),1,!0)),n=new u5(i.doc.resolve(n.$from.pos),i.doc.resolve(s),n.depth));const o=fx(n);if(o==null)return!1;i.lift(n,o);let l=i.doc.resolve(i.mapping.map(a,-1)-1);return xf(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),e(i.scrollIntoView()),!0}function bMe(t,e,r){let n=t.tr,i=r.parent;for(let p=r.end,g=r.endIndex-1,m=r.startIndex;g>m;g--)p-=i.child(g).nodeSize,n.delete(p-1,p+1);let a=n.doc.resolve(r.start),s=a.nodeAfter;if(n.mapping.map(r.end)!=r.start+a.nodeAfter.nodeSize)return!1;let o=r.startIndex==0,l=r.endIndex==i.childCount,u=a.node(-1),h=a.index(-1);if(!u.canReplace(h+(o?0:1),h+1,s.content.append(l?gt.empty:gt.from(i))))return!1;let d=a.pos,f=d+s.nodeSize;return n.step(new Ta(d-(o?1:0),f+(l?1:0),d+1,f-1,new $t((o?gt.empty:gt.from(i.copy(gt.empty))).append(l?gt.empty:gt.from(i.copy(gt.empty))),o?0:1,l?0:1),o?0:1)),e(n.scrollIntoView()),!0}function xMe(t){return function(e,r){let{$from:n,$to:i}=e.selection,a=n.blockRange(i,u=>u.childCount>0&&u.firstChild.type==t);if(!a)return!1;let s=a.startIndex;if(s==0)return!1;let o=a.parent,l=o.child(s-1);if(l.type!=t)return!1;if(r){let u=l.lastChild&&l.lastChild.type==o.type,h=gt.from(u?t.create():null),d=new $t(gt.from(t.create(null,gt.from(o.type.create(null,h)))),u?3:1,0),f=a.start,p=a.end;r(e.tr.step(new Ta(f-(u?3:1),p,f,p,d,1,!0)).scrollIntoView())}return!0}}const qa=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},mb=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let sD=null;const Vu=function(t,e,r){let n=sD||(sD=document.createRange());return n.setEnd(t,r??t.nodeValue.length),n.setStart(t,e||0),n},TMe=function(){sD=null},T0=function(t,e,r,n){return r&&(IY(t,e,r,n,-1)||IY(t,e,r,n,1))},wMe=/^(img|br|input|textarea|hr)$/i;function IY(t,e,r,n,i){for(var a;;){if(t==r&&e==n)return!0;if(e==(i<0?0:cl(t))){let s=t.parentNode;if(!s||s.nodeType!=1||Bk(t)||wMe.test(t.nodeName)||t.contentEditable=="false")return!1;e=qa(t)+(i<0?0:1),t=s}else if(t.nodeType==1){let s=t.childNodes[e+(i<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((a=s.pmViewDesc)===null||a===void 0)&&a.ignoreForSelection)e+=i;else return!1;else t=s,e=i<0?cl(t):0}else return!1}}function cl(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function CMe(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=cl(t)}else if(t.parentNode&&!Bk(t))e=qa(t),t=t.parentNode;else return null}}function kMe(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Bk(t))e=qa(t)+1,t=t.parentNode;else return null}}function SMe(t,e,r){for(let n=e==0,i=e==cl(t);n||i;){if(t==r)return!0;let a=qa(t);if(t=t.parentNode,!t)return!1;n=n&&a==0,i=i&&a==cl(t)}}function Bk(t){let e;for(let r=t;r&&!(e=r.pmViewDesc);r=r.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const $6=function(t){return t.focusNode&&T0(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Tp(t,e){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=e,r}function EMe(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function AMe(t,e,r){if(t.caretPositionFromPoint)try{let n=t.caretPositionFromPoint(e,r);if(n)return{node:n.offsetNode,offset:Math.min(cl(n.offsetNode),n.offset)}}catch{}if(t.caretRangeFromPoint){let n=t.caretRangeFromPoint(e,r);if(n)return{node:n.startContainer,offset:Math.min(cl(n.startContainer),n.startOffset)}}}const jc=typeof navigator<"u"?navigator:null,NY=typeof document<"u"?document:null,Tf=jc&&jc.userAgent||"",oD=/Edge\/(\d+)/.exec(Tf),yse=/MSIE \d/.exec(Tf),lD=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Tf),vo=!!(yse||lD||oD),Fd=yse?document.documentMode:lD?+lD[1]:oD?+oD[1]:0,ml=!vo&&/gecko\/(\d+)/i.test(Tf);ml&&+(/Firefox\/(\d+)/.exec(Tf)||[0,0])[1];const cD=!vo&&/Chrome\/(\d+)/.exec(Tf),Ya=!!cD,vse=cD?+cD[1]:0,ps=!vo&&!!jc&&/Apple Computer/.test(jc.vendor),yb=ps&&(/Mobile\/\w+/.test(Tf)||!!jc&&jc.maxTouchPoints>2),al=yb||(jc?/Mac/.test(jc.platform):!1),bse=jc?/Win/.test(jc.platform):!1,ju=/Android \d/.test(Tf),Fk=!!NY&&"webkitFontSmoothing"in NY.documentElement.style,_Me=Fk?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function RMe(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Cu(t,e){return typeof t=="number"?t:t[e]}function LMe(t){let e=t.getBoundingClientRect(),r=e.width/t.offsetWidth||1,n=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*r,top:e.top,bottom:e.top+t.clientHeight*n}}function DY(t,e,r){if(!uD(e)&&e.left==0)return;let n=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,a=t.dom.ownerDocument;for(let s=r||t.dom;s;){if(s.nodeType!=1){s=mb(s);continue}let o=s,l=o==a.body,u=l?RMe(a):LMe(o),h=0,d=0;if(e.top<u.top+Cu(n,"top")?d=-(u.top-e.top+Cu(i,"top")):e.bottom>u.bottom-Cu(n,"bottom")&&(d=e.bottom-e.top>u.bottom-u.top?e.top+Cu(i,"top")-u.top:e.bottom-u.bottom+Cu(i,"bottom")),e.left<u.left+Cu(n,"left")?h=-(u.left-e.left+Cu(i,"left")):e.right>u.right-Cu(n,"right")&&(h=e.right-u.right+Cu(i,"right")),h||d)if(l)a.defaultView.scrollBy(h,d);else{let p=o.scrollLeft,g=o.scrollTop;d&&(o.scrollTop+=d),h&&(o.scrollLeft+=h);let m=o.scrollLeft-p,y=o.scrollTop-g;e={left:e.left-m,top:e.top-y,right:e.right-m,bottom:e.bottom-y}}let f=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(f))break;s=f=="absolute"?s.offsetParent:mb(s)}}function MMe(t){let e=t.dom.getBoundingClientRect(),r=Math.max(0,e.top),n,i;for(let a=(e.left+e.right)/2,s=r+1;s<Math.min(innerHeight,e.bottom);s+=5){let o=t.root.elementFromPoint(a,s);if(!o||o==t.dom||!t.dom.contains(o))continue;let l=o.getBoundingClientRect();if(l.top>=r-20){n=o,i=l.top;break}}return{refDOM:n,refTop:i,stack:xse(t.dom)}}function xse(t){let e=[],r=t.ownerDocument;for(let n=t;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),t!=r);n=mb(n));return e}function IMe({refDOM:t,refTop:e,stack:r}){let n=t?t.getBoundingClientRect().top:0;Tse(r,n==0?0:n-e)}function Tse(t,e){for(let r=0;r<t.length;r++){let{dom:n,top:i,left:a}=t[r];n.scrollTop!=i+e&&(n.scrollTop=i+e),n.scrollLeft!=a&&(n.scrollLeft=a)}}let zg=null;function NMe(t){if(t.setActive)return t.setActive();if(zg)return t.focus(zg);let e=xse(t);t.focus(zg==null?{get preventScroll(){return zg={preventScroll:!0},!0}}:void 0),zg||(zg=!1,Tse(e,0))}function wse(t,e){let r,n=2e8,i,a=0,s=e.top,o=e.top,l,u;for(let h=t.firstChild,d=0;h;h=h.nextSibling,d++){let f;if(h.nodeType==1)f=h.getClientRects();else if(h.nodeType==3)f=Vu(h).getClientRects();else continue;for(let p=0;p<f.length;p++){let g=f[p];if(g.top<=s&&g.bottom>=o){s=Math.max(g.bottom,s),o=Math.min(g.top,o);let m=g.left>e.left?g.left-e.left:g.right<e.left?e.left-g.right:0;if(m<n){r=h,n=m,i=m&&r.nodeType==3?{left:g.right<e.left?g.right:g.left,top:e.top}:e,h.nodeType==1&&m&&(a=d+(e.left>=(g.left+g.right)/2?1:0));continue}}else g.top>e.top&&!l&&g.left<=e.left&&g.right>=e.left&&(l=h,u={left:Math.max(g.left,Math.min(g.right,e.left)),top:g.top});!r&&(e.left>=g.right&&e.top>=g.top||e.left>=g.left&&e.top>=g.bottom)&&(a=d+1)}}return!r&&l&&(r=l,i=u,n=0),r&&r.nodeType==3?DMe(r,i):!r||n&&r.nodeType==1?{node:t,offset:a}:wse(r,i)}function DMe(t,e){let r=t.nodeValue.length,n=document.createRange(),i;for(let a=0;a<r;a++){n.setEnd(t,a+1),n.setStart(t,a);let s=ld(n,1);if(s.top!=s.bottom&&MF(e,s)){i={node:t,offset:a+(e.left>=(s.left+s.right)/2?1:0)};break}}return n.detach(),i||{node:t,offset:0}}function MF(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function OMe(t,e){let r=t.parentNode;return r&&/^li$/i.test(r.nodeName)&&e.left<t.getBoundingClientRect().left?r:t}function $Me(t,e,r){let{node:n,offset:i}=wse(e,r),a=-1;if(n.nodeType==1&&!n.firstChild){let s=n.getBoundingClientRect();a=s.left!=s.right&&r.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(n,i,a)}function PMe(t,e,r,n){let i=-1;for(let a=e,s=!1;a!=t.dom;){let o=t.docView.nearestDesc(a,!0),l;if(!o)return null;if(o.dom.nodeType==1&&(o.node.isBlock&&o.parent||!o.contentDOM)&&((l=o.dom.getBoundingClientRect()).width||l.height)&&(o.node.isBlock&&o.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(o.dom.nodeName)&&(!s&&l.left>n.left||l.top>n.top?i=o.posBefore:(!s&&l.right<n.left||l.bottom<n.top)&&(i=o.posAfter),s=!0),!o.contentDOM&&i<0&&!o.node.isText))return(o.node.isBlock?n.top<(l.top+l.bottom)/2:n.left<(l.left+l.right)/2)?o.posBefore:o.posAfter;a=o.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,r,-1)}function Cse(t,e,r){let n=t.childNodes.length;if(n&&r.top<r.bottom)for(let i=Math.max(0,Math.min(n-1,Math.floor(n*(e.top-r.top)/(r.bottom-r.top))-2)),a=i;;){let s=t.childNodes[a];if(s.nodeType==1){let o=s.getClientRects();for(let l=0;l<o.length;l++){let u=o[l];if(MF(e,u))return Cse(s,e,u)}}if((a=(a+1)%n)==i)break}return t}function BMe(t,e){let r=t.dom.ownerDocument,n,i=0,a=AMe(r,e.left,e.top);a&&({node:n,offset:i}=a);let s=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top),o;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let u=t.dom.getBoundingClientRect();if(!MF(e,u)||(s=Cse(t.dom,e,u),!s))return null}if(ps)for(let u=s;n&&u;u=mb(u))u.draggable&&(n=void 0);if(s=OMe(s,e),n){if(ml&&n.nodeType==1&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let h=n.childNodes[i],d;h.nodeName=="IMG"&&(d=h.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&i++}let u;Fk&&i&&n.nodeType==1&&(u=n.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,n==t.dom&&i==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?o=t.state.doc.content.size:(i==0||n.nodeType!=1||n.childNodes[i-1].nodeName!="BR")&&(o=PMe(t,n,i,e))}o==null&&(o=$Me(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:o,inside:l?l.posAtStart-l.border:-1}}function uD(t){return t.top<t.bottom||t.left<t.right}function ld(t,e){let r=t.getClientRects();if(r.length){let n=r[e<0?0:r.length-1];if(uD(n))return n}return Array.prototype.find.call(r,uD)||t.getBoundingClientRect()}const FMe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function kse(t,e,r){let{node:n,offset:i,atom:a}=t.docView.domFromPos(e,r<0?-1:1),s=Fk||ml;if(n.nodeType==3)if(s&&(FMe.test(n.nodeValue)||(r<0?!i:i==n.nodeValue.length))){let l=ld(Vu(n,i,i),r);if(ml&&i&&/\s/.test(n.nodeValue[i-1])&&i<n.nodeValue.length){let u=ld(Vu(n,i-1,i-1),-1);if(u.top==l.top){let h=ld(Vu(n,i,i+1),-1);if(h.top!=l.top)return Yx(h,h.left<u.left)}}return l}else{let l=i,u=i,h=r<0?1:-1;return r<0&&!i?(u++,h=-1):r>=0&&i==n.nodeValue.length?(l--,h=1):r<0?l--:u++,Yx(ld(Vu(n,l,u),h),h<0)}if(!t.state.doc.resolve(e-(a||0)).parent.inlineContent){if(a==null&&i&&(r<0||i==cl(n))){let l=n.childNodes[i-1];if(l.nodeType==1)return rM(l.getBoundingClientRect(),!1)}if(a==null&&i<cl(n)){let l=n.childNodes[i];if(l.nodeType==1)return rM(l.getBoundingClientRect(),!0)}return rM(n.getBoundingClientRect(),r>=0)}if(a==null&&i&&(r<0||i==cl(n))){let l=n.childNodes[i-1],u=l.nodeType==3?Vu(l,cl(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return Yx(ld(u,1),!1)}if(a==null&&i<cl(n)){let l=n.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let u=l?l.nodeType==3?Vu(l,0,s?0:1):l.nodeType==1?l:null:null;if(u)return Yx(ld(u,-1),!0)}return Yx(ld(n.nodeType==3?Vu(n):n,-r),r>=0)}function Yx(t,e){if(t.width==0)return t;let r=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:r,right:r}}function rM(t,e){if(t.height==0)return t;let r=e?t.top:t.bottom;return{top:r,bottom:r,left:t.left,right:t.right}}function Sse(t,e,r){let n=t.state,i=t.root.activeElement;n!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return r()}finally{n!=e&&t.updateState(n),i!=t.dom&&i&&i.focus()}}function zMe(t,e,r){let n=e.selection,i=r=="up"?n.$from:n.$to;return Sse(t,e,()=>{let{node:a}=t.docView.domFromPos(i.pos,r=="up"?-1:1);for(;;){let o=t.docView.nearestDesc(a,!0);if(!o)break;if(o.node.isBlock){a=o.contentDOM||o.dom;break}a=o.dom.parentNode}let s=kse(t,i.pos,1);for(let o=a.firstChild;o;o=o.nextSibling){let l;if(o.nodeType==1)l=o.getClientRects();else if(o.nodeType==3)l=Vu(o,0,o.nodeValue.length).getClientRects();else continue;for(let u=0;u<l.length;u++){let h=l[u];if(h.bottom>h.top+1&&(r=="up"?s.top-h.top>(h.bottom-s.top)*2:h.bottom-s.bottom>(s.bottom-h.top)*2))return!1}}return!0})}const VMe=/[\u0590-\u08ac]/;function GMe(t,e,r){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let i=n.parentOffset,a=!i,s=i==n.parent.content.size,o=t.domSelection();return o?!VMe.test(n.parent.textContent)||!o.modify?r=="left"||r=="backward"?a:s:Sse(t,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:h,anchorOffset:d}=t.domSelectionRange(),f=o.caretBidiLevel;o.modify("move",r,"character");let p=n.depth?t.docView.domAfterPos(n.before()):t.dom,{focusNode:g,focusOffset:m}=t.domSelectionRange(),y=g&&!p.contains(g.nodeType==1?g:g.parentNode)||l==g&&u==m;try{o.collapse(h,d),l&&(l!=h||u!=d)&&o.extend&&o.extend(l,u)}catch{}return f!=null&&(o.caretBidiLevel=f),y}):n.pos==n.start()||n.pos==n.end()}let OY=null,$Y=null,PY=!1;function WMe(t,e,r){return OY==e&&$Y==r?PY:(OY=e,$Y=r,PY=r=="up"||r=="down"?zMe(t,e,r):GMe(t,e,r))}const yl=0,BY=1,Wp=2,Xl=3;class zk{constructor(e,r,n,i){this.parent=e,this.children=r,this.dom=n,this.contentDOM=i,this.dirty=yl,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,r,n){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let r=0;r<this.children.length;r++)e+=this.children[r].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let r=0,n=this.posAtStart;;r++){let i=this.children[r];if(i==e)return n;n+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,r,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let a,s;if(e==this.contentDOM)a=e.childNodes[r-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;a=e.previousSibling}for(;a&&!((s=a.pmViewDesc)&&s.parent==this);)a=a.previousSibling;return a?this.posBeforeChild(s)+s.size:this.posAtStart}else{let a,s;if(e==this.contentDOM)a=e.childNodes[r];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;a=e.nextSibling}for(;a&&!((s=a.pmViewDesc)&&s.parent==this);)a=a.nextSibling;return a?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=r>qa(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(let a=e;;a=a.parentNode){if(a==this.dom){i=!1;break}if(a.previousSibling)break}if(i==null&&r==e.childNodes.length)for(let a=e;;a=a.parentNode){if(a==this.dom){i=!0;break}if(a.nextSibling)break}}return i??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,r=!1){for(let n=!0,i=e;i;i=i.parentNode){let a=this.getDesc(i),s;if(a&&(!r||a.node))if(n&&(s=a.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))n=!1;else return a}}getDesc(e){let r=e.pmViewDesc;for(let n=r;n;n=n.parent)if(n==this)return r}posFromDOM(e,r,n){for(let i=e;i;i=i.parentNode){let a=this.getDesc(i);if(a)return a.localPosFromDOM(e,r,n)}return-1}descAt(e){for(let r=0,n=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==e&&a!=n){for(;!i.border&&i.children.length;)for(let s=0;s<i.children.length;s++){let o=i.children[s];if(o.size){i=o;break}}return i}if(e<a)return i.descAt(e-n-i.border);n=a}}domFromPos(e,r){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,i=0;for(let a=0;n<this.children.length;n++){let s=this.children[n],o=a+s.size;if(o>e||s instanceof Ase){i=e-a;break}a=o}if(i)return this.children[n].domFromPos(i-this.children[n].border,r);for(let a;n&&!(a=this.children[n-1]).size&&a instanceof Ese&&a.side>=0;n--);if(r<=0){let a,s=!0;for(;a=n?this.children[n-1]:null,!(!a||a.dom.parentNode==this.contentDOM);n--,s=!1);return a&&r&&s&&!a.border&&!a.domAtom?a.domFromPos(a.size,r):{node:this.contentDOM,offset:a?qa(a.dom)+1:0}}else{let a,s=!0;for(;a=n<this.children.length?this.children[n]:null,!(!a||a.dom.parentNode==this.contentDOM);n++,s=!1);return a&&s&&!a.border&&!a.domAtom?a.domFromPos(0,r):{node:this.contentDOM,offset:a?qa(a.dom):this.contentDOM.childNodes.length}}}parseRange(e,r,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:r,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,a=-1;for(let s=n,o=0;;o++){let l=this.children[o],u=s+l.size;if(i==-1&&e<=u){let h=s+l.border;if(e>=h&&r<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,r,h);e=s;for(let d=o;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=qa(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(u>r||o==this.children.length-1)){r=u;for(let h=o+1;h<this.children.length;h++){let d=this.children[h];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){a=qa(d.dom);break}r+=d.size}a==-1&&(a=this.contentDOM.childNodes.length);break}s=u}return{node:this.contentDOM,from:e,to:r,fromOffset:i,toOffset:a}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let r=this.children[e<0?0:this.children.length-1];return r.size==0||r.emptyChildAt(e)}domAfterPos(e){let{node:r,offset:n}=this.domFromPos(e,0);if(r.nodeType!=1||n==r.childNodes.length)throw new RangeError("No node after pos "+e);return r.childNodes[n]}setSelection(e,r,n,i=!1){let a=Math.min(e,r),s=Math.max(e,r);for(let p=0,g=0;p<this.children.length;p++){let m=this.children[p],y=g+m.size;if(a>g&&s<y)return m.setSelection(e-g-m.border,r-g-m.border,n,i);g=y}let o=this.domFromPos(e,e?-1:1),l=r==e?o:this.domFromPos(r,r?-1:1),u=n.root.getSelection(),h=n.domSelectionRange(),d=!1;if((ml||ps)&&e==r){let{node:p,offset:g}=o;if(p.nodeType==3){if(d=!!(g&&p.nodeValue[g-1]==`
`),d&&g==p.nodeValue.length)for(let m=p,y;m;m=m.parentNode){if(y=m.nextSibling){y.nodeName=="BR"&&(o=l={node:y.parentNode,offset:qa(y)+1});break}let v=m.pmViewDesc;if(v&&v.node&&v.node.isBlock)break}}else{let m=p.childNodes[g-1];d=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(ml&&h.focusNode&&h.focusNode!=l.node&&h.focusNode.nodeType==1){let p=h.focusNode.childNodes[h.focusOffset];p&&p.contentEditable=="false"&&(i=!0)}if(!(i||d&&ps)&&T0(o.node,o.offset,h.anchorNode,h.anchorOffset)&&T0(l.node,l.offset,h.focusNode,h.focusOffset))return;let f=!1;if((u.extend||e==r)&&!(d&&ml)){u.collapse(o.node,o.offset);try{e!=r&&u.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(e>r){let g=o;o=l,l=g}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(o.node,o.offset),u.removeAllRanges(),u.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,r){for(let n=0,i=0;i<this.children.length;i++){let a=this.children[i],s=n+a.size;if(n==s?e<=s&&r>=n:e<s&&r>n){let o=n+a.border,l=s-a.border;if(e>=o&&r<=l){this.dirty=e==n||r==s?Wp:BY,e==o&&r==l&&(a.contentLost||a.dom.parentNode!=this.contentDOM)?a.dirty=Xl:a.markDirty(e-o,r-o);return}else a.dirty=a.dom==a.contentDOM&&a.dom.parentNode==this.contentDOM&&!a.children.length?Wp:Xl}n=s}this.dirty=Wp}markParentsDirty(){let e=1;for(let r=this.parent;r;r=r.parent,e++){let n=e==1?Wp:BY;r.dirty<n&&(r.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Ese extends zk{constructor(e,r,n,i){let a,s=r.type.toDOM;if(typeof s=="function"&&(s=s(n,()=>{if(!a)return i;if(a.parent)return a.parent.posBeforeChild(a)})),!r.type.spec.raw){if(s.nodeType!=1){let o=document.createElement("span");o.appendChild(s),s=o}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=r,this.widget=r,a=this}matchesWidget(e){return this.dirty==yl&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let r=this.widget.spec.stopEvent;return r?r(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class HMe extends zk{constructor(e,r,n,i){super(e,[],r,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(e,r){return e!=this.textDOM?this.posAtStart+(r?this.size:0):this.posAtStart+r}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class zd extends zk{constructor(e,r,n,i,a){super(e,[],n,i),this.mark=r,this.spec=a}static create(e,r,n,i){let a=i.nodeViews[r.type.name],s=a&&a(r,i,n);return(!s||!s.dom)&&(s=Z0.renderSpec(document,r.type.spec.toDOM(r,n),null,r.attrs)),new zd(e,r,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Xl||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Xl&&this.mark.eq(e)}markDirty(e,r){if(super.markDirty(e,r),this.dirty!=yl){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=yl}}slice(e,r,n){let i=zd.create(this.parent,this.mark,!0,n),a=this.children,s=this.size;r<s&&(a=dD(a,r,s,n)),e>0&&(a=dD(a,0,e,n));for(let o=0;o<a.length;o++)a[o].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Vd extends zk{constructor(e,r,n,i,a,s,o){super(e,[],a,s),this.node=r,this.outerDeco=n,this.innerDeco=i,this.nodeDOM=o}static create(e,r,n,i,a,s){let o=a.nodeViews[r.type.name],l,u=o&&o(r,a,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},n,i),h=u&&u.dom,d=u&&u.contentDOM;if(r.isText){if(!h)h=document.createTextNode(r.text);else if(h.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else h||({dom:h,contentDOM:d}=Z0.renderSpec(document,r.type.spec.toDOM(r),null,r.attrs));!d&&!r.isText&&h.nodeName!="BR"&&(h.hasAttribute("contenteditable")||(h.contentEditable="false"),r.type.spec.draggable&&(h.draggable=!0));let f=h;return h=Lse(h,n,r),u?l=new qMe(e,r,n,i,h,d||null,f,u):r.isText?new P6(e,r,n,i,h,f):new Vd(e,r,n,i,h,d||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let r={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(r.preserveWhitespace="full"),!this.contentDOM)r.getContent=()=>this.node.content;else if(!this.contentLost)r.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let i=this.children[n];if(this.dom.contains(i.dom.parentNode)){r.contentElement=i.dom.parentNode;break}}if(!r.contentElement){let n=e&&e.find(i=>i.nodeType==1&&e.indexOf(i.parentNode)<0&&this.dom.contains(i));n?r.contentElement=n:r.getContent=()=>gt.empty}}return r}matchesNode(e,r,n){return this.dirty==yl&&e.eq(this.node)&&h5(r,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,r){let n=this.node.inlineContent,i=r,a=e.composing?this.localCompositionInfo(e,r):null,s=a&&a.pos>-1?a:null,o=a&&a.pos<0,l=new YMe(this,s&&s.node,e);KMe(this.node,this.innerDeco,(u,h,d)=>{u.spec.marks?l.syncToMarks(u.spec.marks,n,e,h):u.type.side>=0&&!d&&l.syncToMarks(h==this.node.childCount?In.none:this.node.child(h).marks,n,e,h),l.placeWidget(u,e,i)},(u,h,d,f)=>{l.syncToMarks(u.marks,n,e,f);let p;l.findNodeMatch(u,h,d,f)||o&&e.state.selection.from>i&&e.state.selection.to<i+u.nodeSize&&(p=l.findIndexWithChild(a.node))>-1&&l.updateNodeAt(u,h,d,p,e)||l.updateNextNode(u,h,d,e,f,i)||l.addNode(u,h,d,e,i),i+=u.nodeSize}),l.syncToMarks([],n,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Wp)&&(s&&this.protectLocalComposition(e,s),_se(this.contentDOM,this.children,e),yb&&ZMe(this.dom))}localCompositionInfo(e,r){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof rr)||n<r||i>r+this.node.content.size)return null;let a=e.input.compositionNode;if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){let s=a.nodeValue,o=QMe(this.node.content,s,n-r,i-r);return o<0?null:{node:a,pos:o,text:s}}else return{node:a,pos:-1,text:""}}protectLocalComposition(e,{node:r,pos:n,text:i}){if(this.getDesc(r))return;let a=r;for(;a.parentNode!=this.contentDOM;a=a.parentNode){for(;a.previousSibling;)a.parentNode.removeChild(a.previousSibling);for(;a.nextSibling;)a.parentNode.removeChild(a.nextSibling);a.pmViewDesc&&(a.pmViewDesc=void 0)}let s=new HMe(this,a,r,i);e.input.compositionNodes.push(s),this.children=dD(this.children,n,n+i.length,e,s)}update(e,r,n,i){return this.dirty==Xl||!e.sameMarkup(this.node)?!1:(this.updateInner(e,r,n,i),!0)}updateInner(e,r,n,i){this.updateOuterDeco(r),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=yl}updateOuterDeco(e){if(h5(e,this.outerDeco))return;let r=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=Rse(this.dom,this.nodeDOM,hD(this.outerDeco,this.node,r),hD(e,this.node,r)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function FY(t,e,r,n,i){Lse(n,e,t);let a=new Vd(void 0,t,e,r,n,n,n);return a.contentDOM&&a.updateChildren(i,0),a}class P6 extends Vd{constructor(e,r,n,i,a,s){super(e,r,n,i,a,null,s)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,r,n,i){return this.dirty==Xl||this.dirty!=yl&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(r),(this.dirty!=yl||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=yl,!0)}inParent(){let e=this.parent.contentDOM;for(let r=this.nodeDOM;r;r=r.parentNode)if(r==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,r,n){return e==this.nodeDOM?this.posAtStart+Math.min(r,this.node.text.length):super.localPosFromDOM(e,r,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,r,n){let i=this.node.cut(e,r),a=document.createTextNode(i.text);return new P6(this.parent,i,this.outerDeco,this.innerDeco,a,a)}markDirty(e,r){super.markDirty(e,r),this.dom!=this.nodeDOM&&(e==0||r==this.nodeDOM.nodeValue.length)&&(this.dirty=Xl)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Ase extends zk{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==yl&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class qMe extends Vd{constructor(e,r,n,i,a,s,o,l){super(e,r,n,i,a,s,o),this.spec=l}update(e,r,n,i){if(this.dirty==Xl)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let a=this.spec.update(e,r,n);return a&&this.updateInner(e,r,n,i),a}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,r,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,r,n,i){this.spec.setSelection?this.spec.setSelection(e,r,n.root):super.setSelection(e,r,n,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function _se(t,e,r){let n=t.firstChild,i=!1;for(let a=0;a<e.length;a++){let s=e[a],o=s.dom;if(o.parentNode==t){for(;o!=n;)n=zY(n),i=!0;n=n.nextSibling}else i=!0,t.insertBefore(o,n);if(s instanceof zd){let l=n?n.previousSibling:t.lastChild;_se(s.contentDOM,s.children,r),n=l?l.nextSibling:t.firstChild}}for(;n;)n=zY(n),i=!0;i&&r.trackWrites==t&&(r.trackWrites=null)}const Cw=function(t){t&&(this.nodeName=t)};Cw.prototype=Object.create(null);const Hp=[new Cw];function hD(t,e,r){if(t.length==0)return Hp;let n=r?Hp[0]:new Cw,i=[n];for(let a=0;a<t.length;a++){let s=t[a].type.attrs;if(s){s.nodeName&&i.push(n=new Cw(s.nodeName));for(let o in s){let l=s[o];l!=null&&(r&&i.length==1&&i.push(n=new Cw(e.isInline?"span":"div")),o=="class"?n.class=(n.class?n.class+" ":"")+l:o=="style"?n.style=(n.style?n.style+";":"")+l:o!="nodeName"&&(n[o]=l))}}}return i}function Rse(t,e,r,n){if(r==Hp&&n==Hp)return e;let i=e;for(let a=0;a<n.length;a++){let s=n[a],o=r[a];if(a){let l;o&&o.nodeName==s.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(i),o=Hp[0]),i=l}UMe(i,o||Hp[0],s)}return i}function UMe(t,e,r){for(let n in e)n!="class"&&n!="style"&&n!="nodeName"&&!(n in r)&&t.removeAttribute(n);for(let n in r)n!="class"&&n!="style"&&n!="nodeName"&&r[n]!=e[n]&&t.setAttribute(n,r[n]);if(e.class!=r.class){let n=e.class?e.class.split(" ").filter(Boolean):[],i=r.class?r.class.split(" ").filter(Boolean):[];for(let a=0;a<n.length;a++)i.indexOf(n[a])==-1&&t.classList.remove(n[a]);for(let a=0;a<i.length;a++)n.indexOf(i[a])==-1&&t.classList.add(i[a]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=r.style){if(e.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=n.exec(e.style);)t.style.removeProperty(i[1])}r.style&&(t.style.cssText+=r.style)}}function Lse(t,e,r){return Rse(t,t,Hp,hD(e,r,t.nodeType!=1))}function h5(t,e){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].type.eq(e[r].type))return!1;return!0}function zY(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class YMe{constructor(e,r,n){this.lock=r,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=XMe(e.node.content,e)}destroyBetween(e,r){if(e!=r){for(let n=e;n<r;n++)this.top.children[n].destroy();this.top.children.splice(e,r-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,r,n,i){let a=0,s=this.stack.length>>1,o=Math.min(s,e.length);for(;a<o&&(a==s-1?this.top:this.stack[a+1<<1]).matchesMark(e[a])&&e[a].type.spec.spanning!==!1;)a++;for(;a<s;)this.destroyRest(),this.top.dirty=yl,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let l=-1,u=this.top.children.length;i<this.preMatch.index&&(u=Math.min(this.index+3,u));for(let h=this.index;h<u;h++){let d=this.top.children[h];if(d.matchesMark(e[s])&&!this.isLocked(d.dom)){l=h;break}}if(l<0&&this.index<this.top.children.length){let h=this.top.children[this.index];h instanceof zd&&h.dirty!=Xl&&h.mark.type==e[s].type&&h.spec.update&&!this.isLocked(h.dom)&&h.spec.update(e[s])&&(h.mark=e[s],l=this.index,this.changed=!0)}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let h=zd.create(this.top,e[s],r,n);this.top.children.splice(this.index,0,h),this.top=h,this.changed=!0}this.index=0,s++}}findNodeMatch(e,r,n,i){let a=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,r,n))a=this.top.children.indexOf(s,this.index);else for(let o=this.index,l=Math.min(this.top.children.length,o+5);o<l;o++){let u=this.top.children[o];if(u.matchesNode(e,r,n)&&!this.preMatch.matched.has(u)){a=o;break}}return a<0?!1:(this.destroyBetween(this.index,a),this.index++,!0)}updateNodeAt(e,r,n,i,a){let s=this.top.children[i];return s.dirty==Xl&&s.dom==s.contentDOM&&(s.dirty=Wp),s.update(e,r,n,a)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let r=e.parentNode;if(!r)return-1;if(r==this.top.contentDOM){let n=e.pmViewDesc;if(n){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==n)return i}return-1}e=r}}updateNextNode(e,r,n,i,a,s){for(let o=this.index;o<this.top.children.length;o++){let l=this.top.children[o];if(l instanceof Vd){let u=this.preMatch.matched.get(l);if(u!=null&&u!=a)return!1;let h=l.dom,d,f=this.isLocked(h)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Xl&&h5(r,l.outerDeco));if(!f&&l.update(e,r,n,i))return this.destroyBetween(this.index,o),l.dom!=h&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(l,e,r,n,i,s)))return this.destroyBetween(this.index,o),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=Wp,d.updateChildren(i,s+1),d.dirty=yl),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,r,n,i,a,s){if(e.dirty||r.isAtom||!e.children.length||!e.node.content.eq(r.content)||!h5(n,e.outerDeco)||!i.eq(e.innerDeco))return null;let o=Vd.create(this.top,r,n,i,a,s);if(o.contentDOM){o.children=e.children,e.children=[];for(let l of o.children)l.parent=o}return e.destroy(),o}addNode(e,r,n,i,a){let s=Vd.create(this.top,e,r,n,i,a);s.contentDOM&&s.updateChildren(i,a+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,r,n){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let a=new Ese(this.top,e,r,n);this.top.children.splice(this.index++,0,a),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],r=this.top;for(;e instanceof zd;)r=e,e=r.children[r.children.length-1];(!e||!(e instanceof P6)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((ps||Ya)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",r),this.addHackNode("BR",this.top))}addHackNode(e,r){if(r==this.top&&this.index<r.children.length&&r.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e=="IMG"&&(n.className="ProseMirror-separator",n.alt=""),e=="BR"&&(n.className="ProseMirror-trailingBreak");let i=new Ase(this.top,[],n,null);r!=this.top?r.children.push(i):r.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function XMe(t,e){let r=e,n=r.children.length,i=t.childCount,a=new Map,s=[];e:for(;i>0;){let o;for(;;)if(n){let u=r.children[n-1];if(u instanceof zd)r=u,n=u.children.length;else{o=u,n--;break}}else{if(r==e)break e;n=r.parent.children.indexOf(r),r=r.parent}let l=o.node;if(l){if(l!=t.child(i-1))break;--i,a.set(o,i),s.push(o)}}return{index:i,matched:a,matches:s.reverse()}}function jMe(t,e){return t.type.side-e.type.side}function KMe(t,e,r,n){let i=e.locals(t),a=0;if(i.length==0){for(let u=0;u<t.childCount;u++){let h=t.child(u);n(h,i,e.forChild(a,h),u),a+=h.nodeSize}return}let s=0,o=[],l=null;for(let u=0;;){let h,d;for(;s<i.length&&i[s].to==a;){let y=i[s++];y.widget&&(h?(d||(d=[h])).push(y):h=y)}if(h)if(d){d.sort(jMe);for(let y=0;y<d.length;y++)r(d[y],u,!!l)}else r(h,u,!!l);let f,p;if(l)p=-1,f=l,l=null;else if(u<t.childCount)p=u,f=t.child(u++);else break;for(let y=0;y<o.length;y++)o[y].to<=a&&o.splice(y--,1);for(;s<i.length&&i[s].from<=a&&i[s].to>a;)o.push(i[s++]);let g=a+f.nodeSize;if(f.isText){let y=g;s<i.length&&i[s].from<y&&(y=i[s].from);for(let v=0;v<o.length;v++)o[v].to<y&&(y=o[v].to);y<g&&(l=f.cut(y-a),f=f.cut(0,y-a),g=y,p=-1)}else for(;s<i.length&&i[s].to<g;)s++;let m=f.isInline&&!f.isLeaf?o.filter(y=>!y.inline):o.slice();n(f,m,e.forChild(a,f),p),a=g}}function ZMe(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function QMe(t,e,r,n){for(let i=0,a=0;i<t.childCount&&a<=n;){let s=t.child(i++),o=a;if(a+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<t.childCount;){let u=t.child(i++);if(a+=u.nodeSize,!u.isText)break;l+=u.text}if(a>=r){if(a>=n&&l.slice(n-e.length-o,n-o)==e)return n-e.length;let u=o<n?l.lastIndexOf(e,n-o-1):-1;if(u>=0&&u+e.length+o>=r)return o+u;if(r==n&&l.length>=n+e.length-o&&l.slice(n-o,n-o+e.length)==e)return n}}return-1}function dD(t,e,r,n,i){let a=[];for(let s=0,o=0;s<t.length;s++){let l=t[s],u=o,h=o+=l.size;u>=r||h<=e?a.push(l):(u<e&&a.push(l.slice(0,e-u,n)),i&&(a.push(i),i=void 0),h>r&&a.push(l.slice(r-u,l.size,n)))}return a}function IF(t,e=null){let r=t.domSelectionRange(),n=t.state.doc;if(!r.focusNode)return null;let i=t.docView.nearestDesc(r.focusNode),a=i&&i.size==0,s=t.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(s<0)return null;let o=n.resolve(s),l,u;if($6(r)){for(l=s;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&lr.isSelectable(d)&&i.parent&&!(d.isInline&&SMe(r.focusNode,r.focusOffset,i.dom))){let f=i.posBefore;u=new lr(s==f?o:n.resolve(f))}}else{if(r instanceof t.dom.ownerDocument.defaultView.Selection&&r.rangeCount>1){let d=s,f=s;for(let p=0;p<r.rangeCount;p++){let g=r.getRangeAt(p);d=Math.min(d,t.docView.posFromDOM(g.startContainer,g.startOffset,1)),f=Math.max(f,t.docView.posFromDOM(g.endContainer,g.endOffset,-1))}if(d<0)return null;[l,s]=f==t.state.selection.anchor?[f,d]:[d,f],o=n.resolve(s)}else l=t.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(l<0)return null}let h=n.resolve(l);if(!u){let d=e=="pointer"||t.state.selection.head<o.pos&&!a?1:-1;u=NF(t,h,o,d)}return u}function Mse(t){return t.editable?t.hasFocus():Nse(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function lh(t,e=!1){let r=t.state.selection;if(Ise(t,r),!Mse(t))return;let n=t.input.mouseDown;if(!e&&Ya&&n){let i=t.domSelectionRange(),a=t.domObserver.currentSelection;if(i.anchorNode&&a.anchorNode&&T0(i.anchorNode,i.anchorOffset,a.anchorNode,a.anchorOffset)&&n.delaySelUpdate()){t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)eIe(t);else{let{anchor:i,head:a}=r,s,o;VY&&!(r instanceof rr)&&(r.$from.parent.inlineContent||(s=GY(t,r.from)),!r.empty&&!r.$from.parent.inlineContent&&(o=GY(t,r.to))),t.docView.setSelection(i,a,t,e),VY&&(s&&WY(s),o&&WY(o)),r.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&JMe(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}const VY=ps||Ya&&vse<63;function GY(t,e){let{node:r,offset:n}=t.docView.domFromPos(e,0),i=n<r.childNodes.length?r.childNodes[n]:null,a=n?r.childNodes[n-1]:null;if(ps&&i&&i.contentEditable=="false")return nM(i);if((!i||i.contentEditable=="false")&&(!a||a.contentEditable=="false")){if(i)return nM(i);if(a)return nM(a)}}function nM(t){return t.contentEditable="true",ps&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function WY(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function JMe(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let r=t.domSelectionRange(),n=r.anchorNode,i=r.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(r.anchorNode!=n||r.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Mse(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function eIe(t){let e=t.domSelection();if(!e)return;let r=t.cursorWrapper.dom,n=r.nodeName=="IMG";n?e.collapse(r.parentNode,qa(r)+1):e.collapse(r,0),!n&&!t.state.selection.visible&&vo&&Fd<=11&&(r.disabled=!0,r.disabled=!1)}function Ise(t,e){if(e instanceof lr){let r=t.docView.descAt(e.from);r!=t.lastSelectedViewDesc&&(HY(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else HY(t)}function HY(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function NF(t,e,r,n){return t.someProp("createSelectionBetween",i=>i(t,e,r))||rr.between(e,r,n)}function qY(t){return t.editable&&!t.hasFocus()?!1:Nse(t)}function Nse(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function tIe(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),r=t.domSelectionRange();return T0(e.node,e.offset,r.anchorNode,r.anchorOffset)}function fD(t,e){let{$anchor:r,$head:n}=t.selection,i=e>0?r.max(n):r.min(n),a=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return a&&Cr.findFrom(a,e)}function ud(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function UY(t,e,r){let n=t.state.selection;if(n instanceof rr)if(r.indexOf("s")>-1){let{$head:i}=n,a=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!a||a.isText||!a.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+a.nodeSize*(e<0?-1:1));return ud(t,new rr(n.$anchor,s))}else if(n.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=fD(t.state,e);return i&&i instanceof lr?ud(t,i):!1}else if(!(al&&r.indexOf("m")>-1)){let i=n.$head,a=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!a||a.isText)return!1;let o=e<0?i.pos-a.nodeSize:i.pos;return a.isAtom||(s=t.docView.descAt(o))&&!s.contentDOM?lr.isSelectable(a)?ud(t,new lr(e<0?t.state.doc.resolve(i.pos-a.nodeSize):i)):Fk?ud(t,new rr(t.state.doc.resolve(e<0?o:o+a.nodeSize))):!1:!1}}else return!1;else{if(n instanceof lr&&n.node.isInline)return ud(t,new rr(e>0?n.$to:n.$from));{let i=fD(t.state,e);return i?ud(t,i):!1}}}function d5(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function kw(t,e){let r=t.pmViewDesc;return r&&r.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Vg(t,e){return e<0?rIe(t):nIe(t)}function rIe(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let i,a,s=!1;for(ml&&r.nodeType==1&&n<d5(r)&&kw(r.childNodes[n],-1)&&(s=!0);;)if(n>0){if(r.nodeType!=1)break;{let o=r.childNodes[n-1];if(kw(o,-1))i=r,a=--n;else if(o.nodeType==3)r=o,n=r.nodeValue.length;else break}}else{if(Dse(r))break;{let o=r.previousSibling;for(;o&&kw(o,-1);)i=r.parentNode,a=qa(o),o=o.previousSibling;if(o)r=o,n=d5(r);else{if(r=r.parentNode,r==t.dom)break;n=0}}}s?pD(t,r,n):i&&pD(t,i,a)}function nIe(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let i=d5(r),a,s;for(;;)if(n<i){if(r.nodeType!=1)break;let o=r.childNodes[n];if(kw(o,1))a=r,s=++n;else break}else{if(Dse(r))break;{let o=r.nextSibling;for(;o&&kw(o,1);)a=o.parentNode,s=qa(o)+1,o=o.nextSibling;if(o)r=o,n=0,i=d5(r);else{if(r=r.parentNode,r==t.dom)break;n=i=0}}}a&&pD(t,a,s)}function Dse(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function iIe(t,e){for(;t&&e==t.childNodes.length&&!Bk(t);)e=qa(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let r=t.childNodes[e];if(r.nodeType==3)return r;if(r.nodeType==1&&r.contentEditable=="false")break;t=r,e=0}}function aIe(t,e){for(;t&&!e&&!Bk(t);)e=qa(t),t=t.parentNode;for(;t&&e;){let r=t.childNodes[e-1];if(r.nodeType==3)return r;if(r.nodeType==1&&r.contentEditable=="false")break;t=r,e=t.childNodes.length}}function pD(t,e,r){if(e.nodeType!=3){let a,s;(s=iIe(e,r))?(e=s,r=0):(a=aIe(e,r))&&(e=a,r=a.nodeValue.length)}let n=t.domSelection();if(!n)return;if($6(n)){let a=document.createRange();a.setEnd(e,r),a.setStart(e,r),n.removeAllRanges(),n.addRange(a)}else n.extend&&n.extend(e,r);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&lh(t)},50)}function YY(t,e){let r=t.state.doc.resolve(e);if(!(Ya||bse)&&r.parent.inlineContent){let i=t.coordsAtPos(e);if(e>r.start()){let a=t.coordsAtPos(e-1),s=(a.top+a.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(a.left-i.left)>1)return a.left<i.left?"ltr":"rtl"}if(e<r.end()){let a=t.coordsAtPos(e+1),s=(a.top+a.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(a.left-i.left)>1)return a.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function XY(t,e,r){let n=t.state.selection;if(n instanceof rr&&!n.empty||r.indexOf("s")>-1||al&&r.indexOf("m")>-1)return!1;let{$from:i,$to:a}=n;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=fD(t.state,e);if(s&&s instanceof lr)return ud(t,s)}if(!i.parent.inlineContent){let s=e<0?i:a,o=n instanceof Do?Cr.near(s,e):Cr.findFrom(s,e);return o?ud(t,o):!1}return!1}function jY(t,e){if(!(t.state.selection instanceof rr))return!0;let{$head:r,$anchor:n,empty:i}=t.state.selection;if(!r.sameParent(n))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let a=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){let s=t.state.tr;return e<0?s.delete(r.pos-a.nodeSize,r.pos):s.delete(r.pos,r.pos+a.nodeSize),t.dispatch(s),!0}return!1}function KY(t,e,r){t.domObserver.stop(),e.contentEditable=r,t.domObserver.start()}function sIe(t){if(!ps||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:r}=t.domSelectionRange();if(e&&e.nodeType==1&&r==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;KY(t,n,"true"),setTimeout(()=>KY(t,n,"false"),20)}return!1}function oIe(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function lIe(t,e){let r=e.keyCode,n=oIe(e);if(r==8||al&&r==72&&n=="c")return jY(t,-1)||Vg(t,-1);if(r==46&&!e.shiftKey||al&&r==68&&n=="c")return jY(t,1)||Vg(t,1);if(r==13||r==27)return!0;if(r==37||al&&r==66&&n=="c"){let i=r==37?YY(t,t.state.selection.from)=="ltr"?-1:1:-1;return UY(t,i,n)||Vg(t,i)}else if(r==39||al&&r==70&&n=="c"){let i=r==39?YY(t,t.state.selection.from)=="ltr"?1:-1:1;return UY(t,i,n)||Vg(t,i)}else{if(r==38||al&&r==80&&n=="c")return XY(t,-1,n)||Vg(t,-1);if(r==40||al&&r==78&&n=="c")return sIe(t)||XY(t,1,n)||Vg(t,1);if(n==(al?"m":"c")&&(r==66||r==73||r==89||r==90))return!0}return!1}function DF(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let r=[],{content:n,openStart:i,openEnd:a}=e;for(;i>1&&a>1&&n.childCount==1&&n.firstChild.childCount==1;){i--,a--;let p=n.firstChild;r.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),n=p.content}let s=t.someProp("clipboardSerializer")||Z0.fromSchema(t.state.schema),o=zse(),l=o.createElement("div");l.appendChild(s.serializeFragment(n,{document:o}));let u=l.firstChild,h,d=0;for(;u&&u.nodeType==1&&(h=Fse[u.nodeName.toLowerCase()]);){for(let p=h.length-1;p>=0;p--){let g=o.createElement(h[p]);for(;l.firstChild;)g.appendChild(l.firstChild);l.appendChild(g),d++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${a}${d?` -${d}`:""} ${JSON.stringify(r)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
`);return{dom:l,text:f,slice:e}}function Ose(t,e,r,n,i){let a=i.parent.type.spec.code,s,o;if(!r&&!e)return null;let l=!!e&&(n||a||!r);if(l){if(t.someProp("transformPastedText",f=>{e=f(e,a||n,t)}),a)return o=new $t(gt.from(t.state.schema.text(e.replace(/\r\n?/g,`
`))),0,0),t.someProp("transformPasted",f=>{o=f(o,t,!0)}),o;let d=t.someProp("clipboardTextParser",f=>f(e,i,n,t));if(d)o=d;else{let f=i.marks(),{schema:p}=t.state,g=Z0.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let y=s.appendChild(document.createElement("p"));m&&y.appendChild(g.serializeNode(p.text(m,f)))})}}else t.someProp("transformPastedHTML",d=>{r=d(r,t)}),s=dIe(r),Fk&&fIe(s);let u=s&&s.querySelector("[data-pm-slice]"),h=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(h&&h[3])for(let d=+h[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(o||(o=(t.someProp("clipboardParser")||t.someProp("domParser")||sh.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||h),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!cIe.test(f.parentNode.nodeName)?{ignore:!0}:null}})),h)o=pIe(ZY(o,+h[1],+h[2]),h[4]);else if(o=$t.maxOpen(uIe(o.content,i),!0),o.openStart||o.openEnd){let d=0,f=0;for(let p=o.content.firstChild;d<o.openStart&&!p.type.spec.isolating;d++,p=p.firstChild);for(let p=o.content.lastChild;f<o.openEnd&&!p.type.spec.isolating;f++,p=p.lastChild);o=ZY(o,d,f)}return t.someProp("transformPasted",d=>{o=d(o,t,l)}),o}const cIe=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function uIe(t,e){if(t.childCount<2)return t;for(let r=e.depth;r>=0;r--){let i=e.node(r).contentMatchAt(e.index(r)),a,s=[];if(t.forEach(o=>{if(!s)return;let l=i.findWrapping(o.type),u;if(!l)return s=null;if(u=s.length&&a.length&&Pse(l,a,o,s[s.length-1],0))s[s.length-1]=u;else{s.length&&(s[s.length-1]=Bse(s[s.length-1],a.length));let h=$se(o,l);s.push(h),i=i.matchType(h.type),a=l}}),s)return gt.from(s)}return t}function $se(t,e,r=0){for(let n=e.length-1;n>=r;n--)t=e[n].create(null,gt.from(t));return t}function Pse(t,e,r,n,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let a=Pse(t,e,r,n.lastChild,i+1);if(a)return n.copy(n.content.replaceChild(n.childCount-1,a));if(n.contentMatchAt(n.childCount).matchType(i==t.length-1?r.type:t[i+1]))return n.copy(n.content.append(gt.from($se(r,t,i+1))))}}function Bse(t,e){if(e==0)return t;let r=t.content.replaceChild(t.childCount-1,Bse(t.lastChild,e-1)),n=t.contentMatchAt(t.childCount).fillBefore(gt.empty,!0);return t.copy(r.append(n))}function gD(t,e,r,n,i,a){let s=e<0?t.firstChild:t.lastChild,o=s.content;return t.childCount>1&&(a=0),i<n-1&&(o=gD(o,e,r,n,i+1,a)),i>=r&&(o=e<0?s.contentMatchAt(0).fillBefore(o,a<=i).append(o):o.append(s.contentMatchAt(s.childCount).fillBefore(gt.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(o))}function ZY(t,e,r){return e<t.openStart&&(t=new $t(gD(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),r<t.openEnd&&(t=new $t(gD(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}const Fse={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function zse(){return document.implementation.createHTMLDocument("title")}let iM=null;function hIe(t){let e=window.trustedTypes;return e?(iM||(iM=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:r=>r})),iM.createHTML(t)):t}function dIe(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let r=zse(),n=r.body,i=/<([a-z][^>\s]+)/i.exec(t),a;if((a=i&&Fse[i[1].toLowerCase()])&&(t=a.map(s=>"<"+s+">").join("")+t+a.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=hIe(t),a)for(let s=0;s<a.length;s++)n=n.querySelector(a[s])||n;for(let s=0;s<r.styleSheets.length;s++){let o=r.styleSheets[s];for(let l=0;l<o.rules.length;l++){let u=o.rules[l];if(u instanceof CSSStyleRule){let h=n.querySelectorAll(u.selectorText);for(let d=0;d<h.length;d++)h[d].style.cssText+=u.style.cssText}}}return n}function fIe(t){let e=t.querySelectorAll(Ya?"span:not([class]):not([style])":"span.Apple-converted-space");for(let r=0;r<e.length;r++){let n=e[r];n.childNodes.length==1&&n.textContent==" "&&n.parentNode&&n.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),n)}}function pIe(t,e){if(!t.size)return t;let r=t.content.firstChild.type.schema,n;try{n=JSON.parse(e)}catch{return t}let{content:i,openStart:a,openEnd:s}=t;for(let o=n.length-2;o>=0;o-=2){let l=r.nodes[n[o]];if(!l||l.hasRequiredAttrs())break;i=gt.from(l.create(n[o+1],i)),a++,s++}return new $t(i,a,s)}const Ws={},Hs={},gIe={touchstart:!0,touchmove:!0};class mIe{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function yIe(t){for(let e in Ws){let r=Ws[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=n=>{bIe(t,n)&&!OF(t,n)&&(t.editable||!(n.type in Hs))&&r(t,n)},gIe[e]?{passive:!0}:void 0)}ps&&t.dom.addEventListener("input",()=>null),mD(t)}function Ku(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function vIe(t){t.input.mouseDown&&t.input.mouseDown.done(),t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function mD(t){t.someProp("handleDOMEvents",e=>{for(let r in e)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=n=>OF(t,n))})}function OF(t,e){return t.someProp("handleDOMEvents",r=>{let n=r[e.type];return n?n(t,e)||e.defaultPrevented:!1})}function bIe(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let r=e.target;r!=t.dom;r=r.parentNode)if(!r||r.nodeType==11||r.pmViewDesc&&r.pmViewDesc.stopEvent(e))return!1;return!0}function xIe(t,e){!OF(t,e)&&Ws[e.type]&&(t.editable||!(e.type in Hs))&&Ws[e.type](t,e)}Hs.keydown=(t,e)=>{let r=e;if(t.input.shiftKey=r.keyCode==16||r.shiftKey,!Hse(t)&&(t.input.lastKeyCode=r.keyCode,t.input.lastKeyCodeTime=Date.now(),!(ju&&Ya&&r.keyCode==13)))if(r.keyCode!=229&&t.domObserver.forceFlush(),yb&&r.keyCode==13&&!r.ctrlKey&&!r.altKey&&!r.metaKey){let n=Date.now();t.input.lastIOSEnter=n,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==n&&(t.someProp("handleKeyDown",i=>i(t,Tp(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",n=>n(t,r))||lIe(t,r)?r.preventDefault():Ku(t,"key")};Hs.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Hs.keypress=(t,e)=>{let r=e;if(Hse(t)||!r.charCode||r.ctrlKey&&!r.altKey||al&&r.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,r))){r.preventDefault();return}let n=t.state.selection;if(!(n instanceof rr)||!n.$from.sameParent(n.$to)){let i=String.fromCharCode(r.charCode),a=()=>t.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",s=>s(t,n.$from.pos,n.$to.pos,i,a))&&t.dispatch(a()),r.preventDefault()}};function Vk(t){return{left:t.clientX,top:t.clientY}}function TIe(t,e){let r=e.x-t.clientX,n=e.y-t.clientY;return r*r+n*n<100}function $F(t,e,r,n,i){if(n==-1)return!1;let a=t.state.doc.resolve(n);for(let s=a.depth+1;s>0;s--)if(t.someProp(e,o=>s>a.depth?o(t,r,a.nodeAfter,a.before(s),i,!0):o(t,r,a.node(s),a.before(s),i,!1)))return!0;return!1}function Gk(t,e,r){if(t.focused||t.focus(),t.state.selection.eq(e))return;let n=t.state.tr.setSelection(e);n.setMeta("pointer",!0),t.dispatch(n)}function wIe(t,e){if(e==-1)return!1;let r=t.state.doc.resolve(e),n=r.nodeAfter;return n&&n.isAtom&&lr.isSelectable(n)?(Gk(t,new lr(r)),!0):!1}function CIe(t,e){if(e==-1)return!1;let r=t.state.selection,n,i;r instanceof lr&&(n=r.node);let a=t.state.doc.resolve(e);for(let s=a.depth+1;s>0;s--){let o=s>a.depth?a.nodeAfter:a.node(s);if(lr.isSelectable(o)){n&&r.$from.depth>0&&s>=r.$from.depth&&a.before(r.$from.depth+1)==r.$from.pos?i=a.before(r.$from.depth):i=a.before(s);break}}return i!=null?(Gk(t,lr.create(t.state.doc,i)),!0):!1}function kIe(t,e,r,n,i){return $F(t,"handleClickOn",e,r,n)||t.someProp("handleClick",a=>a(t,e,n))||(i?CIe(t,r):wIe(t,r))}function SIe(t,e,r,n){return $F(t,"handleDoubleClickOn",e,r,n)||t.someProp("handleDoubleClick",i=>i(t,e,n))}function EIe(t,e,r,n){return $F(t,"handleTripleClickOn",e,r,n)||t.someProp("handleTripleClick",i=>i(t,e,n))||AIe(t,r,n)}function AIe(t,e,r){if(r.button!=0)return!1;let n=Vse(t,e,!0),i=t.state.doc;return n?(Gk(t,n),n instanceof rr&&i.eq(t.state.doc)&&(t.input.mouseDown=new RIe(t,n)),!0):!1}function Vse(t,e,r){let n=t.state.doc;if(e==-1)return n.inlineContent?rr.create(n,0,n.content.size):null;let i=n.resolve(e);for(let a=i.depth+1;a>0;a--){let s=a>i.depth?i.nodeAfter:i.node(a),o=i.before(a);if(s.inlineContent)return rr.create(n,o+1,o+1+s.content.size);if(r&&lr.isSelectable(s))return lr.create(n,o)}return null}function PF(t){return f5(t)}const Gse=al?"metaKey":"ctrlKey";Ws.mousedown=(t,e)=>{let r=e;t.input.shiftKey=r.shiftKey;let n=PF(t),i=Date.now(),a="singleClick";i-t.input.lastClick.time<500&&TIe(r,t.input.lastClick)&&!r[Gse]&&t.input.lastClick.button==r.button&&(t.input.lastClick.type=="singleClick"?a="doubleClick":t.input.lastClick.type=="doubleClick"&&(a="tripleClick")),t.input.lastClick={time:i,x:r.clientX,y:r.clientY,type:a,button:r.button},t.input.mouseDown&&t.input.mouseDown.done();let s=t.posAtCoords(Vk(r));s&&(a=="singleClick"?t.input.mouseDown=new _Ie(t,s,r,!!n):(a=="doubleClick"?SIe:EIe)(t,s.pos,s.inside,r)?r.preventDefault():Ku(t,"pointer"))};class Wse{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class _Ie extends Wse{constructor(e,r,n,i){super(e),this.pos=r,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[Gse],this.allowDefault=n.shiftKey;let a,s;if(r.inside>-1)a=e.state.doc.nodeAt(r.inside),s=r.inside;else{let h=e.state.doc.resolve(r.pos);a=h.parent,s=h.depth?h.before():0}const o=i?null:n.target,l=o?e.docView.nearestDesc(o,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:u}=e.state;n.button==0&&(a.type.spec.draggable&&a.type.spec.selectable!==!1||u instanceof lr&&u.from<=s&&u.to>s)&&(this.mightDrag={node:a,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ml&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),Ku(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||lh(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(Vk(e))),this.updateAllowDefault(e),this.allowDefault||!r?Ku(this.view,"pointer"):kIe(this.view,r.pos,r.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ps&&this.mightDrag&&!this.mightDrag.node.isAtom||Ya&&!this.view.state.selection.visible&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(Gk(this.view,Cr.near(this.view.state.doc.resolve(r.pos))),e.preventDefault()):Ku(this.view,"pointer")}move(e){this.updateAllowDefault(e),Ku(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class RIe extends Wse{constructor(e,r){super(e),this.startSelection=r,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),Ku(this.view,"pointer");let r=this.view.posAtCoords(Vk(e)),n=r&&Vse(this.view,r.inside,!1);if(!n)return;let{doc:i}=this.view.state,a=this.startSelection,[s,o]=n.from<a.from?[a.to,n.from]:[a.from,n.to];Gk(this.view,rr.create(i,s,o))}}Ws.touchstart=t=>{t.input.lastTouch=Date.now(),PF(t),Ku(t,"pointer")};Ws.touchmove=t=>{t.input.lastTouch=Date.now(),Ku(t,"pointer")};Ws.contextmenu=t=>PF(t);function Hse(t,e){return t.composing?!0:ps&&Math.abs(Date.now()-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const LIe=ju?5e3:-1;Hs.compositionstart=Hs.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,r=e.selection.$to;if(e.selection instanceof rr&&(e.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)||Ya&&bse&&MIe(t)))t.markCursor=t.state.storedMarks||r.marks(),f5(t,!0),t.markCursor=null;else if(f5(t,!e.selection.empty),ml&&e.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let n=t.domSelectionRange();for(let i=n.focusNode,a=n.focusOffset;i&&i.nodeType==1&&a!=0;){let s=a<0?i.lastChild:i.childNodes[a-1];if(!s)break;if(s.nodeType==3){let o=t.domSelection();o&&o.collapse(s,s.nodeValue.length);break}else i=s,a=-1}}t.input.composing=!0}qse(t,LIe)};function MIe(t){let{focusNode:e,focusOffset:r}=t.domSelectionRange();if(!e||e.nodeType!=1||r>=e.childNodes.length)return!1;let n=e.childNodes[r];return n.nodeType==1&&n.contentEditable=="false"}Hs.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now(),t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,qse(t,20))};function qse(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>f5(t),e))}function Use(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function IIe(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let r=CMe(e.focusNode,e.focusOffset),n=kMe(e.focusNode,e.focusOffset);if(r&&n&&r!=n){let i=n.pmViewDesc,a=t.domObserver.lastChangedTextNode;if(r==a||n==a)return a;if(!i||!i.isText(n.nodeValue))return n;if(t.input.compositionNode==n){let s=r.pmViewDesc;if(!(!s||!s.isText(r.nodeValue)))return n}}return r||n}function f5(t,e=!1){if(!(ju&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Use(t),e||t.docView&&t.docView.dirty){let r=IF(t),n=t.state.selection;return r&&!r.eq(n)?t.dispatch(t.state.tr.setSelection(r)):(t.markCursor||e)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function NIe(t,e){if(!t.dom.parentNode)return;let r=t.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(e),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),t.focus()},50)}const mC=vo&&Fd<15||yb&&_Me<604;Ws.copy=Hs.cut=(t,e)=>{let r=e,n=t.state.selection,i=r.type=="cut";if(n.empty)return;let a=mC?null:r.clipboardData,s=n.content(),{dom:o,text:l}=DF(t,s);a?(r.preventDefault(),a.clearData(),a.setData("text/html",o.innerHTML),a.setData("text/plain",l)):NIe(t,o),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function DIe(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function OIe(t,e){if(!t.dom.parentNode)return;let r=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,n=t.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),n.parentNode&&n.parentNode.removeChild(n),r?yC(t,n.value,null,i,e):yC(t,n.textContent,n.innerHTML,i,e)},50)}function yC(t,e,r,n,i){let a=Ose(t,e,r,n,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,a||$t.empty)))return!0;if(!a)return!1;let s=DIe(a),o=s?t.state.tr.replaceSelectionWith(s,n):t.state.tr.replaceSelection(a);return t.dispatch(o.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Yse(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let r=t.getData("text/uri-list");return r?r.replace(/\r?\n/g," "):""}Hs.paste=(t,e)=>{let r=e;if(t.composing&&!ju)return;let n=mC?null:r.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;n&&yC(t,Yse(n),n.getData("text/html"),i,r)?r.preventDefault():OIe(t,r)};class Xse{constructor(e,r,n){this.slice=e,this.move=r,this.node=n}}const $Ie=al?"altKey":"ctrlKey";function jse(t,e){let r;return t.someProp("dragCopies",n=>{r=r||n(e)}),r!=null?!r:!e[$Ie]}Ws.dragstart=(t,e)=>{let r=e,n=t.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let i=t.state.selection,a=i.empty?null:t.posAtCoords(Vk(r)),s;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof lr?i.to-1:i.to))){if(n&&n.mightDrag)s=lr.create(t.state.doc,n.mightDrag.pos);else if(r.target&&r.target.nodeType==1){let d=t.docView.nearestDesc(r.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(s=lr.create(t.state.doc,d.posBefore))}}let o=(s||t.state.selection).content(),{dom:l,text:u,slice:h}=DF(t,o);(!r.dataTransfer.files.length||!Ya||vse>120)&&r.dataTransfer.clearData(),r.dataTransfer.setData(mC?"Text":"text/html",l.innerHTML),r.dataTransfer.effectAllowed="copyMove",mC||r.dataTransfer.setData("text/plain",u),t.dragging=new Xse(h,jse(t,r),s)};Ws.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Hs.dragover=Hs.dragenter=(t,e)=>e.preventDefault();Hs.drop=(t,e)=>{try{PIe(t,e,t.dragging)}finally{t.dragging=null}};function PIe(t,e,r){if(!e.dataTransfer)return;let n=t.posAtCoords(Vk(e));if(!n)return;let i=t.state.doc.resolve(n.pos),a=r&&r.slice;a?t.someProp("transformPasted",p=>{a=p(a,t,!1)}):a=Ose(t,Yse(e.dataTransfer),mC?null:e.dataTransfer.getData("text/html"),!1,i);let s=!!(r&&jse(t,e));if(t.someProp("handleDrop",p=>p(t,e,a||$t.empty,s))){e.preventDefault();return}if(!a)return;e.preventDefault();let o=a?Kae(t.state.doc,i.pos,a):i.pos;o==null&&(o=i.pos);let l=t.state.tr;if(s){let{node:p}=r;p?p.replace(l):l.deleteSelection()}let u=l.mapping.map(o),h=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=l.doc;if(h?l.replaceRangeWith(u,u,a.content.firstChild):l.replaceRange(u,u,a),l.doc.eq(d))return;let f=l.doc.resolve(u);if(h&&lr.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))l.setSelection(new lr(f));else{let p=l.mapping.map(o);l.mapping.maps[l.mapping.maps.length-1].forEach((g,m,y,v)=>p=v),l.setSelection(NF(t,f,l.doc.resolve(p)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}Ws.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&lh(t)},20))};Ws.blur=(t,e)=>{let r=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),r.relatedTarget&&t.dom.contains(r.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};Ws.beforeinput=(t,e)=>{if(ju&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",a=>a(t,Tp(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in Hs)Ws[t]=Hs[t];function vC(t,e){if(t==e)return!0;for(let r in t)if(t[r]!==e[r])return!1;for(let r in e)if(!(r in t))return!1;return!0}class p5{constructor(e,r){this.toDOM=e,this.spec=r||o0,this.side=this.spec.side||0}map(e,r,n,i){let{pos:a,deleted:s}=e.mapResult(r.from+i,this.side<0?-1:1);return s?null:new ba(a-n,a-n,this)}valid(){return!0}eq(e){return this==e||e instanceof p5&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&vC(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Gd{constructor(e,r){this.attrs=e,this.spec=r||o0}map(e,r,n,i){let a=e.map(r.from+i,this.spec.inclusiveStart?-1:1)-n,s=e.map(r.to+i,this.spec.inclusiveEnd?1:-1)-n;return a>=s?null:new ba(a,s,this)}valid(e,r){return r.from<r.to}eq(e){return this==e||e instanceof Gd&&vC(this.attrs,e.attrs)&&vC(this.spec,e.spec)}static is(e){return e.type instanceof Gd}destroy(){}}class BF{constructor(e,r){this.attrs=e,this.spec=r||o0}map(e,r,n,i){let a=e.mapResult(r.from+i,1);if(a.deleted)return null;let s=e.mapResult(r.to+i,-1);return s.deleted||s.pos<=a.pos?null:new ba(a.pos-n,s.pos-n,this)}valid(e,r){let{index:n,offset:i}=e.content.findIndex(r.from),a;return i==r.from&&!(a=e.child(n)).isText&&i+a.nodeSize==r.to}eq(e){return this==e||e instanceof BF&&vC(this.attrs,e.attrs)&&vC(this.spec,e.spec)}destroy(){}}class ba{constructor(e,r,n){this.from=e,this.to=r,this.type=n}copy(e,r){return new ba(e,r,this.type)}eq(e,r=0){return this.type.eq(e.type)&&this.from+r==e.from&&this.to+r==e.to}map(e,r,n){return this.type.map(e,this,r,n)}static widget(e,r,n){return new ba(e,e,new p5(r,n))}static inline(e,r,n,i){return new ba(e,r,new Gd(n,i))}static node(e,r,n,i){return new ba(e,r,new BF(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Gd}get widget(){return this.type instanceof p5}}const pm=[],o0={};class kn{constructor(e,r){this.local=e.length?e:pm,this.children=r.length?r:pm}static create(e,r){return r.length?g5(r,e,0,o0):us}find(e,r,n){let i=[];return this.findInner(e??0,r??1e9,i,0,n),i}findInner(e,r,n,i,a){for(let s=0;s<this.local.length;s++){let o=this.local[s];o.from<=r&&o.to>=e&&(!a||a(o.spec))&&n.push(o.copy(o.from+i,o.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<r&&this.children[s+1]>e){let o=this.children[s]+1;this.children[s+2].findInner(e-o,r-o,n,i+o,a)}}map(e,r,n){return this==us||e.maps.length==0?this:this.mapInner(e,r,0,0,n||o0)}mapInner(e,r,n,i,a){let s;for(let o=0;o<this.local.length;o++){let l=this.local[o].map(e,n,i);l&&l.type.valid(r,l)?(s||(s=[])).push(l):a.onRemove&&a.onRemove(this.local[o].spec)}return this.children.length?BIe(this.children,s||[],e,r,n,i,a):s?new kn(s.sort(l0),pm):us}add(e,r){return r.length?this==us?kn.create(e,r):this.addInner(e,r,0):this}addInner(e,r,n){let i,a=0;e.forEach((o,l)=>{let u=l+n,h;if(h=Zse(r,o,u)){for(i||(i=this.children.slice());a<i.length&&i[a]<l;)a+=3;i[a]==l?i[a+2]=i[a+2].addInner(o,h,u+1):i.splice(a,0,l,l+o.nodeSize,g5(h,o,u+1,o0)),a+=3}});let s=Kse(a?Qse(r):r,-n);for(let o=0;o<s.length;o++)s[o].type.valid(e,s[o])||s.splice(o--,1);return new kn(s.length?this.local.concat(s).sort(l0):this.local,i||this.children)}remove(e){return e.length==0||this==us?this:this.removeInner(e,0)}removeInner(e,r){let n=this.children,i=this.local;for(let a=0;a<n.length;a+=3){let s,o=n[a]+r,l=n[a+1]+r;for(let h=0,d;h<e.length;h++)(d=e[h])&&d.from>o&&d.to<l&&(e[h]=null,(s||(s=[])).push(d));if(!s)continue;n==this.children&&(n=this.children.slice());let u=n[a+2].removeInner(s,o+1);u!=us?n[a+2]=u:(n.splice(a,3),a-=3)}if(i.length){for(let a=0,s;a<e.length;a++)if(s=e[a])for(let o=0;o<i.length;o++)i[o].eq(s,r)&&(i==this.local&&(i=this.local.slice()),i.splice(o--,1))}return n==this.children&&i==this.local?this:i.length||n.length?new kn(i,n):us}forChild(e,r){if(this==us)return this;if(r.isLeaf)return kn.empty;let n,i;for(let o=0;o<this.children.length;o+=3)if(this.children[o]>=e){this.children[o]==e&&(n=this.children[o+2]);break}let a=e+1,s=a+r.content.size;for(let o=0;o<this.local.length;o++){let l=this.local[o];if(l.from<s&&l.to>a&&l.type instanceof Gd){let u=Math.max(a,l.from)-a,h=Math.min(s,l.to)-a;u<h&&(i||(i=[])).push(l.copy(u,h))}}if(i){let o=new kn(i.sort(l0),pm);return n?new wd([o,n]):o}return n||us}eq(e){if(this==e)return!0;if(!(e instanceof kn)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let r=0;r<this.local.length;r++)if(!this.local[r].eq(e.local[r]))return!1;for(let r=0;r<this.children.length;r+=3)if(this.children[r]!=e.children[r]||this.children[r+1]!=e.children[r+1]||!this.children[r+2].eq(e.children[r+2]))return!1;return!0}locals(e){return FF(this.localsInner(e))}localsInner(e){if(this==us)return pm;if(e.inlineContent||!this.local.some(Gd.is))return this.local;let r=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof Gd||r.push(this.local[n]);return r}forEachSet(e){e(this)}}kn.empty=new kn([],[]);kn.removeOverlap=FF;const us=kn.empty;class wd{constructor(e){this.members=e}map(e,r){const n=this.members.map(i=>i.map(e,r,o0));return wd.from(n)}forChild(e,r){if(r.isLeaf)return kn.empty;let n=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(e,r);a!=us&&(a instanceof wd?n=n.concat(a.members):n.push(a))}return wd.from(n)}eq(e){if(!(e instanceof wd)||e.members.length!=this.members.length)return!1;for(let r=0;r<this.members.length;r++)if(!this.members[r].eq(e.members[r]))return!1;return!0}locals(e){let r,n=!0;for(let i=0;i<this.members.length;i++){let a=this.members[i].localsInner(e);if(a.length)if(!r)r=a;else{n&&(r=r.slice(),n=!1);for(let s=0;s<a.length;s++)r.push(a[s])}}return r?FF(n?r:r.sort(l0)):pm}static from(e){switch(e.length){case 0:return us;case 1:return e[0];default:return new wd(e.every(r=>r instanceof kn)?e:e.reduce((r,n)=>r.concat(n instanceof kn?n:n.members),[]))}}forEachSet(e){for(let r=0;r<this.members.length;r++)this.members[r].forEachSet(e)}}function BIe(t,e,r,n,i,a,s){let o=t.slice();for(let u=0,h=a;u<r.maps.length;u++){let d=0;r.maps[u].forEach((f,p,g,m)=>{let y=m-g-(p-f);for(let v=0;v<o.length;v+=3){let T=o[v+1];if(T<0||f>T+h-d)continue;let b=o[v]+h-d;p>=b?o[v+1]=f<=b?-2:-1:f>=h&&y&&(o[v]+=y,o[v+1]+=y)}d+=y}),h=r.maps[u].map(h,-1)}let l=!1;for(let u=0;u<o.length;u+=3)if(o[u+1]<0){if(o[u+1]==-2){l=!0,o[u+1]=-1;continue}let h=r.map(t[u]+a),d=h-i;if(d<0||d>=n.content.size){l=!0;continue}let f=r.map(t[u+1]+a,-1),p=f-i,{index:g,offset:m}=n.content.findIndex(d),y=n.maybeChild(g);if(y&&m==d&&m+y.nodeSize==p){let v=o[u+2].mapInner(r,y,h+1,t[u]+a+1,s);v!=us?(o[u]=d,o[u+1]=p,o[u+2]=v):(o[u+1]=-2,l=!0)}else l=!0}if(l){let u=FIe(o,t,e,r,i,a,s),h=g5(u,n,0,s);e=h.local;for(let d=0;d<o.length;d+=3)o[d+1]<0&&(o.splice(d,3),d-=3);for(let d=0,f=0;d<h.children.length;d+=3){let p=h.children[d];for(;f<o.length&&o[f]<p;)f+=3;o.splice(f,0,h.children[d],h.children[d+1],h.children[d+2])}}return new kn(e.sort(l0),o)}function Kse(t,e){if(!e||!t.length)return t;let r=[];for(let n=0;n<t.length;n++){let i=t[n];r.push(new ba(i.from+e,i.to+e,i.type))}return r}function FIe(t,e,r,n,i,a,s){function o(l,u){for(let h=0;h<l.local.length;h++){let d=l.local[h].map(n,i,u);d?r.push(d):s.onRemove&&s.onRemove(l.local[h].spec)}for(let h=0;h<l.children.length;h+=3)o(l.children[h+2],l.children[h]+u+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&o(t[l+2],e[l]+a+1);return r}function Zse(t,e,r){if(e.isLeaf)return null;let n=r+e.nodeSize,i=null;for(let a=0,s;a<t.length;a++)(s=t[a])&&s.from>r&&s.to<n&&((i||(i=[])).push(s),t[a]=null);return i}function Qse(t){let e=[];for(let r=0;r<t.length;r++)t[r]!=null&&e.push(t[r]);return e}function g5(t,e,r,n){let i=[],a=!1;e.forEach((o,l)=>{let u=Zse(t,o,l+r);if(u){a=!0;let h=g5(u,o,r+l+1,n);h!=us&&i.push(l,l+o.nodeSize,h)}});let s=Kse(a?Qse(t):t,-r).sort(l0);for(let o=0;o<s.length;o++)s[o].type.valid(e,s[o])||(n.onRemove&&n.onRemove(s[o].spec),s.splice(o--,1));return s.length||i.length?new kn(s,i):us}function l0(t,e){return t.from-e.from||t.to-e.to}function FF(t){let e=t;for(let r=0;r<e.length-1;r++){let n=e[r];if(n.from!=n.to)for(let i=r+1;i<e.length;i++){let a=e[i];if(a.from==n.from){a.to!=n.to&&(e==t&&(e=t.slice()),e[i]=a.copy(a.from,n.to),QY(e,i+1,a.copy(n.to,a.to)));continue}else{a.from<n.to&&(e==t&&(e=t.slice()),e[r]=n.copy(n.from,a.from),QY(e,i,n.copy(a.from,n.to)));break}}}return e}function QY(t,e,r){for(;e<t.length&&l0(r,t[e])>0;)e++;t.splice(e,0,r)}function aM(t){let e=[];return t.someProp("decorations",r=>{let n=r(t.state);n&&n!=us&&e.push(n)}),t.cursorWrapper&&e.push(kn.create(t.state.doc,[t.cursorWrapper.deco])),wd.from(e)}const zIe={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},VIe=vo&&Fd<=11;class GIe{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class WIe{constructor(e,r){this.view=e,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new GIe,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let i=0;i<n.length;i++)this.queue.push(n[i]);vo&&Fd<=11&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():ps&&e.composing&&n.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),VIe&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,zIe)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let r=0;r<e.length;r++)this.queue.push(e[r]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(qY(this.view)){if(this.suppressingSelectionUpdates)return lh(this.view);if(vo&&Fd<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&T0(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let r=new Set,n;for(let a=e.focusNode;a;a=mb(a))r.add(a);for(let a=e.anchorNode;a;a=mb(a))if(r.has(a)){n=a;break}let i=n&&this.view.docView.nearestDesc(n);if(i&&i.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&qY(e)&&!this.ignoreSelectionChange(n),a=-1,s=-1,o=!1,l=[];if(e.editable)for(let h=0;h<r.length;h++){let d=this.registerMutation(r[h],l);d&&(a=a<0?d.from:Math.min(d.from,a),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(o=!0))}if(l.some(h=>h.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||Ya&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&r.some(h=>h.type=="childList"&&h.removedNodes.length))){for(let h of l)if(h.nodeName=="BR"&&h.parentNode){let d=h.nextSibling;for(;d&&d.nodeType==1;){if(d.contentEditable=="false"){h.parentNode.removeChild(h);break}d=d.firstChild}}}else if(ml&&l.length){let h=l.filter(d=>d.nodeName=="BR");if(h.length==2){let[d,f]=h;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of h){let p=f.parentNode;p&&p.nodeName=="LI"&&(!d||UIe(e,d)!=p)&&f.remove()}}}let u=null;a<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&$6(n)&&(u=IF(e))&&u.eq(Cr.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,lh(e),this.currentSelection.set(n),e.scrollToSelection()):(a>-1||i)&&(a>-1&&(e.docView.markDirty(a,s),HIe(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,YIe(e,l)),this.handleDOMChange(a,s,o,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||lh(e),this.currentSelection.set(n))}registerMutation(e,r){if(r.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let h=0;h<e.addedNodes.length;h++){let d=e.addedNodes[h];r.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let i=e.previousSibling,a=e.nextSibling;if(vo&&Fd<=11&&e.addedNodes.length)for(let h=0;h<e.addedNodes.length;h++){let{previousSibling:d,nextSibling:f}=e.addedNodes[h];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(i=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(a=f)}let s=i&&i.parentNode==e.target?qa(i)+1:0,o=n.localPosFromDOM(e.target,s,-1),l=a&&a.parentNode==e.target?qa(a):e.target.childNodes.length,u=n.localPosFromDOM(e.target,l,1);return{from:o,to:u}}else return e.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let JY=new WeakMap,eX=!1;function HIe(t){if(!JY.has(t)&&(JY.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=ml,eX)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),eX=!0}}function tX(t,e){let r=e.startContainer,n=e.startOffset,i=e.endContainer,a=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return T0(s.node,s.offset,i,a)&&([r,n,i,a]=[i,a,r,n]),{anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:a}}function qIe(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return tX(t,i)}let r;function n(i){i.preventDefault(),i.stopImmediatePropagation(),r=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0),r?tX(t,r):null}function UIe(t,e){for(let r=e.parentNode;r&&r!=t.dom;r=r.parentNode){let n=t.docView.nearestDesc(r,!0);if(n&&n.node.isBlock)return r}return null}function YIe(t,e){var r;let{focusNode:n,focusOffset:i}=t.domSelectionRange();for(let a of e)if(((r=a.parentNode)===null||r===void 0?void 0:r.nodeName)=="TR"){let s=a.nextSibling;for(;s&&s.nodeName!="TD"&&s.nodeName!="TH";)s=s.nextSibling;if(s){let o=s;for(;;){let l=o.firstChild;if(!l||l.nodeType!=1||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;o=l}o.insertBefore(a,o.firstChild),n==a&&t.domSelection().collapse(a,i)}else a.parentNode.removeChild(a)}}function XIe(t,e,r,n){let{node:i,fromOffset:a,toOffset:s,from:o,to:l}=t.docView.parseRange(e,r),u=t.domSelectionRange(),h,d=u.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(h=[{node:d,offset:u.anchorOffset}],$6(u)||h.push({node:u.focusNode,offset:u.focusOffset})),Ya&&t.input.lastKeyCode===8)for(let v=s;v>a;v--){let T=i.childNodes[v-1],b=T.pmViewDesc;if(T.nodeName=="BR"&&!b){s=v;break}if(!b||b.size)break}let f=t.state.doc,p=t.someProp("domParser")||sh.fromSchema(t.state.schema),g=f.resolve(o),m=null,y=p.parse(i,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:a,to:s,preserveWhitespace:g.parent.type.whitespace=="pre"?"full":!0,findPositions:h,ruleFromNode:jIe(n),context:g});if(h&&h[0].pos!=null){let v=h[0].pos,T=h[1]&&h[1].pos;T==null&&(T=v),m={anchor:v+o,head:T+o}}return{doc:y,sel:m,from:o,to:l}}const jIe=t=>e=>{let r=e.pmViewDesc;if(r)return r.parseRule(t);if(e.nodeName=="BR"&&e.parentNode){if(ps&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||ps&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null},KIe=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function ZIe(t,e,r,n,i){let a=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let k=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,E=IF(t,k);if(E&&!t.state.selection.eq(E)){if(Ya&&ju&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",M=>M(t,Tp(13,"Enter"))))return;let _=t.state.tr.setSelection(E);k=="pointer"?_.setMeta("pointer",!0):k=="key"&&_.scrollIntoView(),a&&_.setMeta("composition",a),t.dispatch(_)}return}let s=t.state.doc.resolve(e),o=s.sharedDepth(r);e=s.before(o+1),r=t.state.doc.resolve(r).after(o+1);let l=t.state.selection,u=XIe(t,e,r,i),h=t.state.doc,d=h.slice(u.from,u.to),f,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,p="end"):(f=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let g=e8e(d.content,u.doc.content,u.from,f,p);if(g&&t.input.domChangeCount++,(yb&&t.input.lastIOSEnter>Date.now()-225||ju)&&i.some(k=>k.nodeType==1&&!KIe.test(k.nodeName))&&(!g||g.endA>=g.endB)&&t.someProp("handleKeyDown",k=>k(t,Tp(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!g)if(n&&l instanceof rr&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))g={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let k=rX(t,t.state.doc,u.sel);if(k&&!k.eq(t.state.selection)){let E=t.state.tr.setSelection(k);a&&E.setMeta("composition",a),t.dispatch(E)}}return}t.state.selection.from<t.state.selection.to&&g.start==g.endB&&t.state.selection instanceof rr&&(g.start>t.state.selection.from&&g.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?g.start=t.state.selection.from:g.endA<t.state.selection.to&&g.endA>=t.state.selection.to-2&&t.state.selection.to<=u.to&&(g.endB+=t.state.selection.to-g.endA,g.endA=t.state.selection.to)),vo&&Fd<=11&&g.endB==g.start+1&&g.endA==g.start&&g.start>u.from&&u.doc.textBetween(g.start-u.from-1,g.start-u.from+1)=="  "&&(g.start--,g.endA--,g.endB--);let m=u.doc.resolveNoCache(g.start-u.from),y=u.doc.resolveNoCache(g.endB-u.from),v=h.resolve(g.start),T=m.sameParent(y)&&m.parent.inlineContent&&v.end()>=g.endA;if((yb&&t.input.lastIOSEnter>Date.now()-225&&(!T||i.some(k=>k.nodeName=="DIV"||k.nodeName=="P"))||!T&&m.pos<u.doc.content.size&&(!m.sameParent(y)||!m.parent.inlineContent)&&m.pos<y.pos&&!/\S/.test(u.doc.textBetween(m.pos,y.pos,"","")))&&t.someProp("handleKeyDown",k=>k(t,Tp(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>g.start&&JIe(h,g.start,g.endA,m,y)&&t.someProp("handleKeyDown",k=>k(t,Tp(8,"Backspace")))){ju&&Ya&&t.domObserver.suppressSelectionUpdates();return}Ya&&g.endB==g.start&&(t.input.lastChromeDelete=Date.now()),ju&&!T&&m.start()!=y.start()&&y.parentOffset==0&&m.depth==y.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==g.endA&&(g.endB-=2,y=u.doc.resolveNoCache(g.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(k){return k(t,Tp(13,"Enter"))})},20));let b=g.start,w=g.endA,C=k=>{let E=k||t.state.tr.replace(b,w,u.doc.slice(g.start-u.from,g.endB-u.from));if(u.sel){let _=rX(t,E.doc,u.sel);_&&!(Ya&&t.composing&&_.empty&&(g.start!=g.endB||t.input.lastChromeDelete<Date.now()-100)&&(_.head==b||_.head==E.mapping.map(w)-1)||vo&&_.empty&&_.head==b)&&E.setSelection(_)}return a&&E.setMeta("composition",a),E.scrollIntoView()},S;if(T)if(m.pos==y.pos){vo&&Fd<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>lh(t),20));let k=C(t.state.tr.delete(b,w)),E=h.resolve(g.start).marksAcross(h.resolve(g.endA));E&&k.ensureMarks(E),t.dispatch(k)}else if(g.endA==g.endB&&(S=QIe(m.parent.content.cut(m.parentOffset,y.parentOffset),v.parent.content.cut(v.parentOffset,g.endA-v.start())))){let k=C(t.state.tr);S.type=="add"?k.addMark(b,w,S.mark):k.removeMark(b,w,S.mark),t.dispatch(k)}else if(m.parent.child(m.index()).isText&&m.index()==y.index()-(y.textOffset?0:1)){let k=m.parent.textBetween(m.parentOffset,y.parentOffset),E=()=>C(t.state.tr.insertText(k,b,w));t.someProp("handleTextInput",_=>_(t,b,w,k,E))||t.dispatch(E())}else t.dispatch(C());else t.dispatch(C())}function rX(t,e,r){return Math.max(r.anchor,r.head)>e.content.size?null:NF(t,e.resolve(r.anchor),e.resolve(r.head))}function QIe(t,e){let r=t.firstChild.marks,n=e.firstChild.marks,i=r,a=n,s,o,l;for(let h=0;h<n.length;h++)i=n[h].removeFromSet(i);for(let h=0;h<r.length;h++)a=r[h].removeFromSet(a);if(i.length==1&&a.length==0)o=i[0],s="add",l=h=>h.mark(o.addToSet(h.marks));else if(i.length==0&&a.length==1)o=a[0],s="remove",l=h=>h.mark(o.removeFromSet(h.marks));else return null;let u=[];for(let h=0;h<e.childCount;h++)u.push(l(e.child(h)));if(gt.from(u).eq(t))return{mark:o,type:s}}function JIe(t,e,r,n,i){if(r-e<=i.pos-n.pos||sM(n,!0,!1)<i.pos)return!1;let a=t.resolve(e);if(!n.parent.isTextblock){let o=a.nodeAfter;return o!=null&&r==e+o.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let s=t.resolve(sM(a,!0,!0));return!s.parent.isTextblock||s.pos>r||sM(s,!0,!1)<r?!1:n.parent.content.cut(n.parentOffset).eq(s.parent.content)}function sM(t,e,r){let n=t.depth,i=e?t.end():t.pos;for(;n>0&&(e||t.indexAfter(n)==t.node(n).childCount);)n--,i++,e=!1;if(r){let a=t.node(n).maybeChild(t.indexAfter(n));for(;a&&!a.isLeaf;)a=a.firstChild,i++}return i}function e8e(t,e,r,n,i){let a=t.findDiffStart(e,r),s=r+t.size,o=r+e.size;if(a==null)return null;let{a:l,b:u}=t.findDiffEnd(e,s,o);if(i=="end"){let h=Math.max(0,a-Math.min(l,u));n-=l+h-a}if(l<a&&s<o){let h=n<=a&&n>=l?a-n:0;a-=h,u=a+(u-l),l=a}else if(u<a){let h=n<=a&&n>=u?a-n:0;a-=h,l=a+(l-u),u=a}return{start:a,endA:l,endB:u}}class Jse{constructor(e,r){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new mIe,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(oX),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=aX(this),iX(this),this.nodeViews=sX(this),this.docView=FY(this.state.doc,nX(this),aM(this),this.dom,this),this.domObserver=new WIe(this,(n,i,a,s)=>ZIe(this,n,i,a,s)),this.domObserver.start(),yIe(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let r in e)this._props[r]=e[r];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&mD(this);let r=this._props;this._props=e,e.plugins&&(e.plugins.forEach(oX),this.directPlugins=e.plugins),this.updateStateInner(e.state,r)}setProps(e){let r={};for(let n in this._props)r[n]=this._props[n];r.state=this.state;for(let n in e)r[n]=e[n];this.update(r)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,r){var n;let i=this.state,a=!1,s=!1;e.storedMarks&&this.composing&&(Use(this),s=!0),this.state=e;let o=i.plugins!=e.plugins||this._props.plugins!=r.plugins;if(o||this._props.plugins!=r.plugins||this._props.nodeViews!=r.nodeViews){let p=sX(this);r8e(p,this.nodeViews)&&(this.nodeViews=p,a=!0)}(o||r.handleDOMEvents!=this._props.handleDOMEvents)&&mD(this),this.editable=aX(this),iX(this);let l=aM(this),u=nX(this),h=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",d=a||!this.docView.matchesNode(e.doc,u,l);(d||!e.selection.eq(i.selection))&&(s=!0);let f=h=="preserve"&&s&&this.dom.style.overflowAnchor==null&&MMe(this);if(s){this.domObserver.stop();let p=d&&(vo||Ya)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&t8e(i.selection,e.selection);if(d){let m=Ya?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=IIe(this)),(a||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=FY(e.doc,u,l,this.dom,this)),m&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(p=!0)}let g=this.input.mouseDown;p||!(g&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&tIe(this)&&g.delaySelUpdate())?lh(this,p):(Ise(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((n=this.dragging)===null||n===void 0)&&n.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),h=="reset"?this.dom.scrollTop=0:h=="to selection"?this.scrollToSelection():f&&IMe(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",r=>r(this)))if(this.state.selection instanceof lr){let r=this.docView.domAfterPos(this.state.selection.from);r.nodeType==1&&DY(this,r.getBoundingClientRect(),e)}else DY(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let r=0;r<this.directPlugins.length;r++){let n=this.directPlugins[r];n.spec.view&&this.pluginViews.push(n.spec.view(this))}for(let r=0;r<this.state.plugins.length;r++){let n=this.state.plugins[r];n.spec.view&&this.pluginViews.push(n.spec.view(this))}}else for(let r=0;r<this.pluginViews.length;r++){let n=this.pluginViews[r];n.update&&n.update(this,e)}}updateDraggedNode(e,r){let n=e.node,i=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)i=n.from;else{let a=n.from+(this.state.doc.content.size-r.doc.content.size);(a>0&&a<this.state.doc.content.size&&this.state.doc.nodeAt(a))==n.node&&(i=a)}this.dragging=new Xse(e.slice,e.move,i<0?void 0:lr.create(this.state.doc,i))}someProp(e,r){let n=this._props&&this._props[e],i;if(n!=null&&(i=r?r(n):n))return i;for(let s=0;s<this.directPlugins.length;s++){let o=this.directPlugins[s].props[e];if(o!=null&&(i=r?r(o):o))return i}let a=this.state.plugins;if(a)for(let s=0;s<a.length;s++){let o=a[s].props[e];if(o!=null&&(i=r?r(o):o))return i}}hasFocus(){if(vo){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&NMe(this.dom),lh(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let r=this.dom.parentNode;r;r=r.parentNode)if(r.nodeType==9||r.nodeType==11&&r.host)return r.getSelection||(Object.getPrototypeOf(r).getSelection=()=>r.ownerDocument.getSelection()),this._root=r}return e||document}updateRoot(){this._root=null}posAtCoords(e){return BMe(this,e)}coordsAtPos(e,r=1){return kse(this,e,r)}domAtPos(e,r=0){return this.docView.domFromPos(e,r)}nodeDOM(e){let r=this.docView.descAt(e);return r?r.nodeDOM:null}posAtDOM(e,r,n=-1){let i=this.docView.posFromDOM(e,r,n);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,r){return WMe(this,r||this.state,e)}pasteHTML(e,r){return yC(this,"",e,!1,r||new ClipboardEvent("paste"))}pasteText(e,r){return yC(this,e,null,!0,r||new ClipboardEvent("paste"))}serializeForClipboard(e){return DF(this,e)}destroy(){this.docView&&(vIe(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],aM(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,TMe())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return xIe(this,e)}domSelectionRange(){let e=this.domSelection();return e?ps&&this.root.nodeType===11&&EMe(this.dom.ownerDocument)==this.dom&&qIe(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}Jse.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function nX(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",r=>{if(typeof r=="function"&&(r=r(t.state)),r)for(let n in r)n=="class"?e.class+=" "+r[n]:n=="style"?e.style=(e.style?e.style+";":"")+r[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(r[n]))}),e.translate||(e.translate="no"),[ba.node(0,t.state.doc.content.size,e)]}function iX(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:ba.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function aX(t){return!t.someProp("editable",e=>e(t.state)===!1)}function t8e(t,e){let r=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(r)!=e.$anchor.start(r)}function sX(t){let e=Object.create(null);function r(n){for(let i in n)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=n[i])}return t.someProp("nodeViews",r),t.someProp("markViews",r),e}function r8e(t,e){let r=0,n=0;for(let i in t){if(t[i]!=e[i])return!0;r++}for(let i in e)n++;return r!=n}function oX(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Kd={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:"'"},m5={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},n8e=typeof navigator<"u"&&/Mac/.test(navigator.platform),i8e=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ua=0;Ua<10;Ua++)Kd[48+Ua]=Kd[96+Ua]=String(Ua);for(var Ua=1;Ua<=24;Ua++)Kd[Ua+111]="F"+Ua;for(var Ua=65;Ua<=90;Ua++)Kd[Ua]=String.fromCharCode(Ua+32),m5[Ua]=String.fromCharCode(Ua);for(var oM in Kd)m5.hasOwnProperty(oM)||(m5[oM]=Kd[oM]);function a8e(t){var e=n8e&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||i8e&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",r=!e&&t.key||(t.shiftKey?m5:Kd)[t.keyCode]||t.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}const s8e=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),o8e=typeof navigator<"u"&&/Win/.test(navigator.platform);function l8e(t){let e=t.split(/-(?!$)/),r=e[e.length-1];r=="Space"&&(r=" ");let n,i,a,s;for(let o=0;o<e.length-1;o++){let l=e[o];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))a=!0;else if(/^mod$/i.test(l))s8e?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(r="Alt-"+r),i&&(r="Ctrl-"+r),s&&(r="Meta-"+r),a&&(r="Shift-"+r),r}function c8e(t){let e=Object.create(null);for(let r in t)e[l8e(r)]=t[r];return e}function lM(t,e,r=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),r&&e.shiftKey&&(t="Shift-"+t),t}function u8e(t){return new Un({props:{handleKeyDown:zF(t)}})}function zF(t){let e=c8e(t);return function(r,n){let i=a8e(n),a,s=e[lM(i,n)];if(s&&s(r.state,r.dispatch,r))return!0;if(i.length==1&&i!=" "){if(n.shiftKey){let o=e[lM(i,n,!1)];if(o&&o(r.state,r.dispatch,r))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(o8e&&n.ctrlKey&&n.altKey)&&(a=Kd[n.keyCode])&&a!=i){let o=e[lM(a,n)];if(o&&o(r.state,r.dispatch,r))return!0}}return!1}}var h8e=Object.defineProperty,VF=(t,e)=>{for(var r in e)h8e(t,r,{get:e[r],enumerable:!0})};function B6(t){const{state:e,transaction:r}=t;let{selection:n}=r,{doc:i}=r,{storedMarks:a}=r;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return a},get selection(){return n},get doc(){return i},get tr(){return n=r.selection,i=r.doc,a=r.storedMarks,r}}}var F6=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:r}=this,{view:n}=e,{tr:i}=r,a=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([s,o])=>[s,(...u)=>{const h=o(...u)(a);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&n.dispatch(i),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:r,editor:n,state:i}=this,{view:a}=n,s=[],o=!!t,l=t||i.tr,u=()=>(!o&&e&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(l),s.every(d=>d===!0)),h={...Object.fromEntries(Object.entries(r).map(([d,f])=>[d,(...g)=>{const m=this.buildProps(l,e),y=f(...g)(m);return s.push(y),h}])),run:u};return h}createCan(t){const{rawCommands:e,state:r}=this,n=!1,i=t||r.tr,a=this.buildProps(i,n);return{...Object.fromEntries(Object.entries(e).map(([o,l])=>[o,(...u)=>l(...u)({...a,dispatch:void 0})])),chain:()=>this.createChain(i,n)}}buildProps(t,e=!0){const{rawCommands:r,editor:n,state:i}=this,{view:a}=n,s={tr:t,editor:n,view:a,state:B6({state:i,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([o,l])=>[o,(...u)=>l(...u)(s)]))}};return s}},Ml={};VF(Ml,{blur:()=>d8e,clearContent:()=>f8e,clearNodes:()=>p8e,command:()=>g8e,createParagraphNear:()=>m8e,cut:()=>y8e,deleteCurrentNode:()=>v8e,deleteNode:()=>b8e,deleteRange:()=>x8e,deleteSelection:()=>C8e,enter:()=>k8e,exitCode:()=>S8e,extendMarkRange:()=>E8e,first:()=>A8e,focus:()=>R8e,forEach:()=>L8e,insertContent:()=>M8e,insertContentAt:()=>D8e,joinBackward:()=>P8e,joinDown:()=>$8e,joinForward:()=>B8e,joinItemBackward:()=>F8e,joinItemForward:()=>z8e,joinTextblockBackward:()=>V8e,joinTextblockForward:()=>G8e,joinUp:()=>O8e,keyboardShortcut:()=>H8e,lift:()=>q8e,liftEmptyBlock:()=>U8e,liftListItem:()=>Y8e,newlineInCode:()=>X8e,resetAttributes:()=>j8e,scrollIntoView:()=>K8e,selectAll:()=>Z8e,selectNodeBackward:()=>Q8e,selectNodeForward:()=>J8e,selectParentNode:()=>eNe,selectTextblockEnd:()=>tNe,selectTextblockStart:()=>rNe,setContent:()=>nNe,setMark:()=>CNe,setMeta:()=>kNe,setNode:()=>SNe,setNodeSelection:()=>ENe,setTextDirection:()=>ANe,setTextSelection:()=>_Ne,sinkListItem:()=>RNe,splitBlock:()=>LNe,splitListItem:()=>MNe,toggleList:()=>NNe,toggleMark:()=>DNe,toggleNode:()=>ONe,toggleWrap:()=>$Ne,undoInputRule:()=>PNe,unsetAllMarks:()=>BNe,unsetMark:()=>FNe,unsetTextDirection:()=>zNe,updateAttributes:()=>VNe,wrapIn:()=>GNe,wrapInList:()=>WNe});var d8e=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var r;t.isDestroyed||(e.dom.blur(),(r=window==null?void 0:window.getSelection())==null||r.removeAllRanges())}),!0),f8e=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),p8e=()=>({state:t,tr:e,dispatch:r})=>{const{selection:n}=e,{ranges:i}=n;return r&&i.forEach(({$from:a,$to:s})=>{t.doc.nodesBetween(a.pos,s.pos,(o,l)=>{if(o.type.isText)return;const{doc:u,mapping:h}=e,d=u.resolve(h.map(l)),f=u.resolve(h.map(l+o.nodeSize)),p=d.blockRange(f);if(!p)return;const g=fx(p);if(o.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(p.start,m)}(g||g===0)&&e.lift(p,g)})}),!0},g8e=t=>e=>t(e),m8e=()=>({state:t,dispatch:e})=>fse(t,e),y8e=(t,e)=>({editor:r,tr:n})=>{const{state:i}=r,a=i.doc.slice(t.from,t.to);n.deleteRange(t.from,t.to);const s=n.mapping.map(e);return n.insert(s,a.content),n.setSelection(new rr(n.doc.resolve(Math.max(s-1,0)))),!0},v8e=()=>({tr:t,dispatch:e})=>{const{selection:r}=t,n=r.$anchor.node();if(n.content.size>0)return!1;const i=t.selection.$anchor;for(let a=i.depth;a>0;a-=1)if(i.node(a).type===n.type){if(e){const o=i.before(a),l=i.after(a);t.delete(o,l).scrollIntoView()}return!0}return!1};function ji(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var b8e=t=>({tr:e,state:r,dispatch:n})=>{const i=ji(t,r.schema),a=e.selection.$anchor;for(let s=a.depth;s>0;s-=1)if(a.node(s).type===i){if(n){const l=a.before(s),u=a.after(s);e.delete(l,u).scrollIntoView()}return!0}return!1},x8e=t=>({tr:e,dispatch:r})=>{const{from:n,to:i}=t;return r&&e.delete(n,i),!0},T8e=t=>t.content?/^text(\*|\+)/.test(t.content):!1,lX=(t,e,r)=>{if(!t.parent.isInline||r==="left"&&t.pos>t.start()||r==="right"&&t.pos<t.end())return t.pos;const n=e.nodes[t.parent.type.name].spec;return T8e(n)?r==="left"?t.start()-1:t.end()+1:t.pos},w8e=(t,e,r)=>{const n=lX(t,r,"left"),i=lX(e,r,"right");return{from:n,to:i}},C8e=()=>({state:t,dispatch:e})=>{const{$from:r,$to:n}=t.selection;if(t.selection.empty)return!1;const{from:i,to:a}=w8e(r,n,t.schema);return e&&(t.tr.deleteRange(i,a).scrollIntoView(),e(t.tr)),!0},k8e=()=>({commands:t})=>t.keyboardShortcut("Enter"),S8e=()=>({state:t,dispatch:e})=>sMe(t,e);function GF(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function y5(t,e,r={strict:!0}){const n=Object.keys(e);return n.length?n.every(i=>r.strict?e[i]===t[i]:GF(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function eoe(t,e,r={}){return t.find(n=>n.type===e&&y5(Object.fromEntries(Object.keys(r).map(i=>[i,n.attrs[i]])),r))}function cX(t,e,r={}){return!!eoe(t,e,r)}function WF(t,e,r){if(!t||!e)return;let n=t.parent.childAfter(t.parentOffset);if((!n.node||!n.node.marks.some(u=>u.type===e))&&(n=t.parent.childBefore(t.parentOffset)),!n.node||!n.node.marks.some(u=>u.type===e))return;if(!r){const u=n.node.marks.find(h=>h.type===e);u&&(r=u.attrs)}if(!eoe([...n.node.marks],e,r))return;let a=n.index,s=t.start()+n.offset,o=a+1,l=s+n.node.nodeSize;for(;a>0&&cX([...t.parent.child(a-1).marks],e,r);)a-=1,s-=t.parent.child(a).nodeSize;for(;o<t.parent.childCount&&cX([...t.parent.child(o).marks],e,r);)l+=t.parent.child(o).nodeSize,o+=1;return{from:s,to:l}}function Nh(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var E8e=(t,e)=>({tr:r,state:n,dispatch:i})=>{const a=Nh(t,n.schema),{doc:s,selection:o}=r,{$from:l,from:u,to:h}=o;if(i){const d=WF(l,a,e);if(d&&d.from<=u&&d.to>=h){const f=rr.create(s,d.from,d.to);r.setSelection(f)}}return!0},A8e=t=>e=>{const r=typeof t=="function"?t(e):t;for(let n=0;n<r.length;n+=1)if(r[n](e))return!0;return!1};function toe(t){return t instanceof rr}function qp(t=0,e=0,r=0){return Math.min(Math.max(t,e),r)}function roe(t,e=null){if(!e)return null;const r=Cr.atStart(t),n=Cr.atEnd(t);if(e==="start"||e===!0)return r;if(e==="end")return n;const i=r.from,a=n.to;return e==="all"?rr.create(t,qp(0,i,a),qp(t.content.size,i,a)):rr.create(t,qp(e,i,a),qp(e,i,a))}function uX(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function v5(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function _8e(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var R8e=(t=null,e={})=>({editor:r,view:n,tr:i,dispatch:a})=>{e={scrollIntoView:!0,...e};const s=()=>{(v5()||uX())&&n.dom.focus(),_8e()&&!v5()&&!uX()&&n.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{r.isDestroyed||(n.focus(),e!=null&&e.scrollIntoView&&r.commands.scrollIntoView())})};try{if(n.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(a&&t===null&&!toe(r.state.selection))return s(),!0;const o=roe(i.doc,t)||r.state.selection,l=r.state.selection.eq(o);return a&&(l||i.setSelection(o),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},L8e=(t,e)=>r=>t.every((n,i)=>e(n,{...r,index:i})),M8e=(t,e)=>({tr:r,commands:n})=>n.insertContentAt({from:r.selection.from,to:r.selection.to},t,e),noe=t=>{const e=t.childNodes;for(let r=e.length-1;r>=0;r-=1){const n=e[r];n.nodeType===3&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?t.removeChild(n):n.nodeType===1&&noe(n)}return t};function $T(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,r=new window.DOMParser().parseFromString(e,"text/html").body;return noe(r)}function bC(t,e,r){if(t instanceof Bd||t instanceof gt)return t;r={slice:!0,parseOptions:{},...r};const n=typeof t=="object"&&t!==null,i=typeof t=="string";if(n)try{if(Array.isArray(t)&&t.length>0)return gt.fromArray(t.map(o=>e.nodeFromJSON(o)));const s=e.nodeFromJSON(t);return r.errorOnInvalidContent&&s.check(),s}catch(a){if(r.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:a});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",a),bC("",e,r)}if(i){if(r.errorOnInvalidContent){let s=!1,o="";const l=new Fae({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(s=!0,o=typeof u=="string"?u:u.outerHTML,null)}]}})});if(r.slice?sh.fromSchema(l).parseSlice($T(t),r.parseOptions):sh.fromSchema(l).parse($T(t),r.parseOptions),r.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${o}`)})}const a=sh.fromSchema(e);return r.slice?a.parseSlice($T(t),r.parseOptions).content:a.parse($T(t),r.parseOptions)}return bC("",e,r)}function I8e(t,e,r){const n=t.steps.length-1;if(n<e)return;const i=t.steps[n];if(!(i instanceof Vi||i instanceof Ta))return;const a=t.mapping.maps[n];let s=0;a.forEach((o,l,u,h)=>{s===0&&(s=h)}),t.setSelection(Cr.near(t.doc.resolve(s),r))}var N8e=t=>!("type"in t),D8e=(t,e,r)=>({tr:n,dispatch:i,editor:a})=>{var s;if(i){r={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...r};let o;const l=y=>{a.emit("contentError",{editor:a,error:y,disableCollaboration:()=>{"collaboration"in a.storage&&typeof a.storage.collaboration=="object"&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...r.parseOptions};if(!r.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{bC(e,a.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(y){l(y)}try{o=bC(e,a.schema,{parseOptions:u,errorOnInvalidContent:(s=r.errorOnInvalidContent)!=null?s:a.options.enableContentCheck})}catch(y){return l(y),!1}let{from:h,to:d}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,p=!0;if((N8e(o)?o:[o]).forEach(y=>{y.check(),f=f?y.isText&&y.marks.length===0:!1,p=p?y.isBlock:!1}),h===d&&p){const{parent:y}=n.doc.resolve(h);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(h-=1,d+=1)}let m;if(f){if(Array.isArray(e))m=e.map(y=>y.text||"").join("");else if(e instanceof gt){let y="";e.forEach(v=>{v.text&&(y+=v.text)}),m=y}else typeof e=="object"&&e&&e.text?m=e.text:m=e;n.insertText(m,h,d)}else{m=o;const y=n.doc.resolve(h),v=y.node(),T=y.parentOffset===0,b=v.isText||v.isTextblock,w=v.content.size>0;T&&b&&w&&p&&(h=Math.max(0,h-1)),n.replaceWith(h,d,m)}r.updateSelection&&I8e(n,n.steps.length-1,-1),r.applyInputRules&&n.setMeta("applyInputRules",{from:h,text:m}),r.applyPasteRules&&n.setMeta("applyPasteRules",{from:h,text:m})}return!0},O8e=()=>({state:t,dispatch:e})=>nMe(t,e),$8e=()=>({state:t,dispatch:e})=>iMe(t,e),P8e=()=>({state:t,dispatch:e})=>sse(t,e),B8e=()=>({state:t,dispatch:e})=>use(t,e),F8e=()=>({state:t,dispatch:e,tr:r})=>{try{const n=N6(t.doc,t.selection.$from.pos,-1);return n==null?!1:(r.join(n,2),e&&e(r),!0)}catch{return!1}},z8e=()=>({state:t,dispatch:e,tr:r})=>{try{const n=N6(t.doc,t.selection.$from.pos,1);return n==null?!1:(r.join(n,2),e&&e(r),!0)}catch{return!1}},V8e=()=>({state:t,dispatch:e})=>tMe(t,e),G8e=()=>({state:t,dispatch:e})=>rMe(t,e);function ioe(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function W8e(t){const e=t.split(/-(?!$)/);let r=e[e.length-1];r==="Space"&&(r=" ");let n,i,a,s;for(let o=0;o<e.length-1;o+=1){const l=e[o];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))a=!0;else if(/^mod$/i.test(l))v5()||ioe()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return n&&(r=`Alt-${r}`),i&&(r=`Ctrl-${r}`),s&&(r=`Meta-${r}`),a&&(r=`Shift-${r}`),r}var H8e=t=>({editor:e,view:r,tr:n,dispatch:i})=>{const a=W8e(t).split(/-(?!$)/),s=a.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),o=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{r.someProp("handleKeyDown",u=>u(r,o))});return l==null||l.steps.forEach(u=>{const h=u.map(n.mapping);h&&i&&n.maybeStep(h)}),!0};function Zd(t,e,r={}){const{from:n,to:i,empty:a}=t.selection,s=e?ji(e,t.schema):null,o=[];t.doc.nodesBetween(n,i,(d,f)=>{if(d.isText)return;const p=Math.max(n,f),g=Math.min(i,f+d.nodeSize);o.push({node:d,from:p,to:g})});const l=i-n,u=o.filter(d=>s?s.name===d.node.type.name:!0).filter(d=>y5(d.node.attrs,r,{strict:!1}));return a?!!u.length:u.reduce((d,f)=>d+f.to-f.from,0)>=l}var q8e=(t,e={})=>({state:r,dispatch:n})=>{const i=ji(t,r.schema);return Zd(r,i,e)?aMe(r,n):!1},U8e=()=>({state:t,dispatch:e})=>pse(t,e),Y8e=t=>({state:e,dispatch:r})=>{const n=ji(t,e.schema);return yMe(n)(e,r)},X8e=()=>({state:t,dispatch:e})=>dse(t,e);function z6(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function hX(t,e){const r=typeof e=="string"?[e]:e;return Object.keys(t).reduce((n,i)=>(r.includes(i)||(n[i]=t[i]),n),{})}var j8e=(t,e)=>({tr:r,state:n,dispatch:i})=>{let a=null,s=null;const o=z6(typeof t=="string"?t:t.name,n.schema);if(!o)return!1;o==="node"&&(a=ji(t,n.schema)),o==="mark"&&(s=Nh(t,n.schema));let l=!1;return r.selection.ranges.forEach(u=>{n.doc.nodesBetween(u.$from.pos,u.$to.pos,(h,d)=>{a&&a===h.type&&(l=!0,i&&r.setNodeMarkup(d,void 0,hX(h.attrs,e))),s&&h.marks.length&&h.marks.forEach(f=>{s===f.type&&(l=!0,i&&r.addMark(d,d+h.nodeSize,s.create(hX(f.attrs,e))))})})}),l},K8e=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),Z8e=()=>({tr:t,dispatch:e})=>{if(e){const r=new Do(t.doc);t.setSelection(r)}return!0},Q8e=()=>({state:t,dispatch:e})=>lse(t,e),J8e=()=>({state:t,dispatch:e})=>hse(t,e),eNe=()=>({state:t,dispatch:e})=>cMe(t,e),tNe=()=>({state:t,dispatch:e})=>dMe(t,e),rNe=()=>({state:t,dispatch:e})=>hMe(t,e);function yD(t,e,r={},n={}){return bC(t,e,{slice:!1,parseOptions:r,errorOnInvalidContent:n.errorOnInvalidContent})}var nNe=(t,{errorOnInvalidContent:e,emitUpdate:r=!0,parseOptions:n={}}={})=>({editor:i,tr:a,dispatch:s,commands:o})=>{const{doc:l}=a;if(n.preserveWhitespace!=="full"){const u=yD(t,i.schema,n,{errorOnInvalidContent:e??i.options.enableContentCheck});return s&&a.replaceWith(0,l.content.size,u).setMeta("preventUpdate",!r),!0}return s&&a.setMeta("preventUpdate",!r),o.insertContentAt({from:0,to:l.content.size},t,{parseOptions:n,errorOnInvalidContent:e??i.options.enableContentCheck})};function aoe(t,e){const r=Nh(e,t.schema),{from:n,to:i,empty:a}=t.selection,s=[];a?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(n,i,l=>{s.push(...l.marks)});const o=s.find(l=>l.type.name===r.name);return o?{...o.attrs}:{}}function soe(t,e){const r=new SF(t);return e.forEach(n=>{n.steps.forEach(i=>{r.step(i)})}),r}function iNe(t){for(let e=0;e<t.edgeCount;e+=1){const{type:r}=t.edge(e);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}function aNe(t,e,r){const n=[];return t.nodesBetween(e.from,e.to,(i,a)=>{r(i)&&n.push({node:i,pos:a})}),n}function ooe(t,e){for(let r=t.depth;r>0;r-=1){const n=t.node(r);if(e(n))return{pos:r>0?t.before(r):0,start:t.start(r),depth:r,node:n}}}function V6(t){return e=>ooe(e.$from,t)}function Ut(t,e,r){return t.config[e]===void 0&&t.parent?Ut(t.parent,e,r):typeof t.config[e]=="function"?t.config[e].bind({...r,parent:t.parent?Ut(t.parent,e,r):null}):t.config[e]}function G6(t){return t.map(e=>{const r={name:e.name,options:e.options,storage:e.storage},n=Ut(e,"addExtensions",r);return n?[e,...G6(n())]:e}).flat(10)}function HF(t,e){const r=Z0.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(r),i.innerHTML}function loe(t){return typeof t=="function"}function un(t,e=void 0,...r){return loe(t)?e?t.bind(e)(...r):t(...r):t}function sNe(t={}){return Object.keys(t).length===0&&t.constructor===Object}function vb(t){const e=t.filter(i=>i.type==="extension"),r=t.filter(i=>i.type==="node"),n=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:r,markExtensions:n}}function coe(t){const e=[],{nodeExtensions:r,markExtensions:n}=vb(t),i=[...r,...n],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=r.filter(u=>u.name!=="text").map(u=>u.name),o=n.map(u=>u.name),l=[...s,...o];return t.forEach(u=>{const h={name:u.name,options:u.options,storage:u.storage,extensions:i},d=Ut(u,"addGlobalAttributes",h);if(!d)return;d().forEach(p=>{let g;Array.isArray(p.types)?g=p.types:p.types==="*"?g=l:p.types==="nodes"?g=s:p.types==="marks"?g=o:g=[],g.forEach(m=>{Object.entries(p.attributes).forEach(([y,v])=>{e.push({type:m,name:y,attribute:{...a,...v}})})})})}),i.forEach(u=>{const h={name:u.name,options:u.options,storage:u.storage},d=Ut(u,"addAttributes",h);if(!d)return;const f=d();Object.entries(f).forEach(([p,g])=>{const m={...a,...g};typeof(m==null?void 0:m.default)=="function"&&(m.default=m.default()),m!=null&&m.isRequired&&(m==null?void 0:m.default)===void 0&&delete m.default,e.push({type:u.name,name:p,attribute:m})})}),e}function oNe(t){const e=[];let r="",n=!1,i=!1,a=0;const s=t.length;for(let o=0;o<s;o+=1){const l=t[o];if(l==="'"&&!i){n=!n,r+=l;continue}if(l==='"'&&!n){i=!i,r+=l;continue}if(!n&&!i){if(l==="("){a+=1,r+=l;continue}if(l===")"&&a>0){a-=1,r+=l;continue}if(l===";"&&a===0){e.push(r),r="";continue}}r+=l}return r&&e.push(r),e}function dX(t){const e=[],r=oNe(t||""),n=r.length;for(let i=0;i<n;i+=1){const a=r[i],s=a.indexOf(":");if(s===-1)continue;const o=a.slice(0,s).trim(),l=a.slice(s+1).trim();o&&l&&e.push([o,l])}return e}function Wn(...t){return t.filter(e=>!!e).reduce((e,r)=>{const n={...e};return Object.entries(r).forEach(([i,a])=>{if(!n[i]){n[i]=a;return}if(i==="class"){const o=a?String(a).split(" "):[],l=n[i]?n[i].split(" "):[],u=o.filter(h=>!l.includes(h));n[i]=[...l,...u].join(" ")}else if(i==="style"){const o=new Map([...dX(n[i]),...dX(a)]);n[i]=Array.from(o.entries()).map(([l,u])=>`${l}: ${u}`).join("; ")}else n[i]=a}),n},{})}function xC(t,e){return e.filter(r=>r.type===t.type.name).filter(r=>r.attribute.rendered).map(r=>r.attribute.renderHTML?r.attribute.renderHTML(t.attrs)||{}:{[r.name]:t.attrs[r.name]}).reduce((r,n)=>Wn(r,n),{})}function lNe(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function fX(t,e){return"style"in t?t:{...t,getAttrs:r=>{const n=t.getAttrs?t.getAttrs(r):t.attrs;if(n===!1)return!1;const i=e.reduce((a,s)=>{const o=s.attribute.parseHTML?s.attribute.parseHTML(r):lNe(r.getAttribute(s.name));return o==null?a:{...a,[s.name]:o}},{});return{...n,...i}}}}function pX(t){return Object.fromEntries(Object.entries(t).filter(([e,r])=>e==="attrs"&&sNe(r)?!1:r!=null))}function gX(t){var e,r;const n={};return!((e=t==null?void 0:t.attribute)!=null&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(n.default=t.attribute.default),((r=t==null?void 0:t.attribute)==null?void 0:r.validate)!==void 0&&(n.validate=t.attribute.validate),[t.name,n]}function uoe(t,e){var r;const n=coe(t),{nodeExtensions:i,markExtensions:a}=vb(t),s=(r=i.find(u=>Ut(u,"topNode")))==null?void 0:r.name,o=Object.fromEntries(i.map(u=>{const h=n.filter(v=>v.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},f=t.reduce((v,T)=>{const b=Ut(T,"extendNodeSchema",d);return{...v,...b?b(u):{}}},{}),p=pX({...f,content:un(Ut(u,"content",d)),marks:un(Ut(u,"marks",d)),group:un(Ut(u,"group",d)),inline:un(Ut(u,"inline",d)),atom:un(Ut(u,"atom",d)),selectable:un(Ut(u,"selectable",d)),draggable:un(Ut(u,"draggable",d)),code:un(Ut(u,"code",d)),whitespace:un(Ut(u,"whitespace",d)),linebreakReplacement:un(Ut(u,"linebreakReplacement",d)),defining:un(Ut(u,"defining",d)),isolating:un(Ut(u,"isolating",d)),attrs:Object.fromEntries(h.map(gX))}),g=un(Ut(u,"parseHTML",d));g&&(p.parseDOM=g.map(v=>fX(v,h)));const m=Ut(u,"renderHTML",d);m&&(p.toDOM=v=>m({node:v,HTMLAttributes:xC(v,h)}));const y=Ut(u,"renderText",d);return y&&(p.toText=y),[u.name,p]})),l=Object.fromEntries(a.map(u=>{const h=n.filter(y=>y.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},f=t.reduce((y,v)=>{const T=Ut(v,"extendMarkSchema",d);return{...y,...T?T(u):{}}},{}),p=pX({...f,inclusive:un(Ut(u,"inclusive",d)),excludes:un(Ut(u,"excludes",d)),group:un(Ut(u,"group",d)),spanning:un(Ut(u,"spanning",d)),code:un(Ut(u,"code",d)),attrs:Object.fromEntries(h.map(gX))}),g=un(Ut(u,"parseHTML",d));g&&(p.parseDOM=g.map(y=>fX(y,h)));const m=Ut(u,"renderHTML",d);return m&&(p.toDOM=y=>m({mark:y,HTMLAttributes:xC(y,h)})),[u.name,p]}));return new Fae({topNode:s,nodes:o,marks:l})}function cNe(t){const e=t.filter((r,n)=>t.indexOf(r)!==n);return Array.from(new Set(e))}function ly(t){return t.sort((r,n)=>{const i=Ut(r,"priority")||100,a=Ut(n,"priority")||100;return i>a?-1:i<a?1:0})}function qF(t){const e=ly(G6(t)),r=cNe(e.map(n=>n.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(n=>`'${n}'`).join(", ")}]. This can lead to issues.`),e}function hoe(t,e){const r=qF(t);return uoe(r,e)}function uNe(t,e){const r=hoe(e),n=$T(t);return sh.fromSchema(r).parse(n).toJSON()}function doe(t,e,r){const{from:n,to:i}=e,{blockSeparator:a=`
`,textSerializers:s={}}=r||{};let o="";return t.nodesBetween(n,i,(l,u,h,d)=>{var f;l.isBlock&&u>n&&(o+=a);const p=s==null?void 0:s[l.type.name];if(p)return h&&(o+=p({node:l,pos:u,parent:h,index:d,range:e})),!1;l.isText&&(o+=(f=l==null?void 0:l.text)==null?void 0:f.slice(Math.max(n,u)-u,i-u))}),o}function hNe(t,e){const r={from:0,to:t.content.size};return doe(t,r,e)}function foe(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,r])=>[e,r.spec.toText]))}function dNe(t,e){const r=ji(e,t.schema),{from:n,to:i}=t.selection,a=[];t.doc.nodesBetween(n,i,o=>{a.push(o)});const s=a.reverse().find(o=>o.type.name===r.name);return s?{...s.attrs}:{}}function poe(t,e){const r=z6(typeof e=="string"?e:e.name,t.schema);return r==="node"?dNe(t,e):r==="mark"?aoe(t,e):{}}function fNe(t,e=JSON.stringify){const r={};return t.filter(n=>{const i=e(n);return Object.prototype.hasOwnProperty.call(r,i)?!1:r[i]=!0})}function pNe(t){const e=fNe(t);return e.length===1?e:e.filter((r,n)=>!e.filter((a,s)=>s!==n).some(a=>r.oldRange.from>=a.oldRange.from&&r.oldRange.to<=a.oldRange.to&&r.newRange.from>=a.newRange.from&&r.newRange.to<=a.newRange.to))}function UF(t){const{mapping:e,steps:r}=t,n=[];return e.maps.forEach((i,a)=>{const s=[];if(i.ranges.length)i.forEach((o,l)=>{s.push({from:o,to:l})});else{const{from:o,to:l}=r[a];if(o===void 0||l===void 0)return;s.push({from:o,to:l})}s.forEach(({from:o,to:l})=>{const u=e.slice(a).map(o,-1),h=e.slice(a).map(l),d=e.invert().map(u,-1),f=e.invert().map(h);n.push({oldRange:{from:d,to:f},newRange:{from:u,to:h}})})}),pNe(n)}function YF(t,e,r){const n=[];return t===e?r.resolve(t).marks().forEach(i=>{const a=r.resolve(t),s=WF(a,i.type);s&&n.push({mark:i,...s})}):r.nodesBetween(t,e,(i,a)=>{!i||(i==null?void 0:i.nodeSize)===void 0||n.push(...i.marks.map(s=>({from:a,to:a+i.nodeSize,mark:s})))}),n}var gNe=(t,e,r,n=20)=>{const i=t.doc.resolve(r);let a=n,s=null;for(;a>0&&s===null;){const o=i.node(a);(o==null?void 0:o.type.name)===e?s=o:a-=1}return[s,a]};function Xx(t,e){return e.nodes[t]||e.marks[t]||null}function D4(t,e,r){return Object.fromEntries(Object.entries(r).filter(([n])=>{const i=t.find(a=>a.type===e&&a.name===n);return i?i.attribute.keepOnSplit:!1}))}var mNe=(t,e=500)=>{let r="";const n=t.parentOffset;return t.parent.nodesBetween(Math.max(0,n-e),n,(i,a,s,o)=>{var l,u;const h=((u=(l=i.type.spec).toText)==null?void 0:u.call(l,{node:i,pos:a,parent:s,index:o}))||i.textContent||"%leaf%";r+=i.isAtom&&!i.isText?h:h.slice(0,Math.max(0,n-a))}),r};function vD(t,e,r={}){const{empty:n,ranges:i}=t.selection,a=e?Nh(e,t.schema):null;if(n)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>a?a.name===d.type.name:!0).find(d=>y5(d.attrs,r,{strict:!1}));let s=0;const o=[];if(i.forEach(({$from:d,$to:f})=>{const p=d.pos,g=f.pos;t.doc.nodesBetween(p,g,(m,y)=>{if(a&&m.inlineContent&&!m.type.allowsMarkType(a))return!1;if(!m.isText&&!m.marks.length)return;const v=Math.max(p,y),T=Math.min(g,y+m.nodeSize),b=T-v;s+=b,o.push(...m.marks.map(w=>({mark:w,from:v,to:T})))})}),s===0)return!1;const l=o.filter(d=>a?a.name===d.mark.type.name:!0).filter(d=>y5(d.mark.attrs,r,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),u=o.filter(d=>a?d.mark.type!==a&&d.mark.type.excludes(a):!0).reduce((d,f)=>d+f.to-f.from,0);return(l>0?l+u:l)>=s}function yNe(t,e,r={}){if(!e)return Zd(t,null,r)||vD(t,null,r);const n=z6(e,t.schema);return n==="node"?Zd(t,e,r):n==="mark"?vD(t,e,r):!1}var vNe=(t,e)=>{const{$from:r,$to:n,$anchor:i}=t.selection;if(e){const a=V6(o=>o.type.name===e)(t.selection);if(!a)return!1;const s=t.doc.resolve(a.pos+1);return i.pos+1===s.end()}return!(n.parentOffset<n.parent.nodeSize-2||r.pos!==n.pos)},bNe=t=>{const{$from:e,$to:r}=t.selection;return!(e.parentOffset>0||e.pos!==r.pos)};function mX(t,e){return Array.isArray(e)?e.some(r=>(typeof r=="string"?r:r.name)===t.name):e}function cM(t,e){const{nodeExtensions:r}=vb(e),n=r.find(s=>s.name===t);if(!n)return!1;const i={name:n.name,options:n.options,storage:n.storage},a=un(Ut(n,"group",i));return typeof a!="string"?!1:a.split(" ").includes("list")}function Wk(t,{checkChildren:e=!0,ignoreWhitespace:r=!1}={}){var n;if(r){if(t.type.name==="hardBreak")return!0;if(t.isText)return!/\S/.test((n=t.text)!=null?n:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(a=>{i!==!1&&(Wk(a,{ignoreWhitespace:r,checkChildren:e})||(i=!1))}),i}return!1}function goe(t){return t instanceof lr}var moe=class yoe{constructor(e){this.position=e}static fromJSON(e){return new yoe(e.position)}toJSON(){return{position:this.position}}};function xNe(t,e){const r=e.mapping.mapResult(t.position);return{position:new moe(r.pos),mapResult:r}}function TNe(t){return new moe(t)}function wNe(t,e,r){var n;const{selection:i}=e;let a=null;if(toe(i)&&(a=i.$cursor),a){const o=(n=t.storedMarks)!=null?n:a.marks();return a.parent.type.allowsMarkType(r)&&(!!r.isInSet(o)||!o.some(u=>u.type.excludes(r)))}const{ranges:s}=i;return s.some(({$from:o,$to:l})=>{let u=o.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(r):!1;return t.doc.nodesBetween(o.pos,l.pos,(h,d,f)=>{if(u)return!1;if(h.isInline){const p=!f||f.type.allowsMarkType(r),g=!!r.isInSet(h.marks)||!h.marks.some(m=>m.type.excludes(r));u=p&&g}return!u}),u})}var CNe=(t,e={})=>({tr:r,state:n,dispatch:i})=>{const{selection:a}=r,{empty:s,ranges:o}=a,l=Nh(t,n.schema);if(i)if(s){const u=aoe(n,l);r.addStoredMark(l.create({...u,...e}))}else o.forEach(u=>{const h=u.$from.pos,d=u.$to.pos;n.doc.nodesBetween(h,d,(f,p)=>{const g=Math.max(p,h),m=Math.min(p+f.nodeSize,d);f.marks.find(v=>v.type===l)?f.marks.forEach(v=>{l===v.type&&r.addMark(g,m,l.create({...v.attrs,...e}))}):r.addMark(g,m,l.create(e))})});return wNe(n,r,l)},kNe=(t,e)=>({tr:r})=>(r.setMeta(t,e),!0),SNe=(t,e={})=>({state:r,dispatch:n,chain:i})=>{const a=ji(t,r.schema);let s;return r.selection.$anchor.sameParent(r.selection.$head)&&(s=r.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:o})=>MY(a,{...s,...e})(r)?!0:o.clearNodes()).command(({state:o})=>MY(a,{...s,...e})(o,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},ENe=t=>({tr:e,dispatch:r})=>{if(r){const{doc:n}=e,i=qp(t,0,n.content.size),a=lr.create(n,i);e.setSelection(a)}return!0},ANe=(t,e)=>({tr:r,state:n,dispatch:i})=>{const{selection:a}=n;let s,o;return typeof e=="number"?(s=e,o=e):e&&"from"in e&&"to"in e?(s=e.from,o=e.to):(s=a.from,o=a.to),i&&r.doc.nodesBetween(s,o,(l,u)=>{l.isText||r.setNodeMarkup(u,void 0,{...l.attrs,dir:t})}),!0},_Ne=t=>({tr:e,dispatch:r})=>{if(r){const{doc:n}=e,{from:i,to:a}=typeof t=="number"?{from:t,to:t}:t,s=rr.atStart(n).from,o=rr.atEnd(n).to,l=qp(i,s,o),u=qp(a,s,o),h=rr.create(n,l,u);e.setSelection(h)}return!0},RNe=t=>({state:e,dispatch:r})=>{const n=ji(t,e.schema);return xMe(n)(e,r)};function yX(t,e){const r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(r){const n=r.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(n)}}var LNe=({keepMarks:t=!0}={})=>({tr:e,state:r,dispatch:n,editor:i})=>{const{selection:a,doc:s}=e,{$from:o,$to:l}=a,u=i.extensionManager.attributes,h=D4(u,o.node().type.name,o.node().attrs);if(a instanceof lr&&a.node.isBlock)return!o.parentOffset||!oh(s,o.pos)?!1:(n&&(t&&yX(r,i.extensionManager.splittableMarks),e.split(o.pos).scrollIntoView()),!0);if(!o.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,f=o.depth===0?void 0:iNe(o.node(-1).contentMatchAt(o.indexAfter(-1)));let p=d&&f?[{type:f,attrs:h}]:void 0,g=oh(e.doc,e.mapping.map(o.pos),1,p);if(!p&&!g&&oh(e.doc,e.mapping.map(o.pos),1,f?[{type:f}]:void 0)&&(g=!0,p=f?[{type:f,attrs:h}]:void 0),n){if(g&&(a instanceof rr&&e.deleteSelection(),e.split(e.mapping.map(o.pos),1,p),f&&!d&&!o.parentOffset&&o.parent.type!==f)){const m=e.mapping.map(o.before()),y=e.doc.resolve(m);o.node(-1).canReplaceWith(y.index(),y.index()+1,f)&&e.setNodeMarkup(e.mapping.map(o.before()),f)}t&&yX(r,i.extensionManager.splittableMarks),e.scrollIntoView()}return g},MNe=(t,e={})=>({tr:r,state:n,dispatch:i,editor:a})=>{var s;const o=ji(t,n.schema),{$from:l,$to:u}=n.selection,h=n.selection.node;if(h&&h.isBlock||l.depth<2||!l.sameParent(u))return!1;const d=l.node(-1);if(d.type!==o)return!1;const f=a.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==o||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let v=gt.empty;const T=l.index(-1)?1:l.index(-2)?2:3;for(let E=l.depth-T;E>=l.depth-3;E-=1)v=gt.from(l.node(E).copy(v));const b=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,w={...D4(f,l.node().type.name,l.node().attrs),...e},C=((s=o.contentMatch.defaultType)==null?void 0:s.createAndFill(w))||void 0;v=v.append(gt.from(o.createAndFill(null,C)||void 0));const S=l.before(l.depth-(T-1));r.replace(S,l.after(-b),new $t(v,4-T,0));let k=-1;r.doc.nodesBetween(S,r.doc.content.size,(E,_)=>{if(k>-1)return!1;E.isTextblock&&E.content.size===0&&(k=_+1)}),k>-1&&r.setSelection(rr.near(r.doc.resolve(k))),r.scrollIntoView()}return!0}const p=u.pos===l.end()?d.contentMatchAt(0).defaultType:null,g={...D4(f,d.type.name,d.attrs),...e},m={...D4(f,l.node().type.name,l.node().attrs),...e};r.delete(l.pos,u.pos);const y=p?[{type:o,attrs:g},{type:p,attrs:m}]:[{type:o,attrs:g}];if(!oh(r.doc,l.pos,2))return!1;if(i){const{selection:v,storedMarks:T}=n,{splittableMarks:b}=a.extensionManager,w=T||v.$to.parentOffset&&v.$from.marks();if(r.split(l.pos,2,y).scrollIntoView(),!w||!i)return!0;const C=w.filter(S=>b.includes(S.type.name));r.ensureMarks(C)}return!0};function vX(t){return!t||t==="1"?null:t}function voe(t,e){return vX(t)===vX(e)}var uM=(t,e)=>{const r=V6(s=>s.type===e)(t.selection);if(!r)return!0;const n=t.doc.resolve(Math.max(0,r.pos-1)).before(r.depth);if(n===void 0)return!0;const i=t.doc.nodeAt(n);return!(r.node.type===(i==null?void 0:i.type)&&xf(t.doc,r.pos))||!voe(r.node.attrs.type,i==null?void 0:i.attrs.type)||t.join(r.pos),!0},hM=(t,e)=>{const r=V6(s=>s.type===e)(t.selection);if(!r)return!0;const n=t.doc.resolve(r.start).after(r.depth);if(n===void 0)return!0;const i=t.doc.nodeAt(n);return!(r.node.type===(i==null?void 0:i.type)&&xf(t.doc,n))||!voe(r.node.attrs.type,i==null?void 0:i.attrs.type)||t.join(n),!0};function INe(t){const e=t.doc,r=e.firstChild;if(!r)return null;const n=e.resolve(1),i=e.resolve(r.nodeSize-1);return rr.between(n,i)}var NNe=(t,e,r,n={})=>({editor:i,tr:a,state:s,dispatch:o,chain:l,commands:u,can:h})=>{const{extensions:d,splittableMarks:f}=i.extensionManager,p=ji(t,s.schema),g=ji(e,s.schema),{selection:m,storedMarks:y}=s,{$from:v,$to:T}=m,b=v.blockRange(T),w=y||m.$to.parentOffset&&m.$from.marks();if(!b)return!1;const C=V6(D=>cM(D.type.name,d))(m),S=m.from===0&&m.to===s.doc.content.size,k=s.doc.content.content,E=k.length===1?k[0]:null,_=S&&E&&cM(E.type.name,d)?{node:E,pos:0}:null,M=C??_,L=!!C&&b.depth>=1&&b.depth-C.depth<=1,P=!!_;if((L||P)&&M){if(M.node.type===p)return S&&P?l().command(({tr:D,dispatch:R})=>{const I=INe(D);return I?(D.setSelection(I),R&&R(D),!0):!1}).liftListItem(g).run():u.liftListItem(g);if(cM(M.node.type.name,d)&&p.validContent(M.node.content))return l().command(()=>(a.setNodeMarkup(M.pos,p),!0)).command(()=>uM(a,p)).command(()=>hM(a,p)).run()}return!r||!w||!o?l().command(()=>h().wrapInList(p,n)?!0:u.clearNodes()).wrapInList(p,n).command(()=>uM(a,p)).command(()=>hM(a,p)).run():l().command(()=>{const D=h().wrapInList(p,n),R=w.filter(I=>f.includes(I.type.name));return a.ensureMarks(R),D?!0:u.clearNodes()}).wrapInList(p,n).command(()=>uM(a,p)).command(()=>hM(a,p)).run()},DNe=(t,e={},r={})=>({state:n,commands:i})=>{const{extendEmptyMarkRange:a=!1}=r,s=Nh(t,n.schema);return vD(n,s,e)?i.unsetMark(s,{extendEmptyMarkRange:a}):i.setMark(s,e)},ONe=(t,e,r={})=>({state:n,commands:i})=>{const a=ji(t,n.schema),s=ji(e,n.schema),o=Zd(n,a,r);let l;return n.selection.$anchor.sameParent(n.selection.$head)&&(l=n.selection.$anchor.parent.attrs),o?i.setNode(s,l):i.setNode(a,{...l,...r})},$Ne=(t,e={})=>({state:r,commands:n})=>{const i=ji(t,r.schema);return Zd(r,i,e)?n.lift(i):n.wrapIn(i,e)},PNe=()=>({state:t,dispatch:e})=>{const r=t.plugins;for(let n=0;n<r.length;n+=1){const i=r[n];let a;if(i.spec.isInputRules&&(a=i.getState(t))){if(e){const s=t.tr,o=a.transform;for(let l=o.steps.length-1;l>=0;l-=1)s.step(o.steps[l].invert(o.docs[l]));if(a.text){const l=s.doc.resolve(a.from).marks();s.replaceWith(a.from,a.to,t.schema.text(a.text,l))}else s.delete(a.from,a.to)}return!0}}return!1},BNe=(t={})=>({tr:e,dispatch:r,editor:n})=>{const{ignoreClearable:i=!1}=t,{selection:a}=e,{empty:s,ranges:o}=a;if(s)return!0;const{nonClearableMarks:l}=n.extensionManager;if(r){const u=Object.values(n.schema.marks).filter(h=>i||!l.includes(h.name));o.forEach(h=>{for(const d of u)e.removeMark(h.$from.pos,h.$to.pos,d)})}return!0},FNe=(t,e={})=>({tr:r,state:n,dispatch:i})=>{var a;const{extendEmptyMarkRange:s=!1}=e,{selection:o}=r,l=Nh(t,n.schema),{$from:u,empty:h,ranges:d}=o;if(!i)return!0;if(h&&s){let{from:f,to:p}=o;const g=(a=u.marks().find(y=>y.type===l))==null?void 0:a.attrs,m=WF(u,l,g);m&&(f=m.from,p=m.to),r.removeMark(f,p,l)}else d.forEach(f=>{r.removeMark(f.$from.pos,f.$to.pos,l)});return r.removeStoredMark(l),!0},zNe=t=>({tr:e,state:r,dispatch:n})=>{const{selection:i}=r;let a,s;return typeof t=="number"?(a=t,s=t):t&&"from"in t&&"to"in t?(a=t.from,s=t.to):(a=i.from,s=i.to),n&&e.doc.nodesBetween(a,s,(o,l)=>{if(o.isText)return;const u={...o.attrs};delete u.dir,e.setNodeMarkup(l,void 0,u)}),!0},VNe=(t,e={})=>({tr:r,state:n,dispatch:i})=>{let a=null,s=null;const o=z6(typeof t=="string"?t:t.name,n.schema);if(!o)return!1;o==="node"&&(a=ji(t,n.schema)),o==="mark"&&(s=Nh(t,n.schema));let l=!1;return r.selection.ranges.forEach(u=>{const h=u.$from.pos,d=u.$to.pos;let f,p,g,m;r.selection.empty?n.doc.nodesBetween(h,d,(y,v)=>{a&&a===y.type&&(l=!0,g=Math.max(v,h),m=Math.min(v+y.nodeSize,d),f=v,p=y)}):n.doc.nodesBetween(h,d,(y,v)=>{v<h&&a&&a===y.type&&(l=!0,g=Math.max(v,h),m=Math.min(v+y.nodeSize,d),f=v,p=y),v>=h&&v<=d&&(a&&a===y.type&&(l=!0,i&&r.setNodeMarkup(v,void 0,{...y.attrs,...e})),s&&y.marks.length&&y.marks.forEach(T=>{if(s===T.type&&(l=!0,i)){const b=Math.max(v,h),w=Math.min(v+y.nodeSize,d);r.addMark(b,w,s.create({...T.attrs,...e}))}}))}),p&&(f!==void 0&&i&&r.setNodeMarkup(f,void 0,{...p.attrs,...e}),s&&p.marks.length&&p.marks.forEach(y=>{s===y.type&&i&&r.addMark(g,m,s.create({...y.attrs,...e}))}))}),l},GNe=(t,e={})=>({state:r,dispatch:n})=>{const i=ji(t,r.schema);return fMe(i,e)(r,n)},WNe=(t,e={})=>({state:r,dispatch:n})=>{const i=ji(t,r.schema);return pMe(i,e)(r,n)},HNe=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const r=this.callbacks[t];return r&&r.forEach(n=>n.apply(this,e)),this}off(t,e){const r=this.callbacks[t];return r&&(e?this.callbacks[t]=r.filter(n=>n!==e):delete this.callbacks[t]),this}once(t,e){const r=(...n)=>{this.off(t,r),e.apply(this,n)};return this.on(t,r)}removeAllListeners(){this.callbacks={}}};function bb(t,e){if(t===e)return!0;if(!t||!e)return!1;const r=Object.keys(t),n=Object.keys(e);return r.length!==n.length?!1:r.every(i=>Object.prototype.hasOwnProperty.call(e,i)&&Object.is(t[i],e[i]))}function qNe(t,e){const{selection:r}=t,{$from:n}=r;if(r instanceof lr){const a=n.index();return n.parent.canReplaceWith(a,a+1,e)}let i=n.depth;for(;i>=0;){const a=n.index(i);if(n.node(i).contentMatchAt(a).matchType(e))return!0;i-=1}return!1}function UNe(t,e,r){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}function bX(t){return t.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&amp;/g,"&")}function YNe(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function XNe(t){return typeof t=="number"}function jNe(t){return Object.prototype.toString.call(t).slice(8,-1)}function tE(t){return jNe(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}var KNe={};VF(KNe,{createAtomBlockMarkdownSpec:()=>ZNe,createBlockMarkdownSpec:()=>QNe,createInlineMarkdownSpec:()=>tDe,parseAttributes:()=>XF,parseIndentedBlocks:()=>bD,renderNestedMarkdownContent:()=>KF,serializeAttributes:()=>jF});function XF(t){if(!(t!=null&&t.trim()))return{};const e={},r=[],n=t.replace(/["']([^"']*)["']/g,u=>(r.push(u),`__QUOTED_${r.length-1}__`)),i=n.match(/(?:^|\s)\.([\w-]+)/g);if(i){const u=i.map(h=>h.trim().slice(1));e.class=u.join(" ")}const a=n.match(/(?:^|\s)#([\w-]+)/);a&&(e.id=a[1]);const s=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(n.matchAll(s)).forEach(([,u,h])=>{var d;const f=parseInt(((d=h.match(/__QUOTED_(\d+)__/))==null?void 0:d[1])||"0",10),p=r[f];p&&(e[u]=p.slice(1,-1))});const l=n.replace(/(?:^|\s)\.([\w-]+)/g,"").replace(/(?:^|\s)#([\w-]+)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return l&&l.split(/\s+/).filter(Boolean).forEach(h=>{h.match(/^[a-zA-Z][\w-]*$/)&&(e[h]=!0)}),e}function jF(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(n=>e.push(`.${n}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([r,n])=>{r==="class"||r==="id"||(n===!0?e.push(r):n!==!1&&n!=null&&e.push(`${r}="${String(n)}"`))}),e.join(" ")}function ZNe(t){const{nodeName:e,name:r,parseAttributes:n=XF,serializeAttributes:i=jF,defaultAttributes:a={},requiredAttributes:s=[],allowedAttributes:o}=t,l=r||e,u=h=>{if(!o)return h;const d={};return o.forEach(f=>{f in h&&(d[f]=h[f])}),d};return{parseMarkdown:(h,d)=>{const f={...a,...h.attributes};return d.createNode(e,f,[])},markdownTokenizer:{name:e,level:"block",start(h){var d;const f=new RegExp(`^:::${l}(?:\\s|$)`,"m"),p=(d=h.match(f))==null?void 0:d.index;return p!==void 0?p:-1},tokenize(h,d,f){const p=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),g=h.match(p);if(!g)return;const m=g[1]||"",y=n(m);if(!s.find(T=>!(T in y)))return{type:e,raw:g[0],attributes:y}}},renderMarkdown:h=>{const d=u(h.attrs||{}),f=i(d),p=f?` {${f}}`:"";return`:::${l}${p} :::`}}}function QNe(t){const{nodeName:e,name:r,getContent:n,parseAttributes:i=XF,serializeAttributes:a=jF,defaultAttributes:s={},content:o="block",allowedAttributes:l}=t,u=r||e,h=d=>{if(!l)return d;const f={};return l.forEach(p=>{p in d&&(f[p]=d[p])}),f};return{parseMarkdown:(d,f)=>{let p;if(n){const m=n(d);p=typeof m=="string"?[{type:"text",text:m}]:m}else o==="block"?p=f.parseChildren(d.tokens||[]):p=f.parseInline(d.tokens||[]);const g={...s,...d.attributes};return f.createNode(e,g,p)},markdownTokenizer:{name:e,level:"block",start(d){var f;const p=new RegExp(`^:::${u}`,"m"),g=(f=d.match(p))==null?void 0:f.index;return g!==void 0?g:-1},tokenize(d,f,p){var g;const m=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),y=d.match(m);if(!y)return;const[v,T=""]=y,b=i(T);let w=1;const C=v.length;let S="";const k=/^:::([\w-]*)(\s.*)?/gm,E=d.slice(C);for(k.lastIndex=0;;){const _=k.exec(E);if(_===null)break;const M=_.index,L=_[1];if(!((g=_[2])!=null&&g.endsWith(":::"))){if(L)w+=1;else if(w-=1,w===0){const P=E.slice(0,M);S=P.trim();const D=d.slice(0,C+M+_[0].length);let R=[];if(S)if(o==="block")for(R=p.blockTokens(P),R.forEach(I=>{I.text&&(!I.tokens||I.tokens.length===0)&&(I.tokens=p.inlineTokens(I.text))});R.length>0;){const I=R[R.length-1];if(I.type==="paragraph"&&(!I.text||I.text.trim()===""))R.pop();else break}else R=p.inlineTokens(S);return{type:e,raw:D,attributes:b,content:S,tokens:R}}}}}},renderMarkdown:(d,f)=>{const p=h(d.attrs||{}),g=a(p),m=g?` {${g}}`:"",y=f.renderChildren(d.content||[],`
`);return`:::${u}${m}
${y}
:::`}}}function JNe(t){if(!t.trim())return{};const e={},r=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let n=r.exec(t);for(;n!==null;){const[,i,a,s]=n;e[i]=a||s,n=r.exec(t)}return e}function eDe(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,r])=>`${e}="${r}"`).join(" ")}function tDe(t){const{nodeName:e,name:r,getContent:n,parseAttributes:i=JNe,serializeAttributes:a=eDe,defaultAttributes:s={},selfClosing:o=!1,allowedAttributes:l}=t,u=r||e,h=f=>{if(!l)return f;const p={};return l.forEach(g=>{const m=typeof g=="string"?g:g.name,y=typeof g=="string"?void 0:g.skipIfDefault;if(m in f){const v=f[m];if(y!==void 0&&v===y)return;p[m]=v}}),p},d=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(f,p)=>{const g={...s,...f.attributes};if(o)return p.createNode(e,g);const m=n?n(f):f.content||"";return m?p.createNode(e,g,[p.createTextNode(m)]):p.createNode(e,g,[])},markdownTokenizer:{name:e,level:"inline",start(f){const p=o?new RegExp(`\\[${d}\\s*[^\\]]*\\]`):new RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),g=f.match(p),m=g==null?void 0:g.index;return m!==void 0?m:-1},tokenize(f,p,g){const m=o?new RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),y=f.match(m);if(!y)return;let v="",T="";if(o){const[,w]=y;T=w}else{const[,w,C]=y;T=w,v=C||""}const b=i(T.trim());return{type:e,raw:y[0],content:v.trim(),attributes:b}}},renderMarkdown:f=>{let p="";n?p=n(f):f.content&&f.content.length>0&&(p=f.content.filter(v=>v.type==="text").map(v=>v.text).join(""));const g=h(f.attrs||{}),m=a(g),y=m?` ${m}`:"";return o?`[${u}${y}]`:`[${u}${y}]${p}[/${u}]`}}}function bD(t,e,r){var n,i,a,s;const o=t.split(`
`),l=[];let u="",h=0;const d=e.baseIndentSize||2;for(;h<o.length;){const f=o[h],p=f.match(e.itemPattern);if(!p){if(l.length>0)break;if(f.trim()===""){h+=1,u=`${u}${f}
`;continue}else return}const g=e.extractItemData(p),{indentLevel:m,mainContent:y}=g;u=`${u}${f}
`;const v=[y];for(h+=1;h<o.length;){const C=o[h];if(C.trim()===""){const k=o.slice(h+1).findIndex(M=>M.trim()!=="");if(k===-1)break;if((((i=(n=o[h+1+k].match(/^(\s*)/))==null?void 0:n[1])==null?void 0:i.length)||0)>m){v.push(C),u=`${u}${C}
`,h+=1;continue}else break}if((((s=(a=C.match(/^(\s*)/))==null?void 0:a[1])==null?void 0:s.length)||0)>m)v.push(C),u=`${u}${C}
`,h+=1;else break}let T;const b=v.slice(1);if(b.length>0){const C=b.map(S=>S.slice(m+d)).join(`
`);C.trim()&&(e.customNestedParser?T=e.customNestedParser(C):T=r.blockTokens(C))}const w=e.createToken(g,T);l.push(w)}if(l.length!==0)return{items:l,raw:u}}function KF(t,e,r,n){if(!t||!Array.isArray(t.content))return"";const i=typeof r=="function"?r(n):r,[a,...s]=t.content,o=e.renderChildren([a]);let l=`${i}${o}`;return s&&s.length>0&&s.forEach((u,h)=>{var d,f;const p=(f=(d=e.renderChild)==null?void 0:d.call(e,u,h+1))!=null?f:e.renderChildren([u]);if(p!=null){const g=p.split(`
`).map(m=>m?e.indent(m):e.indent("")).join(`
`);l+=u.type==="paragraph"?`
${g}`:`
${g}`}}),l}function xX(t){return typeof t.type=="string"?t.type:t.type.name}function rDe(t,e){if(t.length!==e.length)return!1;const r=Array.from({length:e.length},()=>!1);return t.every(n=>{const i=xX(n),a=e.findIndex((s,o)=>!r[o]&&i===xX(s)&&bb(n.attrs,s.attrs));return a===-1?!1:(r[a]=!0,!0)})}function boe(t,e){const r={...t};return tE(t)&&tE(e)&&Object.keys(e).forEach(n=>{tE(e[n])&&tE(t[n])?r[n]=boe(t[n],e[n]):r[n]=e[n]}),r}function nDe(t,e,r={}){const{state:n}=e,{doc:i,tr:a}=n,s=t;i.descendants((o,l)=>{const u=a.mapping.map(l),h=a.mapping.map(l)+o.nodeSize;let d=null;if(o.marks.forEach(p=>{if(p!==s)return!1;d=p}),!d)return;let f=!1;if(Object.keys(r).forEach(p=>{r[p]!==d.attrs[p]&&(f=!0)}),f){const p=t.type.create({...t.attrs,...r});a.removeMark(u,h,t.type),a.addMark(u,h,p)}}),a.docChanged&&e.view.dispatch(a)}var Hk=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},iDe=(t,e)=>{if(GF(e))return e.exec(t);const r=e(t);if(!r)return null;const n=[r.text];return n.index=r.index,n.input=t,n.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(r.replaceWith)),n};function rE(t){var e;const{editor:r,from:n,to:i,text:a,rules:s,plugin:o}=t,{view:l}=r;if(l.composing)return!1;const u=l.state.doc.resolve(n);if(u.parent.type.spec.code||(e=u.nodeBefore||u.nodeAfter)!=null&&e.marks.find(f=>f.type.spec.code))return!1;let h=!1;const d=mNe(u)+a;return s.forEach(f=>{if(h)return;const p=iDe(d,f.find);if(!p)return;const g=l.state.tr,m=B6({state:l.state,transaction:g}),y={from:n-(p[0].length-a.length),to:i},{commands:v,chain:T,can:b}=new F6({editor:r,state:m});f.handler({state:m,range:y,match:p,commands:v,chain:T,can:b})===null||!g.steps.length||(f.undoable&&g.setMeta(o,{transform:g,from:n,to:i,text:a}),l.dispatch(g),h=!0)}),h}function aDe(t){const{editor:e,rules:r}=t,n=new Un({state:{init(){return null},apply(i,a,s){const o=i.getMeta(n);if(o)return o;const l=i.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:h}=l;typeof h=="string"?h=h:h=HF(gt.from(h),s.schema);const{from:d}=l,f=d+h.length;rE({editor:e,from:d,to:f,text:h,rules:r,plugin:n})}),i.selectionSet||i.docChanged?null:a}},props:{handleTextInput(i,a,s,o){return rE({editor:e,from:a,to:s,text:o,rules:r,plugin:n})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:a}=i.state.selection;a&&rE({editor:e,from:a.pos,to:a.pos,text:"",rules:r,plugin:n})}),!1)},handleKeyDown(i,a){if(a.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?rE({editor:e,from:s.pos,to:s.pos,text:`
`,rules:r,plugin:n}):!1}},isInputRules:!0});return n}var ZF=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...un(Ut(this,"addOptions",{name:this.name}))}}get storage(){return{...un(Ut(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>boe(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},Q0=class xoe extends ZF{constructor(){super(...arguments),this.type="mark"}static create(e={}){const r=typeof e=="function"?e():e;return new xoe(r)}static handleExit({editor:e,mark:r}){const{tr:n}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(u=>(u==null?void 0:u.type.name)===r.name))return!1;const l=s.find(u=>(u==null?void 0:u.type.name)===r.name);return l&&n.removeStoredMark(l),n.insertText(" ",i.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const r=typeof e=="function"?e():e;return super.extend(r)}},Toe=class{constructor(t){this.find=t.find,this.handler=t.handler}},sDe=(t,e,r)=>{if(GF(e))return[...t.matchAll(e)];const n=e(t,r);return n?n.map(i=>{const a=[i.text];return a.index=i.index,a.input=t,a.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),a.push(i.replaceWith)),a}):[]};function oDe(t){const{editor:e,state:r,from:n,to:i,rule:a,pasteEvent:s,dropEvent:o}=t,{commands:l,chain:u,can:h}=new F6({editor:e,state:r}),d=[];return r.doc.nodesBetween(n,i,(p,g)=>{var m,y,v,T,b;if((y=(m=p.type)==null?void 0:m.spec)!=null&&y.code||!(p.isText||p.isTextblock||p.isInline))return;const w=(b=(T=(v=p.content)==null?void 0:v.size)!=null?T:p.nodeSize)!=null?b:0,C=Math.max(n,g),S=Math.min(i,g+w);if(C>=S)return;const k=p.isText?p.text||"":p.textBetween(C-g,S-g,void 0,"");sDe(k,a.find,s).forEach(_=>{if(_.index===void 0)return;const M=C+_.index+1,L=M+_[0].length,P={from:r.tr.mapping.map(M),to:r.tr.mapping.map(L)},D=a.handler({state:r,range:P,match:_,commands:l,chain:u,can:h,pasteEvent:s,dropEvent:o});d.push(D)})}),d.every(p=>p!==null)}var nE=null,lDe=t=>{var e;const r=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=r.clipboardData)==null||e.setData("text/html",t),r};function cDe(t){const{editor:e,rules:r}=t;let n=null,i=!1,a=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,o;try{o=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{o=null}const l=({state:h,from:d,to:f,rule:p,pasteEvt:g})=>{const m=h.tr,y=B6({state:h,transaction:m});if(!(!oDe({editor:e,state:y,from:Math.max(d-1,0),to:f.b-1,rule:p,pasteEvent:g,dropEvent:o})||!m.steps.length)){try{o=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{o=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return r.map(h=>new Un({view(d){const f=g=>{var m;n=(m=d.dom.parentElement)!=null&&m.contains(g.target)?d.dom.parentElement:null,n&&(nE=e)},p=()=>{nE&&(nE=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:(d,f)=>{if(a=n===d.dom.parentElement,o=f,!a){const p=nE;p!=null&&p.isEditable&&setTimeout(()=>{const g=p.state.selection;g&&p.commands.deleteRange({from:g.from,to:g.to})},10)}return!1},paste:(d,f)=>{var p;const g=(p=f.clipboardData)==null?void 0:p.getData("text/html");return s=f,i=!!(g!=null&&g.includes("data-pm-slice")),!1}}},appendTransaction:(d,f,p)=>{const g=d[0],m=g.getMeta("uiEvent")==="paste"&&!i,y=g.getMeta("uiEvent")==="drop"&&!a,v=g.getMeta("applyPasteRules"),T=!!v;if(!m&&!y&&!T)return;if(T){let{text:C}=v;typeof C=="string"?C=C:C=HF(gt.from(C),p.schema);const{from:S}=v,k=S+C.length,E=lDe(C);return l({rule:h,state:p,from:S,to:{b:k},pasteEvt:E})}const b=f.doc.content.findDiffStart(p.doc.content),w=f.doc.content.findDiffEnd(p.doc.content);if(!(!XNe(b)||!w||b===w.b))return l({rule:h,state:p,from:b,to:w,pasteEvt:s})}}))}var W6=class{constructor(t,e){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=qF(t),this.schema=uoe(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Xx(e.name,this.schema)},n=Ut(e,"addCommands",r);return n?{...t,...n()}:t},{})}get plugins(){const{editor:t}=this;return ly([...this.extensions].reverse()).flatMap(n=>{const i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Xx(n.name,this.schema)},a=[],s=Ut(n,"addKeyboardShortcuts",i);let o={};if(n.type==="mark"&&Ut(n,"exitable",i)&&(o.ArrowRight=()=>Q0.handleExit({editor:t,mark:n})),s){const f=Object.fromEntries(Object.entries(s()).map(([p,g])=>[p,()=>g({editor:t})]));o={...o,...f}}const l=u8e(o);a.push(l);const u=Ut(n,"addInputRules",i);if(mX(n,t.options.enableInputRules)&&u){const f=u();if(f&&f.length){const p=aDe({editor:t,rules:f}),g=Array.isArray(p)?p:[p];a.push(...g)}}const h=Ut(n,"addPasteRules",i);if(mX(n,t.options.enablePasteRules)&&h){const f=h();if(f&&f.length){const p=cDe({editor:t,rules:f});a.push(...p)}}const d=Ut(n,"addProseMirrorPlugins",i);if(d){const f=d();a.push(...f)}return a})}get attributes(){return coe(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=vb(this.extensions);return Object.fromEntries(e.filter(r=>!!Ut(r,"addNodeView")).map(r=>{const n=this.attributes.filter(l=>l.type===r.name),i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:ji(r.name,this.schema)},a=Ut(r,"addNodeView",i);if(!a)return[];const s=a();if(!s)return[];const o=(l,u,h,d,f)=>{const p=xC(l,n);return s({node:l,view:u,getPos:h,decorations:d,innerDecorations:f,editor:t,extension:r,HTMLAttributes:p})};return[r.name,o]}))}dispatchTransaction(t){const{editor:e}=this;return ly([...this.extensions].reverse()).reduceRight((n,i)=>{const a={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:e,type:Xx(i.name,this.schema)},s=Ut(i,"dispatchTransaction",a);return s?o=>{s.call(a,{transaction:o,next:n})}:n},t)}transformPastedHTML(t){const{editor:e}=this;return ly([...this.extensions]).reduce((n,i)=>{const a={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:e,type:Xx(i.name,this.schema)},s=Ut(i,"transformPastedHTML",a);return s?(o,l)=>{const u=n(o,l);return s.call(a,u)}:n},t||(n=>n))}get markViews(){const{editor:t}=this,{markExtensions:e}=vb(this.extensions);return Object.fromEntries(e.filter(r=>!!Ut(r,"addMarkView")).map(r=>{const n=this.attributes.filter(o=>o.type===r.name),i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:Nh(r.name,this.schema)},a=Ut(r,"addMarkView",i);if(!a)return[];const s=(o,l,u)=>{const h=xC(o,n);return a()({mark:o,view:l,inline:u,editor:t,extension:r,HTMLAttributes:h,updateAttributes:d=>{nDe(o,t,d)}})};return[r.name,s]}))}destroy(){this.extensions.forEach(t=>{let e=t;for(;e.parent;){const r=e.parent;r.child===e&&(r.child=null),e=r}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var r,n;const i={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Xx(e.name,this.schema)};e.type==="mark"&&(((r=un(Ut(e,"keepOnSplit",i)))==null||r)&&this.splittableMarks.push(e.name),(n=un(Ut(e,"clearable",i)))==null||n||this.nonClearableMarks.push(e.name));const a=Ut(e,"onBeforeCreate",i),s=Ut(e,"onCreate",i),o=Ut(e,"onUpdate",i),l=Ut(e,"onSelectionUpdate",i),u=Ut(e,"onTransaction",i),h=Ut(e,"onFocus",i),d=Ut(e,"onBlur",i),f=Ut(e,"onDestroy",i);a&&this.editor.on("beforeCreate",a),s&&this.editor.on("create",s),o&&this.editor.on("update",o),l&&this.editor.on("selectionUpdate",l),u&&this.editor.on("transaction",u),h&&this.editor.on("focus",h),d&&this.editor.on("blur",d),f&&this.editor.on("destroy",f)})}};W6.resolve=qF;W6.sort=ly;W6.flatten=G6;var uDe={};VF(uDe,{ClipboardTextSerializer:()=>Coe,Commands:()=>koe,Delete:()=>Soe,Drop:()=>Eoe,Editable:()=>Aoe,FocusEvents:()=>Roe,Keymap:()=>Loe,Paste:()=>Moe,Tabindex:()=>Ioe,TextDirection:()=>Noe,focusEventsPluginKey:()=>_oe});var ci=class woe extends ZF{constructor(){super(...arguments),this.type="extension"}static create(e={}){const r=typeof e=="function"?e():e;return new woe(r)}configure(e){return super.configure(e)}extend(e){const r=typeof e=="function"?e():e;return super.extend(r)}},Coe=ci.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Un({key:new Ei("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:r}=t,{doc:n,selection:i}=e,a=foe(r),{blockSeparator:s}=this.options,o={...s!==void 0?{blockSeparator:s}:{},textSerializers:a};return[...i.ranges].sort((u,h)=>u.$from.pos-h.$from.pos).map(({$from:u,$to:h})=>doe(n,{from:u.pos,to:h.pos},o)).join(s??`
`)}}})]}}),koe=ci.create({name:"commands",addCommands(){return{...Ml}}}),Soe=ci.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var r,n,i;const a=()=>{var s,o,l,u;if((u=(l=(o=(s=this.editor.options.coreExtensionOptions)==null?void 0:s.delete)==null?void 0:o.filterTransaction)==null?void 0:l.call(o,t))!=null?u:t.getMeta("y-sync$"))return;const h=soe(t.before,[t,...e]);UF(h).forEach(p=>{h.mapping.mapResult(p.oldRange.from).deletedAfter&&h.mapping.mapResult(p.oldRange.to).deletedBefore&&h.before.nodesBetween(p.oldRange.from,p.oldRange.to,(g,m)=>{const y=m+g.nodeSize-2,v=p.oldRange.from<=m&&y<=p.oldRange.to;this.editor.emit("delete",{type:"node",node:g,from:m,to:y,newFrom:h.mapping.map(m),newTo:h.mapping.map(y),deletedRange:p.oldRange,newRange:p.newRange,partial:!v,editor:this.editor,transaction:t,combinedTransform:h})})});const f=h.mapping;h.steps.forEach((p,g)=>{var m,y;if(p instanceof ql){const v=f.slice(g).map(p.from,-1),T=f.slice(g).map(p.to),b=f.invert().map(v,-1),w=f.invert().map(T),C=v>0?(m=h.doc.nodeAt(v-1))==null?void 0:m.marks.some(k=>k.eq(p.mark)):!1,S=(y=h.doc.nodeAt(T))==null?void 0:y.marks.some(k=>k.eq(p.mark));this.editor.emit("delete",{type:"mark",mark:p.mark,from:p.from,to:p.to,deletedRange:{from:b,to:w},newRange:{from:v,to:T},partial:!!(S||C),editor:this.editor,transaction:t,combinedTransform:h})}})};(i=(n=(r=this.editor.options.coreExtensionOptions)==null?void 0:r.delete)==null?void 0:n.async)==null||i?setTimeout(a,0):a()}}),Eoe=ci.create({name:"drop",addProseMirrorPlugins(){return[new Un({key:new Ei("tiptapDrop"),props:{handleDrop:(t,e,r,n)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:r,moved:n})}}})]}}),Aoe=ci.create({name:"editable",addProseMirrorPlugins(){return[new Un({key:new Ei("editable"),props:{editable:()=>this.editor.options.editable}})]}}),_oe=new Ei("focusEvents"),Roe=ci.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Un({key:_oe,props:{handleDOMEvents:{focus:(e,r)=>{t.isFocused=!0;const n=t.state.tr.setMeta("focus",{event:r}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,r)=>{t.isFocused=!1;const n=t.state.tr.setMeta("blur",{event:r}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}}),Loe=ci.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:o})=>{const{selection:l,doc:u}=o,{empty:h,$anchor:d}=l,{pos:f,parent:p}=d,g=d.parent.isTextblock&&f>0?o.doc.resolve(f-1):d,m=g.parent.type.spec.isolating,y=d.pos-d.parentOffset,v=m&&g.parent.childCount===1?y===d.pos:Cr.atStart(u).from===f;return!h||!p.type.isTextblock||p.textContent.length||!v||v&&d.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},a={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return v5()||ioe()?a:i},addProseMirrorPlugins(){return[new Un({key:new Ei("clearDocument"),appendTransaction:(t,e,r)=>{if(t.some(m=>m.getMeta("composition")))return;const n=t.some(m=>m.docChanged)&&!e.doc.eq(r.doc),i=t.some(m=>m.getMeta("preventClearDocument"));if(!n||i)return;const{empty:a,from:s,to:o}=e.selection,l=Cr.atStart(e.doc).from,u=Cr.atEnd(e.doc).to;if(a||!(s===l&&o===u)||!Wk(r.doc))return;const f=r.tr,p=B6({state:r,transaction:f}),{commands:g}=new F6({editor:this.editor,state:p});if(g.clearNodes(),!!f.steps.length)return f}})]}}),Moe=ci.create({name:"paste",addProseMirrorPlugins(){return[new Un({key:new Ei("tiptapPaste"),props:{handlePaste:(t,e,r)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:r})}}})]}}),Ioe=ci.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new Un({key:new Ei("tabindex"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!=null?t:"0"}}}})]}}),Noe=ci.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=vb(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const r=e.getAttribute("dir");return r&&(r==="ltr"||r==="rtl"||r==="auto")?r:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Un({key:new Ei("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),hDe=class PT{constructor(e,r,n=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=r,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let r=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}r=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:r,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),r=this.resolvedPos.doc.resolve(e);return new PT(r,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new PT(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new PT(e,this.editor)}get children(){const e=[];return this.node.content.forEach((r,n)=>{const i=r.isBlock&&!r.isTextblock,a=r.isAtom&&!r.isText,s=r.isInline,o=this.pos+n+(a?0:1);if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(o);if(!i&&!s&&l.depth<=this.depth)return;const u=new PT(l,this.editor,i,i||s?r:null);i&&(u.actualDepth=this.depth+1),e.push(u)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,r={}){let n=null,i=this.parent;for(;i&&!n;){if(i.node.type.name===e)if(Object.keys(r).length>0){const a=i.node.attrs,s=Object.keys(r);for(let o=0;o<s.length;o+=1){const l=s[o];if(a[l]!==r[l])break}}else n=i;i=i.parent}return n}querySelector(e,r={}){return this.querySelectorAll(e,r,!0)[0]||null}querySelectorAll(e,r={},n=!1){let i=[];if(!this.children||this.children.length===0)return i;const a=Object.keys(r);return this.children.forEach(s=>{n&&i.length>0||(s.node.type.name===e&&a.every(l=>r[l]===s.node.attrs[l])&&i.push(s),!(n&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,r,n))))}),i}setAttribute(e){const{tr:r}=this.editor.state;r.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(r)}},dDe=`.ProseMirror {
position: relative;
}
.ProseMirror {
word-wrap: break-word;
white-space: pre-wrap;
white-space: break-spaces;
-webkit-font-variant-ligatures: none;
font-variant-ligatures: none;
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}
.ProseMirror [contenteditable="false"] {
white-space: normal;
}
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
white-space: pre-wrap;
}
.ProseMirror pre {
white-space: pre-wrap;
}
img.ProseMirror-separator {
display: inline !important;
border: none !important;
margin: 0 !important;
width: 0 !important;
height: 0 !important;
}
.ProseMirror-gapcursor {
display: none;
pointer-events: none;
position: absolute;
margin: 0;
}
.ProseMirror-gapcursor:after {
content: "";
display: block;
position: absolute;
top: -2px;
width: 20px;
border-top: 1px solid black;
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}
@keyframes ProseMirror-cursor-blink {
to {
visibility: hidden;
}
}
.ProseMirror-hideselection *::selection {
background: transparent;
}
.ProseMirror-hideselection *::-moz-selection {
background: transparent;
}
.ProseMirror-hideselection * {
caret-color: transparent;
}
.ProseMirror-focused .ProseMirror-gapcursor {
display: block;
}`,fDe=class extends HNe{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:xNe,createMappablePosition:TNe},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:i,moved:a})=>this.options.onDrop(n,i,a)),this.on("paste",({event:n,slice:i})=>this.options.onPaste(n,i)),this.on("delete",this.options.onDelete);const e=this.createDoc(),r=roe(e,this.options.autofocus);this.editorState=Gm.create({doc:e,schema:this.schema,selection:r||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=UNe(dDe,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const r=loe(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],n=this.state.reconfigure({plugins:r});return this.view.updateState(n),n}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let r=e;if([].concat(t).forEach(i=>{const a=typeof i=="string"?`${i}$`:i.key;r=r.filter(s=>!s.key.startsWith(a))}),e.length===r.length)return;const n=this.state.reconfigure({plugins:r});return this.view.updateState(n),n}createExtensionManager(){var t,e,r,n;const a=[...this.options.enableCoreExtensions?[Aoe,Coe.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),koe,Roe,Loe,Ioe.configure({value:(n=(r=this.options.coreExtensionOptions)==null?void 0:r.tabindex)==null?void 0:n.value}),Eoe,Moe,Soe,Noe.configure({direction:this.options.textDirection})].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s==null?void 0:s.type));this.extensionManager=new W6(a,this)}createCommandManager(){this.commandManager=new F6({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=yD(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager()}}),t=yD(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:r}=this.options,n=e.dispatchTransaction||this.dispatchTransaction.bind(this),i=r?this.extensionManager.dispatchTransaction(n):n,a=e.transformPastedHTML,s=this.extensionManager.transformPastedHTML(a);this.editorView=new Jse(t,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:i,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.prependClass(),this.injectCSS();const l=this.view.dom;l.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(u=>{var h;return(h=this.capturedTransaction)==null?void 0:h.step(u)});return}const{state:e,transactions:r}=this.state.applyTransaction(t),n=!this.state.selection.eq(e.selection),i=r.includes(t),a=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:r.slice(1)}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});const s=r.findLast(u=>u.getMeta("focus")||u.getMeta("blur")),o=s==null?void 0:s.getMeta("focus"),l=s==null?void 0:s.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:s}),l&&this.emit("blur",{editor:this,event:l.event,transaction:s}),!(t.getMeta("preventUpdate")||!r.some(u=>u.docChanged)||a.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:r.slice(1)})}getAttributes(t){return poe(this.state,t)}isActive(t,e){const r=typeof t=="string"?t:null,n=typeof t=="string"?e:t;return yNe(this.state,r,n)}getJSON(){return this.state.doc.toJSON()}getHTML(){return HF(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
`,textSerializers:r={}}=t||{};return hNe(this.state.doc,{blockSeparator:e,textSerializers:{...foe(this.schema),...r}})}get isEmpty(){return Wk(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var r;return((r=this.$doc)==null?void 0:r.querySelector(t,e))||null}$nodes(t,e){var r;return((r=this.$doc)==null?void 0:r.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t),r=t>0&&e.nodeAfter&&!e.nodeAfter.isText?e.nodeAfter:null;return new hDe(e,this,!1,r)}get $doc(){return this.$pos(0)}};function w0(t){return new Hk({find:t.find,handler:({state:e,range:r,match:n})=>{const i=un(t.getAttributes,void 0,n);if(i===!1||i===null)return null;const{tr:a}=e,s=n[n.length-1],o=n[0];if(s){const l=o.search(/\S/),u=r.from+o.indexOf(s),h=u+s.length;if(YF(r.from,r.to,e.doc).filter(p=>p.mark.type.excluded.find(m=>m===t.type&&m!==p.mark.type)).filter(p=>p.to>u).length)return null;h<r.to&&a.delete(h,r.to),u>r.from&&a.delete(r.from+l,u);const f=r.from+l+s.length;a.addMark(r.from+l,f,t.type.create(i||{})),a.removeStoredMark(t.type)}},undoable:t.undoable})}function Doe(t){return new Hk({find:t.find,handler:({state:e,range:r,match:n})=>{const i=un(t.getAttributes,void 0,n)||{},{tr:a}=e,s=r.from;let o=r.to;const l=t.type.create(i);if(n[1]){const u=n[0].lastIndexOf(n[1]);let h=s+u;h>o?h=o:o=h+n[1].length;const d=n[0][n[0].length-1];a.insertText(d,s+n[0].length-1),a.replaceWith(h,o,l)}else if(n[0]){const u=t.type.isInline?s:s-1;a.insert(u,t.type.create(i)).delete(a.mapping.map(s),a.mapping.map(o))}a.scrollIntoView()},undoable:t.undoable})}function xD(t){return new Hk({find:t.find,handler:({state:e,range:r,match:n})=>{const i=e.doc.resolve(r.from),a=un(t.getAttributes,void 0,n)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(r.from,r.to).setBlockType(r.from,r.from,t.type,a)},undoable:t.undoable})}function xb(t){return new Hk({find:t.find,handler:({state:e,range:r,match:n,chain:i})=>{const a=un(t.getAttributes,void 0,n)||{},s=e.tr.delete(r.from,r.to),l=s.doc.resolve(r.from).blockRange(),u=l&&kF(l,t.type,a);if(!u)return null;if(s.wrap(l,u),t.keepMarks&&t.editor){const{selection:d,storedMarks:f}=e,{splittableMarks:p}=t.editor.extensionManager,g=f||d.$to.parentOffset&&d.$from.marks();if(g){const m=g.filter(y=>p.includes(y.type.name));s.ensureMarks(m)}}if(t.keepAttributes){const d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(d,a).run()}const h=s.doc.resolve(r.from-1).nodeBefore;h&&h.type===t.type&&xf(s.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(n,h))&&s.join(r.from-1)},undoable:t.undoable})}var pDe=t=>"touches"in t,gDe=class{constructor(t){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=o=>{if(!this.isResizing||!this.activeHandle)return;const l=o.clientX-this.startX,u=o.clientY-this.startY;this.handleResize(l,u)},this.handleTouchMove=o=>{if(!this.isResizing||!this.activeHandle)return;const l=o.touches[0];if(!l)return;const u=l.clientX-this.startX,h=l.clientY-this.startY;this.handleResize(u,h)},this.handleMouseUp=()=>{if(!this.isResizing)return;const o=this.element.offsetWidth,l=this.element.offsetHeight;this.onCommit(o,l),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!1)};var e,r,n,i,a,s;this.node=t.node,this.editor=t.editor,this.element=t.element,this.element.draggable=!1,this.contentElement=t.contentElement,this.getPos=t.getPos,this.onResize=t.onResize,this.onCommit=t.onCommit,this.onUpdate=t.onUpdate,(e=t.options)!=null&&e.min&&(this.minSize={...this.minSize,...t.options.min}),(r=t.options)!=null&&r.max&&(this.maxSize=t.options.max),(n=t==null?void 0:t.options)!=null&&n.directions&&(this.directions=t.options.directions),(i=t.options)!=null&&i.preserveAspectRatio&&(this.preserveAspectRatio=t.options.preserveAspectRatio),(a=t.options)!=null&&a.className&&(this.classNames={container:t.options.className.container||"",wrapper:t.options.className.wrapper||"",handle:t.options.className.handle||"",resizing:t.options.className.resizing||""}),(s=t.options)!=null&&s.createCustomHandle&&(this.createCustomHandle=t.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var t;return(t=this.contentElement)!=null?t:null}handleEditorUpdate(){const t=this.editor.isEditable;t!==this.lastEditableState&&(this.lastEditableState=t,t?t&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(t,e,r){return t.type!==this.node.type?!1:(this.node=t,this.onUpdate?this.onUpdate(t,e,r):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const t=document.createElement("div");return t.dataset.resizeContainer="",t.dataset.node=this.node.type.name,t.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(t.className=this.classNames.container),t.appendChild(this.wrapper),t}createWrapper(){const t=document.createElement("div");return t.style.position="relative",t.style.display="block",t.dataset.resizeWrapper="",this.classNames.wrapper&&(t.className=this.classNames.wrapper),t.appendChild(this.element),t}createHandle(t){const e=document.createElement("div");return e.dataset.resizeHandle=t,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(t,e){const r=e.includes("top"),n=e.includes("bottom"),i=e.includes("left"),a=e.includes("right");r&&(t.style.top="0"),n&&(t.style.bottom="0"),i&&(t.style.left="0"),a&&(t.style.right="0"),(e==="top"||e==="bottom")&&(t.style.left="0",t.style.right="0"),(e==="left"||e==="right")&&(t.style.top="0",t.style.bottom="0")}attachHandles(){this.directions.forEach(t=>{let e;this.createCustomHandle?e=this.createCustomHandle(t):e=this.createHandle(t),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${t}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(t)),this.createCustomHandle||this.positionHandle(e,t),e.addEventListener("mousedown",r=>this.handleResizeStart(r,t)),e.addEventListener("touchstart",r=>this.handleResizeStart(r,t)),this.handleMap.set(t,e),this.wrapper.appendChild(e)})}removeHandles(){this.handleMap.forEach(t=>t.remove()),this.handleMap.clear()}applyInitialSize(){const t=this.node.attrs.width,e=this.node.attrs.height;t?(this.element.style.width=`${t}px`,this.initialWidth=t):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(t,e){t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.activeHandle=e,pDe(t)?(this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY):(this.startX=t.clientX,this.startY=t.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(t,e){if(!this.activeHandle)return;const r=this.preserveAspectRatio||this.isShiftKeyPressed,{width:n,height:i}=this.calculateNewDimensions(this.activeHandle,t,e),a=this.applyConstraints(n,i,r);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(t,e,r){let n=this.startWidth,i=this.startHeight;const a=t.includes("right"),s=t.includes("left"),o=t.includes("bottom"),l=t.includes("top");return a?n=this.startWidth+e:s&&(n=this.startWidth-e),o?i=this.startHeight+r:l&&(i=this.startHeight-r),(t==="right"||t==="left")&&(n=this.startWidth+(a?e:-e)),(t==="top"||t==="bottom")&&(i=this.startHeight+(o?r:-r)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(n,i,t):{width:n,height:i}}applyConstraints(t,e,r){var n,i,a,s;if(!r){let u=Math.max(this.minSize.width,t),h=Math.max(this.minSize.height,e);return(n=this.maxSize)!=null&&n.width&&(u=Math.min(this.maxSize.width,u)),(i=this.maxSize)!=null&&i.height&&(h=Math.min(this.maxSize.height,h)),{width:u,height:h}}let o=t,l=e;return o<this.minSize.width&&(o=this.minSize.width,l=o/this.aspectRatio),l<this.minSize.height&&(l=this.minSize.height,o=l*this.aspectRatio),(a=this.maxSize)!=null&&a.width&&o>this.maxSize.width&&(o=this.maxSize.width,l=o/this.aspectRatio),(s=this.maxSize)!=null&&s.height&&l>this.maxSize.height&&(l=this.maxSize.height,o=l*this.aspectRatio),{width:o,height:l}}applyAspectRatio(t,e,r){const n=r==="left"||r==="right",i=r==="top"||r==="bottom";return n?{width:t,height:t/this.aspectRatio}:i?{width:e*this.aspectRatio,height:e}:{width:t,height:t/this.aspectRatio}}},Aa=class Ooe extends ZF{constructor(){super(...arguments),this.type="node"}static create(e={}){const r=typeof e=="function"?e():e;return new Ooe(r)}configure(e){return super.configure(e)}extend(e){const r=typeof e=="function"?e():e;return super.extend(r)}};function Qd(t){return new Toe({find:t.find,handler:({state:e,range:r,match:n,pasteEvent:i})=>{const a=un(t.getAttributes,void 0,n,i);if(a===!1||a===null)return null;const{tr:s}=e,o=n[n.length-1],l=n[0];let u=r.to;if(o){const h=l.search(/\S/),d=r.from+l.indexOf(o),f=d+o.length;if(YF(r.from,r.to,e.doc).filter(m=>m.mark.type.excluded.find(v=>v===t.type&&v!==m.mark.type)).filter(m=>m.to>d).length)return null;f<r.to&&s.delete(f,r.to),d>r.from&&s.delete(r.from+h,d),u=r.from+h+o.length,s.addMark(r.from+h,u,t.type.create(a||{})),n.index!==void 0&&n.input!==void 0&&n.index+n[0].length>=n.input.length||s.removeStoredMark(t.type)}}})}var b5=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:r,...n}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,n,r]},mDe=(t,e)=>{var r;const{state:n,view:i}=t,{selection:a}=n;if(!a.empty)return!1;const{$from:s}=a;if(s.parentOffset!==0)return!1;const o=s.depth-1;if(o<0)return!1;const l=s.node(o),u=s.index(o);if(u===0)return!1;if(l.type===e)return t.commands.lift(e.name);const h=l.child(u-1);if(h.type!==e||!((r=h.lastChild)!=null&&r.isTextblock))return!1;const d=s.before(),p=d-1-1,{tr:g}=n;return g.delete(d,s.after()).insert(p,s.parent.content),g.setSelection(rr.create(g.doc,p)),i.dispatch(g.scrollIntoView()),!0},yDe=/^\s*>\s$/,vDe=Aa.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return b5("blockquote",{...Wn(this.options.HTMLAttributes,t),children:b5("slot",{})})},parseMarkdown:(t,e)=>{var r;const n=(r=e.parseBlockChildren)!=null?r:e.parseChildren;return e.createNode("blockquote",void 0,n(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const r=">",n=[];return t.content.forEach((i,a)=>{var s,o;const h=((o=(s=e.renderChild)==null?void 0:s.call(e,i,a))!=null?o:e.renderChildren([i])).split(`
`).map(d=>d.trim()===""?r:`${r} ${d}`);n.push(h.join(`
`))}),n.join(`
${r}
`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>mDe(this.editor,this.type)}},addInputRules(){return[xb({find:yDe,type:this.type})]}}),bDe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,xDe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,TDe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,wDe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,CDe=Q0.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return b5("strong",{...Wn(this.options.HTMLAttributes,t),children:b5("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[w0({find:bDe,type:this.type}),w0({find:TDe,type:this.type})]},addPasteRules(){return[Qd({find:xDe,type:this.type}),Qd({find:wDe,type:this.type})]}}),kDe=t=>{const e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},SDe=t=>{const e=/`([^`]+)`(?!`)/g,r=[];let n;for(;(n=e.exec(t))!==null;)n.index>0&&t[n.index-1]==="`"||r.push({index:n.index,text:n[0],replaceWith:n[1]});return r},EDe=Q0.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Wn(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[w0({find:kDe,type:this.type})]},addPasteRules(){return[Qd({find:SDe,type:this.type})]}}),dM=4,ADe=/^```([a-z]+)?[\s\n]$/,_De=/^~~~([a-z]+)?[\s\n]$/,$oe=Aa.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:dM,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:r}=this.options;if(!r)return null;const a=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(s=>s.startsWith(r)).map(s=>s.replace(r,""))[0];return a||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Wn(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var r,n;return((r=t.raw)==null?void 0:r.startsWith("```"))===!1&&((n=t.raw)==null?void 0:n.startsWith("~~~"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var r;let n="";const i=((r=t.attrs)==null?void 0:r.language)||"";return t.content?n=[`\`\`\`${i}`,e.renderChildren(t.content),"```"].join(`
`):n=`\`\`\`${i}
\`\`\``,n},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,r=e.pos===1;return!t||e.parent.type.name!==this.name?!1:r||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const r=(e=this.options.tabSize)!=null?e:dM,{state:n}=t,{selection:i}=n,{$from:a,empty:s}=i;if(a.parent.type!==this.type)return!1;const o=" ".repeat(r);return s?t.commands.insertContent(o):t.commands.command(({tr:l})=>{const{from:u,to:h}=i,p=n.doc.textBetween(u,h,`
`,`
`).split(`
`).map(g=>o+g).join(`
`);return l.replaceWith(u,h,n.schema.text(p)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const r=(e=this.options.tabSize)!=null?e:dM,{state:n}=t,{selection:i}=n,{$from:a,empty:s}=i;return a.parent.type!==this.type?!1:s?t.commands.command(({tr:o})=>{var l;const{pos:u}=a,h=a.start(),d=a.end(),p=n.doc.textBetween(h,d,`
`,`
`).split(`
`);let g=0,m=0;const y=u-h;for(let S=0;S<p.length;S+=1){if(m+p[S].length>=y){g=S;break}m+=p[S].length+1}const T=((l=p[g].match(/^ */))==null?void 0:l[0])||"",b=Math.min(T.length,r);if(b===0)return!0;let w=h;for(let S=0;S<g;S+=1)w+=p[S].length+1;return o.delete(w,w+b),u-w<=b&&o.setSelection(rr.create(o.doc,w)),!0}):t.commands.command(({tr:o})=>{const{from:l,to:u}=i,f=n.doc.textBetween(l,u,`
`,`
`).split(`
`).map(p=>{var g;const m=((g=p.match(/^ */))==null?void 0:g[0])||"",y=Math.min(m.length,r);return p.slice(y)}).join(`
`);return o.replaceWith(l,u,n.schema.text(f)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:r}=e,{$from:n,empty:i}=r;if(!i||n.parent.type!==this.type)return!1;const a=n.parentOffset===n.parent.nodeSize-2,s=n.parent.textContent.endsWith(`
`);return!a||!s?!1:t.chain().command(({tr:o})=>(o.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:r,doc:n}=e,{$from:i,empty:a}=r;if(!a||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const o=i.after();return o===void 0?!1:n.nodeAt(o)?t.commands.command(({tr:u})=>(u.setSelection(Cr.near(n.resolve(o))),!0)):t.commands.exitCode()}}},addInputRules(){return[xD({find:ADe,type:this.type,getAttributes:t=>({language:t[1]})}),xD({find:_De,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Un({key:new Ei("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const r=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("vscode-editor-data"),i=n?JSON.parse(n):void 0,a=i==null?void 0:i.mode;if(!r||!a)return!1;const{tr:s,schema:o}=t.state,l=o.text(r.replace(/\r\n?/g,`
`));return s.replaceSelectionWith(this.type.create({language:a},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(rr.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),RDe=$oe,LDe=Aa.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
`):""}),MDe=Aa.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Wn(this.options.HTMLAttributes,t)]},renderText(){return`
`},renderMarkdown:()=>`
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:r,editor:n})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:a}=r;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:o}=n.extensionManager,l=a||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:h})=>{if(h&&l&&s){const d=l.filter(f=>o.includes(f.type.name));u.ensureMarks(d)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),IDe=Aa.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Wn(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var r;const n=(r=t.attrs)!=null&&r.level?parseInt(t.attrs.level,10):1,i="#".repeat(n);return t.content?`${i} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>xD({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),NDe=Aa.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Wn(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!qNe(e,e.schema.nodes[this.name]))return!1;const{selection:r}=e,{$to:n}=r,i=t();return goe(r)?i.insertContentAt(n.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:a,tr:s,dispatch:o})=>{if(o){const{$to:l}=s.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?s.setSelection(rr.create(s.doc,l.pos+1)):l.nodeAfter.isBlock?s.setSelection(lr.create(s.doc,l.pos)):s.setSelection(rr.create(s.doc,l.pos));else{const h=a.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,d=h==null?void 0:h.create();d&&(s.insert(u,d),s.setSelection(rr.create(s.doc,u+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Doe({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),DDe=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,ODe=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,$De=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,PDe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,BDe=Q0.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Wn(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[w0({find:DDe,type:this.type}),w0({find:$De,type:this.type})]},addPasteRules(){return[Qd({find:ODe,type:this.type}),Qd({find:PDe,type:this.type})]}});const FDe="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",zDe="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",TD="numeric",wD="ascii",CD="alpha",Sw="asciinumeric",BT="alphanumeric",kD="domain",Poe="emoji",VDe="scheme",GDe="slashscheme",fM="whitespace";function WDe(t,e){return t in e||(e[t]=[]),e[t]}function Up(t,e,r){e[TD]&&(e[Sw]=!0,e[BT]=!0),e[wD]&&(e[Sw]=!0,e[CD]=!0),e[Sw]&&(e[BT]=!0),e[CD]&&(e[BT]=!0),e[BT]&&(e[kD]=!0),e[Poe]&&(e[kD]=!0);for(const n in e){const i=WDe(n,r);i.indexOf(t)<0&&i.push(t)}}function HDe(t,e){const r={};for(const n in e)e[n].indexOf(t)>=0&&(r[n]=!0);return r}function uo(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}uo.groups={};uo.prototype={accepts(){return!!this.t},go(t){const e=this,r=e.j[t];if(r)return r;for(let n=0;n<e.jr.length;n++){const i=e.jr[n][0],a=e.jr[n][1];if(a&&i.test(t))return a}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,r,n){for(let i=0;i<t.length;i++)this.tt(t[i],e,r,n)},tr(t,e,r,n){n=n||uo.groups;let i;return e&&e.j?i=e:(i=new uo(e),r&&n&&Up(e,r,n)),this.jr.push([t,i]),i},ts(t,e,r,n){let i=this;const a=t.length;if(!a)return i;for(let s=0;s<a-1;s++)i=i.tt(t[s]);return i.tt(t[a-1],e,r,n)},tt(t,e,r,n){n=n||uo.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const a=e;let s,o=i.go(t);if(o?(s=new uo,Object.assign(s.j,o.j),s.jr.push.apply(s.jr,o.jr),s.jd=o.jd,s.t=o.t):s=new uo,a){if(n)if(s.t&&typeof s.t=="string"){const l=Object.assign(HDe(s.t,n),r);Up(a,l,n)}else r&&Up(a,r,n);s.t=a}return i.j[t]=s,s}};const Br=(t,e,r,n,i)=>t.ta(e,r,n,i),yi=(t,e,r,n,i)=>t.tr(e,r,n,i),TX=(t,e,r,n,i)=>t.ts(e,r,n,i),Rt=(t,e,r,n,i)=>t.tt(e,r,n,i),Ou="WORD",SD="UWORD",Boe="ASCIINUMERICAL",Foe="ALPHANUMERICAL",TC="LOCALHOST",ED="TLD",AD="UTLD",O4="SCHEME",gm="SLASH_SCHEME",QF="NUM",_D="WS",JF="NL",Ew="OPENBRACE",Aw="CLOSEBRACE",x5="OPENBRACKET",T5="CLOSEBRACKET",w5="OPENPAREN",C5="CLOSEPAREN",k5="OPENANGLEBRACKET",S5="CLOSEANGLEBRACKET",E5="FULLWIDTHLEFTPAREN",A5="FULLWIDTHRIGHTPAREN",_5="LEFTCORNERBRACKET",R5="RIGHTCORNERBRACKET",L5="LEFTWHITECORNERBRACKET",M5="RIGHTWHITECORNERBRACKET",I5="FULLWIDTHLESSTHAN",N5="FULLWIDTHGREATERTHAN",D5="AMPERSAND",O5="APOSTROPHE",$5="ASTERISK",hd="AT",P5="BACKSLASH",B5="BACKTICK",F5="CARET",Yp="COLON",ez="COMMA",z5="DOLLAR",Ec="DOT",V5="EQUALS",tz="EXCLAMATION",nl="HYPHEN",_w="PERCENT",G5="PIPE",W5="PLUS",H5="POUND",Rw="QUERY",rz="QUOTE",zoe="FULLWIDTHMIDDLEDOT",nz="SEMI",Ac="SLASH",Lw="TILDE",q5="UNDERSCORE",Voe="EMOJI",U5="SYM";var Goe=Object.freeze({__proto__:null,ALPHANUMERICAL:Foe,AMPERSAND:D5,APOSTROPHE:O5,ASCIINUMERICAL:Boe,ASTERISK:$5,AT:hd,BACKSLASH:P5,BACKTICK:B5,CARET:F5,CLOSEANGLEBRACKET:S5,CLOSEBRACE:Aw,CLOSEBRACKET:T5,CLOSEPAREN:C5,COLON:Yp,COMMA:ez,DOLLAR:z5,DOT:Ec,EMOJI:Voe,EQUALS:V5,EXCLAMATION:tz,FULLWIDTHGREATERTHAN:N5,FULLWIDTHLEFTPAREN:E5,FULLWIDTHLESSTHAN:I5,FULLWIDTHMIDDLEDOT:zoe,FULLWIDTHRIGHTPAREN:A5,HYPHEN:nl,LEFTCORNERBRACKET:_5,LEFTWHITECORNERBRACKET:L5,LOCALHOST:TC,NL:JF,NUM:QF,OPENANGLEBRACKET:k5,OPENBRACE:Ew,OPENBRACKET:x5,OPENPAREN:w5,PERCENT:_w,PIPE:G5,PLUS:W5,POUND:H5,QUERY:Rw,QUOTE:rz,RIGHTCORNERBRACKET:R5,RIGHTWHITECORNERBRACKET:M5,SCHEME:O4,SEMI:nz,SLASH:Ac,SLASH_SCHEME:gm,SYM:U5,TILDE:Lw,TLD:ED,UNDERSCORE:q5,UTLD:AD,UWORD:SD,WORD:Ou,WS:_D});const ku=/[a-z]/,jx=new RegExp("\\p{L}","u"),pM=new RegExp("\\p{Emoji}","u"),Su=/\d/,gM=/\s/,wX="\r",mM=`
`,qDe="️",UDe="‍",yM="";let iE=null,aE=null;function YDe(t=[]){const e={};uo.groups=e;const r=new uo;iE==null&&(iE=CX(FDe)),aE==null&&(aE=CX(zDe)),Rt(r,"'",O5),Rt(r,"{",Ew),Rt(r,"}",Aw),Rt(r,"[",x5),Rt(r,"]",T5),Rt(r,"(",w5),Rt(r,")",C5),Rt(r,"<",k5),Rt(r,">",S5),Rt(r,"(",E5),Rt(r,")",A5),Rt(r,"「",_5),Rt(r,"」",R5),Rt(r,"『",L5),Rt(r,"』",M5),Rt(r,"<",I5),Rt(r,">",N5),Rt(r,"&",D5),Rt(r,"*",$5),Rt(r,"@",hd),Rt(r,"`",B5),Rt(r,"^",F5),Rt(r,":",Yp),Rt(r,",",ez),Rt(r,"$",z5),Rt(r,".",Ec),Rt(r,"=",V5),Rt(r,"!",tz),Rt(r,"-",nl),Rt(r,"%",_w),Rt(r,"|",G5),Rt(r,"+",W5),Rt(r,"#",H5),Rt(r,"?",Rw),Rt(r,'"',rz),Rt(r,"/",Ac),Rt(r,";",nz),Rt(r,"~",Lw),Rt(r,"_",q5),Rt(r,"\\",P5),Rt(r,"・",zoe);const n=yi(r,Su,QF,{[TD]:!0});yi(n,Su,n);const i=yi(n,ku,Boe,{[Sw]:!0}),a=yi(n,jx,Foe,{[BT]:!0}),s=yi(r,ku,Ou,{[wD]:!0});yi(s,Su,i),yi(s,ku,s),yi(i,Su,i),yi(i,ku,i);const o=yi(r,jx,SD,{[CD]:!0});yi(o,ku),yi(o,Su,a),yi(o,jx,o),yi(a,Su,a),yi(a,ku),yi(a,jx,a);const l=Rt(r,mM,JF,{[fM]:!0}),u=Rt(r,wX,_D,{[fM]:!0}),h=yi(r,gM,_D,{[fM]:!0});Rt(r,yM,h),Rt(u,mM,l),Rt(u,yM,h),yi(u,gM,h),Rt(h,wX),Rt(h,mM),yi(h,gM,h),Rt(h,yM,h);const d=yi(r,pM,Voe,{[Poe]:!0});Rt(d,"#"),yi(d,pM,d),Rt(d,qDe,d);const f=Rt(d,UDe);Rt(f,"#"),yi(f,pM,d);const p=[[ku,s],[Su,i]],g=[[ku,null],[jx,o],[Su,a]];for(let m=0;m<iE.length;m++)Qh(r,iE[m],ED,Ou,p);for(let m=0;m<aE.length;m++)Qh(r,aE[m],AD,SD,g);Up(ED,{tld:!0,ascii:!0},e),Up(AD,{utld:!0,alpha:!0},e),Qh(r,"file",O4,Ou,p),Qh(r,"mailto",O4,Ou,p),Qh(r,"http",gm,Ou,p),Qh(r,"https",gm,Ou,p),Qh(r,"ftp",gm,Ou,p),Qh(r,"ftps",gm,Ou,p),Up(O4,{scheme:!0,ascii:!0},e),Up(gm,{slashscheme:!0,ascii:!0},e),t=t.sort((m,y)=>m[0]>y[0]?1:-1);for(let m=0;m<t.length;m++){const y=t[m][0],T=t[m][1]?{[VDe]:!0}:{[GDe]:!0};y.indexOf("-")>=0?T[kD]=!0:ku.test(y)?Su.test(y)?T[Sw]=!0:T[wD]=!0:T[TD]=!0,TX(r,y,y,T)}return TX(r,"localhost",TC,{ascii:!0}),r.jd=new uo(U5),{start:r,tokens:Object.assign({groups:e},Goe)}}function Woe(t,e){const r=XDe(e.replace(/[A-Z]/g,o=>o.toLowerCase())),n=r.length,i=[];let a=0,s=0;for(;s<n;){let o=t,l=null,u=0,h=null,d=-1,f=-1;for(;s<n&&(l=o.go(r[s]));)o=l,o.accepts()?(d=0,f=0,h=o):d>=0&&(d+=r[s].length,f++),u+=r[s].length,a+=r[s].length,s++;a-=d,s-=f,u-=d,i.push({t:h.t,v:e.slice(a-u,a),s:a-u,e:a})}return i}function XDe(t){const e=[],r=t.length;let n=0;for(;n<r;){let i=t.charCodeAt(n),a,s=i<55296||i>56319||n+1===r||(a=t.charCodeAt(n+1))<56320||a>57343?t[n]:t.slice(n,n+2);e.push(s),n+=s.length}return e}function Qh(t,e,r,n,i){let a;const s=e.length;for(let o=0;o<s-1;o++){const l=e[o];t.j[l]?a=t.j[l]:(a=new uo(n),a.jr=i.slice(),t.j[l]=a),t=a}return a=new uo(r),a.jr=i.slice(),t.j[e[s-1]]=a,a}function CX(t){const e=[],r=[];let n=0,i="0123456789";for(;n<t.length;){let a=0;for(;i.indexOf(t[n+a])>=0;)a++;if(a>0){e.push(r.join(""));for(let s=parseInt(t.substring(n,n+a),10);s>0;s--)r.pop();n+=a}else r.push(t[n]),n++}return e}const wC={defaultProtocol:"http",events:null,format:kX,formatHref:kX,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function iz(t,e=null){let r=Object.assign({},wC);t&&(r=Object.assign(r,t instanceof iz?t.o:t));const n=r.ignoreTags,i=[];for(let a=0;a<n.length;a++)i.push(n[a].toUpperCase());this.o=r,e&&(this.defaultRender=e),this.ignoreTags=i}iz.prototype={o:wC,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,r){const n=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=r.t in i?i[r.t]:wC[t],typeof i=="function"&&n&&(i=i(e,r))):typeof i=="function"&&n&&(i=i(e,r.t,r)),i)},getObj(t,e,r){let n=this.o[t];return typeof n=="function"&&e!=null&&(n=n(e,r.t,r)),n},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function kX(t){return t}function Hoe(t,e){this.t="token",this.v=t,this.tk=e}Hoe.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),r=t.get("truncate",e,this),n=t.get("format",e,this);return r&&n.length>r?n.substring(0,r)+"…":n},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=wC.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,r=this.toHref(t.get("defaultProtocol")),n=t.get("formatHref",r,this),i=t.get("tagName",r,e),a=this.toFormattedString(t),s={},o=t.get("className",r,e),l=t.get("target",r,e),u=t.get("rel",r,e),h=t.getObj("attributes",r,e),d=t.getObj("events",r,e);return s.href=n,o&&(s.class=o),l&&(s.target=l),u&&(s.rel=u),h&&Object.assign(s,h),{tagName:i,attributes:s,content:a,eventListeners:d}}};function H6(t,e){class r extends Hoe{constructor(i,a){super(i,a),this.t=t}}for(const n in e)r.prototype[n]=e[n];return r.t=t,r}const jDe=H6("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),SX=H6("text"),KDe=H6("nl"),sE=H6("url",{isLink:!0,toHref(t=wC.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==TC&&t[1].t===Yp}}),Zo=t=>new uo(t);function ZDe({groups:t}){const e=t.domain.concat([D5,$5,hd,P5,B5,F5,z5,V5,nl,QF,_w,G5,W5,H5,Ac,U5,Lw,q5]),r=[O5,Yp,ez,Ec,tz,_w,Rw,rz,nz,k5,S5,Ew,Aw,T5,x5,w5,C5,E5,A5,_5,R5,L5,M5,I5,N5],n=[D5,O5,$5,P5,B5,F5,z5,V5,nl,Ew,Aw,_w,G5,W5,H5,Rw,Ac,U5,Lw,q5],i=Zo(),a=Rt(i,Lw);Br(a,n,a),Br(a,t.domain,a);const s=Zo(),o=Zo(),l=Zo();Br(i,t.domain,s),Br(i,t.scheme,o),Br(i,t.slashscheme,l),Br(s,n,a),Br(s,t.domain,s);const u=Rt(s,hd);Rt(a,hd,u),Rt(o,hd,u),Rt(l,hd,u);const h=Rt(a,Ec);Br(h,n,a),Br(h,t.domain,a);const d=Zo();Br(u,t.domain,d),Br(d,t.domain,d);const f=Rt(d,Ec);Br(f,t.domain,d);const p=Zo(jDe);Br(f,t.tld,p),Br(f,t.utld,p),Rt(u,TC,p);const g=Rt(d,nl);Rt(g,nl,g),Br(g,t.domain,d),Br(p,t.domain,d),Rt(p,Ec,f),Rt(p,nl,g);const m=Rt(s,nl),y=Rt(s,Ec);Rt(m,nl,m),Br(m,t.domain,s),Br(y,n,a),Br(y,t.domain,s);const v=Zo(sE);Br(y,t.tld,v),Br(y,t.utld,v),Br(v,t.domain,s),Br(v,n,a),Rt(v,Ec,y),Rt(v,nl,m),Rt(v,hd,u);const T=Rt(v,Yp),b=Zo(sE);Br(T,t.numeric,b);const w=Zo(sE),C=Zo();Br(w,e,w),Br(w,r,C),Br(C,e,w),Br(C,r,C),Rt(v,Ac,w),Rt(b,Ac,w);const S=Rt(o,Yp),k=Rt(l,Yp),E=Rt(k,Ac),_=Rt(E,Ac);Br(o,t.domain,s),Rt(o,Ec,y),Rt(o,nl,m),Br(l,t.domain,s),Rt(l,Ec,y),Rt(l,nl,m),Br(S,t.domain,w),Rt(S,Ac,w),Rt(S,Rw,w),Br(_,t.domain,w),Br(_,e,w),Rt(_,Ac,w);const M=[[Ew,Aw],[x5,T5],[w5,C5],[k5,S5],[E5,A5],[_5,R5],[L5,M5],[I5,N5]];for(let L=0;L<M.length;L++){const[P,D]=M[L],R=Rt(w,P);Rt(C,P,R);const I=Zo(sE);Br(R,e,I);const $=Zo();Br(R,r,$),Rt(R,D,w),Br(I,e,I),Br(I,r,$),Br($,e,I),Br($,r,$),Rt(I,D,w),Rt($,D,w)}return Rt(i,TC,v),Rt(i,JF,KDe),{start:i,tokens:Goe}}function QDe(t,e,r){let n=r.length,i=0,a=[],s=[];for(;i<n;){let o=t,l=null,u=null,h=0,d=null,f=-1;for(;i<n&&!(l=o.go(r[i].t));)s.push(r[i++]);for(;i<n&&(u=l||o.go(r[i].t));)l=null,o=u,o.accepts()?(f=0,d=o):f>=0&&f++,i++,h++;if(f<0)i-=h,i<n&&(s.push(r[i]),i++);else{s.length>0&&(a.push(vM(SX,e,s)),s=[]),i-=f,h-=f;const p=d.t,g=r.slice(i-h,i);a.push(vM(p,e,g))}}return s.length>0&&a.push(vM(SX,e,s)),a}function vM(t,e,r){const n=r[0].s,i=r[r.length-1].e,a=e.slice(n,i);return new t(a,r)}const JDe=typeof console<"u"&&console&&console.warn||(()=>{}),eOe="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Zn={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function tOe(){return uo.groups={},Zn.scanner=null,Zn.parser=null,Zn.tokenQueue=[],Zn.pluginQueue=[],Zn.customSchemes=[],Zn.initialized=!1,Zn}function EX(t,e=!1){if(Zn.initialized&&JDe(`linkifyjs: already initialized - will not register custom scheme "${t}" ${eOe}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
3. "-" cannot repeat`);Zn.customSchemes.push([t,e])}function rOe(){Zn.scanner=YDe(Zn.customSchemes);for(let t=0;t<Zn.tokenQueue.length;t++)Zn.tokenQueue[t][1]({scanner:Zn.scanner});Zn.parser=ZDe(Zn.scanner.tokens);for(let t=0;t<Zn.pluginQueue.length;t++)Zn.pluginQueue[t][1]({scanner:Zn.scanner,parser:Zn.parser});return Zn.initialized=!0,Zn}function az(t){return Zn.initialized||rOe(),QDe(Zn.parser.start,t,Woe(Zn.scanner.start,t))}az.scan=Woe;function qoe(t,e=null,r=null){if(e&&typeof e=="object"){if(r)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);r=e,e=null}const n=new iz(r),i=az(t),a=[];for(let s=0;s<i.length;s++){const o=i[s];o.isLink&&(!e||o.t===e)&&n.check(o)&&a.push(o.toFormattedObject(n))}return a}var sz="[\0-   ᠎ -\u2029  ]",nOe=new RegExp(sz),iOe=new RegExp(`${sz}$`),aOe=new RegExp(sz,"g");function sOe(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function oOe(t){return new Un({key:new Ei("autolink"),appendTransaction:(e,r,n)=>{const i=e.some(u=>u.docChanged)&&!r.doc.eq(n.doc),a=e.some(u=>u.getMeta("preventAutolink"));if(!i||a)return;const{tr:s}=n,o=soe(r.doc,[...e]);if(UF(o).forEach(({newRange:u})=>{const h=aNe(n.doc,u,p=>p.isTextblock);let d,f;if(h.length>1)d=h[0],f=n.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(h.length){const p=n.doc.textBetween(u.from,u.to," "," ");if(!iOe.test(p))return;d=h[0],f=n.doc.textBetween(d.pos,u.to,void 0," ")}if(d&&f){const p=f.split(nOe).filter(Boolean);if(p.length<=0)return!1;const g=p[p.length-1],m=d.pos+f.lastIndexOf(g);if(!g)return!1;const y=az(g).map(v=>v.toObject(t.defaultProtocol));if(!sOe(y))return!1;y.filter(v=>v.isLink).map(v=>({...v,from:m+v.start+1,to:m+v.end+1})).filter(v=>n.schema.marks.code?!n.doc.rangeHasMark(v.from,v.to,n.schema.marks.code):!0).filter(v=>t.validate(v.value)).filter(v=>t.shouldAutoLink(v.value)).forEach(v=>{YF(v.from,v.to,n.doc).some(T=>T.mark.type===t.type)||s.addMark(v.from,v.to,t.type.create({href:v.href}))})}}),!!s.steps.length)return s}})}function lOe(t){return new Un({key:new Ei("handleClickLink"),props:{handleClick:(e,r,n)=>{var i,a;if(n.button!==0||!e.editable)return!1;let s=null;if(n.target instanceof HTMLAnchorElement)s=n.target;else{const l=n.target;if(!l)return!1;const u=t.editor.view.dom;s=l.closest("a"),s&&!u.contains(s)&&(s=null)}if(!s)return!1;let o=!1;if(t.enableClickSelection&&(o=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){const l=poe(e.state,t.type.name),u=(i=s.href)!=null?i:l.href,h=(a=s.target)!=null?a:l.target;u&&(window.open(u,h),o=!0)}return o}}})}var cOe=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,uOe=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function Uoe(t,e){let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n-=1)r+=1;return r%2===1}function hOe(t,e){let r=0,n=0;for(;n<e;){if(t[n]!=="`"){n+=1;continue}if(r===0&&Uoe(t,n)){n+=1;continue}let i=0;for(;n<e&&t[n]==="`";)i+=1,n+=1;r===0?r=i:i===r&&(r=0)}return r>0}function Yoe(t,e,r){var n,i;const[,a,s]=e;return(e.index?t[e.index-1]:void 0)==="!"||Uoe(t,(n=e.index)!=null?n:0)||hOe(t,(i=e.index)!=null?i:0)?!1:!!a.trim()&&r(s)}function Xoe(t){var e,r;const[n,i,a,,s,o,l]=t,u=(e=s??o)!=null?e:l;return{index:(r=t.index)!=null?r:0,text:n,replaceWith:i,data:{href:a,title:u||null,markdown:!0}}}function dOe(t,e){return t.index<e.index+e.text.length&&e.index<t.index+t.text.length}function joe(t){var e,r,n;return{href:(e=t.data)==null?void 0:e.href,title:(n=(r=t.data)==null?void 0:r.title)!=null?n:null}}function fOe(t){const e=w0({find:r=>{const n=cOe.exec(r);return!n||!Yoe(r,n,t.isAllowedHref)?null:Xoe(n)},type:t.type,getAttributes:joe});return new Hk({find:e.find,handler:r=>{const n=e.handler(r);return n!==null&&r.state.tr.steps.length&&r.state.tr.setMeta("preventAutolink",!0),n}})}function pOe(t){const e=Qd({find:r=>{var n,i;const a=[];for(const o of r.matchAll(uOe))Yoe(r,o,t.isAllowedHref)&&a.push(Xoe(o));const s=((i=(n=t.findPlainUrls)==null?void 0:n.call(t,r))!=null?i:[]).filter(o=>!a.some(l=>dOe(l,o)));return[...a,...s]},type:t.type,getAttributes:joe});return new Toe({find:e.find,handler:r=>{var n;const i=e.handler(r);return i!==null&&r.state.tr.steps.length&&((n=r.match.data)!=null&&n.markdown)&&r.state.tr.setMeta("preventAutolink",!0),i}})}function gOe(t){return new Un({key:new Ei("handlePasteLink"),props:{handlePaste:(e,r,n)=>{const{shouldAutoLink:i}=t,{state:a}=e,{selection:s}=a,{empty:o}=s;if(o)return!1;let l="";n.content.forEach(h=>{l+=h.textContent});const u=qoe(l,{defaultProtocol:t.defaultProtocol}).find(h=>h.isLink&&h.value===l);return!l||!u||i!==void 0&&!i(u.value)?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}function Eu(t,e){const r=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(n=>{const i=typeof n=="string"?n:n.scheme;i&&r.push(i)}),!t||t.replace(aOe,"").match(new RegExp(`^(?:(?:${r.map(n=>n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}var mOe=Q0.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){EX(t);return}EX(t.scheme,t.optionalSlashes)})},onDestroy(){tOe()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Eu(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),r=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||r&&!t.includes("@"))return!0;const i=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(i)||!/\./.test(i))}}},addAttributes(){var t,e,r;return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:(t=this.options.HTMLAttributes.target)!=null?t:null},rel:{default:(e=this.options.HTMLAttributes.rel)!=null?e:null},class:{default:(r=this.options.HTMLAttributes.class)!=null?r:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:r=>!!Eu(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Eu(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Wn(this.options.HTMLAttributes,t),0]:["a",Wn(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var r,n,i,a;const s=(n=(r=t.attrs)==null?void 0:r.href)!=null?n:"",o=(a=(i=t.attrs)==null?void 0:i.title)!=null?a:"",l=e.renderChildren(t);return o?`[${l}](${s} "${o}")`:`[${l}](${s})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:r}=t;return this.options.isAllowedUri(r,{defaultValidate:n=>!!Eu(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:r}=t||{};return r&&!this.options.isAllowedUri(r,{defaultValidate:n=>!!Eu(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[fOe({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!Eu(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){const t=e=>{const r=[];if(e){const{protocols:n,defaultProtocol:i}=this.options;qoe(e).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:o=>!!Eu(o,n),protocols:n,defaultProtocol:i})).forEach(s=>{this.options.shouldAutoLink(s.value)&&r.push({text:s.value,data:{href:s.href},index:s.start})})}return r};return this.options.markdownLinks?[pOe({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:r=>!!Eu(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:t})]:[Qd({find:t,type:this.type,getAttributes:e=>{var r;return{href:(r=e.data)==null?void 0:r.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:r}=this.options;return this.options.autolink&&t.push(oOe({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!Eu(i,e),protocols:e,defaultProtocol:r}),shouldAutoLink:this.options.shouldAutoLink})),t.push(lOe({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(gOe({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),yOe=Object.defineProperty,vOe=(t,e)=>{for(var r in e)yOe(t,r,{get:e[r],enumerable:!0})},bOe="listItem",AX="textStyle",_X=/^\s*([-+*])\s$/,Koe=Aa.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Wn(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(bOe,this.editor.getAttributes(AX)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=xb({find:_X,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=xb({find:_X,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(AX),editor:this.editor})),[t]}}),xOe=(t,e,r)=>{const{selection:n}=t;if(!n.empty)return null;const{$from:i}=n;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let a=-1;for(let p=i.depth;p>0;p-=1)if(i.node(p).type.name===e){a=p;break}if(a<0)return null;const s=i.node(a),o=i.index(a);if(o+1>=s.childCount)return null;const l=s.child(o+1);if(!r.includes(l.type.name))return null;const u=t.schema.nodes[e];let h=!1;if(l.forEach(p=>{p.type===u&&p.childCount>1&&(h=!0)}),!h)return null;const d=t.doc.resolve(i.after()).nodeAfter;if(!d||!r.includes(d.type.name))return null;const f=[];return d.forEach(p=>{f.push(p)}),f.length===0?null:{listItemDepth:a,nestedList:d,nestedListPos:i.after(),insertPos:i.after(a),items:f}},TOe=(t,e,r,n)=>{const i=xOe(t,r,n);if(!i)return!1;const{selection:a}=t,{nestedList:s,nestedListPos:o,insertPos:l,items:u}=i,h=t.tr;h.delete(o,o+s.nodeSize);const d=h.mapping.map(l);return h.insert(d,gt.from(u)),h.setSelection(a.map(h.doc,h.mapping)),e&&e(h),!0},wOe=(t,e,r)=>TOe(t.state,t.view.dispatch,e,r),Zoe=(t,e)=>ci.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const r=()=>wOe(this.editor,t,e);return{Delete:r,"Mod-Delete":r}}}),Qoe=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],oE="abcdefghijklmnopqrstuvwxyz",COe="[a-zA-Z]{1,2}",Joe=String.raw`\d+|[ivxlcdmIVXLCDM]+|${COe}`;function q6(t){let e=t,r="";for(const[n,i]of Qoe)for(;e>=n;)r+=i,e-=n;return r}function oz(t){return q6(t).toUpperCase()}function ele(t){const e=t.toLowerCase();let r=0,n=0;for(;r<e.length;){let i=!1;for(const[a,s]of Qoe)if(e.startsWith(s,r)){n+=a,r+=s.length,i=!0;break}if(!i)return 0}return n}function kOe(t){if(!/^[ivxlcdmIVXLCDM]+$/.test(t))return!1;const e=ele(t);return e<=0?!1:(t===t.toLowerCase()?q6(e):oz(e))===t}function SOe(t){const e=t.toLowerCase();if(e.length===1)return e.charCodeAt(0)-97+1;if(e.length===2){const r=e.charCodeAt(0)-97,n=e.charCodeAt(1)-97;return(r+1)*26+n+1}return 0}function Y5(t){if(t<=26)return oE[t-1];const e=Math.floor((t-1)/26)-1,r=(t-1)%26;return e<0?oE[r]:oE[e]+oE[r]}function U6(t){if(!(!t||/^\d+$/.test(t))){if(kOe(t))return t===t.toLowerCase()?"i":"I";if(/^[a-z]{1,2}$/.test(t))return"a";if(/^[A-Z]{1,2}$/.test(t))return"A"}}function lz(t){if(/^\d+$/.test(t))return parseInt(t,10);const e=U6(t);if(e==="i"||e==="I")return ele(t);if(e==="a"||e==="A"){const n=SOe(t);return n>0?n:1}const r=parseInt(t,10);return Number.isNaN(r)?1:r}function EOe(t,e){if(t==="numeric")return String(e);switch(t){case"a":return Y5(e);case"A":return Y5(e).toUpperCase();case"i":return q6(e);case"I":return oz(e);default:return String(e)}}function AOe(t){var e;if(t.length===0)return!1;const r=(e=U6(t[0]))!=null?e:"numeric",n=lz(t[0]);if(n<1)return!1;for(let i=0;i<t.length;i++){const a=EOe(r,n+i);if(t[i]!==a)return!1}return!0}function _Oe(t){return{type:U6(t),start:lz(t)}}function ROe(t){const{type:e,start:r}=_Oe(t),n={};return e&&(n.type=e),r!==1&&(n.start=r),n}function LOe(t,e,r=". "){const n=e+1;if(!t||t==="1")return`${n}${r}`;switch(t){case"a":return`${Y5(n)}${r}`;case"A":return`${Y5(n).toUpperCase()}${r}`;case"i":return`${q6(n)}${r}`;case"I":return`${oz(n)}${r}`;default:return`${n}${r}`}}function MOe(t){var e,r;const n=(e=t.tokens)==null?void 0:e[0];return!!(t.text&&((r=t.tokens)==null?void 0:r.length)===1&&(n==null?void 0:n.type)==="list"&&n.ordered&&n.raw===t.text)}function IOe(t,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(t)):e.parseInline([{type:"text",raw:t,text:t}])}var tle=Aa.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Wn(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{var r;if(t.type!=="list_item")return[];const n=(r=e.parseBlockChildren)!=null?r:e.parseChildren;let i=[];if(t.tokens&&t.tokens.length>0){if(MOe(t))return{type:"listItem",content:[{type:"paragraph",content:IOe(t.text||"",e)}]};if(t.tokens.some(s=>s.type==="paragraph"))i=n(t.tokens);else{const s=t.tokens[0];if(s&&s.type==="text"&&s.tokens&&s.tokens.length>0){if(i=[{type:"paragraph",content:e.parseInline(s.tokens)}],t.tokens.length>1){const l=t.tokens.slice(1),u=n(l);i.push(...u)}}else i=n(t.tokens)}}return i.length===0&&(i=[{type:"paragraph",content:[]}]),{type:"listItem",content:i}},renderMarkdown:(t,e,r)=>KF(t,e,n=>{var i,a,s,o;if(n.parentType==="bulletList")return"- ";if(n.parentType==="orderedList"){const l=((a=(i=n.meta)==null?void 0:i.parentAttrs)==null?void 0:a.start)||1,u=(o=(s=n.meta)==null?void 0:s.parentAttrs)==null?void 0:o.type,h=l-1+(n.index||0);return LOe(u,h,". ")}return"- "},r),addExtensions(){return[Zoe(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),NOe={};vOe(NOe,{findListItemPos:()=>Y6,getNextListDepth:()=>cz,handleBackspace:()=>RD,handleDelete:()=>LD,hasListBefore:()=>rle,hasListItemAfter:()=>DOe,hasListItemBefore:()=>OOe,listItemHasSubList:()=>$Oe,nextListIsDeeper:()=>nle,nextListIsHigher:()=>ile});var Y6=(t,e)=>{const{$from:r}=e.selection,n=ji(t,e.schema);let i=null,a=r.depth,s=r.pos,o=null;for(;a>0&&o===null;)i=r.node(a),i.type===n?o=a:(a-=1,s-=1);return o===null?null:{$pos:e.doc.resolve(s),depth:o}},cz=(t,e)=>{const r=Y6(t,e);if(!r)return!1;const[,n]=gNe(e,t,r.$pos.pos+4);return n},rle=(t,e,r)=>{const{$anchor:n}=t.selection,i=Math.max(0,n.pos-2),a=t.doc.resolve(i).node();return!(!a||!r.includes(a.type.name))},RD=(t,e,r)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Zd(t.state,e)&&rle(t.state,e,r)){const{$anchor:n}=t.state.selection,i=t.state.doc.resolve(n.before()-1),a=[];i.node().descendants((l,u)=>{l.type.name===e&&a.push({node:l,pos:u})});const s=a.at(-1);if(!s)return!1;const o=t.state.doc.resolve(i.start()+s.pos+1);return t.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}return!Zd(t.state,e)||!bNe(t.state)?!1:t.chain().liftListItem(e).run()},nle=(t,e)=>{const r=cz(t,e),n=Y6(t,e);return!n||!r?!1:r>n.depth},ile=(t,e)=>{const r=cz(t,e),n=Y6(t,e);return!n||!r?!1:r<n.depth},LD=(t,e)=>{if(!Zd(t.state,e)||!vNe(t.state,e))return!1;const{selection:r}=t.state,{$from:n,$to:i}=r;return!r.empty&&n.sameParent(i)?!1:nle(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():ile(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},DOe=(t,e)=>{var r;const{$anchor:n}=e.selection,i=e.doc.resolve(n.pos-n.parentOffset-2);return!(i.index()===i.parent.childCount-1||((r=i.nodeAfter)==null?void 0:r.type.name)!==t)},OOe=(t,e)=>{var r;const{$anchor:n}=e.selection,i=e.doc.resolve(n.pos-2);return!(i.index()===0||((r=i.nodeBefore)==null?void 0:r.type.name)!==t)},$Oe=(t,e,r)=>{if(!r)return!1;const n=ji(t,e.schema);let i=!1;return r.descendants(a=>{a.type===n&&(i=!0)}),i},ale=ci.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r})=>{t.state.schema.nodes[r]!==void 0&&LD(t,r)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r})=>{t.state.schema.nodes[r]!==void 0&&LD(t,r)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r,wrapperNames:n})=>{t.state.schema.nodes[r]!==void 0&&RD(t,r,n)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r,wrapperNames:n})=>{t.state.schema.nodes[r]!==void 0&&RD(t,r,n)&&(e=!0)}),e}}}}),MD=new RegExp(`^(\\s*)(${Joe})([.)])\\s+(.*)$`),POe=/^\s/,FT={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function BOe(t){return MD.test(t.trimStart())}function FOe(t){const e=t.trimStart();return FT.bulletItem.test(e)||BOe(e)||FT.heading.test(e)||FT.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||FT.codeFence.test(e)}function zOe(t){return Object.values(FT).some(e=>e.test(t))}function VOe(t){const e=[],r=[];let n=!1;return t.forEach(i=>{if(n){r.push(i);return}if(i.trim()===""){n=!0,r.push(i);return}if(e.length>0&&FOe(i)){n=!0,r.push(i);return}e.push(i)}),{paragraphLines:e,blockLines:r}}function GOe(t){const e=[];let r=0,n=0;for(;r<t.length;){const i=t[r],a=i.match(MD);if(!a)break;const[,s,o,l,u]=a,h=s.length,d=parseInt(o,10),f=isNaN(d)?U6(o):void 0,p=isNaN(d)?lz(o):d,g=[u];let m=r+1;const y=[i];let v=!1;for(;m<t.length;){const T=t[m];if(T.match(MD))break;if(T.trim()==="")y.push(T),g.push(""),v=!0,m+=1;else if(T.match(POe)){const w=T.length-T.trimStart().length,C=h+o.length+1;y.push(T),g.push(T.slice(Math.min(w,C))),m+=1}else{if(v||zOe(T))break;y.push(T),g.push(T),m+=1}}e.push({indent:h,number:p,type:f,content:g.join(`
`).trim(),contentLines:g,raw:y.join(`
`)}),n=m,r=m}return[e,n]}var WOe=new RegExp(`^(${Joe})([.)])\\s+(.+)$`);function HOe(t){const e=t.split(`
`).filter(a=>a.trim().length>0);if(e.length===0)return null;const r=[];for(const a of e){const s=a.trim().match(WOe);if(!s)return null;r.push({marker:s[1],content:s[3]})}const n=r.map(a=>a.marker);return AOe(n)?{type:"orderedList",attrs:ROe(r[0].marker),content:r.map(a=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:a.content}]}]}))}:null}function sle(t,e,r){const n=[];let i=0;for(;i<t.length;){const a=t[i];if(a.indent===e){const{paragraphLines:s,blockLines:o}=VOe(a.contentLines),l=s.join(`
`).trim(),u=[];l&&u.push({type:"paragraph",raw:l,tokens:r.inlineTokens(l)});const h=o.join(`
`).trim();if(h){const p=r.blockTokens(h);u.push(...p)}let d=i+1;const f=[];for(;d<t.length&&t[d].indent>e;)f.push(t[d]),d+=1;if(f.length>0){const p=Math.min(...f.map(m=>m.indent)),g=sle(f,p,r);u.push({type:"list",ordered:!0,start:f[0].number,typeMarker:f[0].type,items:g,raw:f.map(m=>m.raw).join(`
`)})}n.push({type:"list_item",raw:a.raw,tokens:u}),i=d}else i+=1}return n}function qOe(t,e){return t.map(r=>{if(r.type!=="list_item")return e.parseChildren([r])[0];const n=[];return r.tokens&&r.tokens.length>0&&r.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")n.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const a=e.parseChildren([i]);n.push({type:"paragraph",content:a})}else{const a=e.parseChildren([i]);a.length>0&&n.push(...a)}}),{type:"listItem",content:n}})}var UOe="listItem",RX="textStyle",LX=/^(\d+)\.\s$/;function MX(t){const e=t.match(/list-style-type\s*:\s*([^;]+)/i);if(!e)return null;switch(e[1].trim().toLowerCase()){case"upper-roman":return"I";case"lower-roman":return"i";case"upper-alpha":case"upper-latin":return"A";case"lower-alpha":case"lower-latin":return"a";default:return null}}var ole=Aa.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>{const e=t.getAttribute("type");if(e)return e;const r=t.getAttribute("style");if(r){const i=MX(r);if(i)return i}const n=t.querySelector("li");if(n){const i=n.getAttribute("style");if(i){const a=MX(i);if(a)return a}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,type:r,...n}=t,i=Wn(this.options.HTMLAttributes,n);return e!==1&&(i.start=e),r&&r!=="1"&&(i.type=r),["ol",i,0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const r=t.start||1,n=t.typeMarker,i=t.items?qOe(t.items,e):[],a={};return r!==1&&(a.start=r),n&&(a.type=n),Object.keys(a).length>0?{type:"orderedList",attrs:a,content:i}:{type:"orderedList",content:i}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(t,e,r)=>{var n,i;const a=t.split(`
`),[s,o]=GOe(a);if(s.length===0)return;const l=sle(s,s[0].indent,r);if(l.length===0)return;const u=((n=s[0])==null?void 0:n.number)||1,h=(i=s[0])==null?void 0:i.type;return{type:"list",ordered:!0,start:u,typeMarker:h,items:l,raw:a.slice(0,o).join(`
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(UOe,this.editor.getAttributes(RX)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new Un({props:{handlePaste:(t,e)=>{var r,n;const i=(r=e.clipboardData)==null?void 0:r.getData("text/html");if(i!=null&&i.trim())return!1;const a=(n=e.clipboardData)==null?void 0:n.getData("text/plain");if(!a)return!1;const s=HOe(a);if(!s)return!1;try{const o=t.state.schema.nodeFromJSON(s),l=t.state.tr.replaceSelectionWith(o);return t.dispatch(l),!0}catch{return!1}}}})]},addInputRules(){const t=(r,n)=>(!n.attrs.type||n.attrs.type==="1")&&n.childCount+n.attrs.start===+r[1];let e=xb({find:LX,type:this.type,getAttributes:r=>({start:+r[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=xb({find:LX,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:r=>({start:+r[1],...this.editor.getAttributes(RX)}),joinPredicate:t,editor:this.editor})),[e]}}),YOe=/^\s*(\[([( |x])?\])\s$/,XOe=Aa.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",Wn(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const r=[];if(t.tokens&&t.tokens.length>0?r.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?r.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):r.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const n=e.parseChildren(t.nestedTokens);r.push(...n)}return e.createNode("taskItem",{checked:t.checked||!1},r)},renderMarkdown:(t,e)=>{var r;const i=`- [${(r=t.attrs)!=null&&r.checked?"x":" "}] `;return KF(t,e,i)},addExtensions(){return this.options.nested?[Zoe(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:r,editor:n})=>{const i=document.createElement("li"),a=document.createElement("label"),s=document.createElement("span"),o=document.createElement("input"),l=document.createElement("div"),u=d=>{var f,p;o.ariaLabel=((p=(f=this.options.a11y)==null?void 0:f.checkboxLabel)==null?void 0:p.call(f,d,o.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`};u(t),a.contentEditable="false",o.type="checkbox",o.addEventListener("mousedown",d=>d.preventDefault()),o.addEventListener("change",d=>{if(!n.isEditable&&!this.options.onReadOnlyChecked){o.checked=!o.checked;return}const{checked:f}=d.target;n.isEditable&&typeof r=="function"&&n.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const g=r();if(typeof g!="number")return!1;const m=p.doc.nodeAt(g);return p.setNodeMarkup(g,void 0,{...m==null?void 0:m.attrs,checked:f}),!0}).run(),!n.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(o.checked=!o.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,f])=>{i.setAttribute(d,f)}),i.dataset.checked=t.attrs.checked,o.checked=t.attrs.checked,a.append(o,s),i.append(a,l),Object.entries(e).forEach(([d,f])=>{i.setAttribute(d,f)});let h=new Set(Object.keys(e));return{dom:i,contentDOM:l,update:d=>{if(d.type!==this.type)return!1;i.dataset.checked=d.attrs.checked,o.checked=d.attrs.checked,u(d);const f=n.extensionManager.attributes,p=xC(d,f),g=new Set(Object.keys(p)),m=this.options.HTMLAttributes;return h.forEach(y=>{g.has(y)||(y in m?i.setAttribute(y,m[y]):i.removeAttribute(y))}),Object.entries(p).forEach(([y,v])=>{v==null?y in m?i.setAttribute(y,m[y]):i.removeAttribute(y):i.setAttribute(y,v)}),h=g,!0}}}},addInputRules(){return[xb({find:YOe,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),jOe=Aa.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",Wn(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const r=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return r!==void 0?r:-1},tokenize(t,e,r){const n=a=>{const s=bD(a,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,l)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:r.inlineTokens(o.mainContent),nestedTokens:l}),customNestedParser:n},r);if(s){const o={type:"taskList",raw:s.raw,items:s.items},l=a.slice(s.raw.length);return l.trim()?[o,...r.blockTokens(l)]:[o]}return r.blockTokens(a)},i=bD(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,s)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:r.inlineTokens(a.mainContent),nestedTokens:s}),customNestedParser:n},r);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});ci.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(Koe.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(tle.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(ale.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(ole.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(XOe.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(jOe.configure(this.options.taskList)),t}});var lE="&nbsp;",bM=" ",KOe=Aa.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Wn(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const r=t.tokens||[];if(r.length===1&&r[0].type==="image")return e.parseChildren([r[0]]);const n=e.parseInline(r);return r.length===1&&r[0].type==="text"&&(r[0].raw===lE||r[0].text===lE||r[0].raw===bM||r[0].text===bM)&&n.length===1&&n[0].type==="text"&&(n[0].text===lE||n[0].text===bM)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,n)},renderMarkdown:(t,e,r)=>{var n,i;if(!t)return"";const a=Array.isArray(t.content)?t.content:[];if(a.length===0){const s=Array.isArray((n=r==null?void 0:r.previousNode)==null?void 0:n.content)?r.previousNode.content:[];return((i=r==null?void 0:r.previousNode)==null?void 0:i.type)==="paragraph"&&s.length===0?lE:""}return e.renderChildren(a)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),ZOe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,QOe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,JOe=Q0.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Wn(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[w0({find:ZOe,type:this.type})]},addPasteRules(){return[Qd({find:QOe,type:this.type})]}}),e$e=Aa.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),t$e=Q0.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Wn(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,r){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!i)return;const a=i[2].trim();return{type:"underline",raw:i[0],text:a,tokens:r.inlineTokens(a)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function r$e(t={}){return new Un({view(e){return new n$e(e,t)}})}class n$e{constructor(e,r){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=(n=r.width)!==null&&n!==void 0?n:1,this.color=r.color===!1?void 0:r.color||"black",this.class=r.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let a=s=>{this[i](s)};return e.dom.addEventListener(i,a),{name:i,handler:a}})}destroy(){this.handlers.forEach(({name:e,handler:r})=>this.editorView.dom.removeEventListener(e,r))}update(e,r){if(this.cursorPos!=null&&r.doc!=e.state.doc)if(this.lastDragEvent){let n=this.computeTarget(this.lastDragEvent);n==this.cursorPos?this.updateOverlay():this.setCursor(n)}else this.updateOverlay()}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),r=!e.parent.inlineContent,n,i=this.editorView.dom,a=i.getBoundingClientRect(),s=a.width/i.offsetWidth,o=a.height/i.offsetHeight;if(r){let d=e.nodeBefore,f=e.nodeAfter;if(d||f){let p=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(p){let g=p.getBoundingClientRect(),m=d?g.bottom:g.top;d&&f&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let y=this.width/2*o;n={left:g.left,right:g.right,top:m-y,bottom:m+y}}}}if(!n){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*s;n={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r);let u,h;if(!l||l==document.body&&getComputedStyle(l).position=="static")u=-pageXOffset,h=-pageYOffset;else{let d=l.getBoundingClientRect(),f=d.width/l.offsetWidth,p=d.height/l.offsetHeight;u=d.left-l.scrollLeft*f,h=d.top-l.scrollTop*p}this.element.style.left=(n.left-u)/s+"px",this.element.style.top=(n.top-h)/o+"px",this.element.style.width=(n.right-n.left)/s+"px",this.element.style.height=(n.bottom-n.top)/o+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let r=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=r&&r.inside>=0&&this.editorView.state.doc.nodeAt(r.inside),i=n&&n.type.spec.disableDropCursor,a=typeof i=="function"?i(this.editorView,r,e):i;if(!r||a)return null;let s=r.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let o=Kae(this.editorView.state.doc,s,this.editorView.dragging.slice);o!=null&&(s=o)}return s}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let r=this.computeTarget(e);r!=null&&(this.setCursor(r),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class wi extends Cr{constructor(e){super(e,e)}map(e,r){let n=e.resolve(r.map(this.head));return wi.valid(n)?new wi(n):Cr.near(n)}content(){return $t.empty}eq(e){return e instanceof wi&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new wi(e.resolve(r.pos))}getBookmark(){return new uz(this.anchor)}static valid(e){let r=e.parent;if(r.inlineContent||!i$e(e)||!a$e(e))return!1;let n=r.type.spec.allowGapCursor;if(n!=null)return n;let i=r.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,r,n=!1){e:for(;;){if(!n&&wi.valid(e))return e;let i=e.pos,a=null;for(let s=e.depth;;s--){let o=e.node(s);if(r>0?e.indexAfter(s)<o.childCount:e.index(s)>0){a=o.child(r>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=r;let l=e.doc.resolve(i);if(wi.valid(l))return l}for(;;){let s=r>0?a.firstChild:a.lastChild;if(!s){if(a.isAtom&&!a.isText&&!lr.isSelectable(a)){e=e.doc.resolve(i+a.nodeSize*r),n=!1;continue e}break}a=s,i+=r;let o=e.doc.resolve(i);if(wi.valid(o))return o}return null}}}wi.prototype.visible=!1;wi.findFrom=wi.findGapCursorFrom;Cr.jsonID("gapcursor",wi);class uz{constructor(e){this.pos=e}map(e){return new uz(e.map(this.pos))}resolve(e){let r=e.resolve(this.pos);return wi.valid(r)?new wi(r):Cr.near(r)}}function lle(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function i$e(t){for(let e=t.depth;e>=0;e--){let r=t.index(e),n=t.node(e);if(r==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(r-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||lle(i.type))return!0;if(i.inlineContent)return!1}}return!0}function a$e(t){for(let e=t.depth;e>=0;e--){let r=t.indexAfter(e),n=t.node(e);if(r==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(r);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||lle(i.type))return!0;if(i.inlineContent)return!1}}return!0}function s$e(){return new Un({props:{decorations:u$e,createSelectionBetween(t,e,r){return e.pos==r.pos&&wi.valid(r)?new wi(r):null},handleClick:l$e,handleKeyDown:o$e,handleDOMEvents:{beforeinput:c$e}}})}const o$e=zF({ArrowLeft:cE("horiz",-1),ArrowRight:cE("horiz",1),ArrowUp:cE("vert",-1),ArrowDown:cE("vert",1)});function cE(t,e){const r=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,a){let s=n.selection,o=e>0?s.$to:s.$from,l=s.empty;if(s instanceof rr){if(!a.endOfTextblock(r)||o.depth==0)return!1;l=!1,o=n.doc.resolve(e>0?o.after():o.before())}let u=wi.findGapCursorFrom(o,e,l);return u?(i&&i(n.tr.setSelection(new wi(u))),!0):!1}}function l$e(t,e,r){if(!t||!t.editable)return!1;let n=t.state.doc.resolve(e);if(!wi.valid(n))return!1;let i=t.posAtCoords({left:r.clientX,top:r.clientY});return i&&i.inside>-1&&lr.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new wi(n))),!0)}function c$e(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof wi))return!1;let{$from:r}=t.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(t.state.schema.nodes.text);if(!n)return!1;let i=gt.empty;for(let s=n.length-1;s>=0;s--)i=gt.from(n[s].createAndFill(null,i));let a=t.state.tr.replace(r.pos,r.pos,new $t(i,0,0));return a.setSelection(rr.near(a.doc.resolve(r.pos+1))),t.dispatch(a),!1}function u$e(t){if(!(t.selection instanceof wi))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",kn.create(t.doc,[ba.widget(t.selection.head,e,{key:"gapcursor"})])}var X5=200,wa=function(){};wa.prototype.append=function(e){return e.length?(e=wa.from(e),!this.length&&e||e.length<X5&&this.leafAppend(e)||this.length<X5&&e.leafPrepend(this)||this.appendInner(e)):this};wa.prototype.prepend=function(e){return e.length?wa.from(e).append(this):this};wa.prototype.appendInner=function(e){return new h$e(this,e)};wa.prototype.slice=function(e,r){return e===void 0&&(e=0),r===void 0&&(r=this.length),e>=r?wa.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,r))};wa.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};wa.prototype.forEach=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(e,r,n,0):this.forEachInvertedInner(e,r,n,0)};wa.prototype.map=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(a,s){return i.push(e(a,s))},r,n),i};wa.from=function(e){return e instanceof wa?e:e&&e.length?new cle(e):wa.empty};var cle=(function(t){function e(n){t.call(this),this.values=n}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,a){return i==0&&a==this.length?this:new e(this.values.slice(i,a))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,a,s,o){for(var l=a;l<s;l++)if(i(this.values[l],o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,a,s,o){for(var l=a-1;l>=s;l--)if(i(this.values[l],o+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=X5)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=X5)return new e(i.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(e.prototype,r),e})(wa);wa.empty=new cle([]);var h$e=(function(t){function e(r,n){t.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,i,a,s){var o=this.left.length;if(i<o&&this.left.forEachInner(n,i,Math.min(a,o),s)===!1||a>o&&this.right.forEachInner(n,Math.max(i-o,0),Math.min(this.length,a)-o,s+o)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,a,s){var o=this.left.length;if(i>o&&this.right.forEachInvertedInner(n,i-o,Math.max(a,o)-o,s+o)===!1||a<o&&this.left.forEachInvertedInner(n,Math.min(i,o),a,s)===!1)return!1},e.prototype.sliceInner=function(n,i){if(n==0&&i==this.length)return this;var a=this.left.length;return i<=a?this.left.slice(n,i):n>=a?this.right.slice(n-a,i-a):this.left.slice(n,a).append(this.right.slice(0,i-a))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})(wa);const d$e=500;let CC=class mm{constructor(e,r){this.items=e,this.eventCount=r}popEvent(e,r){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,a;r&&(i=this.remapping(n,this.items.length),a=i.maps.length);let s=e.tr,o,l,u=[],h=[];return this.items.forEach((d,f)=>{if(!d.step){i||(i=this.remapping(n,f+1),a=i.maps.length),a--,h.push(d);return}if(i){h.push(new Jh(d.map));let p=d.step.map(i.slice(a)),g;p&&s.maybeStep(p).doc&&(g=s.mapping.maps[s.mapping.maps.length-1],u.push(new Jh(g,void 0,void 0,u.length+h.length))),a--,g&&i.appendMap(g,a)}else s.maybeStep(d.step);if(d.selection)return o=i?d.selection.map(i.slice(a)):d.selection,l=new mm(this.items.slice(0,n).append(h.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:o}}addTransform(e,r,n,i){let a=[],s=this.eventCount,o=this.items,l=!i&&o.length?o.get(o.length-1):null;for(let h=0;h<e.steps.length;h++){let d=e.steps[h].invert(e.docs[h]),f=new Jh(e.mapping.maps[h],d,r),p;(p=l&&l.merge(f))&&(f=p,h?a.pop():o=o.slice(0,o.length-1)),a.push(f),r&&(s++,r=void 0),i||(l=f)}let u=s-n.depth;return u>p$e&&(o=f$e(o,u),s-=u),new mm(o.append(a),s)}remapping(e,r){let n=new pC;return this.items.forEach((i,a)=>{let s=i.mirrorOffset!=null&&a-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,s)},e,r),n}addMaps(e){return this.eventCount==0?this:new mm(this.items.append(e.map(r=>new Jh(r))),this.eventCount)}rebased(e,r){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-r),a=e.mapping,s=e.steps.length,o=this.eventCount;this.items.forEach(f=>{f.selection&&o--},i);let l=r;this.items.forEach(f=>{let p=a.getMirror(--l);if(p==null)return;s=Math.min(s,p);let g=a.maps[p];if(f.step){let m=e.steps[p].invert(e.docs[p]),y=f.selection&&f.selection.map(a.slice(l+1,p));y&&o++,n.push(new Jh(g,m,y))}else n.push(new Jh(g))},i);let u=[];for(let f=r;f<s;f++)u.push(new Jh(a.maps[f]));let h=this.items.slice(0,i).append(u).append(n),d=new mm(h,o);return d.emptyItemCount()>d$e&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach(r=>{r.step||e++}),e}compress(e=this.items.length){let r=this.remapping(0,e),n=r.maps.length,i=[],a=0;return this.items.forEach((s,o)=>{if(o>=e)i.push(s),s.selection&&a++;else if(s.step){let l=s.step.map(r.slice(n)),u=l&&l.getMap();if(n--,u&&r.appendMap(u,n),l){let h=s.selection&&s.selection.map(r.slice(n));h&&a++;let d=new Jh(u.invert(),l,h),f,p=i.length-1;(f=i.length&&i[p].merge(d))?i[p]=f:i.push(d)}}else s.map&&n--},this.items.length,0),new mm(wa.from(i.reverse()),a)}};CC.empty=new CC(wa.empty,0);function f$e(t,e){let r;return t.forEach((n,i)=>{if(n.selection&&e--==0)return r=i,!1}),t.slice(r)}let Jh=class ule{constructor(e,r,n,i){this.map=e,this.step=r,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let r=e.step.merge(this.step);if(r)return new ule(r.getMap().invert(),r,this.selection)}}};class dd{constructor(e,r,n,i,a){this.done=e,this.undone=r,this.prevRanges=n,this.prevTime=i,this.prevComposition=a}}const p$e=20;function g$e(t,e,r,n){let i=r.getMeta(c0),a;if(i)return i.historyState;r.getMeta(v$e)&&(t=new dd(t.done,t.undone,null,0,-1));let s=r.getMeta("appendedTransaction");if(r.steps.length==0)return t;if(s&&s.getMeta(c0))return s.getMeta(c0).redo?new dd(t.done.addTransform(r,void 0,n,$4(e)),t.undone,IX(r.mapping.maps),t.prevTime,t.prevComposition):new dd(t.done,t.undone.addTransform(r,void 0,n,$4(e)),null,t.prevTime,t.prevComposition);if(r.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let o=r.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=o&&(t.prevTime<(r.time||0)-n.newGroupDelay||!m$e(r,t.prevRanges)),u=s?xM(t.prevRanges,r.mapping):IX(r.mapping.maps);return new dd(t.done.addTransform(r,l?e.selection.getBookmark():void 0,n,$4(e)),CC.empty,u,r.time,o??t.prevComposition)}else return(a=r.getMeta("rebased"))?new dd(t.done.rebased(r,a),t.undone.rebased(r,a),xM(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new dd(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),xM(t.prevRanges,r.mapping),t.prevTime,t.prevComposition)}function m$e(t,e){if(!e)return!1;if(!t.docChanged)return!0;let r=!1;return t.mapping.maps[0].forEach((n,i)=>{for(let a=0;a<e.length;a+=2)n<=e[a+1]&&i>=e[a]&&(r=!0)}),r}function IX(t){let e=[];for(let r=t.length-1;r>=0&&e.length==0;r--)t[r].forEach((n,i,a,s)=>e.push(a,s));return e}function xM(t,e){if(!t)return null;let r=[];for(let n=0;n<t.length;n+=2){let i=e.map(t[n],1),a=e.map(t[n+1],-1);i<=a&&r.push(i,a)}return r}function y$e(t,e,r){let n=$4(e),i=c0.get(e).spec.config,a=(r?t.undone:t.done).popEvent(e,n);if(!a)return null;let s=a.selection.resolve(a.transform.doc),o=(r?t.done:t.undone).addTransform(a.transform,e.selection.getBookmark(),i,n),l=new dd(r?o:a.remaining,r?a.remaining:o,null,0,-1);return a.transform.setSelection(s).setMeta(c0,{redo:r,historyState:l})}let TM=!1,NX=null;function $4(t){let e=t.plugins;if(NX!=e){TM=!1,NX=e;for(let r=0;r<e.length;r++)if(e[r].spec.historyPreserveItems){TM=!0;break}}return TM}const c0=new Ei("history"),v$e=new Ei("closeHistory");function b$e(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Un({key:c0,state:{init(){return new dd(CC.empty,CC.empty,null,0,-1)},apply(e,r,n){return g$e(r,n,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,r){let n=r.inputType,i=n=="historyUndo"?dle:n=="historyRedo"?fle:null;return!i||!e.editable?!1:(r.preventDefault(),i(e.state,e.dispatch))}}}})}function hle(t,e){return(r,n)=>{let i=c0.getState(r);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(n){let a=y$e(i,r,t);a&&n(e?a.scrollIntoView():a)}return!0}}const dle=hle(!1,!0),fle=hle(!0,!0);ci.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,r=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(r)}},addProseMirrorPlugins(){let t=!1;return[new Un({key:new Ei("characterCount"),appendTransaction:(e,r,n)=>{if(t)return;const i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){t=!0;return}const s=this.storage.characters({node:n.doc});if(s>i){const o=s-i,l=0,u=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const h=n.tr.deleteRange(l,u);return t=!0,h}t=!0},filterTransaction:(e,r)=>{const n=this.options.limit;if(!e.docChanged||n===0||n===null||n===void 0)return!0;const i=this.storage.characters({node:r.doc}),a=this.storage.characters({node:e.doc});if(a<=n||i>n&&a>n&&a<=i)return!0;if(i>n&&a>n&&a>i||!e.getMeta("paste"))return!1;const o=e.selection.$head.pos,l=a-n,u=o-l,h=o;return e.deleteRange(u,h),!(this.storage.characters({node:e.doc})>n)}})]}});var x$e=ci.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[r$e(this.options)]}});ci.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Un({key:new Ei("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:r,isFocused:n}=this.editor,{anchor:i}=e,a=[];if(!r||!n)return kn.create(t,[]);let s=0;this.options.mode==="deepest"&&t.descendants((l,u)=>{if(l.isText)return;if(!(i>=u&&i<=u+l.nodeSize-1))return!1;s+=1});let o=0;return t.descendants((l,u)=>{if(l.isText||!(i>=u&&i<=u+l.nodeSize-1))return!1;if(o+=1,this.options.mode==="deepest"&&s-o>0||this.options.mode==="shallowest"&&o>1)return this.options.mode==="deepest";a.push(ba.node(u,u+l.nodeSize,{class:this.options.className}))}),kn.create(t,a)}}})]}});var T$e=ci.create({name:"gapCursor",addProseMirrorPlugins(){return[s$e()]},extendNodeSchema(t){var e;const r={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=un(Ut(t,"allowGapCursor",r)))!=null?e:null}}}),ple="placeholder",DX=new Ei("tiptap__placeholder");function gle(t){const{editor:e,placeholder:r,dataAttribute:n,pos:i,node:a,isEmptyDoc:s,hasAnchor:o,classes:{emptyNode:l,emptyEditor:u}}=t,h=[l];return s&&h.push(u),ba.node(i,i+a.nodeSize,{class:h.join(" "),[n]:typeof r=="function"?r({editor:e,node:a,pos:i,hasAnchor:o}):r})}function mle(t,e){return typeof t=="function"?t(e):t}function yle({editor:t,options:e,dataAttribute:r,doc:n,selection:i,from:a,to:s}){const{anchor:o}=i,l=[],u=t.isEmpty;return n.nodesBetween(a,s,(h,d)=>{const f=o>=d&&o<=d+h.nodeSize,p=!h.isLeaf&&Wk(h);return h.type.isTextblock&&(f||!e.showOnlyCurrent)&&p&&l.push(gle({editor:t,isEmptyDoc:u,dataAttribute:r,hasAnchor:f,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:mle(e.emptyNodeClass,{editor:t,node:h,pos:d,hasAnchor:f})},node:h,pos:d})),e.includeChildren}),l}function vle({editor:t,options:e,dataAttribute:r,doc:n,selection:i}){if(!(t.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:s}=i,o=[],l=t.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){const h=n.resolve(s),d=h.depth>0?h.node(1):h.nodeAfter,f=h.depth>0?h.before(1):s;if(d&&d.type.isTextblock&&Wk(d)){const p=s>=f&&s<=f+d.nodeSize;o.push(gle({editor:t,isEmptyDoc:l,dataAttribute:r,hasAnchor:p,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:mle(e.emptyNodeClass,{editor:t,node:d,pos:f,hasAnchor:p})},node:d,pos:f}))}}else o.push(...yle({editor:t,options:e,dataAttribute:r,doc:n,selection:i,from:0,to:n.content.size}));return kn.create(n,o)}function Mw(t,e){var r;const n=t.resolve(e);if(n.depth===0){const s=(r=n.nodeAfter)!=null?r:n.nodeBefore;if(!s)return{from:e,to:e};const o=n.nodeAfter?e:e-s.nodeSize;return{from:o,to:o+s.nodeSize}}const i=n.before(1),a=n.node(1);return{from:i,to:i+a.nodeSize}}function Iw(t,e){return{from:Math.max(0,e.from-1),to:Math.min(t.content.size,e.to-1)}}function w$e(t,e,r){const n=[];return t.forEach((i,a)=>{const s=a,o=s+i.nodeSize,l=s+1,u=o+1;l<r&&u>e&&n.push({from:s,to:o})}),n}function C$e(t){if(t.length===0)return[];const e=[...t].sort((n,i)=>n.from-i.from),r=[{...e[0]}];for(let n=1;n<e.length;n+=1){const i=r[r.length-1],a=e[n];a.from<=i.to?i.to=Math.max(i.to,a.to):r.push({...a})}return r}function k$e(t,e){const r=w$e(t,e.from,e.to);return r.push(Iw(t,Mw(t,e.from))),e.to>e.from?r.push(Iw(t,Mw(t,Math.min(e.to,t.content.size+1)-1))):e.from<t.content.size+1&&r.push(Iw(t,Mw(t,Math.min(e.from+1,t.content.size)))),r}function S$e(t,e,r){const n=[];if(t.docChanged){const i=UF(t);for(const a of i)n.push(...k$e(r.doc,a.newRange))}return t.selectionSet&&(n.push(Iw(r.doc,Mw(r.doc,t.mapping.map(e.selection.anchor)))),n.push(Iw(r.doc,Mw(r.doc,r.selection.anchor)))),C$e(n)}function E$e(t,e,r){const n=Math.max(0,Math.min(t,r.content.size)),i=Math.max(n,Math.min(e,r.content.size));return{from:n,to:i}}function A$e({decorations:t,ranges:e,editor:r,options:n,dataAttribute:i,doc:a,selection:s}){let o=t;for(const l of e){const{from:u,to:h}=E$e(l.from,l.to,a),d=o.find(u,h).filter(p=>p.from>=u&&p.to<=h);d.length&&(o=o.remove(d));const f=yle({editor:r,options:n,dataAttribute:i,doc:a,selection:s,from:u,to:h});f.length&&(o=o.add(a,f))}return o}function _$e({editor:t,options:e,dataAttribute:r}){return{init(n,i){const a=vle({editor:t,options:e,dataAttribute:r,doc:i.doc,selection:i.selection});return a??kn.empty},apply(n,i,a,s){if(!n.docChanged&&!n.selectionSet)return i;const o=i.map(n.mapping,n.doc),l=S$e(n,a,s);return A$e({decorations:o,ranges:l,editor:t,options:e,dataAttribute:r,doc:s.doc,selection:s.selection})}}}function R$e(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function L$e({editor:t,options:e}){const r=e.dataAttribute?`data-${R$e(e.dataAttribute)}`:`data-${ple}`,n=e.showOnlyCurrent&&!e.includeChildren;return new Un({key:DX,...n?{}:{state:_$e({editor:t,options:e,dataAttribute:r})},props:{decorations:n?({doc:i,selection:a})=>vle({editor:t,options:e,dataAttribute:r,doc:i,selection:a}):i=>{var a;return e.showOnlyWhenEditable&&!t.isEditable?kn.empty:(a=DX.getState(i))!=null?a:kn.empty}}})}var M$e=ci.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:ple,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[L$e({editor:this.editor,options:this.options})]}});function ID(t,e){return!t.selection.empty&&!goe(t.selection)&&e.isEditable}function I$e(t,e){return ID(t,e)&&!e.isFocused&&!e.view.dragging}function N$e(){var t;(t=window.getSelection())==null||t.removeAllRanges()}function D$e(t){t.focus()}ci.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Un({key:new Ei("selection"),props:{decorations(r){return I$e(r,t)?kn.create(r.doc,[ba.inline(r.selection.from,r.selection.to,{class:e.className})]):null},handleDOMEvents:{blur(r){return ID(r.state,t)&&N$e(),!1},focus(r){return ID(r.state,t)&&requestAnimationFrame(()=>{!t.isDestroyed&&r.hasFocus()&&D$e(r)}),!1}}}})]}});var O$e="skipTrailingNode";function OX({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var $$e=ci.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Ei(this.name),r=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",n=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(r).includes(i.name));return[new Un({key:e,appendTransaction:(i,a,s)=>{const{doc:o,tr:l,schema:u}=s,h=e.getState(s),d=o.content.size,f=u.nodes[r];if(!i.some(p=>p.getMeta(O$e))&&h)return l.insert(d,f.create())},state:{init:(i,a)=>{const s=a.tr.doc.lastChild;return!OX({node:s,types:n})},apply:(i,a)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return a;const s=i.doc.lastChild;return!OX({node:s,types:n})}}})]}}),P$e=ci.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>dle(t,e),redo:()=>({state:t,dispatch:e})=>fle(t,e)}},addProseMirrorPlugins(){return[b$e(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),B$e=ci.create({name:"starterKit",addExtensions(){var t,e,r,n;const i=[];return this.options.bold!==!1&&i.push(CDe.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(vDe.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(Koe.configure(this.options.bulletList)),this.options.code!==!1&&i.push(EDe.configure(this.options.code)),this.options.codeBlock!==!1&&i.push($oe.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(LDe.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(x$e.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(T$e.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(MDe.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(IDe.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(P$e.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(NDe.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(BDe.configure(this.options.italic)),this.options.listItem!==!1&&i.push(tle.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(ale.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&i.push(mOe.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(ole.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(KOe.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(JOe.configure(this.options.strike)),this.options.text!==!1&&i.push(e$e.configure(this.options.text)),this.options.underline!==!1&&i.push(t$e.configure((r=this.options)==null?void 0:r.underline)),this.options.trailingNode!==!1&&i.push($$e.configure((n=this.options)==null?void 0:n.trailingNode)),i}}),F$e=B$e,z$e=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,V$e=Aa.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",Wn(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,r,n,i,a,s;const o=(r=(e=t.attrs)==null?void 0:e.src)!=null?r:"",l=(i=(n=t.attrs)==null?void 0:n.alt)!=null?i:"",u=(s=(a=t.attrs)==null?void 0:a.title)!=null?s:"";return u?`![${l}](${o} "${u}")`:`![${l}](${o})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:r,alwaysPreserveAspectRatio:n}=this.options.resize;return({node:i,getPos:a,HTMLAttributes:s,editor:o})=>{const l=document.createElement("img");l.draggable=!1;const u=Wn(this.options.HTMLAttributes,s);Object.entries(u).forEach(([f,p])=>{if(p!=null)switch(f){case"width":case"height":break;default:l.setAttribute(f,p);break}}),u.src!==null&&(l.src=u.src);const h=new gDe({element:l,editor:o,node:i,getPos:a,onResize:(f,p)=>{l.style.width=`${f}px`,l.style.height=`${p}px`},onCommit:(f,p)=>{const g=a();g!==void 0&&this.editor.chain().setNodeSelection(g).updateAttributes(this.name,{width:f,height:p}).run()},onUpdate:(f,p,g)=>f.type===i.type,options:{directions:t,min:{width:e,height:r},preserveAspectRatio:n===!0}}),d=h.dom;return d.style.visibility="hidden",d.style.pointerEvents="none",l.onload=()=>{d.style.visibility="",d.style.pointerEvents=""},h}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Doe({find:z$e,type:this.type,getAttributes:t=>{const[,,e,r,n]=t;return{src:r,alt:e,title:n}}})]}}),G$e=V$e,W$e=M$e;let ND,DD;if(typeof WeakMap<"u"){let t=new WeakMap;ND=e=>t.get(e),DD=(e,r)=>(t.set(e,r),r)}else{const t=[];let r=0;ND=n=>{for(let i=0;i<t.length;i+=2)if(t[i]==n)return t[i+1]},DD=(n,i)=>(r==10&&(r=0),t[r++]=n,t[r++]=i)}var Ci=class{constructor(t,e,r,n){this.width=t,this.height=e,this.map=r,this.problems=n}findCell(t){for(let e=0;e<this.map.length;e++){const r=this.map[e];if(r!=t)continue;const n=e%this.width,i=e/this.width|0;let a=n+1,s=i+1;for(let o=1;a<this.width&&this.map[e+o]==r;o++)a++;for(let o=1;s<this.height&&this.map[e+this.width*o]==r;o++)s++;return{left:n,top:i,right:a,bottom:s}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,r){const{left:n,right:i,top:a,bottom:s}=this.findCell(t);return e=="horiz"?(r<0?n==0:i==this.width)?null:this.map[a*this.width+(r<0?n-1:i)]:(r<0?a==0:s==this.height)?null:this.map[n+this.width*(r<0?a-1:s)]}rectBetween(t,e){const{left:r,right:n,top:i,bottom:a}=this.findCell(t),{left:s,right:o,top:l,bottom:u}=this.findCell(e);return{left:Math.min(r,s),top:Math.min(i,l),right:Math.max(n,o),bottom:Math.max(a,u)}}cellsInRect(t){const e=[],r={};for(let n=t.top;n<t.bottom;n++)for(let i=t.left;i<t.right;i++){const a=n*this.width+i,s=this.map[a];r[s]||(r[s]=!0,!(i==t.left&&i&&this.map[a-1]==s||n==t.top&&n&&this.map[a-this.width]==s)&&e.push(s))}return e}positionAt(t,e,r){for(let n=0,i=0;;n++){const a=i+r.child(n).nodeSize;if(n==t){let s=e+t*this.width;const o=(t+1)*this.width;for(;s<o&&this.map[s]<i;)s++;return s==o?a-1:this.map[s]}i=a}}static get(t){return ND(t)||DD(t,H$e(t))}};function H$e(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=q$e(t),r=t.childCount,n=[];let i=0,a=null;const s=[];for(let u=0,h=e*r;u<h;u++)n[u]=0;for(let u=0,h=0;u<r;u++){const d=t.child(u);h++;for(let g=0;;g++){for(;i<n.length&&n[i]!=0;)i++;if(g==d.childCount)break;const m=d.child(g),{colspan:y,rowspan:v,colwidth:T}=m.attrs;for(let b=0;b<v;b++){if(b+u>=r){(a||(a=[])).push({type:"overlong_rowspan",pos:h,n:v-b});break}const w=i+b*e;for(let C=0;C<y;C++){n[w+C]==0?n[w+C]=h:(a||(a=[])).push({type:"collision",row:u,pos:h,n:y-C});const S=T&&T[C];if(S){const k=(w+C)%e*2,E=s[k];E==null||E!=S&&s[k+1]==1?(s[k]=S,s[k+1]=1):E==S&&s[k+1]++}}}i+=y,h+=m.nodeSize}const f=(u+1)*e;let p=0;for(;i<f;)n[i++]==0&&p++;p&&(a||(a=[])).push({type:"missing",row:u,n:p}),h++}(e===0||r===0)&&(a||(a=[])).push({type:"zero_sized"});const o=new Ci(e,r,n,a);let l=!1;for(let u=0;!l&&u<s.length;u+=2)s[u]!=null&&s[u+1]<r&&(l=!0);return l&&U$e(o,s,t),o}function q$e(t){let e=-1,r=!1;for(let n=0;n<t.childCount;n++){const i=t.child(n);let a=0;if(r)for(let s=0;s<n;s++){const o=t.child(s);for(let l=0;l<o.childCount;l++){const u=o.child(l);s+u.attrs.rowspan>n&&(a+=u.attrs.colspan)}}for(let s=0;s<i.childCount;s++){const o=i.child(s);a+=o.attrs.colspan,o.attrs.rowspan>1&&(r=!0)}e==-1?e=a:e!=a&&(e=Math.max(e,a))}return e}function U$e(t,e,r){t.problems||(t.problems=[]);const n={};for(let i=0;i<t.map.length;i++){const a=t.map[i];if(n[a])continue;n[a]=!0;const s=r.nodeAt(a);if(!s)throw new RangeError(`No cell with offset ${a} found`);let o=null;const l=s.attrs;for(let u=0;u<l.colspan;u++){const h=e[(i+u)%t.width*2];h!=null&&(!l.colwidth||l.colwidth[u]!=h)&&((o||(o=Y$e(l)))[u]=h)}o&&t.problems.unshift({type:"colwidth mismatch",pos:a,colwidth:o})}}function Y$e(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let r=0;r<t.colspan;r++)e.push(0);return e}function gs(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const r in t.nodes){const n=t.nodes[r],i=n.spec.tableRole;i&&(e[i]=n)}}return e}const Cd=new Ei("selectingCells");function C0(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function X$e(t){for(let e=t.depth;e>0;e--){const r=t.node(e).type.spec.tableRole;if(r==="cell"||r==="header_cell")return t.node(e)}return null}function hc(t){const e=t.selection.$head;for(let r=e.depth;r>0;r--)if(e.node(r).type.spec.tableRole=="row")return!0;return!1}function X6(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const r=C0(e.$head)||j$e(e.$head);if(r)return r;throw new RangeError(`No cell found around position ${e.head}`)}function j$e(t){for(let e=t.nodeAfter,r=t.pos;e;e=e.firstChild,r++){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return t.doc.resolve(r)}for(let e=t.nodeBefore,r=t.pos;e;e=e.lastChild,r--){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return t.doc.resolve(r-e.nodeSize)}}function OD(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function K$e(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function hz(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function ble(t,e,r){const n=t.node(-1),i=Ci.get(n),a=t.start(-1),s=i.nextCell(t.pos-a,e,r);return s==null?null:t.node(0).resolve(a+s)}function k0(t,e,r=1){const n={...t,colspan:t.colspan-r};return n.colwidth&&(n.colwidth=n.colwidth.slice(),n.colwidth.splice(e,r),n.colwidth.some(i=>i>0)||(n.colwidth=null)),n}function xle(t,e,r=1){const n={...t,colspan:t.colspan+r};if(n.colwidth){n.colwidth=n.colwidth.slice();for(let i=0;i<r;i++)n.colwidth.splice(e,0,0)}return n}function Z$e(t,e,r){const n=gs(e.type.schema).header_cell;for(let i=0;i<t.height;i++)if(e.nodeAt(t.map[r+i*t.width]).type!=n)return!1;return!0}var Gn=class $u extends Cr{constructor(e,r=e){const n=e.node(-1),i=Ci.get(n),a=e.start(-1),s=i.rectBetween(e.pos-a,r.pos-a),o=e.node(0),l=i.cellsInRect(s).filter(h=>h!=r.pos-a);l.unshift(r.pos-a);const u=l.map(h=>{const d=n.nodeAt(h);if(!d)throw new RangeError(`No cell with offset ${h} found`);const f=a+h+1;return new tse(o.resolve(f),o.resolve(f+d.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=e,this.$headCell=r}map(e,r){const n=e.resolve(r.map(this.$anchorCell.pos)),i=e.resolve(r.map(this.$headCell.pos));if(OD(n)&&OD(i)&&hz(n,i)){const a=this.$anchorCell.node(-1)!=n.node(-1);return a&&this.isRowSelection()?$u.rowSelection(n,i):a&&this.isColSelection()?$u.colSelection(n,i):new $u(n,i)}return rr.between(n,i)}content(){const e=this.$anchorCell.node(-1),r=Ci.get(e),n=this.$anchorCell.start(-1),i=r.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),a={},s=[];for(let l=i.top;l<i.bottom;l++){const u=[];for(let h=l*r.width+i.left,d=i.left;d<i.right;d++,h++){const f=r.map[h];if(a[f])continue;a[f]=!0;const p=r.findCell(f);let g=e.nodeAt(f);if(!g)throw new RangeError(`No cell with offset ${f} found`);const m=i.left-p.left,y=p.right-i.right;if(m>0||y>0){let v=g.attrs;if(m>0&&(v=k0(v,0,m)),y>0&&(v=k0(v,v.colspan-y,y)),p.left<i.left){if(g=g.type.createAndFill(v),!g)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(v)}`)}else g=g.type.create(v,g.content)}if(p.top<i.top||p.bottom>i.bottom){const v={...g.attrs,rowspan:Math.min(p.bottom,i.bottom)-Math.max(p.top,i.top)};p.top<i.top?g=g.type.createAndFill(v):g=g.type.create(v,g.content)}u.push(g)}s.push(e.child(l).copy(gt.from(u)))}const o=this.isColSelection()&&this.isRowSelection()?e:s;return new $t(gt.from(o),1,1)}replace(e,r=$t.empty){const n=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){const{$from:o,$to:l}=i[s],u=e.mapping.slice(n);e.replace(u.map(o.pos),u.map(l.pos),s?$t.empty:r)}const a=Cr.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);a&&e.setSelection(a)}replaceWith(e,r){this.replace(e,new $t(gt.from(r),0,0))}forEachCell(e){const r=this.$anchorCell.node(-1),n=Ci.get(r),i=this.$anchorCell.start(-1),a=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let s=0;s<a.length;s++)e(r.nodeAt(a[s]),i+a[s])}isColSelection(){const e=this.$anchorCell.index(-1),r=this.$headCell.index(-1);if(Math.min(e,r)>0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=r+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,i)==this.$headCell.node(-1).childCount}static colSelection(e,r=e){const n=e.node(-1),i=Ci.get(n),a=e.start(-1),s=i.findCell(e.pos-a),o=i.findCell(r.pos-a),l=e.node(0);return s.top<=o.top?(s.top>0&&(e=l.resolve(a+i.map[s.left])),o.bottom<i.height&&(r=l.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))):(o.top>0&&(r=l.resolve(a+i.map[o.left])),s.bottom<i.height&&(e=l.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))),new $u(e,r)}isRowSelection(){const e=this.$anchorCell.node(-1),r=Ci.get(e),n=this.$anchorCell.start(-1),i=r.colCount(this.$anchorCell.pos-n),a=r.colCount(this.$headCell.pos-n);if(Math.min(i,a)>0)return!1;const s=i+this.$anchorCell.nodeAfter.attrs.colspan,o=a+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,o)==r.width}eq(e){return e instanceof $u&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,r=e){const n=e.node(-1),i=Ci.get(n),a=e.start(-1),s=i.findCell(e.pos-a),o=i.findCell(r.pos-a),l=e.node(0);return s.left<=o.left?(s.left>0&&(e=l.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(r=l.resolve(a+i.map[i.width*(o.top+1)-1]))):(o.left>0&&(r=l.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(e=l.resolve(a+i.map[i.width*(s.top+1)-1]))),new $u(e,r)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,r){return new $u(e.resolve(r.anchor),e.resolve(r.head))}static create(e,r,n=r){return new $u(e.resolve(r),e.resolve(n))}getBookmark(){return new Q$e(this.$anchorCell.pos,this.$headCell.pos)}};Gn.prototype.visible=!1;Cr.jsonID("cell",Gn);var Q$e=class Tle{constructor(e,r){this.anchor=e,this.head=r}map(e){return new Tle(e.map(this.anchor),e.map(this.head))}resolve(e){const r=e.resolve(this.anchor),n=e.resolve(this.head);return r.parent.type.spec.tableRole=="row"&&n.parent.type.spec.tableRole=="row"&&r.index()<r.parent.childCount&&n.index()<n.parent.childCount&&hz(r,n)?new Gn(r,n):Cr.near(n,1)}};function J$e(t){if(!(t.selection instanceof Gn))return null;const e=[];return t.selection.forEachCell((r,n)=>{e.push(ba.node(n,n+r.nodeSize,{class:"selectedCell"}))}),kn.create(t.doc,e)}function ePe({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let r=t.pos,n=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,r++);for(let a=e.depth;a>=0&&!(e.before(a+1)>e.start(a));a--,n--);return r==n&&/row|table/.test(t.node(i).type.spec.tableRole)}function tPe({$from:t,$to:e}){let r,n;for(let i=t.depth;i>0;i--){const a=t.node(i);if(a.type.spec.tableRole==="cell"||a.type.spec.tableRole==="header_cell"){r=a;break}}for(let i=e.depth;i>0;i--){const a=e.node(i);if(a.type.spec.tableRole==="cell"||a.type.spec.tableRole==="header_cell"){n=a;break}}return r!==n&&e.parentOffset===0}function rPe(t,e,r){const n=(e||t).selection,i=(e||t).doc;let a,s;if(n instanceof lr&&(s=n.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")a=Gn.create(i,n.from);else if(s=="row"){const o=i.resolve(n.from+1);a=Gn.rowSelection(o,o)}else if(!r){const o=Ci.get(n.node),l=n.from+1,u=l+o.map[o.width*o.height-1];a=Gn.create(i,l+1,u)}}else n instanceof rr&&ePe(n)?a=rr.create(i,n.from):n instanceof rr&&tPe(n)&&(a=rr.create(i,n.$from.start(),n.$from.end()));return a&&(e||(e=t.tr)).setSelection(a),e}const nPe=new Ei("fix-tables");function wle(t,e,r,n){const i=t.childCount,a=e.childCount;e:for(let s=0,o=0;s<a;s++){const l=e.child(s);for(let u=o,h=Math.min(i,s+3);u<h;u++)if(t.child(u)==l){o=u+1,r+=l.nodeSize;continue e}n(l,r),o<i&&t.child(o).sameMarkup(l)?wle(t.child(o),l,r+1,n):l.nodesBetween(0,l.content.size,n,r+1),r+=l.nodeSize}}function Cle(t,e){let r;const n=(i,a)=>{i.type.spec.tableRole=="table"&&(r=iPe(t,i,a,r))};return e?e.doc!=t.doc&&wle(e.doc,t.doc,0,n):t.doc.descendants(n),r}function iPe(t,e,r,n){const i=Ci.get(e);if(!i.problems)return n;n||(n=t.tr);const a=[];for(let l=0;l<i.height;l++)a.push(0);for(let l=0;l<i.problems.length;l++){const u=i.problems[l];if(u.type=="collision"){const h=e.nodeAt(u.pos);if(!h)continue;const d=h.attrs;for(let f=0;f<d.rowspan;f++)a[u.row+f]+=u.n;n.setNodeMarkup(n.mapping.map(r+1+u.pos),null,k0(d,d.colspan-u.n,u.n))}else if(u.type=="missing")a[u.row]+=u.n;else if(u.type=="overlong_rowspan"){const h=e.nodeAt(u.pos);if(!h)continue;n.setNodeMarkup(n.mapping.map(r+1+u.pos),null,{...h.attrs,rowspan:h.attrs.rowspan-u.n})}else if(u.type=="colwidth mismatch"){const h=e.nodeAt(u.pos);if(!h)continue;n.setNodeMarkup(n.mapping.map(r+1+u.pos),null,{...h.attrs,colwidth:u.colwidth})}else if(u.type=="zero_sized"){const h=n.mapping.map(r);n.delete(h,h+e.nodeSize)}}let s,o;for(let l=0;l<a.length;l++)a[l]&&(s==null&&(s=l),o=l);for(let l=0,u=r+1;l<i.height;l++){const h=e.child(l),d=u+h.nodeSize,f=a[l];if(f>0){let p="cell";h.firstChild&&(p=h.firstChild.type.spec.tableRole);const g=[];for(let y=0;y<f;y++){const v=gs(t.schema)[p].createAndFill();v&&g.push(v)}const m=(l==0||s==l-1)&&o==l?u+1:d-1;n.insert(n.mapping.map(m),g)}u=d}return n.setMeta(nPe,{fixTables:!0})}function nu(t){const e=t.selection,r=X6(t),n=r.node(-1),i=r.start(-1),a=Ci.get(n);return{...e instanceof Gn?a.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):a.findCell(r.pos-i),tableStart:i,map:a,table:n}}function kle(t,{map:e,tableStart:r,table:n},i){let a=i>0?-1:0;Z$e(e,n,i+a)&&(a=i==0||i==e.width?null:0);for(let s=0;s<e.height;s++){const o=s*e.width+i;if(i>0&&i<e.width&&e.map[o-1]==e.map[o]){const l=e.map[o],u=n.nodeAt(l);t.setNodeMarkup(t.mapping.map(r+l),null,xle(u.attrs,i-e.colCount(l))),s+=u.attrs.rowspan-1}else{const l=a==null?gs(n.type.schema).cell:n.nodeAt(e.map[o+a]).type,u=e.positionAt(s,i,n);t.insert(t.mapping.map(r+u),l.createAndFill())}}return t}function aPe(t,e){if(!hc(t))return!1;if(e){const r=nu(t);e(kle(t.tr,r,r.left))}return!0}function sPe(t,e){if(!hc(t))return!1;if(e){const r=nu(t);e(kle(t.tr,r,r.right))}return!0}function oPe(t,{map:e,table:r,tableStart:n},i){const a=t.mapping.maps.length;for(let s=0;s<e.height;){const o=s*e.width+i,l=e.map[o],u=r.nodeAt(l),h=u.attrs;if(i>0&&e.map[o-1]==l||i<e.width-1&&e.map[o+1]==l)t.setNodeMarkup(t.mapping.slice(a).map(n+l),null,k0(h,i-e.colCount(l)));else{const d=t.mapping.slice(a).map(n+l);t.delete(d,d+u.nodeSize)}s+=h.rowspan}}function lPe(t,e){if(!hc(t))return!1;if(e){const r=nu(t),n=t.tr;if(r.left==0&&r.right==r.map.width)return!1;for(let i=r.right-1;oPe(n,r,i),i!=r.left;i--){const a=r.tableStart?n.doc.nodeAt(r.tableStart-1):n.doc;if(!a)throw new RangeError("No table found");r.table=a,r.map=Ci.get(a)}e(n)}return!0}function cPe(t,e,r){var n;const i=gs(e.type.schema).header_cell;for(let a=0;a<t.width;a++)if(((n=e.nodeAt(t.map[a+r*t.width]))===null||n===void 0?void 0:n.type)!=i)return!1;return!0}function Sle(t,{map:e,tableStart:r,table:n},i){let a=r;for(let u=0;u<i;u++)a+=n.child(u).nodeSize;const s=[];let o=i>0?-1:0;cPe(e,n,i+o)&&(o=i==0||i==e.height?null:0);for(let u=0,h=e.width*i;u<e.width;u++,h++)if(i>0&&i<e.height&&e.map[h]==e.map[h-e.width]){const d=e.map[h],f=n.nodeAt(d).attrs;t.setNodeMarkup(r+d,null,{...f,rowspan:f.rowspan+1}),u+=f.colspan-1}else{var l;const d=o==null?gs(n.type.schema).cell:(l=n.nodeAt(e.map[h+o*e.width]))===null||l===void 0?void 0:l.type,f=d==null?void 0:d.createAndFill();f&&s.push(f)}return t.insert(a,gs(n.type.schema).row.create(null,s)),t}function uPe(t,e){if(!hc(t))return!1;if(e){const r=nu(t);e(Sle(t.tr,r,r.top))}return!0}function hPe(t,e){if(!hc(t))return!1;if(e){const r=nu(t);e(Sle(t.tr,r,r.bottom))}return!0}function dPe(t,{map:e,table:r,tableStart:n},i){let a=0;for(let u=0;u<i;u++)a+=r.child(u).nodeSize;const s=a+r.child(i).nodeSize,o=t.mapping.maps.length;t.delete(a+n,s+n);const l=new Set;for(let u=0,h=i*e.width;u<e.width;u++,h++){const d=e.map[h];if(!l.has(d)){if(l.add(d),i>0&&d==e.map[h-e.width]){const f=r.nodeAt(d).attrs;t.setNodeMarkup(t.mapping.slice(o).map(d+n),null,{...f,rowspan:f.rowspan-1}),u+=f.colspan-1}else if(i<e.height&&d==e.map[h+e.width]){const f=r.nodeAt(d),p=f.attrs,g=f.type.create({...p,rowspan:f.attrs.rowspan-1},f.content),m=e.positionAt(i+1,u,r);t.insert(t.mapping.slice(o).map(n+m),g),u+=p.colspan-1}}}}function fPe(t,e){if(!hc(t))return!1;if(e){const r=nu(t),n=t.tr;if(r.top==0&&r.bottom==r.map.height)return!1;for(let i=r.bottom-1;dPe(n,r,i),i!=r.top;i--){const a=r.tableStart?n.doc.nodeAt(r.tableStart-1):n.doc;if(!a)throw new RangeError("No table found");r.table=a,r.map=Ci.get(r.table)}e(n)}return!0}function $X(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function pPe({width:t,height:e,map:r},n){let i=n.top*t+n.left,a=i,s=(n.bottom-1)*t+n.left,o=i+(n.right-n.left-1);for(let l=n.top;l<n.bottom;l++){if(n.left>0&&r[a]==r[a-1]||n.right<t&&r[o]==r[o+1])return!0;a+=t,o+=t}for(let l=n.left;l<n.right;l++){if(n.top>0&&r[i]==r[i-t]||n.bottom<e&&r[s]==r[s+t])return!0;i++,s++}return!1}function PX(t,e){const r=t.selection;if(!(r instanceof Gn)||r.$anchorCell.pos==r.$headCell.pos)return!1;const n=nu(t),{map:i}=n;if(pPe(i,n))return!1;if(e){const a=t.tr,s={};let o=gt.empty,l,u;for(let h=n.top;h<n.bottom;h++)for(let d=n.left;d<n.right;d++){const f=i.map[h*i.width+d],p=n.table.nodeAt(f);if(!(s[f]||!p))if(s[f]=!0,l==null)l=f,u=p;else{$X(p)||(o=o.append(p.content));const g=a.mapping.map(f+n.tableStart);a.delete(g,g+p.nodeSize)}}if(l==null||u==null)return!0;if(a.setNodeMarkup(l+n.tableStart,null,{...xle(u.attrs,u.attrs.colspan,n.right-n.left-u.attrs.colspan),rowspan:n.bottom-n.top}),o.size>0){const h=l+1+u.content.size,d=$X(u)?l+1:h;a.replaceWith(d+n.tableStart,h+n.tableStart,o)}a.setSelection(new Gn(a.doc.resolve(l+n.tableStart))),e(a)}return!0}function BX(t,e){const r=gs(t.schema);return gPe(({node:n})=>r[n.type.spec.tableRole])(t,e)}function gPe(t){return(e,r)=>{const n=e.selection;let i,a;if(n instanceof Gn){if(n.$anchorCell.pos!=n.$headCell.pos)return!1;i=n.$anchorCell.nodeAfter,a=n.$anchorCell.pos}else{var s;if(i=X$e(n.$from),!i)return!1;a=(s=C0(n.$from))===null||s===void 0?void 0:s.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(r){let o=i.attrs;const l=[],u=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});const h=nu(e),d=e.tr;for(let p=0;p<h.right-h.left;p++)l.push(u?{...o,colwidth:u&&u[p]?[u[p]]:null}:o);let f;for(let p=h.top;p<h.bottom;p++){let g=h.map.positionAt(p,h.left,h.table);p==h.top&&(g+=i.nodeSize);for(let m=h.left,y=0;m<h.right;m++,y++)m==h.left&&p==h.top||d.insert(f=d.mapping.map(g+h.tableStart,1),t({node:i,row:p,col:m}).createAndFill(l[y]))}d.setNodeMarkup(a,t({node:i,row:h.top,col:h.left}),l[0]),n instanceof Gn&&d.setSelection(new Gn(d.doc.resolve(n.$anchorCell.pos),f?d.doc.resolve(f):void 0)),r(d)}return!0}}function mPe(t,e){return function(r,n){if(!hc(r))return!1;const i=X6(r);if(i.nodeAfter.attrs[t]===e)return!1;if(n){const a=r.tr;r.selection instanceof Gn?r.selection.forEachCell((s,o)=>{s.attrs[t]!==e&&a.setNodeMarkup(o,null,{...s.attrs,[t]:e})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),n(a)}return!0}}function yPe(t){return function(e,r){if(!hc(e))return!1;if(r){const n=gs(e.schema),i=nu(e),a=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),o=s.map(l=>i.table.nodeAt(l));for(let l=0;l<s.length;l++)o[l].type==n.header_cell&&a.setNodeMarkup(i.tableStart+s[l],n.cell,o[l].attrs);if(a.steps.length===0)for(let l=0;l<s.length;l++)a.setNodeMarkup(i.tableStart+s[l],n.header_cell,o[l].attrs);r(a)}return!0}}function FX(t,e,r){const n=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let i=0;i<n.length;i++){const a=e.table.nodeAt(n[i]);if(a&&a.type!==r.header_cell)return!1}return!0}function kC(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?yPe(t):function(r,n){if(!hc(r))return!1;if(n){const i=gs(r.schema),a=nu(r),s=r.tr,o=FX("row",a,i),l=FX("column",a,i),u=(t==="column"?o:t==="row"&&l)?1:0,h=t=="column"?{left:0,top:u,right:1,bottom:a.map.height}:t=="row"?{left:u,top:0,right:a.map.width,bottom:1}:a,d=t=="column"?l?i.cell:i.header_cell:t=="row"?o?i.cell:i.header_cell:i.cell;a.map.cellsInRect(h).forEach(f=>{const p=f+a.tableStart,g=s.doc.nodeAt(p);g&&s.setNodeMarkup(p,d,g.attrs)}),n(s)}return!0}}kC("row",{useDeprecatedLogic:!0});kC("column",{useDeprecatedLogic:!0});const vPe=kC("cell",{useDeprecatedLogic:!0});function bPe(t,e){if(e<0){const r=t.nodeBefore;if(r)return t.pos-r.nodeSize;for(let n=t.index(-1)-1,i=t.before();n>=0;n--){const a=t.node(-1).child(n),s=a.lastChild;if(s)return i-1-s.nodeSize;i-=a.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const r=t.node(-1);for(let n=t.indexAfter(-1),i=t.after();n<r.childCount;n++){const a=r.child(n);if(a.childCount)return i+1;i+=a.nodeSize}}return null}function zX(t){return function(e,r){if(!hc(e))return!1;const n=bPe(X6(e),t);if(n==null)return!1;if(r){const i=e.doc.resolve(n);r(e.tr.setSelection(rr.between(i,K$e(i))).scrollIntoView())}return!0}}function xPe(t,e){const r=t.selection.$anchor;for(let n=r.depth;n>0;n--)if(r.node(n).type.spec.tableRole=="table")return e&&e(t.tr.delete(r.before(n),r.after(n)).scrollIntoView()),!0;return!1}function uE(t,e){const r=t.selection;if(!(r instanceof Gn))return!1;if(e){const n=t.tr,i=gs(t.schema).cell.createAndFill().content;r.forEachCell((a,s)=>{a.content.eq(i)||n.replace(n.mapping.map(s+1),n.mapping.map(s+a.nodeSize-1),new $t(i,0,0))}),n.docChanged&&e(n)}return!0}function TPe(t){if(t.size===0)return null;let{content:e,openStart:r,openEnd:n}=t;for(;e.childCount==1&&(r>0&&n>0||e.child(0).type.spec.tableRole=="table");)r--,n--,e=e.child(0).content;const i=e.child(0),a=i.type.spec.tableRole,s=i.type.schema,o=[];if(a=="row")for(let l=0;l<e.childCount;l++){let u=e.child(l).content;const h=l?0:Math.max(0,r-1),d=l<e.childCount-1?0:Math.max(0,n-1);(h||d)&&(u=$D(gs(s).row,new $t(u,h,d)).content),o.push(u)}else if(a=="cell"||a=="header_cell")o.push(r||n?$D(gs(s).row,new $t(e,r,n)).content:e);else return null;return wPe(s,o)}function wPe(t,e){const r=[];for(let i=0;i<e.length;i++){const a=e[i];for(let s=a.childCount-1;s>=0;s--){const{rowspan:o,colspan:l}=a.child(s).attrs;for(let u=i;u<i+o;u++)r[u]=(r[u]||0)+l}}let n=0;for(let i=0;i<r.length;i++)n=Math.max(n,r[i]);for(let i=0;i<r.length;i++)if(i>=e.length&&e.push(gt.empty),r[i]<n){const a=gs(t).cell.createAndFill(),s=[];for(let o=r[i];o<n;o++)s.push(a);e[i]=e[i].append(gt.from(s))}return{height:e.length,width:n,rows:e}}function $D(t,e){const r=t.createAndFill();return new SF(r).replace(0,r.content.size,e).doc}function CPe({width:t,height:e,rows:r},n,i){if(t!=n){const a=[],s=[];for(let o=0;o<r.length;o++){const l=r[o],u=[];for(let h=a[o]||0,d=0;h<n;d++){let f=l.child(d%l.childCount);h+f.attrs.colspan>n&&(f=f.type.createChecked(k0(f.attrs,f.attrs.colspan,h+f.attrs.colspan-n),f.content)),u.push(f),h+=f.attrs.colspan;for(let p=1;p<f.attrs.rowspan;p++)a[o+p]=(a[o+p]||0)+f.attrs.colspan}s.push(gt.from(u))}r=s,t=n}if(e!=i){const a=[];for(let s=0,o=0;s<i;s++,o++){const l=[],u=r[o%e];for(let h=0;h<u.childCount;h++){let d=u.child(h);s+d.attrs.rowspan>i&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),l.push(d)}a.push(gt.from(l))}r=a,e=i}return{width:t,height:e,rows:r}}function kPe(t,e,r,n,i,a,s){const o=t.doc.type.schema,l=gs(o);let u,h;if(i>e.width)for(let d=0,f=0;d<e.height;d++){const p=r.child(d);f+=p.nodeSize;const g=[];let m;p.lastChild==null||p.lastChild.type==l.cell?m=u||(u=l.cell.createAndFill()):m=h||(h=l.header_cell.createAndFill());for(let y=e.width;y<i;y++)g.push(m);t.insert(t.mapping.slice(s).map(f-1+n),g)}if(a>e.height){const d=[];for(let g=0,m=(e.height-1)*e.width;g<Math.max(e.width,i);g++){const y=g>=e.width?!1:r.nodeAt(e.map[m+g]).type==l.header_cell;d.push(y?h||(h=l.header_cell.createAndFill()):u||(u=l.cell.createAndFill()))}const f=l.row.create(null,gt.from(d)),p=[];for(let g=e.height;g<a;g++)p.push(f);t.insert(t.mapping.slice(s).map(n+r.nodeSize-2),p)}return!!(u||h)}function VX(t,e,r,n,i,a,s,o){if(s==0||s==e.height)return!1;let l=!1;for(let u=i;u<a;u++){const h=s*e.width+u,d=e.map[h];if(e.map[h-e.width]==d){l=!0;const f=r.nodeAt(d),{top:p,left:g}=e.findCell(d);t.setNodeMarkup(t.mapping.slice(o).map(d+n),null,{...f.attrs,rowspan:s-p}),t.insert(t.mapping.slice(o).map(e.positionAt(s,g,r)),f.type.createAndFill({...f.attrs,rowspan:p+f.attrs.rowspan-s})),u+=f.attrs.colspan-1}}return l}function GX(t,e,r,n,i,a,s,o){if(s==0||s==e.width)return!1;let l=!1;for(let u=i;u<a;u++){const h=u*e.width+s,d=e.map[h];if(e.map[h-1]==d){l=!0;const f=r.nodeAt(d),p=e.colCount(d),g=t.mapping.slice(o).map(d+n);t.setNodeMarkup(g,null,k0(f.attrs,s-p,f.attrs.colspan-(s-p))),t.insert(g+f.nodeSize,f.type.createAndFill(k0(f.attrs,0,s-p))),u+=f.attrs.rowspan-1}}return l}function WX(t,e,r,n,i){let a=r?t.doc.nodeAt(r-1):t.doc;if(!a)throw new Error("No table found");let s=Ci.get(a);const{top:o,left:l}=n,u=l+i.width,h=o+i.height,d=t.tr;let f=0;function p(){if(a=r?d.doc.nodeAt(r-1):d.doc,!a)throw new Error("No table found");s=Ci.get(a),f=d.mapping.maps.length}kPe(d,s,a,r,u,h,f)&&p(),VX(d,s,a,r,l,u,o,f)&&p(),VX(d,s,a,r,l,u,h,f)&&p(),GX(d,s,a,r,o,h,l,f)&&p(),GX(d,s,a,r,o,h,u,f)&&p();for(let g=o;g<h;g++){const m=s.positionAt(g,l,a),y=s.positionAt(g,u,a);d.replace(d.mapping.slice(f).map(m+r),d.mapping.slice(f).map(y+r),new $t(i.rows[g-o],0,0))}p(),d.setSelection(new Gn(d.doc.resolve(r+s.positionAt(o,l,a)),d.doc.resolve(r+s.positionAt(h-1,u-1,a)))),e(d)}const SPe=zF({ArrowLeft:hE("horiz",-1),ArrowRight:hE("horiz",1),ArrowUp:hE("vert",-1),ArrowDown:hE("vert",1),"Shift-ArrowLeft":dE("horiz",-1),"Shift-ArrowRight":dE("horiz",1),"Shift-ArrowUp":dE("vert",-1),"Shift-ArrowDown":dE("vert",1),Backspace:uE,"Mod-Backspace":uE,Delete:uE,"Mod-Delete":uE});function P4(t,e,r){return r.eq(t.selection)?!1:(e&&e(t.tr.setSelection(r).scrollIntoView()),!0)}function hE(t,e){return(r,n,i)=>{if(!i)return!1;const a=r.selection;if(a instanceof Gn)return P4(r,n,Cr.near(a.$headCell,e));if(t!="horiz"&&!a.empty)return!1;const s=Ele(i,t,e);if(s==null)return!1;if(t=="horiz")return P4(r,n,Cr.near(r.doc.resolve(a.head+e),e));{const o=r.doc.resolve(s),l=ble(o,t,e);let u;return l?u=Cr.near(l,1):e<0?u=Cr.near(r.doc.resolve(o.before(-1)),-1):u=Cr.near(r.doc.resolve(o.after(-1)),1),P4(r,n,u)}}}function dE(t,e){return(r,n,i)=>{if(!i)return!1;const a=r.selection;let s;if(a instanceof Gn)s=a;else{const l=Ele(i,t,e);if(l==null)return!1;s=new Gn(r.doc.resolve(l))}const o=ble(s.$headCell,t,e);return o?P4(r,n,new Gn(s.$anchorCell,o)):!1}}function EPe(t,e){const r=t.state.doc,n=C0(r.resolve(e));return n?(t.dispatch(t.state.tr.setSelection(new Gn(n))),!0):!1}function APe(t,e,r){if(!hc(t.state))return!1;let n=TPe(r);const i=t.state.selection;if(i instanceof Gn){n||(n={width:1,height:1,rows:[gt.from($D(gs(t.state.schema).cell,r))]});const a=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),o=Ci.get(a).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return n=CPe(n,o.right-o.left,o.bottom-o.top),WX(t.state,t.dispatch,s,o,n),!0}else if(n){const a=X6(t.state),s=a.start(-1);return WX(t.state,t.dispatch,s,Ci.get(a.node(-1)).findCell(a.pos-s),n),!0}else return!1}function _Pe(t,e){var r;if(e.button!=0||e.ctrlKey||e.metaKey)return;const n=HX(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof Gn)a(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&n&&(i=C0(t.state.selection.$anchor))!=null&&((r=wM(t,e))===null||r===void 0?void 0:r.pos)!=i.pos)a(i,e),e.preventDefault();else if(!n)return;function a(l,u){let h=wM(t,u);const d=Cd.getState(t.state)==null;if(!h||!hz(l,h))if(d)h=l;else return;const f=new Gn(l,h);if(d||!t.state.selection.eq(f)){const p=t.state.tr.setSelection(f);d&&p.setMeta(Cd,l.pos),t.dispatch(p)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",o),Cd.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(Cd,-1))}function o(l){const u=l,h=Cd.getState(t.state);let d;if(h!=null)d=t.state.doc.resolve(h);else if(HX(t,u.target)!=n&&(d=wM(t,e),!d))return s();d&&a(d,u)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",o)}function Ele(t,e,r){if(!(t.state.selection instanceof rr))return null;const{$head:n}=t.state.selection;for(let i=n.depth-1;i>=0;i--){const a=n.node(i);if((r<0?n.index(i):n.indexAfter(i))!=(r<0?0:a.childCount))return null;if(a.type.spec.tableRole=="cell"||a.type.spec.tableRole=="header_cell"){const s=n.before(i),o=e=="vert"?r>0?"down":"up":r>0?"right":"left";return t.endOfTextblock(o)?s:null}}return null}function HX(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function wM(t,e){const r=t.posAtCoords({left:e.clientX,top:e.clientY});if(!r)return null;let{inside:n,pos:i}=r;return n>=0&&C0(t.state.doc.resolve(n))||C0(t.state.doc.resolve(i))}var RPe=class{constructor(e,r){this.node=e,this.defaultCellMinWidth=r,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${r}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),PD(e,this.colgroup,this.table,r),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,PD(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function PD(t,e,r,n,i,a){let s=0,o=!0,l=e.firstChild;const u=t.firstChild;if(u){for(let d=0,f=0;d<u.childCount;d++){const{colspan:p,colwidth:g}=u.child(d).attrs;for(let m=0;m<p;m++,f++){const y=i==f?a:g&&g[m],v=y?y+"px":"";if(s+=y||n,y||(o=!1),l)l.style.width!=v&&(l.style.width=v),l=l.nextSibling;else{const T=document.createElement("col");T.style.width=v,e.appendChild(T)}}}for(;l;){var h;const d=l.nextSibling;(h=l.parentNode)===null||h===void 0||h.removeChild(l),l=d}o?(r.style.width=s+"px",r.style.minWidth=""):(r.style.width="",r.style.minWidth=s+"px")}}const No=new Ei("tableColumnResizing");function LPe({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:r=100,View:n=RPe,lastColumnResizable:i=!0}={}){const a=new Un({key:No,state:{init(s,o){var l;const u=(l=a.spec)===null||l===void 0||(l=l.props)===null||l===void 0?void 0:l.nodeViews,h=gs(o.schema).table.name;return n&&u&&(u[h]=(d,f)=>new n(d,r,f)),new MPe(-1,!1)},apply(s,o){return o.apply(s)}},props:{attributes:s=>{const o=No.getState(s);return o&&o.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,o)=>{IPe(s,o,t,i)},mouseleave:s=>{NPe(s)},mousedown:(s,o)=>{DPe(s,o,e,r)}},decorations:s=>{const o=No.getState(s);if(o&&o.activeHandle>-1)return FPe(s,o.activeHandle)},nodeViews:{}}});return a}var MPe=class B4{constructor(e,r){this.activeHandle=e,this.dragging=r}apply(e){const r=this,n=e.getMeta(No);if(n&&n.setHandle!=null)return new B4(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new B4(r.activeHandle,n.setDragging);if(r.activeHandle>-1&&e.docChanged){let i=e.mapping.map(r.activeHandle,-1);return OD(e.doc.resolve(i))||(i=-1),new B4(i,r.dragging)}return r}};function IPe(t,e,r,n){if(!t.editable)return;const i=No.getState(t.state);if(i&&!i.dragging){const a=$Pe(e.target);let s=-1;if(a){const{left:o,right:l}=a.getBoundingClientRect();e.clientX-o<=r?s=qX(t,e,"left",r):l-e.clientX<=r&&(s=qX(t,e,"right",r))}if(s!=i.activeHandle){if(!n&&s!==-1){const o=t.state.doc.resolve(s),l=o.node(-1),u=Ci.get(l),h=o.start(-1);if(u.colCount(o.pos-h)+o.nodeAfter.attrs.colspan-1==u.width-1)return}Ale(t,s)}}}function NPe(t){if(!t.editable)return;const e=No.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&Ale(t,-1)}function DPe(t,e,r,n){var i;if(!t.editable)return!1;const a=(i=t.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,s=No.getState(t.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const o=t.state.doc.nodeAt(s.activeHandle),l=OPe(t,s.activeHandle,o.attrs);t.dispatch(t.state.tr.setMeta(No,{setDragging:{startX:e.clientX,startWidth:l}}));function u(d){a.removeEventListener("mouseup",u),a.removeEventListener("mousemove",h);const f=No.getState(t.state);f!=null&&f.dragging&&(PPe(t,f.activeHandle,UX(f.dragging,d,r)),t.dispatch(t.state.tr.setMeta(No,{setDragging:null})))}function h(d){if(!d.which)return u(d);const f=No.getState(t.state);if(f&&f.dragging){const p=UX(f.dragging,d,r);YX(t,f.activeHandle,p,n)}}return YX(t,s.activeHandle,l,n),a.addEventListener("mouseup",u),a.addEventListener("mousemove",h),e.preventDefault(),!0}function OPe(t,e,{colspan:r,colwidth:n}){const i=n&&n[n.length-1];if(i)return i;const a=t.domAtPos(e);let s=a.node.childNodes[a.offset].offsetWidth,o=r;if(n)for(let l=0;l<r;l++)n[l]&&(s-=n[l],o--);return s/o}function $Pe(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function qX(t,e,r,n){const i=r=="right"?-n:n,a=t.posAtCoords({left:e.clientX+i,top:e.clientY});if(!a)return-1;const{pos:s}=a,o=C0(t.state.doc.resolve(s));if(!o)return-1;if(r=="right")return o.pos;const l=Ci.get(o.node(-1)),u=o.start(-1),h=l.map.indexOf(o.pos-u);return h%l.width==0?-1:u+l.map[h-1]}function UX(t,e,r){const n=e.clientX-t.startX;return Math.max(r,t.startWidth+n)}function Ale(t,e){t.dispatch(t.state.tr.setMeta(No,{setHandle:e}))}function PPe(t,e,r){const n=t.state.doc.resolve(e),i=n.node(-1),a=Ci.get(i),s=n.start(-1),o=a.colCount(n.pos-s)+n.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let u=0;u<a.height;u++){const h=u*a.width+o;if(u&&a.map[h]==a.map[h-a.width])continue;const d=a.map[h],f=i.nodeAt(d).attrs,p=f.colspan==1?0:o-a.colCount(d);if(f.colwidth&&f.colwidth[p]==r)continue;const g=f.colwidth?f.colwidth.slice():BPe(f.colspan);g[p]=r,l.setNodeMarkup(s+d,null,{...f,colwidth:g})}l.docChanged&&t.dispatch(l)}function YX(t,e,r,n){const i=t.state.doc.resolve(e),a=i.node(-1),s=i.start(-1),o=Ci.get(a).colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1;let l=t.domAtPos(i.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&PD(a,l.firstChild,l,n,o,r)}function BPe(t){return Array(t).fill(0)}function FPe(t,e){const r=[],n=t.doc.resolve(e),i=n.node(-1);if(!i)return kn.empty;const a=Ci.get(i),s=n.start(-1),o=a.colCount(n.pos-s)+n.nodeAfter.attrs.colspan-1;for(let u=0;u<a.height;u++){const h=o+u*a.width;if((o==a.width-1||a.map[h]!=a.map[h+1])&&(u==0||a.map[h]!=a.map[h-a.width])){var l;const d=a.map[h],f=s+d+i.nodeAt(d).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",!((l=No.getState(t))===null||l===void 0)&&l.dragging&&r.push(ba.node(s+d,s+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),r.push(ba.widget(f,p))}}return kn.create(t.doc,r)}function zPe({allowTableNodeSelection:t=!1}={}){return new Un({key:Cd,state:{init(){return null},apply(e,r){const n=e.getMeta(Cd);if(n!=null)return n==-1?null:n;if(r==null||!e.docChanged)return r;const{deleted:i,pos:a}=e.mapping.mapResult(r);return i?null:a}},props:{decorations:J$e,handleDOMEvents:{mousedown:_Pe},createSelectionBetween(e){return Cd.getState(e.state)!=null?e.state.selection:null},handleTripleClick:EPe,handleKeyDown:SPe,handlePaste:APe},appendTransaction(e,r,n){return rPe(n,Cle(n,r),t)}})}function j5(t){return t==="left"||t==="right"||t==="center"?t:null}function VPe(t){const e=(t.style.textAlign||"").trim().toLowerCase(),r=(t.getAttribute("align")||"").trim().toLowerCase();return j5(e||r)}function GPe(t){return j5(t==null?void 0:t.align)}function _le(){return{default:null,parseHTML:t=>VPe(t),renderHTML:t=>t.align?{style:`text-align: ${t.align}`}:{}}}var WPe=Aa.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{var e,r;const n=t.getAttribute("colwidth"),i=n?n.split(",").map(a=>parseInt(a,10)):null;if(!i){const a=(e=t.closest("table"))==null?void 0:e.querySelectorAll("colgroup > col"),s=Array.from(((r=t.parentElement)==null?void 0:r.children)||[]).indexOf(t);if(s&&s>-1&&a&&a[s]){const o=a[s].getAttribute("width");return o?[parseInt(o,10)]:null}}return i}},align:_le()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",Wn(this.options.HTMLAttributes,t),0]}}),HPe=Aa.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(n=>parseInt(n,10)):null}},align:_le()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",Wn(this.options.HTMLAttributes,t),0]}}),qPe=Aa.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",Wn(this.options.HTMLAttributes,t),0]}});function BD(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function XX(t,e,r,n,i,a){var s;let o=0,l=!0,u=e.firstChild;const h=t.firstChild;if(h!==null)for(let f=0,p=0;f<h.childCount;f+=1){const{colspan:g,colwidth:m}=h.child(f).attrs;for(let y=0;y<g;y+=1,p+=1){const v=i===p?a:m&&m[y],T=v?`${v}px`:"";if(o+=v||n,v||(l=!1),u){if(u.style.width!==T){const[b,w]=BD(n,v);u.style.setProperty(b,w)}u=u.nextSibling}else{const b=document.createElement("col"),[w,C]=BD(n,v);b.style.setProperty(w,C),e.appendChild(b)}}}for(;u;){const f=u.nextSibling;(s=u.parentNode)==null||s.removeChild(u),u=f}const d=t.attrs.style&&typeof t.attrs.style=="string"&&/\bwidth\s*:/i.test(t.attrs.style);l&&!d?(r.style.width=`${o}px`,r.style.minWidth=""):(r.style.width="",r.style.minWidth=`${o}px`)}var UPe=class{constructor(t,e,r,n={}){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table"));for(const[i,a]of Object.entries(n))a!=null&&(i==="style"?this.table.style.cssText=String(a):this.table.setAttribute(i,String(a)));t.attrs.style&&(this.table.style.cssText=t.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),XX(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,XX(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){const e=t.target,r=this.dom.contains(e),n=this.contentDOM.contains(e);return!!(r&&!n&&(t.type==="attributes"||t.type==="childList"||t.type==="characterData"))}};function YPe(t,e,r,n){let i=0,a=!0;const s=[],o=t.firstChild;if(!o)return{};for(let d=0,f=0;d<o.childCount;d+=1){const{colspan:p,colwidth:g}=o.child(d).attrs;for(let m=0;m<p;m+=1,f+=1){const y=r===f?n:g&&g[m];i+=y||e,y||(a=!1);const[v,T]=BD(e,y);s.push(["col",{style:`${v}: ${T}`}])}}const l=a?`${i}px`:"",u=a?"":`${i}px`;return{colgroup:["colgroup",{},...s],tableWidth:l,tableMinWidth:u}}function jX(t,e){return t.createAndFill()}function XPe(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(r=>{const n=t.nodes[r];n.spec.tableRole&&(e[n.spec.tableRole]=n)}),t.cached.tableNodeTypes=e,e}function jPe(t,e,r,n,i){const a=XPe(t),s=[],o=[];for(let u=0;u<r;u+=1){const h=jX(a.cell);if(h&&o.push(h),n){const d=jX(a.header_cell);d&&s.push(d)}}const l=[];for(let u=0;u<e;u+=1)l.push(a.row.createChecked(null,n&&u===0?s:o));return a.table.createChecked(null,l)}function KPe(t){return t instanceof Gn}var fE=({editor:t})=>{const{selection:e}=t.state;if(!KPe(e))return!1;let r=0;const n=ooe(e.ranges[0].$from,a=>a.type.name==="table");return n==null||n.node.descendants(a=>{if(a.type.name==="table")return!1;["tableCell","tableHeader"].includes(a.type.name)&&(r+=1)}),r===e.ranges.length?(t.commands.deleteTable(),!0):!1},ZPe="";function QPe(t){return(t||"").replace(/\s+/g," ").trim()}function JPe(t,e,r={}){var n;const i=(n=r.cellLineSeparator)!=null?n:ZPe;if(!t||!t.content||t.content.length===0)return"";const a=[];t.content.forEach(m=>{const y=[];m.content&&m.content.forEach(v=>{let T="";v.content&&Array.isArray(v.content)&&v.content.length>1?T=v.content.map(k=>e.renderChildren(k)).join(i):T=v.content?e.renderChildren(v.content):"";const b=QPe(T),w=v.type==="tableHeader",C=GPe(v.attrs);y.push({text:b,isHeader:w,align:C})}),a.push(y)});const s=a.reduce((m,y)=>Math.max(m,y.length),0);if(s===0)return"";const o=Array.from({length:s}).fill(0);a.forEach(m=>{var y;for(let v=0;v<s;v+=1){const b=(((y=m[v])==null?void 0:y.text)||"").length;b>o[v]&&(o[v]=b),o[v]<3&&(o[v]=3)}});const l=(m,y)=>m+" ".repeat(Math.max(0,y-m.length)),u=a[0],h=u.some(m=>m.isHeader),d=Array.from({length:s}).fill(null);a.forEach(m=>{var y;for(let v=0;v<s;v+=1)!d[v]&&((y=m[v])!=null&&y.align)&&(d[v]=m[v].align)});let f=`
`;const p=Array.from({length:s}).map((m,y)=>h&&u[y]&&u[y].text||"");return f+=`| ${p.map((m,y)=>l(m,o[y])).join(" | ")} |
`,f+=`| ${o.map((m,y)=>{const v=Math.max(3,m),T=d[y];return T==="left"?`:${"-".repeat(v)}`:T==="right"?`${"-".repeat(v)}:`:T==="center"?`:${"-".repeat(v)}:`:"-".repeat(v)}).join(" | ")} |
`,(h?a.slice(1):a).forEach(m=>{f+=`| ${Array.from({length:s}).fill(0).map((y,v)=>l(m[v]&&m[v].text||"",o[v])).join(" | ")} |
`}),f}var e9e=JPe,t9e=Aa.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:UPe,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:r,tableWidth:n,tableMinWidth:i}=YPe(t,this.options.cellMinWidth),a=e.style;function s(){return a||(n?`width: ${n}`:`min-width: ${i}`)}const o=["table",Wn(this.options.HTMLAttributes,e,{style:s()}),r,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},o]:o},parseMarkdown:(t,e)=>{const r=[],n=Array.isArray(t.align)?t.align:[];if(t.header){const i=[];t.header.forEach((a,s)=>{var o;const l=j5((o=n[s])!=null?o:a.align),u=l?{align:l}:{};i.push(e.createNode("tableHeader",u,[{type:"paragraph",content:e.parseInline(a.tokens)}]))}),r.push(e.createNode("tableRow",{},i))}return t.rows&&t.rows.forEach(i=>{const a=[];i.forEach((s,o)=>{var l;const u=j5((l=n[o])!=null?l:s.align),h=u?{align:u}:{};a.push(e.createNode("tableCell",h,[{type:"paragraph",content:e.parseInline(s.tokens)}]))}),r.push(e.createNode("tableRow",{},a))}),e.createNode("table",void 0,r)},renderMarkdown:(t,e)=>e9e(t,e),addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:r=!0}={})=>({tr:n,dispatch:i,editor:a})=>{const s=jPe(a.schema,t,e,r);if(i){const o=n.selection.from+1;n.replaceSelectionWith(s).scrollIntoView().setSelection(rr.near(n.doc.resolve(o)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>aPe(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>sPe(t,e),deleteColumn:()=>({state:t,dispatch:e})=>lPe(t,e),addRowBefore:()=>({state:t,dispatch:e})=>uPe(t,e),addRowAfter:()=>({state:t,dispatch:e})=>hPe(t,e),deleteRow:()=>({state:t,dispatch:e})=>fPe(t,e),deleteTable:()=>({state:t,dispatch:e})=>xPe(t,e),mergeCells:()=>({state:t,dispatch:e})=>PX(t,e),splitCell:()=>({state:t,dispatch:e})=>BX(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>kC("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>kC("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>vPe(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>PX(t,e)?!0:BX(t,e),setCellAttribute:(t,e)=>({state:r,dispatch:n})=>mPe(t,e)(r,n),goToNextCell:()=>({state:t,dispatch:e})=>zX(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>zX(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&Cle(t),!0),setCellSelection:t=>({tr:e,dispatch:r})=>{if(r){const n=Gn.create(e.doc,t.anchorCell,t.headCell);e.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:fE,"Mod-Backspace":fE,Delete:fE,"Mod-Delete":fE}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[LPe({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],zPe({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){const t=this.options.resizable&&this.editor.isEditable,e=this.options.View;return t||!e?null:({node:r,view:n,HTMLAttributes:i})=>{const a=Wn(this.options.HTMLAttributes,i);return new e(r,this.options.cellMinWidth,n,a)}},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:un(Ut(t,"tableRole",e))}}}),r9e=ci.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(t9e.configure(this.options.table)),this.options.tableCell!==!1&&t.push(WPe.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(HPe.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(qPe.configure(this.options.tableRow)),t}});function dz(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var J0=dz();function Rle(t){J0=t}var wp={exec:()=>null};function en(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(Ds.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var n9e=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Ds={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},i9e=/^(?:[ \t]*(?:\n|$))+/,a9e=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,s9e=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,qk=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,o9e=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fz=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Lle=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Mle=en(Lle).replace(/bull/g,fz).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),l9e=en(Lle).replace(/bull/g,fz).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),pz=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,c9e=/^[^\n]+/,gz=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,u9e=en(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",gz).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),h9e=en(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,fz).getRegex(),j6="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",mz=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,d9e=en("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",mz).replace("tag",j6).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ile=en(pz).replace("hr",qk).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",j6).getRegex(),f9e=en(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ile).getRegex(),yz={blockquote:f9e,code:a9e,def:u9e,fences:s9e,heading:o9e,hr:qk,html:d9e,lheading:Mle,list:h9e,newline:i9e,paragraph:Ile,table:wp,text:c9e},KX=en("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",qk).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",j6).getRegex(),p9e={...yz,lheading:l9e,table:KX,paragraph:en(pz).replace("hr",qk).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",KX).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",j6).getRegex()},g9e={...yz,html:en(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",mz).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:wp,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:en(pz).replace("hr",qk).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Mle).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},m9e=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,y9e=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Nle=/^( {2,}|\\)\n(?!\s*$)/,v9e=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,px=/[\p{P}\p{S}]/u,K6=/[\s\p{P}\p{S}]/u,vz=/[^\s\p{P}\p{S}]/u,b9e=en(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,K6).getRegex(),Dle=/(?!~)[\p{P}\p{S}]/u,x9e=/(?!~)[\s\p{P}\p{S}]/u,T9e=/(?:[^\s\p{P}\p{S}]|~)/u,w9e=en(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",n9e?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ole=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,C9e=en(Ole,"u").replace(/punct/g,px).getRegex(),k9e=en(Ole,"u").replace(/punct/g,Dle).getRegex(),$le="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",S9e=en($le,"gu").replace(/notPunctSpace/g,vz).replace(/punctSpace/g,K6).replace(/punct/g,px).getRegex(),E9e=en($le,"gu").replace(/notPunctSpace/g,T9e).replace(/punctSpace/g,x9e).replace(/punct/g,Dle).getRegex(),A9e=en("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,vz).replace(/punctSpace/g,K6).replace(/punct/g,px).getRegex(),_9e=en(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,px).getRegex(),R9e="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",L9e=en(R9e,"gu").replace(/notPunctSpace/g,vz).replace(/punctSpace/g,K6).replace(/punct/g,px).getRegex(),M9e=en(/\\(punct)/,"gu").replace(/punct/g,px).getRegex(),I9e=en(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),N9e=en(mz).replace("(?:-->|$)","-->").getRegex(),D9e=en("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",N9e).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),K5=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,O9e=en(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",K5).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ple=en(/^!?\[(label)\]\[(ref)\]/).replace("label",K5).replace("ref",gz).getRegex(),Ble=en(/^!?\[(ref)\](?:\[\])?/).replace("ref",gz).getRegex(),$9e=en("reflink|nolink(?!\\()","g").replace("reflink",Ple).replace("nolink",Ble).getRegex(),ZX=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,bz={_backpedal:wp,anyPunctuation:M9e,autolink:I9e,blockSkip:w9e,br:Nle,code:y9e,del:wp,delLDelim:wp,delRDelim:wp,emStrongLDelim:C9e,emStrongRDelimAst:S9e,emStrongRDelimUnd:A9e,escape:m9e,link:O9e,nolink:Ble,punctuation:b9e,reflink:Ple,reflinkSearch:$9e,tag:D9e,text:v9e,url:wp},P9e={...bz,link:en(/^!?\[(label)\]\((.*?)\)/).replace("label",K5).getRegex(),reflink:en(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",K5).getRegex()},FD={...bz,emStrongRDelimAst:E9e,emStrongLDelim:k9e,delLDelim:_9e,delRDelim:L9e,url:en(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ZX).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:en(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ZX).getRegex()},B9e={...FD,br:en(Nle).replace("{2,}","*").getRegex(),text:en(FD.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},pE={normal:yz,gfm:p9e,pedantic:g9e},Kx={normal:bz,gfm:FD,breaks:B9e,pedantic:P9e},F9e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},QX=t=>F9e[t];function xc(t,e){if(e){if(Ds.escapeTest.test(t))return t.replace(Ds.escapeReplace,QX)}else if(Ds.escapeTestNoEncode.test(t))return t.replace(Ds.escapeReplaceNoEncode,QX);return t}function JX(t){try{t=encodeURI(t).replace(Ds.percentDecode,"%")}catch{return null}return t}function ej(t,e){var a;let r=t.replace(Ds.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(Ds.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(Ds.slashPipe,"|");return n}function Zx(t,e,r){let n=t.length;if(n===0)return"";let i=0;for(;i<n&&t.charAt(n-i-1)===e;)i++;return t.slice(0,n-i)}function z9e(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])r++;else if(t[n]===e[1]&&(r--,r<0))return n;return r>0?-2:-1}function V9e(t,e=0){let r=e,n="";for(let i of t)if(i===" "){let a=4-r%4;n+=" ".repeat(a),r+=a}else n+=i,r++;return n}function tj(t,e,r,n,i){let a=e.href,s=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:s,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function G9e(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(`
`).map(a=>{let s=a.match(r.other.beginningSpace);if(s===null)return a;let[o]=s;return o.length>=i.length?a.slice(i.length):a}).join(`
`)}var Z5=class{constructor(e){jt(this,"options");jt(this,"rules");jt(this,"lexer");this.options=e||J0}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Zx(n,`
`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=G9e(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=Zx(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:Zx(r[0],`
`)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=Zx(r[0],`
`).split(`
`),i="",a="",s=[];for(;n.length>0;){let o=!1,l=[],u;for(u=0;u<n.length;u++)if(this.rules.other.blockquoteStart.test(n[u]))l.push(n[u]),o=!0;else if(!o)l.push(n[u]);else break;n=n.slice(u);let h=l.join(`
`),d=h.replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
${h}`:h,a=a?`${a}
${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,s,!0),this.lexer.state.top=f,n.length===0)break;let p=s.at(-1);if((p==null?void 0:p.type)==="code")break;if((p==null?void 0:p.type)==="blockquote"){let g=p,m=g.raw+`
`+n.join(`
`),y=this.blockquote(m);s[s.length-1]=y,i=i.substring(0,i.length-g.raw.length)+y.raw,a=a.substring(0,a.length-g.text.length)+y.text;break}else if((p==null?void 0:p.type)==="list"){let g=p,m=g.raw+`
`+n.join(`
`),y=this.list(m);s[s.length-1]=y,i=i.substring(0,i.length-p.raw.length)+y.raw,a=a.substring(0,a.length-g.raw.length)+y.raw,n=m.substring(s.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:i,tokens:s,text:a}}}list(e){var n,i;let r=this.rules.block.list.exec(e);if(r){let a=r[1].trim(),s=a.length>1,o={type:"list",raw:"",ordered:s,start:s?+a.slice(0,-1):"",loose:!1,items:[]};a=s?`\\d{1,9}\\${a.slice(-1)}`:`\\${a}`,this.options.pedantic&&(a=s?a:"[*+-]");let l=this.rules.other.listItemRegex(a),u=!1;for(;e;){let d=!1,f="",p="";if(!(r=l.exec(e))||this.rules.block.hr.test(e))break;f=r[0],e=e.substring(f.length);let g=V9e(r[2].split(`
`,1)[0],r[1].length),m=e.split(`
`,1)[0],y=!g.trim(),v=0;if(this.options.pedantic?(v=2,p=g.trimStart()):y?v=r[1].length+1:(v=g.search(this.rules.other.nonSpaceChar),v=v>4?1:v,p=g.slice(v),v+=r[1].length),y&&this.rules.other.blankLine.test(m)&&(f+=m+`
`,e=e.substring(m.length+1),d=!0),!d){let T=this.rules.other.nextBulletRegex(v),b=this.rules.other.hrRegex(v),w=this.rules.other.fencesBeginRegex(v),C=this.rules.other.headingBeginRegex(v),S=this.rules.other.htmlBeginRegex(v),k=this.rules.other.blockquoteBeginRegex(v);for(;e;){let E=e.split(`
`,1)[0],_;if(m=E,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),_=m):_=m.replace(this.rules.other.tabCharGlobal," "),w.test(m)||C.test(m)||S.test(m)||k.test(m)||T.test(m)||b.test(m))break;if(_.search(this.rules.other.nonSpaceChar)>=v||!m.trim())p+=`
`+_.slice(v);else{if(y||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(g)||C.test(g)||b.test(g))break;p+=`
`+m}y=!m.trim(),f+=E+`
`,e=e.substring(E.length+1),g=_.slice(v)}}o.loose||(u?o.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(u=!0)),o.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),o.raw+=f}let h=o.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let d of o.items){if(this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]),d.task){if(d.text=d.text.replace(this.rules.other.listReplaceTask,""),((n=d.tokens[0])==null?void 0:n.type)==="text"||((i=d.tokens[0])==null?void 0:i.type)==="paragraph"){d.tokens[0].raw=d.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),d.tokens[0].text=d.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}}let f=this.rules.other.listTaskCheckbox.exec(d.raw);if(f){let p={type:"checkbox",raw:f[0]+" ",checked:f[0]!=="[ ]"};d.checked=p.checked,o.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=p.raw+d.tokens[0].raw,d.tokens[0].text=p.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(p)):d.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):d.tokens.unshift(p)}}if(!o.loose){let f=d.tokens.filter(g=>g.type==="space"),p=f.length>0&&f.some(g=>this.rules.other.anyLine.test(g.raw));o.loose=p}}if(o.loose)for(let d of o.items){d.loose=!0;for(let f of d.tokens)f.type==="text"&&(f.type="paragraph")}return o}}html(e){let r=this.rules.block.html.exec(e);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(e){let r=this.rules.block.def.exec(e);if(r){let n=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:i,title:a}}}table(e){var o;let r=this.rules.block.table.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let n=ej(r[1]),i=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(o=r[3])!=null&&o.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],s={type:"table",raw:r[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let l of i)this.rules.other.tableAlignRight.test(l)?s.align.push("right"):this.rules.other.tableAlignCenter.test(l)?s.align.push("center"):this.rules.other.tableAlignLeft.test(l)?s.align.push("left"):s.align.push(null);for(let l=0;l<n.length;l++)s.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:s.align[l]});for(let l of a)s.rows.push(ej(l,s.header.length).map((u,h)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:s.align[h]})));return s}}lheading(e){let r=this.rules.block.lheading.exec(e);if(r){let n=r[1].trim();return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===`
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=Zx(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=z9e(r[2],"()");if(s===-2)return;if(s>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),tj(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return tj(n,a,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,o,l=a,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+a);(i=h.exec(r))!==null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(o=[...s].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&a%3&&!((a+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let d=[...i[0]][0].length,f=e.slice(0,a+i.index+d+o);if(Math.min(a,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e,r,n=""){let i=this.rules.inline.delLDelim.exec(e);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,o,l=a,u=this.rules.inline.delRDelim;for(u.lastIndex=0,r=r.slice(-1*e.length+a);(i=u.exec(r))!==null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s||(o=[...s].length,o!==a))continue;if(i[3]||i[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let h=[...i[0]][0].length,d=e.slice(0,a+i.index+h+o),f=d.slice(a,-a);return{type:"del",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let s;do s=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(s!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},$l=class zD{constructor(e){jt(this,"tokens");jt(this,"options");jt(this,"state");jt(this,"inlineQueue");jt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||J0,this.options.tokenizer=this.options.tokenizer||new Z5,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Ds,block:pE.normal,inline:Kx.normal};this.options.pedantic?(r.block=pE.pedantic,r.inline=Kx.pedantic):this.options.gfm&&(r.block=pE.gfm,this.options.breaks?r.inline=Kx.breaks:r.inline=Kx.gfm),this.tokenizer.rules=r}static get rules(){return{block:pE,inline:Kx}}static lex(e,r){return new zD(r).lex(e)}static lexInline(e,r){return new zD(r).inlineTokens(e)}lex(e){e=e.replace(Ds.carriageReturn,`
`),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],n=!1){var i,a,s;for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(Ds.tabCharGlobal," ").replace(Ds.spaceLine,""));e;){let o;if((a=(i=this.options.extensions)==null?void 0:i.block)!=null&&a.some(u=>(o=u.call({lexer:this},e,r))?(e=e.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let u=r.at(-1);o.raw.length===1&&u!==void 0?u.raw+=`
`:r.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
`)?"":`
`)+o.raw,u.text+=`
`+o.text,this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
`)?"":`
`)+o.raw,u.text+=`
`+o.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),r.push(o);continue}let l=e;if((s=this.options.extensions)!=null&&s.startBlock){let u=1/0,h=e.slice(1),d;this.options.extensions.startBlock.forEach(f=>{d=f.call({lexer:this},h),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(l=e.substring(0,u+1))}if(this.state.top&&(o=this.tokenizer.paragraph(l))){let u=r.at(-1);n&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=(u.raw.endsWith(`
`)?"":`
`)+o.raw,u.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o),n=l.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
`)?"":`
`)+o.raw,u.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;this.tokenizer.lexer=this;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let s=!1,o="";for(;e;){s||(o=""),s=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,y=e.slice(1),v;this.options.extensions.startInline.forEach(T=>{v=T.call({lexer:this},y),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),s=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},Q5=class{constructor(e){jt(this,"options");jt(this,"parser");this.options=e||J0}space(e){return""}code({text:e,lang:r,escaped:n}){var s;let i=(s=(r||"").match(Ds.notSpaceStart))==null?void 0:s[0],a=e.replace(Ds.endingNewline,"")+`
`;return i?'<pre><code class="language-'+xc(i)+'">'+(n?a:xc(a,!0))+`</code></pre>
`:"<pre><code>"+(n?a:xc(a,!0))+`</code></pre>
`}blockquote({tokens:e}){return`<blockquote>
${this.parser.parse(e)}</blockquote>
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:r}){return`<h${r}>${this.parser.parseInline(e)}</h${r}>
`}hr(e){return`<hr>
`}list(e){let r=e.ordered,n=e.start,i="";for(let o=0;o<e.items.length;o++){let l=e.items[o];i+=this.listitem(l)}let a=r?"ol":"ul",s=r&&n!==1?' start="'+n+'"':"";return"<"+a+s+`>
`+i+"</"+a+`>
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
`}table(e){let r="",n="";for(let a=0;a<e.header.length;a++)n+=this.tablecell(e.header[a]);r+=this.tablerow({text:n});let i="";for(let a=0;a<e.rows.length;a++){let s=e.rows[a];n="";for(let o=0;o<s.length;o++)n+=this.tablecell(s[o]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
<thead>
`+r+`</thead>
`+i+`</table>
`}tablerow({text:e}){return`<tr>
${e}</tr>
`}tablecell(e){let r=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+r+`</${n}>
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${xc(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),a=JX(e);if(a===null)return i;e=a;let s='<a href="'+e+'"';return r&&(s+=' title="'+xc(r)+'"'),s+=">"+i+"</a>",s}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=JX(e);if(a===null)return xc(n);e=a;let s=`<img src="${e}" alt="${xc(n)}"`;return r&&(s+=` title="${xc(r)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:xc(e.text)}},xz=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},Pl=class VD{constructor(e){jt(this,"options");jt(this,"renderer");jt(this,"textRenderer");this.options=e||J0,this.options.renderer=this.options.renderer||new Q5,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new xz}static parse(e,r){return new VD(r).parse(e)}static parseInline(e,r){return new VD(r).parseInline(e)}parse(e){var n,i;this.renderer.parser=this;let r="";for(let a=0;a<e.length;a++){let s=e[a];if((i=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&i[s.type]){let l=s,u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){r+=u||"";continue}}let o=s;switch(o.type){case"space":{r+=this.renderer.space(o);break}case"hr":{r+=this.renderer.hr(o);break}case"heading":{r+=this.renderer.heading(o);break}case"code":{r+=this.renderer.code(o);break}case"table":{r+=this.renderer.table(o);break}case"blockquote":{r+=this.renderer.blockquote(o);break}case"list":{r+=this.renderer.list(o);break}case"checkbox":{r+=this.renderer.checkbox(o);break}case"html":{r+=this.renderer.html(o);break}case"def":{r+=this.renderer.def(o);break}case"paragraph":{r+=this.renderer.paragraph(o);break}case"text":{r+=this.renderer.text(o);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(e,r=this.renderer){var i,a;this.renderer.parser=this;let n="";for(let s=0;s<e.length;s++){let o=e[s];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[o.type]){let u=this.options.extensions.renderers[o.type].call({parser:this},o);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=u||"";continue}}let l=o;switch(l.type){case"escape":{n+=r.text(l);break}case"html":{n+=r.html(l);break}case"link":{n+=r.link(l);break}case"image":{n+=r.image(l);break}case"checkbox":{n+=r.checkbox(l);break}case"strong":{n+=r.strong(l);break}case"em":{n+=r.em(l);break}case"codespan":{n+=r.codespan(l);break}case"br":{n+=r.br(l);break}case"del":{n+=r.del(l);break}case"text":{n+=r.text(l);break}default:{let u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}},L4,zT=(L4=class{constructor(e){jt(this,"options");jt(this,"block");this.options=e||J0}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?$l.lex:$l.lexInline}provideParser(e=this.block){return e?Pl.parse:Pl.parseInline}},jt(L4,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),jt(L4,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),L4),W9e=class{constructor(...e){jt(this,"defaults",dz());jt(this,"options",this.setOptions);jt(this,"parse",this.parseMarkdown(!0));jt(this,"parseInline",this.parseMarkdown(!1));jt(this,"Parser",Pl);jt(this,"Renderer",Q5);jt(this,"TextRenderer",xz);jt(this,"Lexer",$l);jt(this,"Tokenizer",Z5);jt(this,"Hooks",zT);this.use(...e)}walkTokens(e,r){var i,a;let n=[];for(let s of e)switch(n=n.concat(r.call(this,s)),s.type){case"table":{let o=s;for(let l of o.header)n=n.concat(this.walkTokens(l.tokens,r));for(let l of o.rows)for(let u of l)n=n.concat(this.walkTokens(u.tokens,r));break}case"list":{let o=s;n=n.concat(this.walkTokens(o.items,r));break}default:{let o=s;(a=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&a[o.type]?this.defaults.extensions.childTokens[o.type].forEach(l=>{let u=o[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let s=r.renderers[a.name];s?r.renderers[a.name]=function(...o){let l=a.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=r[a.level];s?s.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),i.extensions=r),n.renderer){let a=this.defaults.renderer||new Q5(this.defaults);for(let s in n.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=n.renderer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new Z5(this.defaults);for(let s in n.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=n.tokenizer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new zT;for(let s in n.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=n.hooks[o],u=a[o];zT.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&zT.passThroughHooksRespectAsync.has(s))return(async()=>{let f=await l.call(a,h);return u.call(a,f)})();let d=l.call(a,h);return u.call(a,d)}:a[o]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(a,h);return f===!1&&(f=await u.apply(a,h)),f})();let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),a&&(l=l.concat(a.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return $l.lex(e,r??this.defaults)}parser(e,r){return Pl.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},a={...this.defaults,...i},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let o=a.hooks?await a.hooks.preprocess(r):r,l=await(a.hooks?await a.hooks.provideLexer(e):e?$l.lex:$l.lexInline)(o,a),u=a.hooks?await a.hooks.processAllTokens(l):l;a.walkTokens&&await Promise.all(this.walkTokens(u,a.walkTokens));let h=await(a.hooks?await a.hooks.provideParser(e):e?Pl.parse:Pl.parseInline)(u,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(s);try{a.hooks&&(r=a.hooks.preprocess(r));let o=(a.hooks?a.hooks.provideLexer(e):e?$l.lex:$l.lexInline)(r,a);a.hooks&&(o=a.hooks.processAllTokens(o)),a.walkTokens&&this.walkTokens(o,a.walkTokens);let l=(a.hooks?a.hooks.provideParser(e):e?Pl.parse:Pl.parseInline)(o,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(o){return s(o)}}}onError(e,r){return n=>{if(n.message+=`
Please report this to https://github.com/markedjs/marked.`,e){let i="<p>An error occurred:</p><pre>"+xc(n.message+"",!0)+"</pre>";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},S0=new W9e;function En(t,e){return S0.parse(t,e)}En.options=En.setOptions=function(t){return S0.setOptions(t),En.defaults=S0.defaults,Rle(En.defaults),En};En.getDefaults=dz;En.defaults=J0;En.use=function(...t){return S0.use(...t),En.defaults=S0.defaults,Rle(En.defaults),En};En.walkTokens=function(t,e){return S0.walkTokens(t,e)};En.parseInline=S0.parseInline;En.Parser=Pl;En.parser=Pl.parse;En.Renderer=Q5;En.TextRenderer=xz;En.Lexer=$l;En.lexer=$l.lex;En.Tokenizer=Z5;En.Hooks=zT;En.parse=En;En.options;En.setOptions;En.use;En.walkTokens;En.parseInline;Pl.parse;$l.lex;function H9e(t,e){const n=e.split(`
`).flatMap(i=>[i,""]).map(i=>`${t}${i}`).join(`
`);return n.slice(0,n.length-1)}function q9e(t,e){const r=[];return Array.from(t.entries()).forEach(([n,i])=>{if(!e){r.push(n);return}(e.marks||[]).find(s=>s.type===n&&bb(s.attrs,i.attrs))||r.push(n)}),r}function U9e(t,e){const r=[];return Array.from(e.entries()).forEach(([n,i])=>{const a=t.get(n);(!a||!bb(a.attrs,i.attrs))&&r.push({type:n,mark:i})}),r}function Y9e(t,e,r,n){const i=!r,a=r&&(!r.marks||r.marks.length===0),s=r&&r.marks&&!n(e,new Map(r.marks.map(l=>[l.type,l]))),o=[];return(i||a||s)&&(r&&r.marks?Array.from(t.entries()).reverse().forEach(([l,u])=>{r.marks.find(d=>d.type===l&&bb(d.attrs,u.attrs))||o.push(l)}):(i||a)&&o.push(...Array.from(t.keys()).reverse())),o}function X9e(t,e){let r="";return Array.from(t.keys()).reverse().forEach(n=>{const i=t.get(n),a=e(n,i);a&&(r=a+r)}),t.clear(),r}function j9e(t,e,r){let n="";return Array.from(t.entries()).forEach(([i,a])=>{const s=r(i,a);s&&(n+=s),e.set(i,a)}),n}function CM(t){const r=(t.raw||t.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return r?{isTask:!0,checked:r[2].toLowerCase()==="x",indentLevel:r[1].length}:{isTask:!1,indentLevel:0}}function gE(t,e){return typeof t!="string"?"json":e}var K9e=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","circle","clippath","defs","ellipse","foreignobject","g","image","line","lineargradient","mask","path","polygon","polyline","radialgradient","rect","stop","switch","symbol","textpath","tspan","use","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),Z9e=/<\/?([a-zA-Z][\w-]*)/g;function Q9e(t){const e=[];let r;for(;(r=Z9e.exec(t))!==null;)e.push(r[1].toLowerCase());return e}function J9e(t){const e=t.toLowerCase();return e.includes("-")?!1:!K9e.has(e)}function eBe(t,e){return Q9e(t).some(n=>J9e(n)?!e.has(n):!1)}var tBe=class{constructor(t){this.activeParseLexer=null,this.extensionRanks=new Map,this.baseExtensions=[],this.extensions=[],this.codeTypes=new Set,this.schemaParseDomTagsCache=null,this.lastParseResult=null;var e,r,n,i,a;this.markedInstance=(e=t==null?void 0:t.marked)!=null?e:En,this.indentStyle=(n=(r=t==null?void 0:t.indentation)==null?void 0:r.style)!=null?n:"space",this.indentSize=(a=(i=t==null?void 0:t.indentation)==null?void 0:i.size)!=null?a:2,this.baseExtensions=(t==null?void 0:t.extensions)||[],t!=null&&t.markedOptions&&typeof this.markedInstance.setOptions=="function"&&this.markedInstance.setOptions(t.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,t!=null&&t.extensions&&(this.baseExtensions=t.extensions,ly(G6(t.extensions)).forEach(o=>this.registerExtension(o)))}get instance(){return this.markedInstance}get indentCharacter(){return this.indentStyle==="space"?" ":" "}get indentString(){return this.indentCharacter.repeat(this.indentSize)}hasMarked(){return!!this.markedInstance}registerExtension(t){var e,r;this.extensions.push(t);const n=un(Ut(t,"code")),i=t.name;n&&this.codeTypes.add(i),this.extensionRanks.has(i)||this.extensionRanks.set(i,this.extensionRanks.size);const a=Ut(t,"markdownTokenName")||i,s=Ut(t,"parseMarkdown"),o=Ut(t,"renderMarkdown"),l=Ut(t,"markdownTokenizer"),u=(e=Ut(t,"markdownOptions"))!=null?e:null,h=(r=u==null?void 0:u.indentsContent)!=null?r:!1,d=u==null?void 0:u.htmlReopen,f={tokenName:a,nodeName:i,parseMarkdown:s,renderMarkdown:o,isIndenting:h,htmlReopen:d,tokenizer:l};if(a&&s){const p=this.registry.get(a)||[];p.push(f),this.registry.set(a,p)}if(o){const p=this.nodeTypeRegistry.get(i)||[];p.push(f),this.nodeTypeRegistry.set(i,p)}l&&this.hasMarked()&&this.registerTokenizer(l)}createLexer(){return new this.markedInstance.Lexer(this.markedInstance.defaults)}createTokenizerHelpers(t){return{inlineTokens:e=>t.inlineTokens(e),blockTokens:e=>t.blockTokens(e)}}tokenizeInline(t){var e;return((e=this.activeParseLexer)!=null?e:this.createLexer()).inlineTokens(t)}registerTokenizer(t){if(!this.hasMarked())return;const{name:e,start:r,level:n="inline",tokenize:i}=t,a=this.createTokenizerHelpers.bind(this),s=this.createLexer.bind(this);let o;r?o=typeof r=="function"?r:u=>u.indexOf(r):o=u=>{const h=i(u,[],this.createTokenizerHelpers(this.createLexer()));return h&&h.raw?u.indexOf(h.raw):-1};const l={name:e,level:n,start:o,tokenizer(u,h){const d=this.lexer?a(this.lexer):a(s()),f=i(u,h,d);if(f&&f.type)return{...f,type:f.type||e,raw:f.raw||"",tokens:f.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[l]})}getHandlersForToken(t){try{return this.registry.get(t)||[]}catch{return[]}}getHandlerForToken(t){const e=this.getHandlersForToken(t);if(e.length>0)return e[0];const r=this.getHandlersForNodeType(t);return r.length>0?r[0]:void 0}getHandlersForNodeType(t){try{return this.nodeTypeRegistry.get(t)||[]}catch{return[]}}serialize(t){if(!t)return"";const e=this.renderNodes(t,t);return this.isEmptyOutput(e)?"":e}isEmptyOutput(t){return!t||t.trim()===""?!0:t.replace(/&nbsp;/g,"").replace(/\u00A0/g,"").trim()===""}parse(t){if(!this.hasMarked())throw new Error("No marked instance available for parsing");const e=this.activeParseLexer,r=this.createLexer();this.activeParseLexer=r;try{const n=r.lex(t);return{type:"doc",content:this.parseTokens(n,!0)}}finally{this.activeParseLexer=e}}parseTokens(t,e=!1){const r=t.reduce((a,s,o)=>(s.type!=="space"&&a.push(o),a),[]);let n=-1,i=0;return t.flatMap((a,s)=>{for(var o;i<r.length&&r[i]<s;)n=r[i],i+=1;if(e&&a.type==="space"){const u=(o=r[i])!=null?o:-1;return this.createImplicitEmptyParagraphsFromSpace(a,n,u)}const l=this.parseToken(a,e);return l===null?[]:Array.isArray(l)?l:[l]})}createImplicitEmptyParagraphsFromSpace(t,e,r){const n=this.countParagraphSeparators(t.raw||"");if(n===0)return[];const a=Math.max(n-(e===-1||r===-1?0:1),0);return Array.from({length:a},()=>({type:"paragraph",content:[]}))}countParagraphSeparators(t){return(t.replace(/\r\n/g,`
`).match(/\n\n/g)||[]).length}parseToken(t,e=!1){if(!t.type)return null;if(t.type==="list")return this.parseListToken(t);const r=this.getHandlersForToken(t.type),n=this.createParseHelpers();if(r.find(a=>{if(!a.parseMarkdown)return!1;const s=a.parseMarkdown(t,n),o=this.normalizeParseResult(s);return o&&(!Array.isArray(o)||o.length>0)?(this.lastParseResult=o,!0):!1})&&this.lastParseResult){const a=this.lastParseResult;return this.lastParseResult=null,a}return this.parseFallbackToken(t,e)}parseListToken(t){if(!t.items||t.items.length===0)return this.parseTokenWithHandlers(t);const e=t.items.some(o=>CM(o).isTask),r=t.items.some(o=>!CM(o).isTask);if(!e||!r||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(t);const n=[];let i=[],a=null;for(let o=0;o<t.items.length;o+=1){const l=t.items[o],{isTask:u,checked:h,indentLevel:d}=CM(l);let f=l;if(u){const m=(l.raw||l.text||"").split(`
`),y=m[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),v=y?y[2]:"";let T=[];if(m.length>1&&m.slice(1).join(`
`).trim()){const w=m.slice(1),C=w.filter(S=>S.trim());if(C.length>0){const S=Math.min(...C.map(_=>_.length-_.trimStart().length)),E=w.map(_=>_.trim()?_.slice(S):"").join(`
`).trim();E&&(T=this.markedInstance.lexer(`${E}
`))}}f={type:"taskItem",raw:"",mainContent:v,indentLevel:d,checked:h??!1,text:v,tokens:this.tokenizeInline(v),nestedTokens:T}}const p=u?"taskList":"list";a!==p?(i.length>0&&n.push({type:a,items:i}),i=[f],a=p):i.push(f)}i.length>0&&n.push({type:a,items:i});const s=[];for(let o=0;o<n.length;o+=1){const l=n[o],u={...t,type:l.type,items:l.items},h=this.parseToken(u);h&&(Array.isArray(h)?s.push(...h):s.push(h))}return s.length>0?s:null}parseTokenWithHandlers(t){if(!t.type)return null;const e=this.getHandlersForToken(t.type),r=this.createParseHelpers();if(e.find(i=>{if(!i.parseMarkdown)return!1;const a=i.parseMarkdown(t,r),s=this.normalizeParseResult(a);return s&&(!Array.isArray(s)||s.length>0)?(this.lastParseResult=s,!0):!1})&&this.lastParseResult){const i=this.lastParseResult;return this.lastParseResult=null,i}return this.parseFallbackToken(t)}createParseHelpers(){return{parseInline:t=>this.parseInlineTokens(t),tokenizeInline:t=>this.tokenizeInline(t),parseChildren:t=>this.parseTokens(t),parseBlockChildren:t=>this.parseTokens(t,!0),createTextNode:(t,e)=>({type:"text",text:t,marks:e||void 0}),createNode:(t,e,r)=>{const n={type:t,attrs:e||void 0,content:r||void 0};return(!e||Object.keys(e).length===0)&&delete n.attrs,n},applyMark:(t,e,r)=>({mark:t,content:e,attrs:r&&Object.keys(r).length>0?r:void 0})}}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(t){var e,r,n,i;const a=[];for(let s=0;s<t.length;s+=1){const o=t[s];if(o.type==="text")a.push({type:"text",text:bX(o.text||"")});else if(o.type==="escape")a.push({type:"text",text:o.text||""});else if(o.type==="html"){const l=((r=(e=o.raw)!=null?e:o.text)!=null?r:"").toString(),u=/^<\/[\s]*[\w-]+/i.test(l),h=l.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!u&&h&&!/\/>$/.test(l)){const f=h[1],p=this.escapeRegex(f),g=new RegExp(`^<\\/\\s*${p}\\b`,"i");let m=-1;const y=[l];for(let v=s+1;v<t.length;v+=1){const T=t[v],b=((i=(n=T.raw)!=null?n:T.text)!=null?i:"").toString();if(y.push(b),T.type==="html"&&g.test(b)){m=v;break}}if(m!==-1){const v=y.join(""),T={type:"html",raw:v,text:v,block:!1},b=this.parseHTMLToken(T);if(b){const w=this.normalizeParseResult(b);Array.isArray(w)?a.push(...w):w&&a.push(w)}s=m;continue}}const d=this.parseHTMLToken(o);if(d){const f=this.normalizeParseResult(d);Array.isArray(f)?a.push(...f):f&&a.push(f)}}else if(o.type){const l=this.getHandlerForToken(o.type);if(l&&l.parseMarkdown){const u=this.createParseHelpers(),h=l.parseMarkdown(o,u);if(this.isMarkResult(h)){const d=this.applyMarkToContent(h.mark,h.content,h.attrs);a.push(...d)}else{const d=this.normalizeParseResult(h);Array.isArray(d)?a.push(...d):d&&a.push(d)}}else o.tokens&&a.push(...this.parseInlineTokens(o.tokens))}}for(let s=a.length-1;s>0;s-=1){const o=a[s],l=a[s-1];if(o.type==="text"&&l.type==="text"){const u=o.marks||[],h=l.marks||[];rDe(u,h)&&(l.text=(l.text||"")+(o.text||""),a.splice(s,1))}}return a}applyMarkToContent(t,e,r){return e.map(n=>{if(n.type==="text"){const i=n.marks||[],a=r?{type:t,attrs:r}:{type:t};return{...n,marks:[...i,a]}}return{...n,content:n.content?this.applyMarkToContent(t,n.content,r):void 0}})}isMarkResult(t){return t&&typeof t=="object"&&"mark"in t}normalizeParseResult(t){return t?this.isMarkResult(t)?t.content:t:null}parseFallbackToken(t,e=!1){switch(t.type){case"paragraph":return{type:"paragraph",content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"heading":return{type:"heading",attrs:{level:t.depth||1},content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"text":return{type:"text",text:bX(t.text||"")};case"html":return this.parseHTMLToken(t);case"escape":return{type:"text",text:t.text||""};case"space":return null;default:return t.tokens?this.parseTokens(t.tokens,e):null}}parseHTMLToken(t){const e=t.text||t.raw||"";if(!e.trim())return null;if(this.isUnrecognizedHtml(e))return this.htmlAsLiteralText(e,!!t.block);if(typeof window>"u"||typeof window.DOMParser>"u")return this.htmlAsLiteralText(e,!!t.block);try{const r=uNe(e,this.baseExtensions);return r.type==="doc"&&r.content?t.block?r.content:r.content.length===1&&r.content[0].type==="paragraph"&&r.content[0].content?r.content[0].content:r.content:r}catch(r){throw new Error(`Failed to parse HTML in markdown: ${r}`)}}isUnrecognizedHtml(t){return eBe(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=hoe(this.baseExtensions),r=n=>{const i=n==null?void 0:n.parseDOM;Array.isArray(i)&&i.forEach(a=>{if(typeof(a==null?void 0:a.tag)=="string"){const s=a.tag.match(/^[a-zA-Z][\w-]*/);s&&t.add(s[0].toLowerCase())}})};Object.values(e.nodes).forEach(n=>r(n.spec)),Object.values(e.marks).forEach(n=>r(n.spec))}catch{}return this.schemaParseDomTagsCache=t,t}htmlAsLiteralText(t,e){const r=t.replace(/\s+$/,"");return r?e?{type:"paragraph",content:[{type:"text",text:r}]}:{type:"text",text:r}:null}encodeTextForMarkdown(t,e,r){return(r==null?void 0:r.type)!=null&&this.codeTypes.has(r.type)||(e.marks||[]).some(i=>this.codeTypes.has(typeof i=="string"?i:i.type))?t:this.escapeMarkdownSyntax(YNe(t))}escapeMarkdownSyntax(t){return t.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(t,e,r=0,n=0,i={}){var a;if(t.type==="text")return this.encodeTextForMarkdown(t.text||"",t,e);if(!t.type)return"";const s=this.getHandlerForToken(t.type);if(!s)return"";const o=Array.isArray(e==null?void 0:e.content)&&r>0?e.content[r-1]:void 0,l={renderChildren:(d,f)=>{const p=s.isIndenting?n+1:n;return!Array.isArray(d)&&d.content?this.renderNodes(d.content,t,f||"",r,p):this.renderNodes(d,t,f||"",r,p)},renderChild:(d,f)=>{const p=s.isIndenting?n+1:n;return this.renderNodeToMarkdown(d,t,f,p)},indent:d=>this.indentString+d,wrapInBlock:H9e},u={index:r,level:n,parentType:e==null?void 0:e.type,previousNode:o,meta:{parentAttrs:e==null?void 0:e.attrs,...i}};return((a=s.renderMarkdown)==null?void 0:a.call(s,t,l,u))||""}renderNodes(t,e,r="",n=0,i=0){return Array.isArray(t)?this.renderNodesWithMarkBoundaries(t,e,r,i):t.type?this.renderNodeToMarkdown(t,e,n,i):""}renderNodesWithMarkBoundaries(t,e,r="",n=0){const i=[],a=new Map,s=new Set,o=new Map;return t.forEach((l,u)=>{const h=u<t.length-1?t[u+1]:null;if(l.type)if(l.type==="text"){let d=this.encodeTextForMarkdown(l.text||"",l,e);const f=new Map((l.marks||[]).map(C=>[C.type,C])),p=this.getMarksToOpenForSerialization(a,f,h),g=q9e(f,h),m=g.filter(C=>a.has(C)),y=m.length>0&&p.length>0;let v="";if(g.length>0&&!y){const C=d.match(/(\s+)$/);C&&(v=C[1],d=d.slice(0,-v.length))}y||g.slice().reverse().forEach(C=>{if(!a.has(C))return;const S=f.get(C),k=this.getMarkClosing(C,S,o.get(C));k&&(d+=k),a.has(C)&&(a.delete(C),o.delete(C))});let T="";if(p.length>0){const C=d.match(/^(\s+)/);C&&(T=C[1],d=d.slice(T.length))}p.forEach(({type:C,mark:S})=>{const k=s.has(C)?"html":"markdown",E=this.getMarkOpening(C,S,k);E&&(d=E+d),o.set(C,k),s.delete(C)}),y||p.slice().reverse().forEach(({type:C,mark:S})=>{a.set(C,S)}),d=T+d;let b;if(y){const C=new Set(((h==null?void 0:h.marks)||[]).map(E=>E.type));p.forEach(({type:E})=>{C.has(E)&&this.getHtmlReopenTags(E)&&s.add(E)});const S=Array.from(a.keys()),k=m.slice().sort((E,_)=>S.indexOf(_)-S.indexOf(E));b=[...p.map(E=>E.type),...k]}else b=Y9e(a,f,h,this.markSetsEqual.bind(this));let w="";if(b.length>0){const C=d.match(/(\s+)$/);C&&(w=C[1],d=d.slice(0,-w.length))}b.forEach(C=>{var S;const k=(S=a.get(C))!=null?S:f.get(C),E=this.getMarkClosing(C,k,o.get(C));E&&(d+=E),a.delete(C),o.delete(C)}),d+=w,d+=v,i.push(d)}else{const d=new Set((l.marks||[]).map(v=>v.type)),f=new Map,p=new Map;a.forEach((v,T)=>{var b;d.has(T)&&(f.set(T,v),p.set(T,(b=o.get(T))!=null?b:"markdown"))});const g=X9e(a,(v,T)=>this.getMarkClosing(v,T,o.get(v)));o.clear();const m=this.renderNodeToMarkdown(l,e,u,n),y=l.type==="hardBreak"?"":j9e(f,a,(v,T)=>{var b;const w=(b=p.get(v))!=null?b:"markdown";return o.set(v,w),this.getMarkOpening(v,T,w)});i.push(g+m+y)}}),i.join(r)}getMarkOpening(t,e,r="markdown"){var n;if(r==="html")return((n=this.getHtmlReopenTags(t))==null?void 0:n.open)||"";const i=this.getHandlersForNodeType(t),a=i.length>0?i[0]:void 0;if(!a||!a.renderMarkdown)return"";const s="__TIPTAP_MARKDOWN_PLACEHOLDER__",o={type:t,attrs:e.attrs||{},content:[{type:"text",text:s}]};try{const l=a.renderMarkdown(o,{renderChildren:()=>s,renderChild:()=>s,indent:h=>h,wrapInBlock:(h,d)=>h+d},{index:0,level:0,parentType:"text",meta:{}}),u=l.indexOf(s);return u>=0?l.substring(0,u):""}catch(l){throw new Error(`Failed to get mark opening for ${t}: ${l}`)}}getMarkClosing(t,e,r="markdown"){var n;if(r==="html")return((n=this.getHtmlReopenTags(t))==null?void 0:n.close)||"";const i=this.getHandlersForNodeType(t),a=i.length>0?i[0]:void 0;if(!a||!a.renderMarkdown)return"";const s="__TIPTAP_MARKDOWN_PLACEHOLDER__",o={type:t,attrs:e.attrs||{},content:[{type:"text",text:s}]};try{const l=a.renderMarkdown(o,{renderChildren:()=>s,renderChild:()=>s,indent:d=>d,wrapInBlock:(d,f)=>d+f},{index:0,level:0,parentType:"text",meta:{}}),u=l.indexOf(s),h=u+s.length;return u>=0?l.substring(h):""}catch(l){throw new Error(`Failed to get mark closing for ${t}: ${l}`)}}getHtmlReopenTags(t){const e=this.getHandlersForNodeType(t),r=e.length>0?e[0]:void 0;return r==null?void 0:r.htmlReopen}markSetsEqual(t,e){return t.size!==e.size?!1:Array.from(t.entries()).every(([r,n])=>{const i=e.get(r);return i&&bb(n.attrs,i.attrs)})}getMarksToOpenForSerialization(t,e,r){const n=U9e(t,e);if(n.length<=1)return n;const i=(r==null?void 0:r.marks)||[],a=(u,h)=>i.some(d=>d.type===u&&bb(d.attrs,h)),s=(u,h)=>{var d,f;const p=(d=this.extensionRanks.get(u.type))!=null?d:Number.MAX_SAFE_INTEGER,g=(f=this.extensionRanks.get(h.type))!=null?f:Number.MAX_SAFE_INTEGER;return p!==g?g-p:u.type.localeCompare(h.type)},o=n.filter(u=>!a(u.type,u.mark.attrs)).sort(s),l=n.filter(u=>a(u.type,u.mark.attrs)).sort(s);return[...o,...l]}},rj=tBe,rBe=ci.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!(e!=null&&e.contentType)||gE(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return Ml.setContent(t,e);const n=this.editor.markdown.parse(t);return Ml.setContent(n,e)},insertContent:(t,e)=>{if(!(e!=null&&e.contentType)||gE(t,e==null?void 0:e.contentType)!=="markdown"||!this.editor.markdown)return Ml.insertContent(t,e);const n=this.editor.markdown.parse(t);return Ml.insertContent(n,e)},insertContentAt:(t,e,r)=>{if(!(r!=null&&r.contentType)||gE(e,r==null?void 0:r.contentType)!=="markdown"||!this.editor.markdown)return Ml.insertContentAt(t,e,r);const i=this.editor.markdown.parse(e);return Ml.insertContentAt(t,i,r)}}},addStorage(){return{manager:new rj({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){var t;if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new rj({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||gE(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const r=this.editor.markdown.parse(this.editor.options.content);(t=r.content)!=null&&t.length&&(this.editor.options.content=r)}});const nBe="modulepreload",iBe=function(t,e){return new URL(t,e).href},nj={},tr=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){let s=function(h){return Promise.all(h.map(d=>Promise.resolve(d).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const o=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=s(r.map(h=>{if(h=iBe(h,n),h in nj)return;nj[h]=!0;const d=h.endsWith(".css"),f=d?'[rel="stylesheet"]':"";if(!!n)for(let m=o.length-1;m>=0;m--){const y=o[m];if(y.href===h&&(!d||y.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${f}`))return;const g=document.createElement("link");if(g.rel=d?"stylesheet":nBe,d||(g.as="script"),g.crossOrigin="",g.href=h,u&&g.setAttribute("nonce",u),document.head.appendChild(g),d)return new Promise((m,y)=>{g.addEventListener("load",m),g.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return i.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})};var Fle=Object.defineProperty,x=(t,e)=>Fle(t,"name",{value:e,configurable:!0}),Z6=(t,e)=>{for(var r in e)Fle(t,r,{get:e[r],enumerable:!0})};function eg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var F4={exports:{}},aBe=F4.exports,ij;function sBe(){return ij||(ij=1,(function(t,e){(function(r,n){t.exports=n()})(aBe,(function(){var r=1e3,n=6e4,i=36e5,a="millisecond",s="second",o="minute",l="hour",u="day",h="week",d="month",f="quarter",p="year",g="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|YYYY|YY|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,T={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(R){var I=["th","st","nd","rd"],$=R%100;return"["+R+(I[($-20)%10]||I[$]||I[0])+"]"}},b=function(R,I,$){var O=String(R);return!O||O.length>=I?R:""+Array(I+1-O.length).join($)+R},w={s:b,z:function(R){var I=-R.utcOffset(),$=Math.abs(I),O=Math.floor($/60),N=$%60;return(I<=0?"+":"-")+b(O,2,"0")+":"+b(N,2,"0")},m:function R(I,$){if(I.date()<$.date())return-R($,I);var O=12*($.year()-I.year())+($.month()-I.month()),N=I.clone().add(O,d),F=$-N<0,z=I.clone().add(O+(F?-1:1),d);return+(-(O+($-N)/(F?N-z:z-N))||0)},a:function(R){return R<0?Math.ceil(R)||0:Math.floor(R)},p:function(R){return{M:d,y:p,w:h,d:u,D:g,h:l,m:o,s,ms:a,Q:f}[R]||String(R||"").toLowerCase().replace(/s$/,"")},u:function(R){return R===void 0}},C="en",S={};S[C]=T;var k="$isDayjsObject",E=function(R){return R instanceof P||!(!R||!R[k])},_=function R(I,$,O){var N;if(!I)return C;if(typeof I=="string"){var F=I.toLowerCase();S[F]&&(N=F),$&&(S[F]=$,N=F);var z=I.split("-");if(!N&&z.length>1)return R(z[0])}else{var V=I.name;S[V]=I,N=V}return!O&&N&&(C=N),N||!O&&C},M=function(R,I){if(E(R))return R.clone();var $=typeof I=="object"?I:{};return $.date=R,$.args=arguments,new P($)},L=w;L.l=_,L.i=E,L.w=function(R,I){return M(R,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var P=(function(){function R($){this.$L=_($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[k]=!0}var I=R.prototype;return I.parse=function($){this.$d=(function(O){var N=O.date,F=O.utc;if(N===null)return new Date(NaN);if(L.u(N))return new Date;if(N instanceof Date)return new Date(N);if(typeof N=="string"&&!/Z$/i.test(N)){var z=N.match(y);if(z){var V=z[2]-1||0,B=(z[7]||"0").substring(0,3);return F?new Date(Date.UTC(z[1],V,z[3]||1,z[4]||0,z[5]||0,z[6]||0,B)):new Date(z[1],V,z[3]||1,z[4]||0,z[5]||0,z[6]||0,B)}}return new Date(N)})($),this.init()},I.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},I.$utils=function(){return L},I.isValid=function(){return this.$d.toString()!==m},I.isSame=function($,O){var N=M($);return this.startOf(O)<=N&&N<=this.endOf(O)},I.isAfter=function($,O){return M($)<this.startOf(O)},I.isBefore=function($,O){return this.endOf(O)<M($)},I.$g=function($,O,N){return L.u($)?this[O]:this.set(N,$)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function($,O){var N=this,F=!!L.u(O)||O,z=L.p($),V=function(K,Q){var te=L.w(N.$u?Date.UTC(N.$y,Q,K):new Date(N.$y,Q,K),N);return F?te:te.endOf(u)},B=function(K,Q){return L.w(N.toDate()[K].apply(N.toDate("s"),(F?[0,0,0,0]:[23,59,59,999]).slice(Q)),N)},G=this.$W,H=this.$M,q=this.$D,Z="set"+(this.$u?"UTC":"");switch(z){case p:return F?V(1,0):V(31,11);case d:return F?V(1,H):V(0,H+1);case h:var Y=this.$locale().weekStart||0,ie=(G<Y?G+7:G)-Y;return V(F?q-ie:q+(6-ie),H);case u:case g:return B(Z+"Hours",0);case l:return B(Z+"Minutes",1);case o:return B(Z+"Seconds",2);case s:return B(Z+"Milliseconds",3);default:return this.clone()}},I.endOf=function($){return this.startOf($,!1)},I.$set=function($,O){var N,F=L.p($),z="set"+(this.$u?"UTC":""),V=(N={},N[u]=z+"Date",N[g]=z+"Date",N[d]=z+"Month",N[p]=z+"FullYear",N[l]=z+"Hours",N[o]=z+"Minutes",N[s]=z+"Seconds",N[a]=z+"Milliseconds",N)[F],B=F===u?this.$D+(O-this.$W):O;if(F===d||F===p){var G=this.clone().set(g,1);G.$d[V](B),G.init(),this.$d=G.set(g,Math.min(this.$D,G.daysInMonth())).$d}else V&&this.$d[V](B);return this.init(),this},I.set=function($,O){return this.clone().$set($,O)},I.get=function($){return this[L.p($)]()},I.add=function($,O){var N,F=this;$=Number($);var z=L.p(O),V=function(H){var q=M(F);return L.w(q.date(q.date()+Math.round(H*$)),F)};if(z===d)return this.set(d,this.$M+$);if(z===p)return this.set(p,this.$y+$);if(z===u)return V(1);if(z===h)return V(7);var B=(N={},N[o]=n,N[l]=i,N[s]=r,N)[z]||1,G=this.$d.getTime()+$*B;return L.w(G,this)},I.subtract=function($,O){return this.add(-1*$,O)},I.format=function($){var O=this,N=this.$locale();if(!this.isValid())return N.invalidDate||m;var F=$||"YYYY-MM-DDTHH:mm:ssZ",z=L.z(this),V=this.$H,B=this.$m,G=this.$M,H=N.weekdays,q=N.months,Z=N.meridiem,Y=function(Q,te,J,ge){return Q&&(Q[te]||Q(O,F))||J[te].slice(0,ge)},ie=function(Q){return L.s(V%12||12,Q,"0")},K=Z||function(Q,te,J){var ge=Q<12?"AM":"PM";return J?ge.toLowerCase():ge};return F.replace(v,(function(Q,te){return te||(function(J){switch(J){case"YY":return String(O.$y).slice(-2);case"YYYY":return L.s(O.$y,4,"0");case"M":return G+1;case"MM":return L.s(G+1,2,"0");case"MMM":return Y(N.monthsShort,G,q,3);case"MMMM":return Y(q,G);case"D":return O.$D;case"DD":return L.s(O.$D,2,"0");case"d":return String(O.$W);case"dd":return Y(N.weekdaysMin,O.$W,H,2);case"ddd":return Y(N.weekdaysShort,O.$W,H,3);case"dddd":return H[O.$W];case"H":return String(V);case"HH":return L.s(V,2,"0");case"h":return ie(1);case"hh":return ie(2);case"a":return K(V,B,!0);case"A":return K(V,B,!1);case"m":return String(B);case"mm":return L.s(B,2,"0");case"s":return String(O.$s);case"ss":return L.s(O.$s,2,"0");case"SSS":return L.s(O.$ms,3,"0");case"Z":return z}return null})(Q)||z.replace(":","")}))},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function($,O,N){var F,z=this,V=L.p(O),B=M($),G=(B.utcOffset()-this.utcOffset())*n,H=this-B,q=function(){return L.m(z,B)};switch(V){case p:F=q()/12;break;case d:F=q();break;case f:F=q()/3;break;case h:F=(H-G)/6048e5;break;case u:F=(H-G)/864e5;break;case l:F=H/i;break;case o:F=H/n;break;case s:F=H/r;break;default:F=H}return N?F:L.a(F)},I.daysInMonth=function(){return this.endOf(d).$D},I.$locale=function(){return S[this.$L]},I.locale=function($,O){if(!$)return this.$L;var N=this.clone(),F=_($,O,!0);return F&&(N.$L=F),N},I.clone=function(){return L.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},R})(),D=P.prototype;return M.prototype=D,[["$ms",a],["$s",s],["$m",o],["$H",l],["$W",u],["$M",d],["$y",p],["$D",g]].forEach((function(R){D[R[1]]=function(I){return this.$g(I,R[0],R[1])}})),M.extend=function(R,I){return R.$i||(R(I,P,M),R.$i=!0),M},M.locale=_,M.isDayjs=E,M.unix=function(R){return M(1e3*R)},M.en=S[C],M.Ls=S,M.p={},M}))})(F4)),F4.exports}var oBe=sBe();const xa=eg(oBe);var Au={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},le={trace:x((...t)=>{},"trace"),debug:x((...t)=>{},"debug"),info:x((...t)=>{},"info"),warn:x((...t)=>{},"warn"),error:x((...t)=>{},"error"),fatal:x((...t)=>{},"fatal")},Tz=x(function(t="fatal"){let e=Au.fatal;typeof t=="string"?t.toLowerCase()in Au&&(e=Au[t]):typeof t=="number"&&(e=t),le.trace=()=>{},le.debug=()=>{},le.info=()=>{},le.warn=()=>{},le.error=()=>{},le.fatal=()=>{},e<=Au.fatal&&(le.fatal=console.error?console.error.bind(console,Qo("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Qo("FATAL"))),e<=Au.error&&(le.error=console.error?console.error.bind(console,Qo("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Qo("ERROR"))),e<=Au.warn&&(le.warn=console.warn?console.warn.bind(console,Qo("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Qo("WARN"))),e<=Au.info&&(le.info=console.info?console.info.bind(console,Qo("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Qo("INFO"))),e<=Au.debug&&(le.debug=console.debug?console.debug.bind(console,Qo("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Qo("DEBUG"))),e<=Au.trace&&(le.trace=console.debug?console.debug.bind(console,Qo("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Qo("TRACE")))},"setLogLevel"),Qo=x(t=>`%c${xa().format("ss.SSS")} : ${t} : `,"format");const z4={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),hsl2rgb:({h:t,s:e,l:r},n)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;const i=r<.5?r*(1+e):r+e-r*e,a=2*r-i;switch(n){case"r":return z4.hue2rgb(a,i,t+1/3)*255;case"g":return z4.hue2rgb(a,i,t)*255;case"b":return z4.hue2rgb(a,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:r},n)=>{t/=255,e/=255,r/=255;const i=Math.max(t,e,r),a=Math.min(t,e,r),s=(i+a)/2;if(n==="l")return s*100;if(i===a)return 0;const o=i-a,l=s>.5?o/(2-i-a):o/(i+a);if(n==="s")return l*100;switch(i){case t:return((e-r)/o+(e<r?6:0))*60;case e:return((r-t)/o+2)*60;case r:return((t-e)/o+4)*60;default:return-1}}},lBe={clamp:(t,e,r)=>e>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},cBe={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},Ar={channel:z4,lang:lBe,unit:cBe},cd={};for(let t=0;t<=255;t++)cd[t]=Ar.unit.dec2hex(t);const ss={ALL:0,RGB:1,HSL:2};let uBe=class{constructor(){this.type=ss.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=ss.ALL}is(e){return this.type===e}};class hBe{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new uBe}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=ss.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=Ar.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=Ar.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Ar.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=Ar.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=Ar.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Ar.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(ss.HSL)&&r!==void 0?r:(this._ensureHSL(),Ar.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(ss.HSL)&&r!==void 0?r:(this._ensureHSL(),Ar.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(ss.HSL)&&r!==void 0?r:(this._ensureHSL(),Ar.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(ss.RGB)&&r!==void 0?r:(this._ensureRGB(),Ar.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(ss.RGB)&&r!==void 0?r:(this._ensureRGB(),Ar.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(ss.RGB)&&r!==void 0?r:(this._ensureRGB(),Ar.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(ss.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(ss.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(ss.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(ss.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(ss.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(ss.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const Q6=new hBe({r:0,g:0,b:0,a:0},"transparent"),cy={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(cy.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,a=i%4===0,s=i>4,o=s?1:17,l=s?8:4,u=a?0:-1,h=s?255:15;return Q6.set({r:(n>>l*(u+3)&h)*o,g:(n>>l*(u+2)&h)*o,b:(n>>l*(u+1)&h)*o,a:a?(n&h)*o/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${cd[Math.round(e)]}${cd[Math.round(r)]}${cd[Math.round(n)]}${cd[Math.round(i*255)]}`:`#${cd[Math.round(e)]}${cd[Math.round(r)]}${cd[Math.round(n)]}`}},Xp={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(Xp.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return Ar.channel.clamp.h(parseFloat(r)*.9);case"rad":return Ar.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return Ar.channel.clamp.h(parseFloat(r)*360)}}return Ar.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(Xp.re);if(!r)return;const[,n,i,a,s,o]=r;return Q6.set({h:Xp._hue2deg(n),s:Ar.channel.clamp.s(parseFloat(i)),l:Ar.channel.clamp.l(parseFloat(a)),a:s?Ar.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)},stringify:t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${Ar.lang.round(e)}, ${Ar.lang.round(r)}%, ${Ar.lang.round(n)}%, ${i})`:`hsl(${Ar.lang.round(e)}, ${Ar.lang.round(r)}%, ${Ar.lang.round(n)}%)`}},Nw={colors:{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",cyanaqua:"#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",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:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",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:"#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",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=Nw.colors[t];if(e)return cy.parse(e)},stringify:t=>{const e=cy.stringify(t);for(const r in Nw.colors)if(Nw.colors[r]===e)return r}},VT={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const r=t.match(VT.re);if(!r)return;const[,n,i,a,s,o,l,u,h]=r;return Q6.set({r:Ar.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:Ar.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:Ar.channel.clamp.b(l?parseFloat(o)*2.55:parseFloat(o)),a:u?Ar.channel.clamp.a(h?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`rgba(${Ar.lang.round(e)}, ${Ar.lang.round(r)}, ${Ar.lang.round(n)}, ${Ar.lang.round(i)})`:`rgb(${Ar.lang.round(e)}, ${Ar.lang.round(r)}, ${Ar.lang.round(n)})`}},sc={format:{keyword:Nw,hex:cy,rgb:VT,rgba:VT,hsl:Xp,hsla:Xp},parse:t=>{if(typeof t!="string")return t;const e=cy.parse(t)||VT.parse(t)||Xp.parse(t)||Nw.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(ss.HSL)||t.data.r===void 0?Xp.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?VT.stringify(t):cy.stringify(t)},zle=(t,e)=>{const r=sc.parse(t);for(const n in e)r[n]=Ar.channel.clamp[n](e[n]);return sc.stringify(r)},jl=(t,e,r=0,n=1)=>{if(typeof t!="number")return zle(t,{a:e});const i=Q6.set({r:Ar.channel.clamp.r(t),g:Ar.channel.clamp.g(e),b:Ar.channel.clamp.b(r),a:Ar.channel.clamp.a(n)});return sc.stringify(i)},wz=(t,e)=>Ar.lang.round(sc.parse(t)[e]),dBe=t=>{const{r:e,g:r,b:n}=sc.parse(t),i=.2126*Ar.channel.toLinear(e)+.7152*Ar.channel.toLinear(r)+.0722*Ar.channel.toLinear(n);return Ar.lang.round(i)},fBe=t=>dBe(t)>=.5,Zs=t=>!fBe(t),Cz=(t,e,r)=>{const n=sc.parse(t),i=n[e],a=Ar.channel.clamp[e](i+r);return i!==a&&(n[e]=a),sc.stringify(n)},Je=(t,e)=>Cz(t,"l",e),et=(t,e)=>Cz(t,"l",-e),aj=(t,e)=>Cz(t,"a",-e),me=(t,e)=>{const r=sc.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return zle(t,n)},pBe=(t,e,r=50)=>{const{r:n,g:i,b:a,a:s}=sc.parse(t),{r:o,g:l,b:u,a:h}=sc.parse(e),d=r/100,f=d*2-1,p=s-h,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,y=1-m,v=n*m+o*y,T=i*m+l*y,b=a*m+u*y,w=s*d+h*(1-d);return jl(v,T,b,w)},Xe=(t,e=100)=>{const r=sc.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,pBe(r,t,e)};/*! @license DOMPurify 3.4.13 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.13/LICENSE */function sj(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function gBe(t){if(Array.isArray(t))return t}function mBe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,s,o=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(l=(n=a.call(r)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(h){u=!0,i=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function yBe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vBe(t,e){return gBe(t)||mBe(t,e)||bBe(t,e)||yBe()}function bBe(t,e){if(t){if(typeof t=="string")return sj(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?sj(t,e):void 0}}const Vle=Object.entries,oj=Object.setPrototypeOf,xBe=Object.isFrozen,TBe=Object.getPrototypeOf,wBe=Object.getOwnPropertyDescriptor;let Xa=Object.freeze,Ja=Object.seal,ym=Object.create,Gle=typeof Reflect<"u"&&Reflect,GD=Gle.apply,WD=Gle.construct;Xa||(Xa=function(e){return e});Ja||(Ja=function(e){return e});GD||(GD=function(e,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];return e.apply(r,i)});WD||(WD=function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return new e(...n)});const Gg=Ki(Array.prototype.forEach),CBe=Ki(Array.prototype.lastIndexOf),lj=Ki(Array.prototype.pop),Wg=Ki(Array.prototype.push),kBe=Ki(Array.prototype.splice),kd=Array.isArray,GT=Ki(String.prototype.toLowerCase),kM=Ki(String.prototype.toString),cj=Ki(String.prototype.match),Qx=Ki(String.prototype.replace),uj=Ki(String.prototype.indexOf),SBe=Ki(String.prototype.trim),EBe=Ki(Number.prototype.toString),ABe=Ki(Boolean.prototype.toString),hj=typeof BigInt>"u"?null:Ki(BigInt.prototype.toString),dj=typeof Symbol>"u"?null:Ki(Symbol.prototype.toString),pa=Ki(Object.prototype.hasOwnProperty),Jx=Ki(Object.prototype.toString),fa=Ki(RegExp.prototype.test),Gf=_Be(TypeError);function Ki(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return GD(t,e,n)}}function _Be(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return WD(t,r)}}function Jr(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:GT;if(oj&&oj(t,null),!kd(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(xBe(e)||(e[n]=a),i=a)}t[i]=!0}return t}function RBe(t){for(let e=0;e<t.length;e++)pa(t,e)||(t[e]=null);return t}function as(t){const e=ym(null);for(const n of Vle(t)){var r=vBe(n,2);const i=r[0],a=r[1];pa(t,i)&&(kd(a)?e[i]=RBe(a):a&&typeof a=="object"&&a.constructor===Object?e[i]=as(a):e[i]=a)}return e}function LBe(t){switch(typeof t){case"string":return t;case"number":return EBe(t);case"boolean":return ABe(t);case"bigint":return hj?hj(t):"0";case"symbol":return dj?dj(t):"Symbol()";case"undefined":return Jx(t);case"function":case"object":{if(t===null)return Jx(t);const e=t,r=Rl(e,"toString");if(typeof r=="function"){const n=r(e);return typeof n=="string"?n:Jx(n)}return Jx(t)}default:return Jx(t)}}function Rl(t,e){for(;t!==null;){const n=wBe(t,e);if(n){if(n.get)return Ki(n.get);if(typeof n.value=="function")return Ki(n.value)}t=TBe(t)}function r(){return null}return r}function MBe(t){try{return fa(t,""),!0}catch{return!1}}const fj=Xa(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),SM=Xa(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),EM=Xa(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),IBe=Xa(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),AM=Xa(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),NBe=Xa(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pj=Xa(["#text"]),gj=Xa(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),_M=Xa(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),mj=Xa(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),mE=Xa(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),DBe=Ja(/{{[\w\W]*|^[\w\W]*}}/g),OBe=Ja(/<%[\w\W]*|^[\w\W]*%>/g),$Be=Ja(/\${[\w\W]*/g),PBe=Ja(/^data-[\-\w.\u00B7-\uFFFF]+$/),BBe=Ja(/^aria-[\-\w]+$/),yj=Ja(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),FBe=Ja(/^(?:\w+script|data):/i),zBe=Ja(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),VBe=Ja(/^html$/i),GBe=Ja(/^[a-z][.\w]*(-[.\w]+)+$/i),vj=Ja(/<[/\w!]/g),bj=Ja(/<[/\w]/g),WBe=Ja(/<\/no(script|embed|frames)/i),HBe=Ja(/\/>/i),Eo={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},qBe=function(){return typeof window>"u"?null:window},UBe=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},xj=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ed=function(e,r,n,i){return pa(e,r)&&kd(e[r])?Jr(i.base?as(i.base):{},e[r],i.transform):n};function Wle(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qBe();const e=wt=>Wle(wt);if(e.version="3.4.13",e.removed=[],!t||!t.document||t.document.nodeType!==Eo.document||!t.Element)return e.isSupported=!1,e;let r=t.document;const n=r,i=n.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,s=t.Node,o=t.Element,l=t.NodeFilter,u=t.NamedNodeMap;u===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,d=t.trustedTypes,f=o.prototype,p=Rl(f,"cloneNode"),g=Rl(f,"remove"),m=Rl(f,"nextSibling"),y=Rl(f,"childNodes"),v=Rl(f,"parentNode"),T=Rl(f,"shadowRoot"),b=Rl(f,"attributes"),w=s&&s.prototype?Rl(s.prototype,"nodeType"):null,C=s&&s.prototype?Rl(s.prototype,"nodeName"):null,S=s&&s.prototype?Rl(s.prototype,"ownerDocument"):null;if(typeof a=="function"){const wt=r.createElement("template");wt.content&&wt.content.ownerDocument&&(r=wt.content.ownerDocument)}let k,E="",_,M=!1,L=0;const P=function(){if(L>0)throw Gf('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},D=function(Le){P(),L++;try{return k.createHTML(Le)}finally{L--}},R=function(Le){P(),L++;try{return k.createScriptURL(Le)}finally{L--}},I=function(){return M||(_=UBe(d,i),M=!0),_},$=r,O=$.implementation,N=$.createNodeIterator,F=$.createDocumentFragment,z=$.getElementsByTagName,V=n.importNode;let B=xj();e.isSupported=typeof Vle=="function"&&typeof v=="function"&&O&&O.createHTMLDocument!==void 0;const G=DBe,H=OBe,q=$Be,Z=PBe,Y=BBe,ie=FBe,K=zBe,Q=GBe;let te=yj,J=null;const ge=Jr({},[...fj,...SM,...EM,...AM,...pj]);let ee=null;const Re=Jr({},[...gj,..._M,...mj,...mE]);let Ie=Object.seal(ym(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Be=null,ce=null;const oe=Object.seal(ym(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let be=!0,fe=!0,Pe=!1,ve=!0,Ce=!1,Ve=!0,se=!1,de=!1,Te=null,ae=null,he=!1,W=!1,ne=!1,j=!1,ue=!0,X=!1;const Oe="user-content-";let xe=!0,Ge=!1,_e={},$e=null;const Me=Jr({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let He=null;const De=Jr({},["audio","video","img","source","image","track"]);let Ke=null;const Ae=Jr({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),at="http://www.w3.org/1998/Math/MathML",Ee="http://www.w3.org/2000/svg",pt="http://www.w3.org/1999/xhtml";let ht=pt,rt=!1,Et=null;const vt=Jr({},[at,Ee,pt],kM),ot=Xa(["mi","mo","mn","ms","mtext"]);let pe=Jr({},ot);const Ct=Xa(["annotation-xml"]);let lt=Jr({},Ct);const st=Jr({},["title","style","font","a","script"]);let mt=null;const _r=["application/xhtml+xml","text/html"],Se="text/html";let Ue=null,tt=null;const kt=r.createElement("form"),Nt=function(Le){return Le instanceof RegExp||Le instanceof Function},sr=function(){let Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(tt&&tt===Le)return;(!Le||typeof Le!="object")&&(Le={}),Le=as(Le),mt=_r.indexOf(Le.PARSER_MEDIA_TYPE)===-1?Se:Le.PARSER_MEDIA_TYPE,Ue=mt==="application/xhtml+xml"?kM:GT,J=ed(Le,"ALLOWED_TAGS",ge,{transform:Ue}),ee=ed(Le,"ALLOWED_ATTR",Re,{transform:Ue}),Et=ed(Le,"ALLOWED_NAMESPACES",vt,{transform:kM}),Ke=ed(Le,"ADD_URI_SAFE_ATTR",Ae,{transform:Ue,base:Ae}),He=ed(Le,"ADD_DATA_URI_TAGS",De,{transform:Ue,base:De}),$e=ed(Le,"FORBID_CONTENTS",Me,{transform:Ue}),Be=ed(Le,"FORBID_TAGS",as({}),{transform:Ue}),ce=ed(Le,"FORBID_ATTR",as({}),{transform:Ue}),_e=pa(Le,"USE_PROFILES")?Le.USE_PROFILES&&typeof Le.USE_PROFILES=="object"?as(Le.USE_PROFILES):Le.USE_PROFILES:!1,be=Le.ALLOW_ARIA_ATTR!==!1,fe=Le.ALLOW_DATA_ATTR!==!1,Pe=Le.ALLOW_UNKNOWN_PROTOCOLS||!1,ve=Le.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ce=Le.SAFE_FOR_TEMPLATES||!1,Ve=Le.SAFE_FOR_XML!==!1,se=Le.WHOLE_DOCUMENT||!1,W=Le.RETURN_DOM||!1,ne=Le.RETURN_DOM_FRAGMENT||!1,j=Le.RETURN_TRUSTED_TYPE||!1,he=Le.FORCE_BODY||!1,ue=Le.SANITIZE_DOM!==!1,X=Le.SANITIZE_NAMED_PROPS||!1,xe=Le.KEEP_CONTENT!==!1,Ge=Le.IN_PLACE||!1,te=MBe(Le.ALLOWED_URI_REGEXP)?Le.ALLOWED_URI_REGEXP:yj,ht=typeof Le.NAMESPACE=="string"?Le.NAMESPACE:pt,pe=pa(Le,"MATHML_TEXT_INTEGRATION_POINTS")&&Le.MATHML_TEXT_INTEGRATION_POINTS&&typeof Le.MATHML_TEXT_INTEGRATION_POINTS=="object"?as(Le.MATHML_TEXT_INTEGRATION_POINTS):Jr({},ot),lt=pa(Le,"HTML_INTEGRATION_POINTS")&&Le.HTML_INTEGRATION_POINTS&&typeof Le.HTML_INTEGRATION_POINTS=="object"?as(Le.HTML_INTEGRATION_POINTS):Jr({},Ct);const je=pa(Le,"CUSTOM_ELEMENT_HANDLING")&&Le.CUSTOM_ELEMENT_HANDLING&&typeof Le.CUSTOM_ELEMENT_HANDLING=="object"?as(Le.CUSTOM_ELEMENT_HANDLING):ym(null);if(Ie=ym(null),pa(je,"tagNameCheck")&&Nt(je.tagNameCheck)&&(Ie.tagNameCheck=je.tagNameCheck),pa(je,"attributeNameCheck")&&Nt(je.attributeNameCheck)&&(Ie.attributeNameCheck=je.attributeNameCheck),pa(je,"allowCustomizedBuiltInElements")&&typeof je.allowCustomizedBuiltInElements=="boolean"&&(Ie.allowCustomizedBuiltInElements=je.allowCustomizedBuiltInElements),Ja(Ie),Ce&&(fe=!1),ne&&(W=!0),_e&&(J=Jr({},pj),ee=ym(null),_e.html===!0&&(Jr(J,fj),Jr(ee,gj)),_e.svg===!0&&(Jr(J,SM),Jr(ee,_M),Jr(ee,mE)),_e.svgFilters===!0&&(Jr(J,EM),Jr(ee,_M),Jr(ee,mE)),_e.mathMl===!0&&(Jr(J,AM),Jr(ee,mj),Jr(ee,mE))),oe.tagCheck=null,oe.attributeCheck=null,pa(Le,"ADD_TAGS")&&(typeof Le.ADD_TAGS=="function"?oe.tagCheck=Le.ADD_TAGS:kd(Le.ADD_TAGS)&&(J===ge&&(J=as(J)),Jr(J,Le.ADD_TAGS,Ue))),pa(Le,"ADD_ATTR")&&(typeof Le.ADD_ATTR=="function"?oe.attributeCheck=Le.ADD_ATTR:kd(Le.ADD_ATTR)&&(ee===Re&&(ee=as(ee)),Jr(ee,Le.ADD_ATTR,Ue))),pa(Le,"ADD_URI_SAFE_ATTR")&&kd(Le.ADD_URI_SAFE_ATTR)&&Jr(Ke,Le.ADD_URI_SAFE_ATTR,Ue),pa(Le,"FORBID_CONTENTS")&&kd(Le.FORBID_CONTENTS)&&($e===Me&&($e=as($e)),Jr($e,Le.FORBID_CONTENTS,Ue)),pa(Le,"ADD_FORBID_CONTENTS")&&kd(Le.ADD_FORBID_CONTENTS)&&($e===Me&&($e=as($e)),Jr($e,Le.ADD_FORBID_CONTENTS,Ue)),xe&&(J["#text"]=!0),se&&Jr(J,["html","head","body"]),J.table&&(Jr(J,["tbody"]),delete Be.tbody),Le.TRUSTED_TYPES_POLICY){if(typeof Le.TRUSTED_TYPES_POLICY.createHTML!="function")throw Gf('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Le.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Gf('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const dt=k;k=Le.TRUSTED_TYPES_POLICY;try{E=D("")}catch(Ft){throw k=dt,Ft}}else Le.TRUSTED_TYPES_POLICY===null?(k=void 0,E=""):(k===void 0&&(k=I()),k&&typeof E=="string"&&(E=D("")));Xa&&Xa(Le),tt=Le},Qt=Jr({},[...SM,...EM,...IBe]),vr=Jr({},[...AM,...NBe]),nr=function(Le,je,dt){return je.namespaceURI===pt?Le==="svg":je.namespaceURI===at?Le==="svg"&&(dt==="annotation-xml"||pe[dt]):!!Qt[Le]},Rr=function(Le,je,dt){return je.namespaceURI===pt?Le==="math":je.namespaceURI===Ee?Le==="math"&&lt[dt]:!!vr[Le]},Zt=function(Le,je,dt){return je.namespaceURI===Ee&&!lt[dt]||je.namespaceURI===at&&!pe[dt]?!1:!vr[Le]&&(st[Le]||!Qt[Le])},gr=function(Le){let je=v(Le);(!je||!je.tagName)&&(je={namespaceURI:ht,tagName:"template"});const dt=GT(Le.tagName),Ft=GT(je.tagName);return Et[Le.namespaceURI]?Le.namespaceURI===Ee?nr(dt,je,Ft):Le.namespaceURI===at?Rr(dt,je,Ft):Le.namespaceURI===pt?Zt(dt,je,Ft):!!(mt==="application/xhtml+xml"&&Et[Le.namespaceURI]):!1},Dr=function(Le){Wg(e.removed,{element:Le});try{v(Le).removeChild(Le)}catch{if(g(Le),!v(Le))throw Gf("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Qe=function(Le){cr(Le);const je=y(Le);if(je){const Ft=[];Gg(je,er=>{Wg(Ft,er)}),Gg(Ft,er=>{try{g(er)}catch{}})}const dt=b(Le);if(dt)for(let Ft=dt.length-1;Ft>=0;--Ft){const er=dt[Ft],ur=er&&er.name;if(typeof ur=="string")try{Le.removeAttribute(ur)}catch{}}},ct=function(Le,je){try{Wg(e.removed,{attribute:je.getAttributeNode(Le),from:je})}catch{Wg(e.removed,{attribute:null,from:je})}if(je.removeAttribute(Le),Le==="is")if(W||ne)try{Dr(je)}catch{}else try{je.setAttribute(Le,"")}catch{}},It=function(Le){const je=b(Le);if(je)for(let dt=je.length-1;dt>=0;--dt){const Ft=je[dt],er=Ft&&Ft.name;if(!(typeof er!="string"||ee[Ue(er)]))try{Le.removeAttribute(er)}catch{}}},cr=function(Le){const je=[Le];for(;je.length>0;){const dt=je.pop();(w?w(dt):dt.nodeType)===Eo.element&&It(dt);const er=y(dt);if(er)for(let ur=er.length-1;ur>=0;--ur)je.push(er[ur])}},Or=function(Le){if(!Ve)return;const je=[Le];for(;je.length>0;){const dt=je.pop(),Ft=w?w(dt):dt.nodeType;if(Ft===Eo.processingInstruction||Ft===Eo.comment&&fa(bj,dt.data)){try{g(dt)}catch{}continue}if(Ft===Eo.element){const ur=dt,gn=Ue(C?C(dt):dt.nodeName);try{ur.hasAttribute&&ur.hasAttribute("patchsrc")&&ur.removeAttribute("patchsrc"),ur.hasAttribute&&ur.hasAttribute("for")&&gn!=="label"&&gn!=="output"&&ur.removeAttribute("for")}catch{}}const er=y(dt);if(er)for(let ur=er.length-1;ur>=0;--ur)je.push(er[ur])}},yt=function(Le){let je=null,dt=null;if(he)Le="<remove></remove>"+Le;else{const ur=cj(Le,/^[\r\n\t ]+/);dt=ur&&ur[0]}mt==="application/xhtml+xml"&&ht===pt&&(Le='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Le+"</body></html>");const Ft=k?D(Le):Le;if(ht===pt)try{je=new h().parseFromString(Ft,mt)}catch{}if(!je||!je.documentElement){je=O.createDocument(ht,"template",null);try{je.documentElement.innerHTML=rt?E:Ft}catch{}}const er=je.body||je.documentElement;return Le&&dt&&er.insertBefore(r.createTextNode(dt),er.childNodes[0]||null),ht===pt?z.call(je,se?"html":"body")[0]:se?je.documentElement:er},it=function(Le){const je=S?S(Le):Le.ownerDocument;return N.call(je||Le,Le,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},xt=function(Le){return Le=Qx(Le,G," "),Le=Qx(Le,H," "),Le=Qx(Le,q," "),Le},nt=function(Le){var je;Le.normalize();const dt=S?S(Le):Le.ownerDocument,Ft=N.call(dt||Le,Le,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let er=Ft.nextNode();for(;er;)er.data=xt(er.data),er=Ft.nextNode();const ur=(je=Le.querySelectorAll)===null||je===void 0?void 0:je.call(Le,"template");ur&&Gg(ur,gn=>{ke(gn.content)&&nt(gn.content)})},Ht=function(Le){const je=C?C(Le):null;return typeof je!="string"||Ue(je)!=="form"?!1:typeof Le.nodeName!="string"||typeof Le.textContent!="string"||typeof Le.removeChild!="function"||Le.attributes!==b(Le)||typeof Le.removeAttribute!="function"||typeof Le.setAttribute!="function"||typeof Le.namespaceURI!="string"||typeof Le.insertBefore!="function"||typeof Le.hasChildNodes!="function"||Le.nodeType!==w(Le)||Le.childNodes!==y(Le)},ke=function(Le){if(!w||typeof Le!="object"||Le===null)return!1;try{return w(Le)===Eo.documentFragment}catch{return!1}},rn=function(Le){if(!w||typeof Le!="object"||Le===null)return!1;try{return typeof w(Le)=="number"}catch{return!1}};function Ne(wt,Le,je){wt.length!==0&&Gg(wt,dt=>{dt.call(e,Le,je,tt)})}const Mr=function(Le,je){return!!(Ve&&Le.hasChildNodes()&&!rn(Le.firstElementChild)&&fa(vj,Le.textContent)&&fa(vj,Le.innerHTML)||Ve&&Le.namespaceURI===pt&&je==="style"&&rn(Le.firstElementChild)||Le.nodeType===Eo.processingInstruction||Ve&&Le.nodeType===Eo.comment&&fa(bj,Le.data))},nn=function(Le,je,dt){if(!Be[je]&&Da(je)&&(Ie.tagNameCheck instanceof RegExp&&fa(Ie.tagNameCheck,je)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(je)))return!1;if(xe&&!$e[je]){const Ft=v(Le),er=y(Le);if(er&&Ft){const ur=er.length;for(let gn=ur-1;gn>=0;--gn){const An=Le===dt?p(er[gn],!0):er[gn];Ft.insertBefore(An,m(Le))}}}return Dr(Le),!0},Bi=function(Le,je,dt,Ft){return Le.length===0?je:je===dt||je===Ft?as(je):je},Qr=function(Le,je){if(Ne(B.beforeSanitizeElements,Le,null),Le!==je&&v(Le)===null)return Ge&&cr(Le),!0;if(Ht(Le))return Dr(Le),!0;const dt=Ue(C?C(Le):Le.nodeName);if(J=Bi(B.uponSanitizeElement,J,ge,Te),Ne(B.uponSanitizeElement,Le,{tagName:dt,allowedTags:J}),Le!==je&&v(Le)===null)return Ge&&cr(Le),!0;if(Mr(Le,dt))return Dr(Le),!0;if(Be[dt]||!(oe.tagCheck instanceof Function&&oe.tagCheck(dt))&&!J[dt]){const er=nn(Le,dt,je);return er===!1&&Ne(B.afterSanitizeElements,Le,null),er}if((w?w(Le):Le.nodeType)===Eo.element&&!gr(Le)||(dt==="noscript"||dt==="noembed"||dt==="noframes")&&fa(WBe,Le.innerHTML))return Dr(Le),!0;if(Ce&&Le.nodeType===Eo.text){const er=xt(Le.textContent);Le.textContent!==er&&(Wg(e.removed,{element:Le.cloneNode()}),Le.textContent=er)}return Ne(B.afterSanitizeElements,Le,null),!1},bn=function(Le,je,dt){if(ce[je]||Ve&&je==="patchsrc"||Ve&&je==="for"&&Le!=="label"&&Le!=="output"||ue&&(je==="id"||je==="name")&&(dt in r||dt in kt))return!1;const Ft=ee[je]||oe.attributeCheck instanceof Function&&oe.attributeCheck(je,Le);if(!(fe&&fa(Z,je))){if(!(be&&fa(Y,je))){if(Ft){if(!Ke[je]){if(!fa(te,Qx(dt,K,""))){if(!((je==="src"||je==="xlink:href"||je==="href")&&Le!=="script"&&uj(dt,"data:")===0&&He[Le])){if(!(Pe&&!fa(ie,Qx(dt,K,"")))){if(dt)return!1}}}}}else if(!(Da(Le)&&(Ie.tagNameCheck instanceof RegExp&&fa(Ie.tagNameCheck,Le)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(Le))&&(Ie.attributeNameCheck instanceof RegExp&&fa(Ie.attributeNameCheck,je)||Ie.attributeNameCheck instanceof Function&&Ie.attributeNameCheck(je,Le))||je==="is"&&Ie.allowCustomizedBuiltInElements&&(Ie.tagNameCheck instanceof RegExp&&fa(Ie.tagNameCheck,dt)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(dt))))return!1}}return!0},Yr=Jr({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Da=function(Le){return!Yr[GT(Le)]&&fa(Q,Le)},gc=function(Le,je,dt,Ft){if(k&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!dt)switch(d.getAttributeType(Le,je)){case"TrustedHTML":return D(Ft);case"TrustedScriptURL":return R(Ft)}return Ft},xu=function(Le,je,dt,Ft){try{dt?Le.setAttributeNS(dt,je,Ft):Le.setAttribute(je,Ft),Ht(Le)?Dr(Le):lj(e.removed)}catch{ct(je,Le)}},Vf=function(Le){Ne(B.beforeSanitizeAttributes,Le,null);const je=Le.attributes;if(!je||Ht(Le))return;ee=Bi(B.uponSanitizeAttribute,ee,Re,ae);const dt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ee,forceKeepAttr:void 0};let Ft=je.length;const er=Ue(Le.nodeName);for(;Ft--;){const ur=je[Ft],gn=ur.name,An=ur.namespaceURI,da=ur.value,_n=Ue(gn),X7=da;let Ss=gn==="value"?X7:SBe(X7);if(dt.attrName=_n,dt.attrValue=Ss,dt.keepAttr=!0,dt.forceKeepAttr=void 0,Ne(B.uponSanitizeAttribute,Le,dt),Ss=dt.attrValue,X&&(_n==="id"||_n==="name")&&uj(Ss,Oe)!==0&&(ct(gn,Le),Ss=Oe+Ss),Ve&&fa(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ss)){ct(gn,Le);continue}if(_n==="attributename"&&cj(Ss,"href")){ct(gn,Le);continue}if(!dt.forceKeepAttr){if(!dt.keepAttr){ct(gn,Le);continue}if(!ve&&fa(HBe,Ss)){ct(gn,Le);continue}if(Ce&&(Ss=xt(Ss)),!bn(er,_n,Ss)){ct(gn,Le);continue}Ss=gc(er,_n,An,Ss),Ss!==X7&&xu(Le,gn,An,Ss)}}Ne(B.afterSanitizeAttributes,Le,null)},Tu=function(Le){let je=null;const dt=it(Le);for(Ne(B.beforeSanitizeShadowDOM,Le,null);je=dt.nextNode();)if(Ne(B.uponSanitizeShadowNode,je,null),Qr(je,Le),Vf(je),ke(je.content)&&Tu(je.content),(w?w(je):je.nodeType)===Eo.element){const er=T(je);ke(er)&&(wu(er),Tu(er))}Ne(B.afterSanitizeShadowDOM,Le,null)},wu=function(Le){const je=[{node:Le,shadow:null}];for(;je.length>0;){const dt=je.pop();if(dt.shadow){Tu(dt.shadow);continue}const Ft=dt.node,ur=(w?w(Ft):Ft.nodeType)===Eo.element,gn=y(Ft);if(gn)for(let An=gn.length-1;An>=0;--An)je.push({node:gn[An],shadow:null});if(ur){const An=C?C(Ft):null;if(typeof An=="string"&&Ue(An)==="template"){const da=Ft.content;ke(da)&&je.push({node:da,shadow:null})}}if(ur){const An=T(Ft);ke(An)&&je.push({node:null,shadow:An},{node:An,shadow:null})}}};return e.sanitize=function(wt){let Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},je=null,dt=null,Ft=null,er=null;if(rt=!wt,rt&&(wt="\x3C!-->"),typeof wt!="string"&&!rn(wt)&&(wt=LBe(wt),typeof wt!="string"))throw Gf("dirty is not a string, aborting");if(!e.isSupported)return wt;de?(J=Te,ee=ae):sr(Le),(B.uponSanitizeElement.length>0||B.uponSanitizeAttribute.length>0)&&(J=as(J)),B.uponSanitizeAttribute.length>0&&(ee=as(ee)),e.removed=[];const ur=Ge&&typeof wt!="string"&&rn(wt);if(ur){Or(wt);const da=C?C(wt):wt.nodeName;if(typeof da=="string"){const _n=Ue(da);if(!J[_n]||Be[_n])throw Qe(wt),Gf("root node is forbidden and cannot be sanitized in-place")}if(Ht(wt))throw Qe(wt),Gf("root node is clobbered and cannot be sanitized in-place");try{wu(wt)}catch(_n){throw Qe(wt),_n}}else if(rn(wt))je=yt("\x3C!---->"),dt=je.ownerDocument.importNode(wt,!0),dt.nodeType===Eo.element&&dt.nodeName==="BODY"||dt.nodeName==="HTML"?je=dt:je.appendChild(dt),wu(dt);else{if(!W&&!Ce&&!se&&wt.indexOf("<")===-1)return k&&j?D(wt):wt;if(je=yt(wt),!je)return W?null:j?E:""}je&&he&&Dr(je.firstChild);const gn=ur?wt:je;try{const da=it(gn);for(;Ft=da.nextNode();)Qr(Ft,gn),Vf(Ft),ke(Ft.content)&&Tu(Ft.content)}catch(da){throw ur&&(Qe(wt),Gg(e.removed,_n=>{_n.element&&cr(_n.element)})),da}if(ur)return Gg(e.removed,da=>{da.element&&cr(da.element)}),Ce&&nt(wt),wt;if(W){if(Ce&&nt(je),ne)for(er=F.call(je.ownerDocument);je.firstChild;)er.appendChild(je.firstChild);else er=je;return(ee.shadowroot||ee.shadowrootmode)&&(er=V.call(n,er,!0)),er}let An=se?je.outerHTML:je.innerHTML;return se&&J["!doctype"]&&je.ownerDocument&&je.ownerDocument.doctype&&je.ownerDocument.doctype.name&&fa(VBe,je.ownerDocument.doctype.name)&&(An="<!DOCTYPE "+je.ownerDocument.doctype.name+`>
`+An),Ce&&(An=xt(An)),k&&j?D(An):An},e.setConfig=function(){let wt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};sr(wt),de=!0,Te=J,ae=ee},e.clearConfig=function(){tt=null,de=!1,Te=null,ae=null,k=_,E=""},e.isValidAttribute=function(wt,Le,je){tt||sr({});const dt=Ue(wt),Ft=Ue(Le);return bn(dt,Ft,je)},e.addHook=function(wt,Le){typeof Le=="function"&&pa(B,wt)&&Wg(B[wt],Le)},e.removeHook=function(wt,Le){if(pa(B,wt)){if(Le!==void 0){const je=CBe(B[wt],Le);return je===-1?void 0:kBe(B[wt],je,1)[0]}return lj(B[wt])}},e.removeHooks=function(wt){pa(B,wt)&&(B[wt]=[])},e.removeAllHooks=function(){B=xj()},e}var ph=Wle(),HD=x((t,e,{depth:r=2}={})=>{const n={depth:r};if(Array.isArray(e)&&!Array.isArray(t))return e.forEach(i=>HD(t,i,n)),t;if(Array.isArray(e)&&Array.isArray(t))return e.forEach(i=>{t.includes(i)||t.push(i)}),t;if(t==null||r<=0)return t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e;if(e!=null&&typeof t=="object"&&typeof e=="object"){const i=t;Object.entries(e).forEach(([a,s])=>{if(typeof s=="object"){if(s===null)return;Object.hasOwn(t,a)||Object.defineProperty(t,a,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),i[a]===void 0&&(i[a]=Array.isArray(s)?[]:{}),typeof i[a]=="object"&&(i[a]=HD(i[a],s,{depth:r-1}))}else typeof i[a]!="object"&&(Object.hasOwn(t,a)?i[a]=s:Object.defineProperty(t,a,{value:s,writable:!0,enumerable:!0,configurable:!0}))})}return t},"assignWithDepth"),Wi=HD,iu="#ffffff",au="#f2f2f2",Sr=x((t,e)=>e?me(t,{s:-40,l:10}):me(t,{s:-40,l:-10}),"mkBorder"),My,YBe=(My=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,C,S,k,E,_,M,L,P,D,R,I,$,O,N,F,z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge,ee;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||et(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||et(this.mainBkg,10)):(this.rowOdd=this.rowOdd||Je(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Je(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||me(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||me(this.primaryColor,{h:330}),this.darkMode)for(let Re=0;Re<this.THEME_COLOR_LIMIT;Re++)this["cScale"+Re]=et(this["cScale"+Re],75);else for(let Re=0;Re<this.THEME_COLOR_LIMIT;Re++)this["cScale"+Re]=et(this["cScale"+Re],25);for(let Re=0;Re<this.THEME_COLOR_LIMIT;Re++)this["cScaleInv"+Re]=this["cScaleInv"+Re]||Xe(this["cScale"+Re]);for(let Re=0;Re<this.THEME_COLOR_LIMIT;Re++)this.darkMode?this["cScalePeer"+Re]=this["cScalePeer"+Re]||Je(this["cScale"+Re],10):this["cScalePeer"+Re]=this["cScalePeer"+Re]||et(this["cScale"+Re],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let Re=0;Re<this.THEME_COLOR_LIMIT;Re++)this["cScaleLabel"+Re]=this["cScaleLabel"+Re]||this.scaleLabelColor;const e=this.darkMode?-4:-1;for(let Re=0;Re<5;Re++)this["surface"+Re]=this["surface"+Re]||me(this.mainBkg,{h:180,s:-15,l:e*(5+Re*3)}),this["surfacePeer"+Re]=this["surfacePeer"+Re]||me(this.mainBkg,{h:180,s:-15,l:e*(8+Re*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||me(this.primaryColor,{h:64}),this.fillType3=this.fillType3||me(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||me(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||me(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||me(this.primaryColor,{h:128}),this.fillType7=this.fillType7||me(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||me(this.primaryColor,{l:-10}),this.pie5=this.pie5||me(this.secondaryColor,{l:-10}),this.pie6=this.pie6||me(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||me(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||me(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||me(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||me(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||me(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||me(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??me(this.primaryColor,{l:-30}),this.venn2=this.venn2??me(this.secondaryColor,{l:-30}),this.venn3=this.venn3??me(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??me(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??me(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??me(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??me(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??me(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:((r=this.cynefin)==null?void 0:r.domainFontSize)||16,itemFontSize:((n=this.cynefin)==null?void 0:n.itemFontSize)||12,boundaryColor:((i=this.cynefin)==null?void 0:i.boundaryColor)||this.lineColor,boundaryWidth:((a=this.cynefin)==null?void 0:a.boundaryWidth)||2,cliffColor:((s=this.cynefin)==null?void 0:s.cliffColor)||"#8B0000",cliffWidth:((o=this.cynefin)==null?void 0:o.cliffWidth)||4,arrowColor:((l=this.cynefin)==null?void 0:l.arrowColor)||this.lineColor,arrowWidth:((u=this.cynefin)==null?void 0:u.arrowWidth)||2,complexBg:((h=this.cynefin)==null?void 0:h.complexBg)||"#E8F5E9",complicatedBg:((d=this.cynefin)==null?void 0:d.complicatedBg)||"#E3F2FD",chaoticBg:((f=this.cynefin)==null?void 0:f.chaoticBg)||"#FBE9E7",clearBg:((p=this.cynefin)==null?void 0:p.clearBg)||"#FFF8E1",confusionBg:((g=this.cynefin)==null?void 0:g.confusionBg)||"#F3E5F5",textColor:((m=this.cynefin)==null?void 0:m.textColor)||this.textColor,labelColor:((y=this.cynefin)==null?void 0:y.labelColor)||this.primaryTextColor},this.radar={axisColor:((v=this.radar)==null?void 0:v.axisColor)||this.lineColor,axisStrokeWidth:((T=this.radar)==null?void 0:T.axisStrokeWidth)||2,axisLabelFontSize:((b=this.radar)==null?void 0:b.axisLabelFontSize)||12,curveOpacity:((w=this.radar)==null?void 0:w.curveOpacity)||.5,curveStrokeWidth:((C=this.radar)==null?void 0:C.curveStrokeWidth)||2,graticuleColor:((S=this.radar)==null?void 0:S.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((k=this.radar)==null?void 0:k.graticuleStrokeWidth)||1,graticuleOpacity:((E=this.radar)==null?void 0:E.graticuleOpacity)||.3,legendBoxSize:((_=this.radar)==null?void 0:_.legendBoxSize)||12,legendFontSize:((M=this.radar)==null?void 0:M.legendFontSize)||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:((L=this.wardley)==null?void 0:L.backgroundColor)||this.background,axisColor:((P=this.wardley)==null?void 0:P.axisColor)||this.lineColor,axisTextColor:((D=this.wardley)==null?void 0:D.axisTextColor)||this.primaryTextColor,gridColor:((R=this.wardley)==null?void 0:R.gridColor)||this.gridColor,componentFill:((I=this.wardley)==null?void 0:I.componentFill)||this.background,componentStroke:(($=this.wardley)==null?void 0:$.componentStroke)||this.lineColor,componentLabelColor:((O=this.wardley)==null?void 0:O.componentLabelColor)||this.primaryTextColor,linkStroke:((N=this.wardley)==null?void 0:N.linkStroke)||this.lineColor,evolutionStroke:((F=this.wardley)==null?void 0:F.evolutionStroke)||this.wardleyEvolutionColor,annotationStroke:((z=this.wardley)==null?void 0:z.annotationStroke)||this.lineColor,annotationTextColor:((V=this.wardley)==null?void 0:V.annotationTextColor)||this.primaryTextColor,annotationFill:((B=this.wardley)==null?void 0:B.annotationFill)||this.background},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||me(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||me(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||me(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||me(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||me(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||me(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Zs(this.quadrant1Fill)?Je(this.quadrant1Fill):et(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((G=this.xyChart)==null?void 0:G.backgroundColor)||this.background,titleColor:((H=this.xyChart)==null?void 0:H.titleColor)||this.primaryTextColor,dataLabelColor:((q=this.xyChart)==null?void 0:q.dataLabelColor)||this.primaryTextColor,xAxisTitleColor:((Z=this.xyChart)==null?void 0:Z.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((Y=this.xyChart)==null?void 0:Y.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((ie=this.xyChart)==null?void 0:ie.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((K=this.xyChart)==null?void 0:K.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((Q=this.xyChart)==null?void 0:Q.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((te=this.xyChart)==null?void 0:te.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((J=this.xyChart)==null?void 0:J.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((ge=this.xyChart)==null?void 0:ge.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((ee=this.xyChart)==null?void 0:ee.plotColorPalette)||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||me(this.primaryColor,{h:-30}),this.git4=this.git4||me(this.primaryColor,{h:-60}),this.git5=this.git5||me(this.primaryColor,{h:-90}),this.git6=this.git6||me(this.primaryColor,{h:60}),this.git7=this.git7||me(this.primaryColor,{h:120}),this.darkMode?(this.git0=Je(this.git0,25),this.git1=Je(this.git1,25),this.git2=Je(this.git2,25),this.git3=Je(this.git3,25),this.git4=Je(this.git4,25),this.git5=Je(this.git5,25),this.git6=Je(this.git6,25),this.git7=Je(this.git7,25)):(this.git0=et(this.git0,25),this.git1=et(this.git1,25),this.git2=et(this.git2,25),this.git3=et(this.git3,25),this.git4=et(this.git4,25),this.git5=et(this.git5,25),this.git6=et(this.git6,25),this.git7=et(this.git7,25)),this.gitInv0=this.gitInv0||Xe(this.git0),this.gitInv1=this.gitInv1||Xe(this.git1),this.gitInv2=this.gitInv2||Xe(this.git2),this.gitInv3=this.gitInv3||Xe(this.git3),this.gitInv4=this.gitInv4||Xe(this.git4),this.gitInv5=this.gitInv5||Xe(this.git5),this.gitInv6=this.gitInv6||Xe(this.git6),this.gitInv7=this.gitInv7||Xe(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||iu,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||au,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(My,"Theme"),My),XBe=x(t=>{const e=new YBe;return e.calculate(t),e},"getThemeVariables"),Iy,jBe=(Iy=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Je(this.primaryColor,16),this.tertiaryColor=me(this.primaryColor,{h:-160}),this.primaryBorderColor=Xe(this.background),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.tertiaryColor),this.lineColor=Xe(this.background),this.textColor=Xe(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Je(Xe("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=jl(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=et("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=et(this.sectionBkgColor,10),this.taskBorderColor=jl(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=jl(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||Je(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||et(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,C,S,k,E,_,M,L,P,D,R,I,$,O,N,F,z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge;this.secondBkg=Je(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=Je(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=Je(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=Xe(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=me(this.primaryColor,{h:64}),this.fillType3=me(this.secondaryColor,{h:64}),this.fillType4=me(this.primaryColor,{h:-64}),this.fillType5=me(this.secondaryColor,{h:-64}),this.fillType6=me(this.primaryColor,{h:128}),this.fillType7=me(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||me(this.primaryColor,{h:210}),this.cScale9=this.cScale9||me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||me(this.primaryColor,{h:330});for(let ee=0;ee<this.THEME_COLOR_LIMIT;ee++)this["cScaleInv"+ee]=this["cScaleInv"+ee]||Xe(this["cScale"+ee]);for(let ee=0;ee<this.THEME_COLOR_LIMIT;ee++)this["cScalePeer"+ee]=this["cScalePeer"+ee]||Je(this["cScale"+ee],10);for(let ee=0;ee<5;ee++)this["surface"+ee]=this["surface"+ee]||me(this.mainBkg,{h:30,s:-30,l:-(-10+ee*4)}),this["surfacePeer"+ee]=this["surfacePeer"+ee]||me(this.mainBkg,{h:30,s:-30,l:-(-7+ee*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let ee=0;ee<this.THEME_COLOR_LIMIT;ee++)this["cScaleLabel"+ee]=this["cScaleLabel"+ee]||this.scaleLabelColor;for(let ee=0;ee<this.THEME_COLOR_LIMIT;ee++)this["pie"+ee]=this["cScale"+ee];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.mainContrastColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.mainContrastColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let ee=0;ee<8;ee++)this["venn"+(ee+1)]=this["venn"+(ee+1)]??Je(this["cScale"+ee],30);this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:((e=this.cynefin)==null?void 0:e.domainFontSize)||16,itemFontSize:((r=this.cynefin)==null?void 0:r.itemFontSize)||12,boundaryColor:((n=this.cynefin)==null?void 0:n.boundaryColor)||this.lineColor,boundaryWidth:((i=this.cynefin)==null?void 0:i.boundaryWidth)||2,cliffColor:((a=this.cynefin)==null?void 0:a.cliffColor)||"#FF6B6B",cliffWidth:((s=this.cynefin)==null?void 0:s.cliffWidth)||4,arrowColor:((o=this.cynefin)==null?void 0:o.arrowColor)||this.lineColor,arrowWidth:((l=this.cynefin)==null?void 0:l.arrowWidth)||2,complexBg:((u=this.cynefin)==null?void 0:u.complexBg)||"#1B5E20",complicatedBg:((h=this.cynefin)==null?void 0:h.complicatedBg)||"#0D47A1",chaoticBg:((d=this.cynefin)==null?void 0:d.chaoticBg)||"#BF360C",clearBg:((f=this.cynefin)==null?void 0:f.clearBg)||"#F57F17",confusionBg:((p=this.cynefin)==null?void 0:p.confusionBg)||"#4A148C",textColor:((g=this.cynefin)==null?void 0:g.textColor)||this.textColor,labelColor:((m=this.cynefin)==null?void 0:m.labelColor)||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||me(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||me(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||me(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||me(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||me(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||me(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Zs(this.quadrant1Fill)?Je(this.quadrant1Fill):et(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((y=this.xyChart)==null?void 0:y.backgroundColor)||this.background,titleColor:((v=this.xyChart)==null?void 0:v.titleColor)||this.primaryTextColor,dataLabelColor:((T=this.xyChart)==null?void 0:T.dataLabelColor)||this.primaryTextColor,xAxisTitleColor:((b=this.xyChart)==null?void 0:b.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((w=this.xyChart)==null?void 0:w.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((C=this.xyChart)==null?void 0:C.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((S=this.xyChart)==null?void 0:S.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((k=this.xyChart)==null?void 0:k.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((E=this.xyChart)==null?void 0:E.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((_=this.xyChart)==null?void 0:_.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((M=this.xyChart)==null?void 0:M.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((L=this.xyChart)==null?void 0:L.plotColorPalette)||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:((P=this.radar)==null?void 0:P.axisColor)||this.lineColor,axisStrokeWidth:((D=this.radar)==null?void 0:D.axisStrokeWidth)||2,axisLabelFontSize:((R=this.radar)==null?void 0:R.axisLabelFontSize)||12,curveOpacity:((I=this.radar)==null?void 0:I.curveOpacity)||.5,curveStrokeWidth:(($=this.radar)==null?void 0:$.curveStrokeWidth)||2,graticuleColor:((O=this.radar)==null?void 0:O.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((N=this.radar)==null?void 0:N.graticuleStrokeWidth)||1,graticuleOpacity:((F=this.radar)==null?void 0:F.graticuleOpacity)||.3,legendBoxSize:((z=this.radar)==null?void 0:z.legendBoxSize)||12,legendFontSize:((V=this.radar)==null?void 0:V.legendFontSize)||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#ff6b6b",this.wardley={backgroundColor:((B=this.wardley)==null?void 0:B.backgroundColor)||this.background,axisColor:((G=this.wardley)==null?void 0:G.axisColor)||this.lineColor,axisTextColor:((H=this.wardley)==null?void 0:H.axisTextColor)||this.primaryTextColor,gridColor:((q=this.wardley)==null?void 0:q.gridColor)||this.gridColor,componentFill:((Z=this.wardley)==null?void 0:Z.componentFill)||this.mainBkg,componentStroke:((Y=this.wardley)==null?void 0:Y.componentStroke)||this.lineColor,componentLabelColor:((ie=this.wardley)==null?void 0:ie.componentLabelColor)||this.primaryTextColor,linkStroke:((K=this.wardley)==null?void 0:K.linkStroke)||this.lineColor,evolutionStroke:((Q=this.wardley)==null?void 0:Q.evolutionStroke)||this.wardleyEvolutionColor,annotationStroke:((te=this.wardley)==null?void 0:te.annotationStroke)||this.lineColor,annotationTextColor:((J=this.wardley)==null?void 0:J.annotationTextColor)||this.primaryTextColor,annotationFill:((ge=this.wardley)==null?void 0:ge.annotationFill)||this.mainBkg},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=Je(this.secondaryColor,20),this.git1=Je(this.pie2||this.secondaryColor,20),this.git2=Je(this.pie3||this.tertiaryColor,20),this.git3=Je(this.pie4||me(this.primaryColor,{h:-30}),20),this.git4=Je(this.pie5||me(this.primaryColor,{h:-60}),20),this.git5=Je(this.pie6||me(this.primaryColor,{h:-90}),10),this.git6=Je(this.pie7||me(this.primaryColor,{h:60}),10),this.git7=Je(this.pie8||me(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||Xe(this.git0),this.gitInv1=this.gitInv1||Xe(this.git1),this.gitInv2=this.gitInv2||Xe(this.git2),this.gitInv3=this.gitInv3||Xe(this.git3),this.gitInv4=this.gitInv4||Xe(this.git4),this.gitInv5=this.gitInv5||Xe(this.git5),this.gitInv6=this.gitInv6||Xe(this.git6),this.gitInv7=this.gitInv7||Xe(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Xe(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Xe(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"#2d2d2d",this.emUiStroke=this.emUiStroke||"#555",this.emProcessorFill=this.emProcessorFill||Je("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||Je("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||Je("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||Je("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||Je(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||Je(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Je(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Je(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Iy,"Theme"),Iy),KBe=x(t=>{const e=new jBe;return e.calculate(t),e},"getThemeVariables"),Ny,ZBe=(Ny=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=me(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=me(this.primaryColor,{h:-160}),this.primaryBorderColor=Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.tertiaryColor),this.lineColor=Xe(this.background),this.textColor=Xe(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=Sr(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=jl(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,C,S,k,E,_,M,L,P,D,R,I,$,O,N,F,z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||me(this.primaryColor,{h:210}),this.cScale9=this.cScale9||me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||me(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||et(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||et(this.tertiaryColor,40);for(let ee=0;ee<this.THEME_COLOR_LIMIT;ee++)this["cScale"+ee]=et(this["cScale"+ee],10),this["cScalePeer"+ee]=this["cScalePeer"+ee]||et(this["cScale"+ee],25);for(let ee=0;ee<this.THEME_COLOR_LIMIT;ee++)this["cScaleInv"+ee]=this["cScaleInv"+ee]||me(this["cScale"+ee],{h:180});for(let ee=0;ee<5;ee++)this["surface"+ee]=this["surface"+ee]||me(this.mainBkg,{h:30,l:-(5+ee*5)}),this["surfacePeer"+ee]=this["surfacePeer"+ee]||me(this.mainBkg,{h:30,l:-(7+ee*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||Xe(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||Xe(this.labelTextColor);for(let ee=0;ee<this.THEME_COLOR_LIMIT;ee++)this["cScaleLabel"+ee]=this["cScaleLabel"+ee]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||Je(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||Je(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=me(this.primaryColor,{h:64}),this.fillType3=me(this.secondaryColor,{h:64}),this.fillType4=me(this.primaryColor,{h:-64}),this.fillType5=me(this.secondaryColor,{h:-64}),this.fillType6=me(this.primaryColor,{h:128}),this.fillType7=me(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||me(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||me(this.primaryColor,{l:-10}),this.pie5=this.pie5||me(this.secondaryColor,{l:-30}),this.pie6=this.pie6||me(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||me(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||me(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||me(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||me(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||me(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||me(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??me(this.primaryColor,{l:-30}),this.venn2=this.venn2??me(this.secondaryColor,{l:-30}),this.venn3=this.venn3??me(this.tertiaryColor,{l:-40}),this.venn4=this.venn4??me(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??me(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??me(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??me(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??me(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:((e=this.cynefin)==null?void 0:e.domainFontSize)||16,itemFontSize:((r=this.cynefin)==null?void 0:r.itemFontSize)||12,boundaryColor:((n=this.cynefin)==null?void 0:n.boundaryColor)||this.lineColor,boundaryWidth:((i=this.cynefin)==null?void 0:i.boundaryWidth)||2,cliffColor:((a=this.cynefin)==null?void 0:a.cliffColor)||"#8B0000",cliffWidth:((s=this.cynefin)==null?void 0:s.cliffWidth)||4,arrowColor:((o=this.cynefin)==null?void 0:o.arrowColor)||this.lineColor,arrowWidth:((l=this.cynefin)==null?void 0:l.arrowWidth)||2,complexBg:((u=this.cynefin)==null?void 0:u.complexBg)||"#E8F5E9",complicatedBg:((h=this.cynefin)==null?void 0:h.complicatedBg)||"#E3F2FD",chaoticBg:((d=this.cynefin)==null?void 0:d.chaoticBg)||"#FBE9E7",clearBg:((f=this.cynefin)==null?void 0:f.clearBg)||"#FFF8E1",confusionBg:((p=this.cynefin)==null?void 0:p.confusionBg)||"#F3E5F5",textColor:((g=this.cynefin)==null?void 0:g.textColor)||this.textColor,labelColor:((m=this.cynefin)==null?void 0:m.labelColor)||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||me(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||me(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||me(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||me(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||me(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||me(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Zs(this.quadrant1Fill)?Je(this.quadrant1Fill):et(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:((y=this.radar)==null?void 0:y.axisColor)||this.lineColor,axisStrokeWidth:((v=this.radar)==null?void 0:v.axisStrokeWidth)||2,axisLabelFontSize:((T=this.radar)==null?void 0:T.axisLabelFontSize)||12,curveOpacity:((b=this.radar)==null?void 0:b.curveOpacity)||.5,curveStrokeWidth:((w=this.radar)==null?void 0:w.curveStrokeWidth)||2,graticuleColor:((C=this.radar)==null?void 0:C.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((S=this.radar)==null?void 0:S.graticuleStrokeWidth)||1,graticuleOpacity:((k=this.radar)==null?void 0:k.graticuleOpacity)||.3,legendBoxSize:((E=this.radar)==null?void 0:E.legendBoxSize)||12,legendFontSize:((_=this.radar)==null?void 0:_.legendFontSize)||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:((M=this.wardley)==null?void 0:M.backgroundColor)||this.background,axisColor:((L=this.wardley)==null?void 0:L.axisColor)||this.lineColor,axisTextColor:((P=this.wardley)==null?void 0:P.axisTextColor)||this.primaryTextColor,gridColor:((D=this.wardley)==null?void 0:D.gridColor)||this.gridColor,componentFill:((R=this.wardley)==null?void 0:R.componentFill)||this.background,componentStroke:((I=this.wardley)==null?void 0:I.componentStroke)||this.lineColor,componentLabelColor:(($=this.wardley)==null?void 0:$.componentLabelColor)||this.primaryTextColor,linkStroke:((O=this.wardley)==null?void 0:O.linkStroke)||this.lineColor,evolutionStroke:((N=this.wardley)==null?void 0:N.evolutionStroke)||this.wardleyEvolutionColor,annotationStroke:((F=this.wardley)==null?void 0:F.annotationStroke)||this.lineColor,annotationTextColor:((z=this.wardley)==null?void 0:z.annotationTextColor)||this.primaryTextColor,annotationFill:((V=this.wardley)==null?void 0:V.annotationFill)||this.background},this.xyChart={backgroundColor:((B=this.xyChart)==null?void 0:B.backgroundColor)||this.background,titleColor:((G=this.xyChart)==null?void 0:G.titleColor)||this.primaryTextColor,dataLabelColor:((H=this.xyChart)==null?void 0:H.dataLabelColor)||this.primaryTextColor,xAxisTitleColor:((q=this.xyChart)==null?void 0:q.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((Z=this.xyChart)==null?void 0:Z.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((Y=this.xyChart)==null?void 0:Y.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((ie=this.xyChart)==null?void 0:ie.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((K=this.xyChart)==null?void 0:K.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((Q=this.xyChart)==null?void 0:Q.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((te=this.xyChart)==null?void 0:te.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((J=this.xyChart)==null?void 0:J.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((ge=this.xyChart)==null?void 0:ge.plotColorPalette)||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||me(this.primaryColor,{h:-30}),this.git4=this.git4||me(this.primaryColor,{h:-60}),this.git5=this.git5||me(this.primaryColor,{h:-90}),this.git6=this.git6||me(this.primaryColor,{h:60}),this.git7=this.git7||me(this.primaryColor,{h:120}),this.darkMode?(this.git0=Je(this.git0,25),this.git1=Je(this.git1,25),this.git2=Je(this.git2,25),this.git3=Je(this.git3,25),this.git4=Je(this.git4,25),this.git5=Je(this.git5,25),this.git6=Je(this.git6,25),this.git7=Je(this.git7,25)):(this.git0=et(this.git0,25),this.git1=et(this.git1,25),this.git2=et(this.git2,25),this.git3=et(this.git3,25),this.git4=et(this.git4,25),this.git5=et(this.git5,25),this.git6=et(this.git6,25),this.git7=et(this.git7,25)),this.gitInv0=this.gitInv0||et(Xe(this.git0),25),this.gitInv1=this.gitInv1||Xe(this.git1),this.gitInv2=this.gitInv2||Xe(this.git2),this.gitInv3=this.gitInv3||Xe(this.git3),this.gitInv4=this.gitInv4||Xe(this.git4),this.gitInv5=this.gitInv5||Xe(this.git5),this.gitInv6=this.gitInv6||Xe(this.git6),this.gitInv7=this.gitInv7||Xe(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Xe(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Xe(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||iu,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||au}calculate(e){if(Object.keys(this).forEach(n=>{this[n]==="calculated"&&(this[n]=void 0)}),typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Ny,"Theme"),Ny),Dh=x(t=>{const e=new ZBe;return e.calculate(t),e},"getThemeVariables"),Dy,QBe=(Dy=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=Je("#cde498",10),this.primaryBorderColor=Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.primaryColor),this.lineColor=Xe(this.background),this.textColor=Xe(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,C,S,k,E,_,M,L,P,D,R,I,$,O,N,F,z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge;this.actorBorder=et(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||me(this.primaryColor,{h:210}),this.cScale9=this.cScale9||me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||me(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||et(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||et(this.tertiaryColor,40);for(let ee=0;ee<this.THEME_COLOR_LIMIT;ee++)this["cScale"+ee]=et(this["cScale"+ee],10),this["cScalePeer"+ee]=this["cScalePeer"+ee]||et(this["cScale"+ee],25);for(let ee=0;ee<this.THEME_COLOR_LIMIT;ee++)this["cScaleInv"+ee]=this["cScaleInv"+ee]||me(this["cScale"+ee],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let ee=0;ee<this.THEME_COLOR_LIMIT;ee++)this["cScaleLabel"+ee]=this["cScaleLabel"+ee]||this.scaleLabelColor;for(let ee=0;ee<5;ee++)this["surface"+ee]=this["surface"+ee]||me(this.mainBkg,{h:30,s:-30,l:-(5+ee*5)}),this["surfacePeer"+ee]=this["surfacePeer"+ee]||me(this.mainBkg,{h:30,s:-30,l:-(8+ee*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||Je(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Je(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=me(this.primaryColor,{h:64}),this.fillType3=me(this.secondaryColor,{h:64}),this.fillType4=me(this.primaryColor,{h:-64}),this.fillType5=me(this.secondaryColor,{h:-64}),this.fillType6=me(this.primaryColor,{h:128}),this.fillType7=me(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||me(this.primaryColor,{l:-30}),this.pie5=this.pie5||me(this.secondaryColor,{l:-30}),this.pie6=this.pie6||me(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||me(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||me(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||me(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||me(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||me(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||me(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??me(this.primaryColor,{l:-30}),this.venn2=this.venn2??me(this.secondaryColor,{l:-30}),this.venn3=this.venn3??me(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??me(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??me(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??me(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??me(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??me(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:((e=this.cynefin)==null?void 0:e.domainFontSize)||16,itemFontSize:((r=this.cynefin)==null?void 0:r.itemFontSize)||12,boundaryColor:((n=this.cynefin)==null?void 0:n.boundaryColor)||this.lineColor,boundaryWidth:((i=this.cynefin)==null?void 0:i.boundaryWidth)||2,cliffColor:((a=this.cynefin)==null?void 0:a.cliffColor)||"#8B4513",cliffWidth:((s=this.cynefin)==null?void 0:s.cliffWidth)||4,arrowColor:((o=this.cynefin)==null?void 0:o.arrowColor)||this.lineColor,arrowWidth:((l=this.cynefin)==null?void 0:l.arrowWidth)||2,complexBg:((u=this.cynefin)==null?void 0:u.complexBg)||"#C8E6C9",complicatedBg:((h=this.cynefin)==null?void 0:h.complicatedBg)||"#DCEDC8",chaoticBg:((d=this.cynefin)==null?void 0:d.chaoticBg)||"#FFE0B2",clearBg:((f=this.cynefin)==null?void 0:f.clearBg)||"#FFF9C4",confusionBg:((p=this.cynefin)==null?void 0:p.confusionBg)||"#D7CCC8",textColor:((g=this.cynefin)==null?void 0:g.textColor)||this.textColor,labelColor:((m=this.cynefin)==null?void 0:m.labelColor)||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||me(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||me(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||me(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||me(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||me(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||me(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Zs(this.quadrant1Fill)?Je(this.quadrant1Fill):et(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:((y=this.radar)==null?void 0:y.axisColor)||this.lineColor,axisStrokeWidth:((v=this.radar)==null?void 0:v.axisStrokeWidth)||2,axisLabelFontSize:((T=this.radar)==null?void 0:T.axisLabelFontSize)||12,curveOpacity:((b=this.radar)==null?void 0:b.curveOpacity)||.5,curveStrokeWidth:((w=this.radar)==null?void 0:w.curveStrokeWidth)||2,graticuleColor:((C=this.radar)==null?void 0:C.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((S=this.radar)==null?void 0:S.graticuleStrokeWidth)||1,graticuleOpacity:((k=this.radar)==null?void 0:k.graticuleOpacity)||.3,legendBoxSize:((E=this.radar)==null?void 0:E.legendBoxSize)||12,legendFontSize:((_=this.radar)==null?void 0:_.legendFontSize)||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:((M=this.wardley)==null?void 0:M.backgroundColor)||this.background,axisColor:((L=this.wardley)==null?void 0:L.axisColor)||this.lineColor,axisTextColor:((P=this.wardley)==null?void 0:P.axisTextColor)||this.primaryTextColor,gridColor:((D=this.wardley)==null?void 0:D.gridColor)||this.gridColor,componentFill:((R=this.wardley)==null?void 0:R.componentFill)||this.background,componentStroke:((I=this.wardley)==null?void 0:I.componentStroke)||this.lineColor,componentLabelColor:(($=this.wardley)==null?void 0:$.componentLabelColor)||this.primaryTextColor,linkStroke:((O=this.wardley)==null?void 0:O.linkStroke)||this.lineColor,evolutionStroke:((N=this.wardley)==null?void 0:N.evolutionStroke)||this.wardleyEvolutionColor,annotationStroke:((F=this.wardley)==null?void 0:F.annotationStroke)||this.lineColor,annotationTextColor:((z=this.wardley)==null?void 0:z.annotationTextColor)||this.primaryTextColor,annotationFill:((V=this.wardley)==null?void 0:V.annotationFill)||this.background},this.xyChart={backgroundColor:((B=this.xyChart)==null?void 0:B.backgroundColor)||this.background,titleColor:((G=this.xyChart)==null?void 0:G.titleColor)||this.primaryTextColor,dataLabelColor:((H=this.xyChart)==null?void 0:H.dataLabelColor)||this.primaryTextColor,xAxisTitleColor:((q=this.xyChart)==null?void 0:q.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((Z=this.xyChart)==null?void 0:Z.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((Y=this.xyChart)==null?void 0:Y.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((ie=this.xyChart)==null?void 0:ie.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((K=this.xyChart)==null?void 0:K.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((Q=this.xyChart)==null?void 0:Q.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((te=this.xyChart)==null?void 0:te.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((J=this.xyChart)==null?void 0:J.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((ge=this.xyChart)==null?void 0:ge.plotColorPalette)||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||me(this.primaryColor,{h:-30}),this.git4=this.git4||me(this.primaryColor,{h:-60}),this.git5=this.git5||me(this.primaryColor,{h:-90}),this.git6=this.git6||me(this.primaryColor,{h:60}),this.git7=this.git7||me(this.primaryColor,{h:120}),this.darkMode?(this.git0=Je(this.git0,25),this.git1=Je(this.git1,25),this.git2=Je(this.git2,25),this.git3=Je(this.git3,25),this.git4=Je(this.git4,25),this.git5=Je(this.git5,25),this.git6=Je(this.git6,25),this.git7=Je(this.git7,25)):(this.git0=et(this.git0,25),this.git1=et(this.git1,25),this.git2=et(this.git2,25),this.git3=et(this.git3,25),this.git4=et(this.git4,25),this.git5=et(this.git5,25),this.git6=et(this.git6,25),this.git7=et(this.git7,25)),this.gitInv0=this.gitInv0||Xe(this.git0),this.gitInv1=this.gitInv1||Xe(this.git1),this.gitInv2=this.gitInv2||Xe(this.git2),this.gitInv3=this.gitInv3||Xe(this.git3),this.gitInv4=this.gitInv4||Xe(this.git4),this.gitInv5=this.gitInv5||Xe(this.git5),this.gitInv6=this.gitInv6||Xe(this.git6),this.gitInv7=this.gitInv7||Xe(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Xe(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Xe(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||iu,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||au}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Dy,"Theme"),Dy),JBe=x(t=>{const e=new QBe;return e.calculate(t),e},"getThemeVariables"),Oy,eFe=(Oy=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=Je(this.contrast,55),this.background="#ffffff",this.tertiaryColor=me(this.primaryColor,{h:-160}),this.primaryBorderColor=Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.tertiaryColor),this.lineColor=Xe(this.background),this.textColor=Xe(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||Je(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w,C,S,k,E,_,M,L,P,D,R,I,$,O,N,F,z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge;this.secondBkg=Je(this.contrast,55),this.border2=this.contrast,this.actorBorder=Je(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let ee=0;ee<this.THEME_COLOR_LIMIT;ee++)this["cScaleInv"+ee]=this["cScaleInv"+ee]||Xe(this["cScale"+ee]);for(let ee=0;ee<this.THEME_COLOR_LIMIT;ee++)this.darkMode?this["cScalePeer"+ee]=this["cScalePeer"+ee]||Je(this["cScale"+ee],10):this["cScalePeer"+ee]=this["cScalePeer"+ee]||et(this["cScale"+ee],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let ee=0;ee<this.THEME_COLOR_LIMIT;ee++)this["cScaleLabel"+ee]=this["cScaleLabel"+ee]||this.scaleLabelColor;for(let ee=0;ee<5;ee++)this["surface"+ee]=this["surface"+ee]||me(this.mainBkg,{l:-(5+ee*5)}),this["surfacePeer"+ee]=this["surfacePeer"+ee]||me(this.mainBkg,{l:-(8+ee*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=Je(this.contrast,30),this.sectionBkgColor2=Je(this.contrast,30),this.taskBorderColor=et(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=Je(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=et(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=me(this.primaryColor,{h:64}),this.fillType3=me(this.secondaryColor,{h:64}),this.fillType4=me(this.primaryColor,{h:-64}),this.fillType5=me(this.secondaryColor,{h:-64}),this.fillType6=me(this.primaryColor,{h:128}),this.fillType7=me(this.secondaryColor,{h:128});for(let ee=0;ee<this.THEME_COLOR_LIMIT;ee++)this["pie"+ee]=this["cScale"+ee];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let ee=0;ee<8;ee++)this["venn"+(ee+1)]=this["venn"+(ee+1)]??this["cScale"+ee];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:((e=this.cynefin)==null?void 0:e.domainFontSize)||16,itemFontSize:((r=this.cynefin)==null?void 0:r.itemFontSize)||12,boundaryColor:((n=this.cynefin)==null?void 0:n.boundaryColor)||this.lineColor,boundaryWidth:((i=this.cynefin)==null?void 0:i.boundaryWidth)||2,cliffColor:((a=this.cynefin)==null?void 0:a.cliffColor)||"#8B0000",cliffWidth:((s=this.cynefin)==null?void 0:s.cliffWidth)||4,arrowColor:((o=this.cynefin)==null?void 0:o.arrowColor)||this.lineColor,arrowWidth:((l=this.cynefin)==null?void 0:l.arrowWidth)||2,complexBg:((u=this.cynefin)==null?void 0:u.complexBg)||"#E8F5E9",complicatedBg:((h=this.cynefin)==null?void 0:h.complicatedBg)||"#E3F2FD",chaoticBg:((d=this.cynefin)==null?void 0:d.chaoticBg)||"#FBE9E7",clearBg:((f=this.cynefin)==null?void 0:f.clearBg)||"#FFF8E1",confusionBg:((p=this.cynefin)==null?void 0:p.confusionBg)||"#F3E5F5",textColor:((g=this.cynefin)==null?void 0:g.textColor)||this.textColor,labelColor:((m=this.cynefin)==null?void 0:m.labelColor)||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||me(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||me(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||me(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||me(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||me(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||me(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Zs(this.quadrant1Fill)?Je(this.quadrant1Fill):et(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((y=this.xyChart)==null?void 0:y.backgroundColor)||this.background,titleColor:((v=this.xyChart)==null?void 0:v.titleColor)||this.primaryTextColor,dataLabelColor:((T=this.xyChart)==null?void 0:T.dataLabelColor)||this.primaryTextColor,xAxisTitleColor:((b=this.xyChart)==null?void 0:b.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((w=this.xyChart)==null?void 0:w.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((C=this.xyChart)==null?void 0:C.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((S=this.xyChart)==null?void 0:S.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((k=this.xyChart)==null?void 0:k.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((E=this.xyChart)==null?void 0:E.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((_=this.xyChart)==null?void 0:_.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((M=this.xyChart)==null?void 0:M.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((L=this.xyChart)==null?void 0:L.plotColorPalette)||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:((P=this.radar)==null?void 0:P.axisColor)||this.lineColor,axisStrokeWidth:((D=this.radar)==null?void 0:D.axisStrokeWidth)||2,axisLabelFontSize:((R=this.radar)==null?void 0:R.axisLabelFontSize)||12,curveOpacity:((I=this.radar)==null?void 0:I.curveOpacity)||.5,curveStrokeWidth:(($=this.radar)==null?void 0:$.curveStrokeWidth)||2,graticuleColor:((O=this.radar)==null?void 0:O.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((N=this.radar)==null?void 0:N.graticuleStrokeWidth)||1,graticuleOpacity:((F=this.radar)==null?void 0:F.graticuleOpacity)||.3,legendBoxSize:((z=this.radar)==null?void 0:z.legendBoxSize)||12,legendFontSize:((V=this.radar)==null?void 0:V.legendFontSize)||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:((B=this.wardley)==null?void 0:B.backgroundColor)||this.background,axisColor:((G=this.wardley)==null?void 0:G.axisColor)||this.lineColor,axisTextColor:((H=this.wardley)==null?void 0:H.axisTextColor)||this.primaryTextColor,gridColor:((q=this.wardley)==null?void 0:q.gridColor)||this.gridColor,componentFill:((Z=this.wardley)==null?void 0:Z.componentFill)||this.background,componentStroke:((Y=this.wardley)==null?void 0:Y.componentStroke)||this.lineColor,componentLabelColor:((ie=this.wardley)==null?void 0:ie.componentLabelColor)||this.primaryTextColor,linkStroke:((K=this.wardley)==null?void 0:K.linkStroke)||this.lineColor,evolutionStroke:((Q=this.wardley)==null?void 0:Q.evolutionStroke)||this.wardleyEvolutionColor,annotationStroke:((te=this.wardley)==null?void 0:te.annotationStroke)||this.lineColor,annotationTextColor:((J=this.wardley)==null?void 0:J.annotationTextColor)||this.primaryTextColor,annotationFill:((ge=this.wardley)==null?void 0:ge.annotationFill)||this.background},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=et(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||me(this.primaryColor,{h:-30}),this.git4=this.pie5||me(this.primaryColor,{h:-60}),this.git5=this.pie6||me(this.primaryColor,{h:-90}),this.git6=this.pie7||me(this.primaryColor,{h:60}),this.git7=this.pie8||me(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||Xe(this.git0),this.gitInv1=this.gitInv1||Xe(this.git1),this.gitInv2=this.gitInv2||Xe(this.git2),this.gitInv3=this.gitInv3||Xe(this.git3),this.gitInv4=this.gitInv4||Xe(this.git4),this.gitInv5=this.gitInv5||Xe(this.git5),this.gitInv6=this.gitInv6||Xe(this.git6),this.gitInv7=this.gitInv7||Xe(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||iu,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||au}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Oy,"Theme"),Oy),tFe=x(t=>{const e=new eFe;return e.calculate(t),e},"getThemeVariables"),$y,rFe=($y=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=Sr(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=me(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||e,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||n,this.cScale3=this.cScale3||me(e,{h:30}),this.cScale4=this.cScale4||me(e,{h:60}),this.cScale5=this.cScale5||me(e,{h:90}),this.cScale6=this.cScale6||me(e,{h:120}),this.cScale7=this.cScale7||me(e,{h:150}),this.cScale8=this.cScale8||me(e,{h:210,l:150}),this.cScale9=this.cScale9||me(e,{h:270}),this.cScale10=this.cScale10||me(e,{h:300}),this.cScale11=this.cScale11||me(e,{h:330}),this.darkMode)for(let y=0;y<this.THEME_COLOR_LIMIT;y++)this["cScale"+y]=et(this["cScale"+y],75);else for(let y=0;y<this.THEME_COLOR_LIMIT;y++)this["cScale"+y]=et(this["cScale"+y],25);for(let y=0;y<this.THEME_COLOR_LIMIT;y++)this["cScaleInv"+y]=this["cScaleInv"+y]||Xe(this["cScale"+y]);for(let y=0;y<this.THEME_COLOR_LIMIT;y++)this.darkMode?this["cScalePeer"+y]=this["cScalePeer"+y]||Je(this["cScale"+y],10):this["cScalePeer"+y]=this["cScalePeer"+y]||et(this["cScale"+y],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let y=0;y<this.THEME_COLOR_LIMIT;y++)this["cScaleLabel"+y]=this["cScaleLabel"+y]||this.scaleLabelColor;const i=this.darkMode?-4:-1;for(let y=0;y<5;y++)this["surface"+y]=this["surface"+y]||me(this.mainBkg,{h:180,s:-15,l:i*(5+y*3)}),this["surfacePeer"+y]=this["surfacePeer"+y]||me(this.mainBkg,{h:180,s:-15,l:i*(8+y*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||e,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||me(e,{h:64}),this.fillType3=this.fillType3||me(r,{h:64}),this.fillType4=this.fillType4||me(e,{h:-64}),this.fillType5=this.fillType5||me(r,{h:-64}),this.fillType6=this.fillType6||me(e,{h:128}),this.fillType7=this.fillType7||me(r,{h:128}),this.pie1=this.pie1||e,this.pie2=this.pie2||r,this.pie3=this.pie3||n,this.pie4=this.pie4||me(e,{l:-10}),this.pie5=this.pie5||me(r,{l:-10}),this.pie6=this.pie6||me(n,{l:-10}),this.pie7=this.pie7||me(e,{h:60,l:-10}),this.pie8=this.pie8||me(e,{h:-60,l:-10}),this.pie9=this.pie9||me(e,{h:120,l:0}),this.pie10=this.pie10||me(e,{h:60,l:-20}),this.pie11=this.pie11||me(e,{h:-60,l:-20}),this.pie12=this.pie12||me(e,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||e,this.quadrant2Fill=this.quadrant2Fill||me(e,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||me(e,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||me(e,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||me(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||me(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||me(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Zs(this.quadrant1Fill)?Je(this.quadrant1Fill):et(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((a=this.xyChart)==null?void 0:a.backgroundColor)||this.background,titleColor:((s=this.xyChart)==null?void 0:s.titleColor)||this.primaryTextColor,xAxisTitleColor:((o=this.xyChart)==null?void 0:o.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((l=this.xyChart)==null?void 0:l.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((u=this.xyChart)==null?void 0:u.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((h=this.xyChart)==null?void 0:h.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((d=this.xyChart)==null?void 0:d.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((f=this.xyChart)==null?void 0:f.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((p=this.xyChart)==null?void 0:p.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((g=this.xyChart)==null?void 0:g.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((m=this.xyChart)==null?void 0:m.plotColorPalette)||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||e,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||e,this.git1=this.git1||r,this.git2=this.git2||n,this.git3=this.git3||me(e,{h:-30}),this.git4=this.git4||me(e,{h:-60}),this.git5=this.git5||me(e,{h:-90}),this.git6=this.git6||me(e,{h:60}),this.git7=this.git7||me(e,{h:120}),this.darkMode?(this.git0=Je(this.git0,25),this.git1=Je(this.git1,25),this.git2=Je(this.git2,25),this.git3=Je(this.git3,25),this.git4=Je(this.git4,25),this.git5=Je(this.git5,25),this.git6=Je(this.git6,25),this.git7=Je(this.git7,25)):(this.git0=et(this.git0,25),this.git1=et(this.git1,25),this.git2=et(this.git2,25),this.git3=et(this.git3,25),this.git4=et(this.git4,25),this.git5=et(this.git5,25),this.git6=et(this.git6,25),this.git7=et(this.git7,25)),this.gitInv0=this.gitInv0||Xe(this.git0),this.gitInv1=this.gitInv1||Xe(this.git1),this.gitInv2=this.gitInv2||Xe(this.git2),this.gitInv3=this.gitInv3||Xe(this.git3),this.gitInv4=this.gitInv4||Xe(this.git4),this.gitInv5=this.gitInv5||Xe(this.git5),this.gitInv6=this.gitInv6||Xe(this.git6),this.gitInv7=this.gitInv7||Xe(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||iu,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||au}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x($y,"Theme"),$y),nFe=x(t=>{const e=new rFe;return e.calculate(t),e},"getThemeVariables"),Py,iFe=(Py=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Je(this.primaryColor,16),this.tertiaryColor=me(this.primaryColor,{h:-160}),this.primaryBorderColor=Xe(this.background),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Je(Xe("#323D47"),10),this.border1="#ccc",this.border2=jl(255,255,255,.25),this.arrowheadColor=Xe(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||me(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||me(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p<this.THEME_COLOR_LIMIT;p++)this["cScale"+p]=et(this["cScale"+p],75);else for(let p=0;p<this.THEME_COLOR_LIMIT;p++)this["cScale"+p]=et(this["cScale"+p],25);for(let p=0;p<this.THEME_COLOR_LIMIT;p++)this["cScaleInv"+p]=this["cScaleInv"+p]||Xe(this["cScale"+p]);for(let p=0;p<this.THEME_COLOR_LIMIT;p++)this.darkMode?this["cScalePeer"+p]=this["cScalePeer"+p]||Je(this["cScale"+p],10):this["cScalePeer"+p]=this["cScalePeer"+p]||et(this["cScale"+p],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let p=0;p<this.THEME_COLOR_LIMIT;p++)this["cScaleLabel"+p]=this["cScaleLabel"+p]||this.scaleLabelColor;const e=this.darkMode?-4:-1;for(let p=0;p<5;p++)this["surface"+p]=this["surface"+p]||me(this.mainBkg,{h:180,s:-15,l:e*(5+p*3)}),this["surfacePeer"+p]=this["surfacePeer"+p]||me(this.mainBkg,{h:180,s:-15,l:e*(8+p*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||me(this.primaryColor,{h:64}),this.fillType3=this.fillType3||me(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||me(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||me(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||me(this.primaryColor,{h:128}),this.fillType7=this.fillType7||me(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||me(this.primaryColor,{l:-10}),this.pie5=this.pie5||me(this.secondaryColor,{l:-10}),this.pie6=this.pie6||me(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||me(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||me(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||me(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||me(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||me(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||me(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||me(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||me(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||me(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||me(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||me(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||me(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Zs(this.quadrant1Fill)?Je(this.quadrant1Fill):et(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((r=this.xyChart)==null?void 0:r.backgroundColor)||this.background,titleColor:((n=this.xyChart)==null?void 0:n.titleColor)||this.primaryTextColor,xAxisTitleColor:((i=this.xyChart)==null?void 0:i.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((a=this.xyChart)==null?void 0:a.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((s=this.xyChart)==null?void 0:s.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((o=this.xyChart)==null?void 0:o.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((l=this.xyChart)==null?void 0:l.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((u=this.xyChart)==null?void 0:u.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((h=this.xyChart)==null?void 0:h.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((d=this.xyChart)==null?void 0:d.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((f=this.xyChart)==null?void 0:f.plotColorPalette)||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||"#0b0000",this.git1=this.git1||"#4d1037",this.git2=this.git2||"#3f5258",this.git3=this.git3||"#4f2f1b",this.git4=this.git4||"#6e0a0a",this.git5=this.git5||"#3b0048",this.git6=this.git6||"#995a01",this.git7=this.git7||"#154706",this.gitDarkMode=!0,this.gitDarkMode?(this.git0=Je(this.git0,25),this.git1=Je(this.git1,25),this.git2=Je(this.git2,25),this.git3=Je(this.git3,25),this.git4=Je(this.git4,25),this.git5=Je(this.git5,25),this.git6=Je(this.git6,25),this.git7=Je(this.git7,25)):(this.git0=et(this.git0,25),this.git1=et(this.git1,25),this.git2=et(this.git2,25),this.git3=et(this.git3,25),this.git4=et(this.git4,25),this.git5=et(this.git5,25),this.git6=et(this.git6,25),this.git7=et(this.git7,25)),this.gitInv0=this.gitInv0||Xe(this.git0),this.gitInv1=this.gitInv1||Xe(this.git1),this.gitInv2=this.gitInv2||Xe(this.git2),this.gitInv3=this.gitInv3||Xe(this.git3),this.gitInv4=this.gitInv4||Xe(this.git4),this.gitInv5=this.gitInv5||Xe(this.git5),this.gitInv6=this.gitInv6||Xe(this.git6),this.gitInv7=this.gitInv7||Xe(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||iu,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||au}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Py,"Theme"),Py),aFe=x(t=>{const e=new iFe;return e.calculate(t),e},"getThemeVariables"),By,sFe=(By=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Sr("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=me(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let y=0;y<this.THEME_COLOR_LIMIT;y++)this["cScale"+y]=this.mainBkg;if(this.darkMode)for(let y=0;y<this.THEME_COLOR_LIMIT;y++)this["cScale"+y]=et(this["cScale"+y],75);else for(let y=0;y<this.THEME_COLOR_LIMIT;y++)this["cScale"+y]=et(this["cScale"+y],25);for(let y=0;y<this.THEME_COLOR_LIMIT;y++)this["cScaleInv"+y]=this["cScaleInv"+y]||Xe(this["cScale"+y]);for(let y=0;y<this.THEME_COLOR_LIMIT;y++)this.darkMode?this["cScalePeer"+y]=this["cScalePeer"+y]||Je(this["cScale"+y],10):this["cScalePeer"+y]=this["cScalePeer"+y]||et(this["cScale"+y],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let y=0;y<this.THEME_COLOR_LIMIT;y++)this["cScaleLabel"+y]=this["cScaleLabel"+y]||this.scaleLabelColor;const i=this.darkMode?-4:-1;for(let y=0;y<5;y++)this["surface"+y]=this["surface"+y]||me(this.mainBkg,{h:180,s:-15,l:i*(5+y*3)}),this["surfacePeer"+y]=this["surfacePeer"+y]||me(this.mainBkg,{h:180,s:-15,l:i*(8+y*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||e,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||me(e,{h:64}),this.fillType3=this.fillType3||me(r,{h:64}),this.fillType4=this.fillType4||me(e,{h:-64}),this.fillType5=this.fillType5||me(r,{h:-64}),this.fillType6=this.fillType6||me(e,{h:128}),this.fillType7=this.fillType7||me(r,{h:128}),this.pie1=this.pie1||e,this.pie2=this.pie2||r,this.pie3=this.pie3||n,this.pie4=this.pie4||me(e,{l:-10}),this.pie5=this.pie5||me(r,{l:-10}),this.pie6=this.pie6||me(n,{l:-10}),this.pie7=this.pie7||me(e,{h:60,l:-10}),this.pie8=this.pie8||me(e,{h:-60,l:-10}),this.pie9=this.pie9||me(e,{h:120,l:0}),this.pie10=this.pie10||me(e,{h:60,l:-20}),this.pie11=this.pie11||me(e,{h:-60,l:-20}),this.pie12=this.pie12||me(e,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||e,this.quadrant2Fill=this.quadrant2Fill||me(e,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||me(e,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||me(e,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||me(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||me(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||me(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Zs(this.quadrant1Fill)?Je(this.quadrant1Fill):et(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((a=this.xyChart)==null?void 0:a.backgroundColor)||this.background,titleColor:((s=this.xyChart)==null?void 0:s.titleColor)||this.primaryTextColor,xAxisTitleColor:((o=this.xyChart)==null?void 0:o.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((l=this.xyChart)==null?void 0:l.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((u=this.xyChart)==null?void 0:u.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((h=this.xyChart)==null?void 0:h.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((d=this.xyChart)==null?void 0:d.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((f=this.xyChart)==null?void 0:f.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((p=this.xyChart)==null?void 0:p.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((g=this.xyChart)==null?void 0:g.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((m=this.xyChart)==null?void 0:m.plotColorPalette)||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||e,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||e,this.git1=this.git1||r,this.git2=this.git2||n,this.git3=this.git3||me(e,{h:-30}),this.git4=this.git4||me(e,{h:-60}),this.git5=this.git5||me(e,{h:-90}),this.git6=this.git6||me(e,{h:60}),this.git7=this.git7||me(e,{h:120}),this.darkMode?(this.git0=Je(this.git0,25),this.git1=Je(this.git1,25),this.git2=Je(this.git2,25),this.git3=Je(this.git3,25),this.git4=Je(this.git4,25),this.git5=Je(this.git5,25),this.git6=Je(this.git6,25),this.git7=Je(this.git7,25)):(this.git0=et(this.git0,25),this.git1=et(this.git1,25),this.git2=et(this.git2,25),this.git3=et(this.git3,25),this.git4=et(this.git4,25),this.git5=et(this.git5,25),this.git6=et(this.git6,25),this.git7=et(this.git7,25)),this.gitInv0=this.gitInv0||Xe(this.git0),this.gitInv1=this.gitInv1||Xe(this.git1),this.gitInv2=this.gitInv2||Xe(this.git2),this.gitInv3=this.gitInv3||Xe(this.git3),this.gitInv4=this.gitInv4||Xe(this.git4),this.gitInv5=this.gitInv5||Xe(this.git5),this.gitInv6=this.gitInv6||Xe(this.git6),this.gitInv7=this.gitInv7||Xe(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||iu,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||au}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(By,"Theme"),By),oFe=x(t=>{const e=new sFe;return e.calculate(t),e},"getThemeVariables"),Fy,lFe=(Fy=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Je(this.primaryColor,16),this.tertiaryColor=me(this.primaryColor,{h:-160}),this.primaryBorderColor=Xe(this.background),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Je(Xe("#323D47"),10),this.border1="#ccc",this.border2=jl(255,255,255,.25),this.arrowheadColor=Xe(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||me(this.primaryColor,{h:30}),this.cScale4=this.cScale4||me(this.primaryColor,{h:60}),this.cScale5=this.cScale5||me(this.primaryColor,{h:90}),this.cScale6=this.cScale6||me(this.primaryColor,{h:120}),this.cScale7=this.cScale7||me(this.primaryColor,{h:150}),this.cScale8=this.cScale8||me(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||me(this.primaryColor,{h:270}),this.cScale10=this.cScale10||me(this.primaryColor,{h:300}),this.cScale11=this.cScale11||me(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p<this.THEME_COLOR_LIMIT;p++)this["cScale"+p]=et(this["cScale"+p],75);else for(let p=0;p<this.THEME_COLOR_LIMIT;p++)this["cScale"+p]=et(this["cScale"+p],25);for(let p=0;p<this.THEME_COLOR_LIMIT;p++)this["cScaleInv"+p]=this["cScaleInv"+p]||Xe(this["cScale"+p]);for(let p=0;p<this.THEME_COLOR_LIMIT;p++)this.darkMode?this["cScalePeer"+p]=this["cScalePeer"+p]||Je(this["cScale"+p],10):this["cScalePeer"+p]=this["cScalePeer"+p]||et(this["cScale"+p],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let p=0;p<this.THEME_COLOR_LIMIT;p++)this["cScaleLabel"+p]=this["cScaleLabel"+p]||this.scaleLabelColor;const e=this.darkMode?-4:-1;for(let p=0;p<5;p++)this["surface"+p]=this["surface"+p]||me(this.mainBkg,{h:180,s:-15,l:e*(5+p*3)}),this["surfacePeer"+p]=this["surfacePeer"+p]||me(this.mainBkg,{h:180,s:-15,l:e*(8+p*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||me(this.primaryColor,{h:64}),this.fillType3=this.fillType3||me(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||me(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||me(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||me(this.primaryColor,{h:128}),this.fillType7=this.fillType7||me(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||me(this.primaryColor,{l:-10}),this.pie5=this.pie5||me(this.secondaryColor,{l:-10}),this.pie6=this.pie6||me(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||me(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||me(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||me(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||me(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||me(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||me(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||me(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||me(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||me(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||me(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||me(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||me(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Zs(this.quadrant1Fill)?Je(this.quadrant1Fill):et(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((r=this.xyChart)==null?void 0:r.backgroundColor)||this.background,titleColor:((n=this.xyChart)==null?void 0:n.titleColor)||this.primaryTextColor,xAxisTitleColor:((i=this.xyChart)==null?void 0:i.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((a=this.xyChart)==null?void 0:a.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((s=this.xyChart)==null?void 0:s.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((o=this.xyChart)==null?void 0:o.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((l=this.xyChart)==null?void 0:l.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((u=this.xyChart)==null?void 0:u.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((h=this.xyChart)==null?void 0:h.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((d=this.xyChart)==null?void 0:d.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((f=this.xyChart)==null?void 0:f.plotColorPalette)||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#16141F",this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||me(this.primaryColor,{h:-30}),this.git4=this.git4||me(this.primaryColor,{h:-60}),this.git5=this.git5||me(this.primaryColor,{h:-90}),this.git6=this.git6||me(this.primaryColor,{h:60}),this.git7=this.git7||me(this.primaryColor,{h:120}),this.darkMode?(this.git0=Je(this.git0,25),this.git1=Je(this.git1,25),this.git2=Je(this.git2,25),this.git3=Je(this.git3,25),this.git4=Je(this.git4,25),this.git5=Je(this.git5,25),this.git6=Je(this.git6,25),this.git7=Je(this.git7,25)):(this.git0=et(this.git0,25),this.git1=et(this.git1,25),this.git2=et(this.git2,25),this.git3=et(this.git3,25),this.git4=et(this.git4,25),this.git5=et(this.git5,25),this.git6=et(this.git6,25),this.git7=et(this.git7,25)),this.gitInv0=this.gitInv0||Xe(this.git0),this.gitInv1=this.gitInv1||Xe(this.git1),this.gitInv2=this.gitInv2||Xe(this.git2),this.gitInv3=this.gitInv3||Xe(this.git3),this.gitInv4=this.gitInv4||Xe(this.git4),this.gitInv5=this.gitInv5||Xe(this.git5),this.gitInv6=this.gitInv6||Xe(this.git6),this.gitInv7=this.gitInv7||Xe(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||iu,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||au}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Fy,"Theme"),Fy),cFe=x(t=>{const e=new lFe;return e.calculate(t),e},"getThemeVariables"),zy,uFe=(zy=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Sr(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){var a,s,o,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=me(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(e,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let y=0;y<this.THEME_COLOR_LIMIT;y++)this["cScaleInv"+y]=this["cScaleInv"+y]||Xe(this["cScale"+y]);for(let y=0;y<this.THEME_COLOR_LIMIT;y++)this.darkMode?this["cScalePeer"+y]=this["cScalePeer"+y]||Je(this["cScale"+y],10):this["cScalePeer"+y]=this["cScalePeer"+y]||et(this["cScale"+y],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let y=0;y<this.THEME_COLOR_LIMIT;y++)this["cScaleLabel"+y]=this["cScaleLabel"+y]||this.scaleLabelColor;const i=this.darkMode?-4:-1;for(let y=0;y<5;y++)this["surface"+y]=this["surface"+y]||me(this.mainBkg,{h:180,s:-15,l:i*(5+y*3)}),this["surfacePeer"+y]=this["surfacePeer"+y]||me(this.mainBkg,{h:180,s:-15,l:i*(8+y*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||e,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||me(e,{h:64}),this.fillType3=this.fillType3||me(r,{h:64}),this.fillType4=this.fillType4||me(e,{h:-64}),this.fillType5=this.fillType5||me(r,{h:-64}),this.fillType6=this.fillType6||me(e,{h:128}),this.fillType7=this.fillType7||me(r,{h:128}),this.pie1=this.pie1||e,this.pie2=this.pie2||r,this.pie3=this.pie3||n,this.pie4=this.pie4||me(e,{l:-10}),this.pie5=this.pie5||me(r,{l:-10}),this.pie6=this.pie6||me(n,{l:-10}),this.pie7=this.pie7||me(e,{h:60,l:-10}),this.pie8=this.pie8||me(e,{h:-60,l:-10}),this.pie9=this.pie9||me(e,{h:120,l:0}),this.pie10=this.pie10||me(e,{h:60,l:-20}),this.pie11=this.pie11||me(e,{h:-60,l:-20}),this.pie12=this.pie12||me(e,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||e,this.quadrant2Fill=this.quadrant2Fill||me(e,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||me(e,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||me(e,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||me(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||me(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||me(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Zs(this.quadrant1Fill)?Je(this.quadrant1Fill):et(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((a=this.xyChart)==null?void 0:a.backgroundColor)||this.background,titleColor:((s=this.xyChart)==null?void 0:s.titleColor)||this.primaryTextColor,xAxisTitleColor:((o=this.xyChart)==null?void 0:o.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((l=this.xyChart)==null?void 0:l.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((u=this.xyChart)==null?void 0:u.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((h=this.xyChart)==null?void 0:h.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((d=this.xyChart)==null?void 0:d.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((f=this.xyChart)==null?void 0:f.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((p=this.xyChart)==null?void 0:p.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((g=this.xyChart)==null?void 0:g.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((m=this.xyChart)==null?void 0:m.plotColorPalette)||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||e,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||e,this.git1=this.git1||r,this.git2=this.git2||n,this.git3=this.git3||me(e,{h:-30}),this.git4=this.git4||me(e,{h:-60}),this.git5=this.git5||me(e,{h:-90}),this.git6=this.git6||me(e,{h:60}),this.git7=this.git7||me(e,{h:120}),this.darkMode?(this.git0=Je(this.git0,25),this.git1=Je(this.git1,25),this.git2=Je(this.git2,25),this.git3=Je(this.git3,25),this.git4=Je(this.git4,25),this.git5=Je(this.git5,25),this.git6=Je(this.git6,25),this.git7=Je(this.git7,25)):(this.git0=et(this.git0,25),this.git1=et(this.git1,25),this.git2=et(this.git2,25),this.git3=et(this.git3,25),this.git4=et(this.git4,25),this.git5=et(this.git5,25),this.git6=et(this.git6,25),this.git7=et(this.git7,25)),this.gitInv0=this.gitInv0||Xe(this.git0),this.gitInv1=this.gitInv1||Xe(this.git1),this.gitInv2=this.gitInv2||Xe(this.git2),this.gitInv3=this.gitInv3||Xe(this.git3),this.gitInv4=this.gitInv4||Xe(this.git4),this.gitInv5=this.gitInv5||Xe(this.git5),this.gitInv6=this.gitInv6||Xe(this.git6),this.gitInv7=this.gitInv7||Xe(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLineColor=this.commitLineColor??"#BDBCCC",this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.fontWeight=600,this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||iu,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||au}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(zy,"Theme"),zy),hFe=x(t=>{const e=new uFe;return e.calculate(t),e},"getThemeVariables"),Vy,dFe=(Vy=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Je(this.primaryColor,16),this.tertiaryColor=me(this.primaryColor,{h:-160}),this.primaryBorderColor=Xe(this.background),this.secondaryBorderColor=Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Sr(this.tertiaryColor,this.darkMode),this.primaryTextColor=Xe(this.primaryColor),this.secondaryTextColor=Xe(this.secondaryColor),this.tertiaryTextColor=Xe(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Je(Xe("#323D47"),10),this.border1="#ccc",this.border2=jl(255,255,255,.25),this.arrowheadColor=Xe(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){var r,n,i,a,s,o,l,u,h,d,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||me(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||me(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Sr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Sr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Sr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Sr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||Xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Xe(this.tertiaryColor),this.lineColor=this.lineColor||Xe(this.background),this.arrowheadColor=this.arrowheadColor||Xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||et(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Xe(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||Je(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let p=0;p<this.THEME_COLOR_LIMIT;p++)this["cScaleInv"+p]=this["cScaleInv"+p]||Xe(this["cScale"+p]);for(let p=0;p<this.THEME_COLOR_LIMIT;p++)this.darkMode?this["cScalePeer"+p]=this["cScalePeer"+p]||Je(this["cScale"+p],10):this["cScalePeer"+p]=this["cScalePeer"+p]||et(this["cScale"+p],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let p=0;p<this.THEME_COLOR_LIMIT;p++)this["cScaleLabel"+p]=et(this["cScale"+p],75);const e=this.darkMode?-4:-1;for(let p=0;p<5;p++)this["surface"+p]=this["surface"+p]||me(this.mainBkg,{h:180,s:-15,l:e*(5+p*3)}),this["surfacePeer"+p]=this["surfacePeer"+p]||me(this.mainBkg,{h:180,s:-15,l:e*(8+p*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||me(this.primaryColor,{h:64}),this.fillType3=this.fillType3||me(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||me(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||me(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||me(this.primaryColor,{h:128}),this.fillType7=this.fillType7||me(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||me(this.primaryColor,{l:-10}),this.pie5=this.pie5||me(this.secondaryColor,{l:-10}),this.pie6=this.pie6||me(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||me(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||me(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||me(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||me(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||me(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||me(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||me(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||me(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||me(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||me(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||me(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||me(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Zs(this.quadrant1Fill)?Je(this.quadrant1Fill):et(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((r=this.xyChart)==null?void 0:r.backgroundColor)||this.background,titleColor:((n=this.xyChart)==null?void 0:n.titleColor)||this.primaryTextColor,xAxisTitleColor:((i=this.xyChart)==null?void 0:i.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((a=this.xyChart)==null?void 0:a.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((s=this.xyChart)==null?void 0:s.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((o=this.xyChart)==null?void 0:o.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((l=this.xyChart)==null?void 0:l.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((u=this.xyChart)==null?void 0:u.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((h=this.xyChart)==null?void 0:h.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((d=this.xyChart)==null?void 0:d.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((f=this.xyChart)==null?void 0:f.plotColorPalette)||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?et(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||me(this.primaryColor,{h:-30}),this.git4=this.git4||me(this.primaryColor,{h:-60}),this.git5=this.git5||me(this.primaryColor,{h:-90}),this.git6=this.git6||me(this.primaryColor,{h:60}),this.git7=this.git7||me(this.primaryColor,{h:120}),this.darkMode?(this.git0=Je(this.git0,25),this.git1=Je(this.git1,25),this.git2=Je(this.git2,25),this.git3=Je(this.git3,25),this.git4=Je(this.git4,25),this.git5=Je(this.git5,25),this.git6=Je(this.git6,25),this.git7=Je(this.git7,25)):(this.git0=et(this.git0,25),this.git1=et(this.git1,25),this.git2=et(this.git2,25),this.git3=et(this.git3,25),this.git4=et(this.git4,25),this.git5=et(this.git5,25),this.git6=et(this.git6,25),this.git7=et(this.git7,25)),this.gitInv0=this.gitInv0||Xe(this.git0),this.gitInv1=this.gitInv1||Xe(this.git1),this.gitInv2=this.gitInv2||Xe(this.git2),this.gitInv3=this.gitInv3||Xe(this.git3),this.gitInv4=this.gitInv4||Xe(this.git4),this.gitInv5=this.gitInv5||Xe(this.git5),this.gitInv6=this.gitInv6||Xe(this.git6),this.gitInv7=this.gitInv7||Xe(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.fontWeight=600,this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||iu,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||au}calculate(e){if(typeof e!="object"){this.updateColors();return}const r=Object.keys(e);r.forEach(n=>{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},x(Vy,"Theme"),Vy),fFe=x(t=>{const e=new dFe;return e.calculate(t),e},"getThemeVariables"),ch={base:{getThemeVariables:XBe},dark:{getThemeVariables:KBe},default:{getThemeVariables:Dh},forest:{getThemeVariables:JBe},neutral:{getThemeVariables:tFe},neo:{getThemeVariables:nFe},"neo-dark":{getThemeVariables:aFe},redux:{getThemeVariables:oFe},"redux-dark":{getThemeVariables:cFe},"redux-color":{getThemeVariables:hFe},"redux-dark-color":{getThemeVariables:fFe}},Oa={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},Hle={...Oa,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:ch.default.getThemeVariables(),sequence:{...Oa.sequence,messageFont:x(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:x(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:x(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...Oa.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Oa.c4,useWidth:void 0,personFont:x(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Oa.flowchart,inheritDir:!1},external_personFont:x(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:x(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:x(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:x(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:x(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:x(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:x(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:x(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:x(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:x(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:x(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:x(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:x(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:x(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:x(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:x(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:x(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:x(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:x(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:x(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:x(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Oa.pie,useWidth:984},xyChart:{...Oa.xyChart,useWidth:void 0},requirement:{...Oa.requirement,useWidth:void 0},packet:{...Oa.packet},eventmodeling:{...Oa.eventmodeling},treeView:{...Oa.treeView,useWidth:void 0},radar:{...Oa.radar},railroad:{...Oa.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...Oa.ishikawa},sankey:{...Oa.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...Oa.venn},cynefin:{...Oa.cynefin}},qle=x((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...qle(t[n],"")]:[...r,e+n],[]),"keyify"),pFe=new Set(qle(Hle,"")),Vr=Hle,gFe={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},mFe=x((t,e)=>{for(const r of Object.keys(t)){const n=t[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof n!="string"||!e.test(n))&&(le.debug("sanitize deleting dictionary entry:",r,n),delete t[r])}},"sanitizeDictionaryConfig"),J5=x(t=>{if(le.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>J5(e));return}for(const e of Object.keys(t)){if(le.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!pFe.has(e)||t[e]==null){le.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){const n=gFe[e];n?mFe(t[e],n):(le.debug("sanitizing object",e),J5(t[e]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(le.debug("sanitizing css option",e),t[e]=Ule(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}le.debug("After sanitization",t)}},"sanitizeDirective"),Ule=x(t=>{let e=0,r=0;for(const n of t){if(e<r)return"{ /* ERROR: Unbalanced CSS */ }";n==="{"?e++:n==="}"&&r++}return e!==r?"{ /* ERROR: Unbalanced CSS */ }":t},"sanitizeCss"),Tb=Object.freeze(Vr),su=x(t=>!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),ho=Wi({},Tb),eA,E0=[],Dw=Wi({},Tb),Uk=x((t,e)=>{let r=Wi({},t),n={};for(const i of e)jle(i),n=Wi(n,i);if(r=Wi(r,n),n.theme&&n.theme in ch){const i=Wi({},eA),a=Wi(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in ch&&(r.themeVariables=ch[r.theme].getThemeVariables(a))}return Dw=r,wFe(Dw),Dw},"updateCurrentConfig"),yFe=x(t=>(ho=Wi({},Tb),ho=Wi(ho,t),t.theme&&ch[t.theme]&&(ho.themeVariables=ch[t.theme].getThemeVariables(t.themeVariables)),Uk(ho,E0),ho),"setSiteConfig"),vFe=x(t=>{eA=Wi({},t)},"saveConfigFromInitialize"),bFe=x(t=>(ho=Wi(ho,t),Uk(ho,E0),ho),"updateSiteConfig"),Yle=x(()=>Wi({},ho),"getSiteConfig"),Xle=x(t=>(Uk(Dw,[t]),Xt()),"setConfig"),Xt=x(()=>Wi({},Dw),"getConfig"),jle=x(t=>{t&&(["secure",...ho.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(le.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&jle(t[e])}))},"sanitize"),xFe=x(t=>{var e;J5(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),E0.push(t),Uk(ho,E0)},"addDirective"),tA=x((t=ho)=>{E0=[],Uk(t,E0)},"reset"),TFe={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},Tj={},Kle=x(t=>{Tj[t]||(le.warn(TFe[t]),Tj[t]=!0)},"issueWarning"),wFe=x(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&Kle("LAZY_LOAD_DEPRECATED")},"checkConfig"),Zle=x(()=>{let t={};eA&&(t=Wi(t,eA));for(const e of E0)t=Wi(t,e);return t},"getUserDefinedConfig"),xn=x(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&Kle("FLOWCHART_HTML_LABELS_DEPRECATED"),su(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),Qle=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,Ow=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,CFe=/\s*%%.*\n/gm,Gy,Jle=(Gy=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},x(Gy,"UnknownDiagramError"),Gy),A0={},kz=x(function(t,e){t=t.replace(Qle,"").replace(Ow,"").replace(CFe,`
`);for(const[r,{detector:n}]of Object.entries(A0))if(n(t,e))return r;throw new Jle(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),qD=x((...t)=>{for(const{id:e,detector:r,loader:n}of t)ece(e,r,n)},"registerLazyLoadedDiagrams"),ece=x((t,e,r)=>{A0[t]&&le.warn(`Detector with key ${t} already exists. Overwriting.`),A0[t]={detector:e,loader:r},le.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),kFe=x(t=>A0[t].loader,"getDiagramLoader"),gx=/<br\s*\/?>/gi,SFe=x(t=>t?nce(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),EFe=(()=>{let t=!1;return()=>{t||(tce(),t=!0)}})();function tce(){const t="data-temp-href-target";ph.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),ph.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}x(tce,"setupDompurifyHooks");var rce=x(t=>(EFe(),ph.sanitize(t)),"removeScript"),wj=x((t,e)=>{if(xn(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=rce(t):r!=="loose"&&(t=nce(t),t=t.replace(/</g,"&lt;").replace(/>/g,"&gt;"),t=t.replace(/=/g,"&equals;"),t=LFe(t))}return t},"sanitizeMore"),Wr=x((t,e)=>t&&(e.dompurifyConfig?t=ph.sanitize(wj(t,e),e.dompurifyConfig).toString():t=ph.sanitize(wj(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),AFe=x((t,e)=>typeof t=="string"?Wr(t,e):t.flat().map(r=>Wr(r,e)),"sanitizeTextOrArray"),_Fe=x(t=>gx.test(t),"hasBreaks"),RFe=x(t=>t.split(gx),"splitBreaks"),LFe=x(t=>t.replace(/#br#/g,"<br/>"),"placeholderToBreak"),nce=x(t=>t.replace(gx,"#br#"),"breakToPlaceholder"),J6=x(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),MFe=x(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),IFe=x(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),fd=x(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n<e.length;n++){let i=e[n];if(i===","&&n>0&&n+1<e.length){const a=e[n-1],s=e[n+1];NFe(a,s)&&(i=a+","+s,n++,r.pop())}r.push(DFe(i))}return r.join("")},"parseGenericTypes"),UD=x((t,e)=>Math.max(0,t.split(e).length-1),"countOccurrence"),NFe=x((t,e)=>{const r=UD(t,"~"),n=UD(e,"~");return r===1&&n===1},"shouldCombineSets"),DFe=x(t=>{const e=UD(t,"~");let r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const n=[...t];let i=n.indexOf("~"),a=n.lastIndexOf("~");for(;i!==-1&&a!==-1&&i!==a;)n[i]="<",n[a]=">",i=n.indexOf("~"),a=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),Cj=x(()=>window.MathMLElement!==void 0,"isMathMLSupported"),YD=/\$\$(.*?)\$\$/g,$i=x(t=>{var e;return(((e=t.match(YD))==null?void 0:e.length)??0)>0},"hasKatex"),Yk=x(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await eR(t,e),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const n=document.querySelector("body");n==null||n.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),OFe=x(async(t,e)=>{if(!$i(t))return t;if(!(Cj()||e.legacyMathML||e.forceLegacyMathML))return t.replace(YD,"MathML is unsupported in this environment.");{const{default:r}=await tr(async()=>{const{default:i}=await Promise.resolve().then(()=>wrt);return{default:i}},void 0,import.meta.url),n=e.forceLegacyMathML||!Cj()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(gx).map(i=>$i(i)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${i}</div>`:`<div>${i}</div>`).join("").replace(YD,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),eR=x(async(t,e)=>Wr(await OFe(t,e),e),"renderKatexSanitized"),At={getRows:SFe,sanitizeText:Wr,sanitizeTextOrArray:AFe,hasBreaks:_Fe,splitBreaks:RFe,lineBreakRegex:gx,removeScript:rce,getUrl:J6,evaluate:su,getMax:MFe,getMin:IFe},$Fe=x(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),PFe=x(function(t,e,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${e}px;`)):(n.set("height",t),n.set("width",e)),n},"calculateSvgSizeAttrs"),Ai=x(function(t,e,r,n){const i=PFe(e,r,n);$Fe(t,i)},"configureSvgSize"),mx=x(function(t,e,r,n){const i=e.node().getBBox(),a=i.width,s=i.height;le.info(`SVG bounds: ${a}x${s}`,i);let o=0,l=0;le.info(`Graph bounds: ${o}x${l}`,t),o=a+r*2,l=s+r*2,le.info(`Calculated bounds: ${o}x${l}`),Ai(e,l,o,n);const u=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",u)},"setupGraphViewbox"),V4={};function XD(t){return[...t.cssRules].map(e=>e.cssText).join(`
`)}x(XD,"cssStyleSheetToString");var BFe=x((t,e,r,n)=>{let i="";return t in V4&&V4[t]?i=V4[t]({...r,svgId:n}):le.warn(`No theme found for ${t}`),`& {
font-family: ${r.fontFamily};
font-size: ${r.fontSize};
fill: ${r.textColor}
}
@keyframes edge-animation-frame {
from {
stroke-dashoffset: 0;
}
}
@keyframes dash {
to {
stroke-dashoffset: 0;
}
}
& .edge-animation-slow {
stroke-dasharray: 9,5 !important;
stroke-dashoffset: 900;
animation: dash 50s linear infinite;
stroke-linecap: round;
}
& .edge-animation-fast {
stroke-dasharray: 9,5 !important;
stroke-dashoffset: 900;
animation: dash 20s linear infinite;
stroke-linecap: round;
}
/* Classes common for multiple diagrams */
& .error-icon {
fill: ${r.errorBkgColor};
}
& .error-text {
fill: ${r.errorTextColor};
stroke: ${r.errorTextColor};
}
& .edge-thickness-normal {
stroke-width: ${r.strokeWidth??1}px;
}
& .edge-thickness-thick {
stroke-width: 3.5px
}
& .edge-pattern-solid {
stroke-dasharray: 0;
}
& .edge-thickness-invisible {
stroke-width: 0;
fill: none;
}
& .edge-pattern-dashed{
stroke-dasharray: 3;
}
.edge-pattern-dotted {
stroke-dasharray: 2;
}
& .marker {
fill: ${r.lineColor};
stroke: ${r.lineColor};
}
& .marker.cross {
stroke: ${r.lineColor};
}
& svg {
font-family: ${r.fontFamily};
font-size: ${r.fontSize};
}
& p {
margin: 0
}
${i}
.node .neo-node {
stroke: ${r.nodeBorder};
}
[data-look="neo"].node rect, [data-look="neo"].cluster rect, [data-look="neo"].node polygon {
stroke: ${r.useGradient?"url("+n+"-gradient)":r.nodeBorder};
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${n}-drop-shadow)`):"none"};
}
[data-look="neo"].swimlane.cluster rect {
filter: none;
}
[data-look="neo"].node path {
stroke: ${r.useGradient?"url("+n+"-gradient)":r.nodeBorder};
stroke-width: ${r.strokeWidth??1}px;
}
[data-look="neo"].node .outer-path {
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${n}-drop-shadow)`):"none"};
}
[data-look="neo"].node .neo-line path {
stroke: ${r.nodeBorder};
filter: none;
}
[data-look="neo"].node circle{
stroke: ${r.useGradient?"url("+n+"-gradient)":r.nodeBorder};
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${n}-drop-shadow)`):"none"};
}
[data-look="neo"].node circle .state-start{
fill: #000000;
}
[data-look="neo"].icon-shape .icon {
fill: ${r.useGradient?"url("+n+"-gradient)":r.nodeBorder};
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${n}-drop-shadow)`):"none"};
}
[data-look="neo"].icon-shape .icon-neo path {
stroke: ${r.useGradient?"url("+n+"-gradient)":r.nodeBorder};
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${n}-drop-shadow)`):"none"};
}
${e}
`},"getStyles"),FFe=x((t,e)=>{e!==void 0&&(V4[t]=e)},"addStylesForDiagram"),zFe=BFe,Sz={};Z6(Sz,{clear:()=>On,getAccDescription:()=>ai,getAccTitle:()=>ni,getDiagramTitle:()=>Yn,setAccDescription:()=>ii,setAccTitle:()=>Hn,setDiagramTitle:()=>ti});var Ez="",Az="",_z="",Rz=x(t=>Wr(t,Xt()),"sanitizeText"),On=x(()=>{Ez="",_z="",Az=""},"clear"),Hn=x(t=>{Ez=Rz(t).replace(/^\s+/g,"")},"setAccTitle"),ni=x(()=>Ez,"getAccTitle"),ii=x(t=>{_z=Rz(t).replace(/\n\s+/g,`
`)},"setAccDescription"),ai=x(()=>_z,"getAccDescription"),ti=x(t=>{Az=Rz(t)},"setDiagramTitle"),Yn=x(()=>Az,"getDiagramTitle"),kj=le,VFe=Tz,Fe=Xt,jD=Xle,ice=Tb,Lz=x(t=>Wr(t,Fe()),"sanitizeText"),Mz=mx,GFe=x(()=>Sz,"getCommonDb"),rA={},nA=x((t,e,r)=>{var n;rA[t]&&kj.warn(`Diagram with id ${t} already registered. Overwriting.`),rA[t]=e,r&&ece(t,r),FFe(t,e.styles),(n=e.injectUtils)==null||n.call(e,kj,VFe,Fe,Lz,Mz,GFe(),()=>{})},"registerDiagram"),KD=x(t=>{if(t in rA)return rA[t];throw new WFe(t)},"getDiagram"),Wy,WFe=(Wy=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},x(Wy,"DiagramNotFoundError"),Wy);function G4(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function HFe(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Iz(t){let e,r,n;t.length!==2?(e=G4,r=(o,l)=>G4(t(o),l),n=(o,l)=>t(o)-l):(e=t===G4||t===HFe?t:qFe,r=t,n=t);function i(o,l,u=0,h=o.length){if(u<h){if(e(l,l)!==0)return h;do{const d=u+h>>>1;r(o[d],l)<0?u=d+1:h=d}while(u<h)}return u}function a(o,l,u=0,h=o.length){if(u<h){if(e(l,l)!==0)return h;do{const d=u+h>>>1;r(o[d],l)<=0?u=d+1:h=d}while(u<h)}return u}function s(o,l,u=0,h=o.length){const d=i(o,l,u,h-1);return d>u&&n(o[d-1],l)>-n(o[d],l)?d-1:d}return{left:i,center:s,right:a}}function qFe(){return 0}function UFe(t){return t===null?NaN:+t}const YFe=Iz(G4),XFe=YFe.right;Iz(UFe).center;class Sj extends Map{constructor(e,r=ZFe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(Ej(this,e))}has(e){return super.has(Ej(this,e))}set(e,r){return super.set(jFe(this,e),r)}delete(e){return super.delete(KFe(this,e))}}function Ej({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function jFe({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function KFe({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function ZFe(t){return t!==null&&typeof t=="object"?t.valueOf():t}const QFe=Math.sqrt(50),JFe=Math.sqrt(10),eze=Math.sqrt(2);function iA(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=QFe?10:a>=JFe?5:a>=eze?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/s,o=Math.round(t*u),l=Math.round(e*u),o/u<t&&++o,l/u>e&&--l,u=-u):(u=Math.pow(10,i)*s,o=Math.round(t/u),l=Math.round(e/u),o*u<t&&++o,l*u>e&&--l),l<o&&.5<=r&&r<2?iA(t,e,r*2):[o,l,u]}function tze(t,e,r){if(e=+e,t=+t,r=+r,!(r>0))return[];if(t===e)return[t];const n=e<t,[i,a,s]=n?iA(e,t,r):iA(t,e,r);if(!(a>=i))return[];const o=a-i+1,l=new Array(o);if(n)if(s<0)for(let u=0;u<o;++u)l[u]=(a-u)/-s;else for(let u=0;u<o;++u)l[u]=(a-u)*s;else if(s<0)for(let u=0;u<o;++u)l[u]=(i+u)/-s;else for(let u=0;u<o;++u)l[u]=(i+u)*s;return l}function ZD(t,e,r){return e=+e,t=+t,r=+r,iA(t,e,r)[2]}function QD(t,e,r){e=+e,t=+t,r=+r;const n=e<t,i=n?ZD(e,t,r):ZD(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function rze(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}return r}function nze(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function ize(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,a=new Array(i);++n<i;)a[n]=t+n*r;return a}function aze(t){return t}var W4=1,RM=2,JD=3,yE=4,Aj=1e-6;function sze(t){return"translate("+t+",0)"}function oze(t){return"translate(0,"+t+")"}function lze(t){return e=>+t(e)}function cze(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function uze(){return!this.__axis}function ace(t,e){var r=[],n=null,i=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===W4||t===yE?-1:1,h=t===yE||t===RM?"x":"y",d=t===W4||t===JD?sze:oze;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):aze),y=Math.max(a,0)+o,v=e.range(),T=+v[0]+l,b=+v[v.length-1]+l,w=(e.bandwidth?cze:lze)(e.copy(),l),C=p.selection?p.selection():p,S=C.selectAll(".domain").data([null]),k=C.selectAll(".tick").data(g,e).order(),E=k.exit(),_=k.enter().append("g").attr("class","tick"),M=k.select("line"),L=k.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(_),M=M.merge(_.append("line").attr("stroke","currentColor").attr(h+"2",u*a)),L=L.merge(_.append("text").attr("fill","currentColor").attr(h,u*y).attr("dy",t===W4?"0em":t===JD?"0.71em":"0.32em")),p!==C&&(S=S.transition(p),k=k.transition(p),M=M.transition(p),L=L.transition(p),E=E.transition(p).attr("opacity",Aj).attr("transform",function(P){return isFinite(P=w(P))?d(P+l):this.getAttribute("transform")}),_.attr("opacity",Aj).attr("transform",function(P){var D=this.parentNode.__axis;return d((D&&isFinite(D=D(P))?D:w(P))+l)})),E.remove(),S.attr("d",t===yE||t===RM?s?"M"+u*s+","+T+"H"+l+"V"+b+"H"+u*s:"M"+l+","+T+"V"+b:s?"M"+T+","+u*s+"V"+l+"H"+b+"V"+u*s:"M"+T+","+l+"H"+b),k.attr("opacity",1).attr("transform",function(P){return d(w(P)+l)}),M.attr(h+"2",u*a),L.attr(h,u*y).text(m),C.filter(uze).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===RM?"start":t===yE?"end":"middle"),C.each(function(){this.__axis=w})}return f.scale=function(p){return arguments.length?(e=p,f):e},f.ticks=function(){return r=Array.from(arguments),f},f.tickArguments=function(p){return arguments.length?(r=p==null?[]:Array.from(p),f):r.slice()},f.tickValues=function(p){return arguments.length?(n=p==null?null:Array.from(p),f):n&&n.slice()},f.tickFormat=function(p){return arguments.length?(i=p,f):i},f.tickSize=function(p){return arguments.length?(a=s=+p,f):a},f.tickSizeInner=function(p){return arguments.length?(a=+p,f):a},f.tickSizeOuter=function(p){return arguments.length?(s=+p,f):s},f.tickPadding=function(p){return arguments.length?(o=+p,f):o},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function hze(t){return ace(W4,t)}function dze(t){return ace(JD,t)}var fze={value:()=>{}};function sce(){for(var t=0,e=arguments.length,r={},n;t<e;++t){if(!(n=arguments[t]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new H4(r)}function H4(t){this._=t}function pze(t,e){return t.trim().split(/^|\s+/).map(function(r){var n="",i=r.indexOf(".");if(i>=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}H4.prototype=sce.prototype={constructor:H4,on:function(t,e){var r=this._,n=pze(t+"",r),i,a=-1,s=n.length;if(arguments.length<2){for(;++a<s;)if((i=(t=n[a]).type)&&(i=gze(r[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<s;)if(i=(t=n[a]).type)r[i]=_j(r[i],t.name,e);else if(e==null)for(i in r)r[i]=_j(r[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new H4(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var r=new Array(i),n=0,i,a;n<i;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],n=0,i=a.length;n<i;++n)a[n].value.apply(e,r)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],i=0,a=n.length;i<a;++i)n[i].value.apply(e,r)}};function gze(t,e){for(var r=0,n=t.length,i;r<n;++r)if((i=t[r]).name===e)return i.value}function _j(t,e,r){for(var n=0,i=t.length;n<i;++n)if(t[n].name===e){t[n]=fze,t=t.slice(0,n).concat(t.slice(n+1));break}return r!=null&&t.push({name:e,value:r}),t}var eO="http://www.w3.org/1999/xhtml";const Rj={svg:"http://www.w3.org/2000/svg",xhtml:eO,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function tR(t){var e=t+="",r=e.indexOf(":");return r>=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),Rj.hasOwnProperty(e)?{space:Rj[e],local:t}:t}function mze(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===eO&&e.documentElement.namespaceURI===eO?e.createElement(t):e.createElementNS(r,t)}}function yze(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function oce(t){var e=tR(t);return(e.local?yze:mze)(e)}function vze(){}function Nz(t){return t==null?vze:function(){return this.querySelector(t)}}function bze(t){typeof t!="function"&&(t=Nz(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var a=e[i],s=a.length,o=n[i]=new Array(s),l,u,h=0;h<s;++h)(l=a[h])&&(u=t.call(l,l.__data__,h,a))&&("__data__"in l&&(u.__data__=l.__data__),o[h]=u);return new Fo(n,this._parents)}function xze(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Tze(){return[]}function lce(t){return t==null?Tze:function(){return this.querySelectorAll(t)}}function wze(t){return function(){return xze(t.apply(this,arguments))}}function Cze(t){typeof t=="function"?t=wze(t):t=lce(t);for(var e=this._groups,r=e.length,n=[],i=[],a=0;a<r;++a)for(var s=e[a],o=s.length,l,u=0;u<o;++u)(l=s[u])&&(n.push(t.call(l,l.__data__,u,s)),i.push(l));return new Fo(n,i)}function cce(t){return function(){return this.matches(t)}}function uce(t){return function(e){return e.matches(t)}}var kze=Array.prototype.find;function Sze(t){return function(){return kze.call(this.children,t)}}function Eze(){return this.firstElementChild}function Aze(t){return this.select(t==null?Eze:Sze(typeof t=="function"?t:uce(t)))}var _ze=Array.prototype.filter;function Rze(){return Array.from(this.children)}function Lze(t){return function(){return _ze.call(this.children,t)}}function Mze(t){return this.selectAll(t==null?Rze:Lze(typeof t=="function"?t:uce(t)))}function Ize(t){typeof t!="function"&&(t=cce(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var a=e[i],s=a.length,o=n[i]=[],l,u=0;u<s;++u)(l=a[u])&&t.call(l,l.__data__,u,a)&&o.push(l);return new Fo(n,this._parents)}function hce(t){return new Array(t.length)}function Nze(){return new Fo(this._enter||this._groups.map(hce),this._parents)}function aA(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}aA.prototype={constructor:aA,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 Dze(t){return function(){return t}}function Oze(t,e,r,n,i,a){for(var s=0,o,l=e.length,u=a.length;s<u;++s)(o=e[s])?(o.__data__=a[s],n[s]=o):r[s]=new aA(t,a[s]);for(;s<l;++s)(o=e[s])&&(i[s]=o)}function $ze(t,e,r,n,i,a,s){var o,l,u=new Map,h=e.length,d=a.length,f=new Array(h),p;for(o=0;o<h;++o)(l=e[o])&&(f[o]=p=s.call(l,l.__data__,o,e)+"",u.has(p)?i[o]=l:u.set(p,l));for(o=0;o<d;++o)p=s.call(t,a[o],o,a)+"",(l=u.get(p))?(n[o]=l,l.__data__=a[o],u.delete(p)):r[o]=new aA(t,a[o]);for(o=0;o<h;++o)(l=e[o])&&u.get(f[o])===l&&(i[o]=l)}function Pze(t){return t.__data__}function Bze(t,e){if(!arguments.length)return Array.from(this,Pze);var r=e?$ze:Oze,n=this._parents,i=this._groups;typeof t!="function"&&(t=Dze(t));for(var a=i.length,s=new Array(a),o=new Array(a),l=new Array(a),u=0;u<a;++u){var h=n[u],d=i[u],f=d.length,p=Fze(t.call(h,h&&h.__data__,u,n)),g=p.length,m=o[u]=new Array(g),y=s[u]=new Array(g),v=l[u]=new Array(f);r(h,d,m,y,v,p,e);for(var T=0,b=0,w,C;T<g;++T)if(w=m[T]){for(T>=b&&(b=T+1);!(C=y[b])&&++b<g;);w._next=C||null}}return s=new Fo(s,n),s._enter=o,s._exit=l,s}function Fze(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function zze(){return new Fo(this._exit||this._groups.map(hce),this._parents)}function Vze(t,e,r){var n=this.enter(),i=this,a=this.exit();return typeof t=="function"?(n=t(n),n&&(n=n.selection())):n=n.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),r==null?a.remove():r(a),n&&i?n.merge(i).order():i}function Gze(t){for(var e=t.selection?t.selection():t,r=this._groups,n=e._groups,i=r.length,a=n.length,s=Math.min(i,a),o=new Array(i),l=0;l<s;++l)for(var u=r[l],h=n[l],d=u.length,f=o[l]=new Array(d),p,g=0;g<d;++g)(p=u[g]||h[g])&&(f[g]=p);for(;l<i;++l)o[l]=r[l];return new Fo(o,this._parents)}function Wze(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var n=t[e],i=n.length-1,a=n[i],s;--i>=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function Hze(t){t||(t=qze);function e(d,f){return d&&f?t(d.__data__,f.__data__):!d-!f}for(var r=this._groups,n=r.length,i=new Array(n),a=0;a<n;++a){for(var s=r[a],o=s.length,l=i[a]=new Array(o),u,h=0;h<o;++h)(u=s[h])&&(l[h]=u);l.sort(e)}return new Fo(i,this._parents).order()}function qze(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Uze(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Yze(){return Array.from(this)}function Xze(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],i=0,a=n.length;i<a;++i){var s=n[i];if(s)return s}return null}function jze(){let t=0;for(const e of this)++t;return t}function Kze(){return!this.node()}function Zze(t){for(var e=this._groups,r=0,n=e.length;r<n;++r)for(var i=e[r],a=0,s=i.length,o;a<s;++a)(o=i[a])&&t.call(o,o.__data__,a,i);return this}function Qze(t){return function(){this.removeAttribute(t)}}function Jze(t){return function(){this.removeAttributeNS(t.space,t.local)}}function eVe(t,e){return function(){this.setAttribute(t,e)}}function tVe(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function rVe(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttribute(t):this.setAttribute(t,r)}}function nVe(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function iVe(t,e){var r=tR(t);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((e==null?r.local?Jze:Qze:typeof e=="function"?r.local?nVe:rVe:r.local?tVe:eVe)(r,e))}function dce(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function aVe(t){return function(){this.style.removeProperty(t)}}function sVe(t,e,r){return function(){this.style.setProperty(t,e,r)}}function oVe(t,e,r){return function(){var n=e.apply(this,arguments);n==null?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function lVe(t,e,r){return arguments.length>1?this.each((e==null?aVe:typeof e=="function"?oVe:sVe)(t,e,r??"")):wb(this.node(),t)}function wb(t,e){return t.style.getPropertyValue(e)||dce(t).getComputedStyle(t,null).getPropertyValue(e)}function cVe(t){return function(){delete this[t]}}function uVe(t,e){return function(){this[t]=e}}function hVe(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function dVe(t,e){return arguments.length>1?this.each((e==null?cVe:typeof e=="function"?hVe:uVe)(t,e)):this.node()[t]}function fce(t){return t.trim().split(/^|\s+/)}function Dz(t){return t.classList||new pce(t)}function pce(t){this._node=t,this._names=fce(t.getAttribute("class")||"")}pce.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 gce(t,e){for(var r=Dz(t),n=-1,i=e.length;++n<i;)r.add(e[n])}function mce(t,e){for(var r=Dz(t),n=-1,i=e.length;++n<i;)r.remove(e[n])}function fVe(t){return function(){gce(this,t)}}function pVe(t){return function(){mce(this,t)}}function gVe(t,e){return function(){(e.apply(this,arguments)?gce:mce)(this,t)}}function mVe(t,e){var r=fce(t+"");if(arguments.length<2){for(var n=Dz(this.node()),i=-1,a=r.length;++i<a;)if(!n.contains(r[i]))return!1;return!0}return this.each((typeof e=="function"?gVe:e?fVe:pVe)(r,e))}function yVe(){this.textContent=""}function vVe(t){return function(){this.textContent=t}}function bVe(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function xVe(t){return arguments.length?this.each(t==null?yVe:(typeof t=="function"?bVe:vVe)(t)):this.node().textContent}function TVe(){this.innerHTML=""}function wVe(t){return function(){this.innerHTML=t}}function CVe(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function kVe(t){return arguments.length?this.each(t==null?TVe:(typeof t=="function"?CVe:wVe)(t)):this.node().innerHTML}function SVe(){this.nextSibling&&this.parentNode.appendChild(this)}function EVe(){return this.each(SVe)}function AVe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function _Ve(){return this.each(AVe)}function RVe(t){var e=typeof t=="function"?t:oce(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function LVe(){return null}function MVe(t,e){var r=typeof t=="function"?t:oce(t),n=e==null?LVe:typeof e=="function"?e:Nz(e);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function IVe(){var t=this.parentNode;t&&t.removeChild(this)}function NVe(){return this.each(IVe)}function DVe(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function OVe(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function $Ve(t){return this.select(t?OVe:DVe)}function PVe(t){return arguments.length?this.property("__data__",t):this.node().__data__}function BVe(t){return function(e){t.call(this,e,this.__data__)}}function FVe(t){return t.trim().split(/^|\s+/).map(function(e){var r="",n=e.indexOf(".");return n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function zVe(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,a;r<i;++r)a=e[r],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++n]=a;++n?e.length=n:delete this.__on}}}function VVe(t,e,r){return function(){var n=this.__on,i,a=BVe(e);if(n){for(var s=0,o=n.length;s<o;++s)if((i=n[s]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=r),i.value=e;return}}this.addEventListener(t.type,a,r),i={type:t.type,name:t.name,value:e,listener:a,options:r},n?n.push(i):this.__on=[i]}}function GVe(t,e,r){var n=FVe(t+""),i,a=n.length,s;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,u=o.length,h;l<u;++l)for(i=0,h=o[l];i<a;++i)if((s=n[i]).type===h.type&&s.name===h.name)return h.value}return}for(o=e?VVe:zVe,i=0;i<a;++i)this.each(o(n[i],e,r));return this}function yce(t,e,r){var n=dce(t),i=n.CustomEvent;typeof i=="function"?i=new i(e,r):(i=n.document.createEvent("Event"),r?(i.initEvent(e,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function WVe(t,e){return function(){return yce(this,t,e)}}function HVe(t,e){return function(){return yce(this,t,e.apply(this,arguments))}}function qVe(t,e){return this.each((typeof e=="function"?HVe:WVe)(t,e))}function*UVe(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],i=0,a=n.length,s;i<a;++i)(s=n[i])&&(yield s)}var vce=[null];function Fo(t,e){this._groups=t,this._parents=e}function Xk(){return new Fo([[document.documentElement]],vce)}function YVe(){return this}Fo.prototype=Xk.prototype={constructor:Fo,select:bze,selectAll:Cze,selectChild:Aze,selectChildren:Mze,filter:Ize,data:Bze,enter:Nze,exit:zze,join:Vze,merge:Gze,selection:YVe,order:Wze,sort:Hze,call:Uze,nodes:Yze,node:Xze,size:jze,empty:Kze,each:Zze,attr:iVe,style:lVe,property:dVe,classed:mVe,text:xVe,html:kVe,raise:EVe,lower:_Ve,append:RVe,insert:MVe,remove:NVe,clone:$Ve,datum:PVe,on:GVe,dispatch:qVe,[Symbol.iterator]:UVe};function ut(t){return typeof t=="string"?new Fo([[document.querySelector(t)]],[document.documentElement]):new Fo([[t]],vce)}function jk(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function rR(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function tg(){}var SC=.7,sA=1/SC,uy="\\s*([+-]?\\d+)\\s*",EC="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Hc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",XVe=/^#([0-9a-f]{3,8})$/,jVe=new RegExp(`^rgb\\(${uy},${uy},${uy}\\)$`),KVe=new RegExp(`^rgb\\(${Hc},${Hc},${Hc}\\)$`),ZVe=new RegExp(`^rgba\\(${uy},${uy},${uy},${EC}\\)$`),QVe=new RegExp(`^rgba\\(${Hc},${Hc},${Hc},${EC}\\)$`),JVe=new RegExp(`^hsl\\(${EC},${Hc},${Hc}\\)$`),eGe=new RegExp(`^hsla\\(${EC},${Hc},${Hc},${EC}\\)$`),Lj={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};jk(tg,_0,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Mj,formatHex:Mj,formatHex8:tGe,formatHsl:rGe,formatRgb:Ij,toString:Ij});function Mj(){return this.rgb().formatHex()}function tGe(){return this.rgb().formatHex8()}function rGe(){return xce(this).formatHsl()}function Ij(){return this.rgb().formatRgb()}function _0(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=XVe.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?Nj(e):r===3?new hs(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?vE(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?vE(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=jVe.exec(t))?new hs(e[1],e[2],e[3],1):(e=KVe.exec(t))?new hs(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=ZVe.exec(t))?vE(e[1],e[2],e[3],e[4]):(e=QVe.exec(t))?vE(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=JVe.exec(t))?$j(e[1],e[2]/100,e[3]/100,1):(e=eGe.exec(t))?$j(e[1],e[2]/100,e[3]/100,e[4]):Lj.hasOwnProperty(t)?Nj(Lj[t]):t==="transparent"?new hs(NaN,NaN,NaN,0):null}function Nj(t){return new hs(t>>16&255,t>>8&255,t&255,1)}function vE(t,e,r,n){return n<=0&&(t=e=r=NaN),new hs(t,e,r,n)}function bce(t){return t instanceof tg||(t=_0(t)),t?(t=t.rgb(),new hs(t.r,t.g,t.b,t.opacity)):new hs}function tO(t,e,r,n){return arguments.length===1?bce(t):new hs(t,e,r,n??1)}function hs(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}jk(hs,tO,rR(tg,{brighter(t){return t=t==null?sA:Math.pow(sA,t),new hs(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?SC:Math.pow(SC,t),new hs(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new hs(u0(this.r),u0(this.g),u0(this.b),oA(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:Dj,formatHex:Dj,formatHex8:nGe,formatRgb:Oj,toString:Oj}));function Dj(){return`#${jp(this.r)}${jp(this.g)}${jp(this.b)}`}function nGe(){return`#${jp(this.r)}${jp(this.g)}${jp(this.b)}${jp((isNaN(this.opacity)?1:this.opacity)*255)}`}function Oj(){const t=oA(this.opacity);return`${t===1?"rgb(":"rgba("}${u0(this.r)}, ${u0(this.g)}, ${u0(this.b)}${t===1?")":`, ${t})`}`}function oA(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function u0(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function jp(t){return t=u0(t),(t<16?"0":"")+t.toString(16)}function $j(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Wl(t,e,r,n)}function xce(t){if(t instanceof Wl)return new Wl(t.h,t.s,t.l,t.opacity);if(t instanceof tg||(t=_0(t)),!t)return new Wl;if(t instanceof Wl)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),s=NaN,o=a-i,l=(a+i)/2;return o?(e===a?s=(r-n)/o+(r<n)*6:r===a?s=(n-e)/o+2:s=(e-r)/o+4,o/=l<.5?a+i:2-a-i,s*=60):o=l>0&&l<1?0:s,new Wl(s,o,l,t.opacity)}function iGe(t,e,r,n){return arguments.length===1?xce(t):new Wl(t,e,r,n??1)}function Wl(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}jk(Wl,iGe,rR(tg,{brighter(t){return t=t==null?sA:Math.pow(sA,t),new Wl(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?SC:Math.pow(SC,t),new Wl(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,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new hs(LM(t>=240?t-240:t+120,i,n),LM(t,i,n),LM(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Wl(Pj(this.h),bE(this.s),bE(this.l),oA(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=oA(this.opacity);return`${t===1?"hsl(":"hsla("}${Pj(this.h)}, ${bE(this.s)*100}%, ${bE(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Pj(t){return t=(t||0)%360,t<0?t+360:t}function bE(t){return Math.max(0,Math.min(1,t||0))}function LM(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const aGe=Math.PI/180,sGe=180/Math.PI,lA=18,Tce=.96422,wce=1,Cce=.82521,kce=4/29,hy=6/29,Sce=3*hy*hy,oGe=hy*hy*hy;function Ece(t){if(t instanceof qc)return new qc(t.l,t.a,t.b,t.opacity);if(t instanceof Zu)return Ace(t);t instanceof hs||(t=bce(t));var e=DM(t.r),r=DM(t.g),n=DM(t.b),i=MM((.2225045*e+.7168786*r+.0606169*n)/wce),a,s;return e===r&&r===n?a=s=i:(a=MM((.4360747*e+.3850649*r+.1430804*n)/Tce),s=MM((.0139322*e+.0971045*r+.7141733*n)/Cce)),new qc(116*i-16,500*(a-i),200*(i-s),t.opacity)}function lGe(t,e,r,n){return arguments.length===1?Ece(t):new qc(t,e,r,n??1)}function qc(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}jk(qc,lGe,rR(tg,{brighter(t){return new qc(this.l+lA*(t??1),this.a,this.b,this.opacity)},darker(t){return new qc(this.l-lA*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=Tce*IM(e),t=wce*IM(t),r=Cce*IM(r),new hs(NM(3.1338561*e-1.6168667*t-.4906146*r),NM(-.9787684*e+1.9161415*t+.033454*r),NM(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function MM(t){return t>oGe?Math.pow(t,1/3):t/Sce+kce}function IM(t){return t>hy?t*t*t:Sce*(t-kce)}function NM(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function DM(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function cGe(t){if(t instanceof Zu)return new Zu(t.h,t.c,t.l,t.opacity);if(t instanceof qc||(t=Ece(t)),t.a===0&&t.b===0)return new Zu(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*sGe;return new Zu(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function rO(t,e,r,n){return arguments.length===1?cGe(t):new Zu(t,e,r,n??1)}function Zu(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function Ace(t){if(isNaN(t.h))return new qc(t.l,0,0,t.opacity);var e=t.h*aGe;return new qc(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}jk(Zu,rO,rR(tg,{brighter(t){return new Zu(this.h,this.c,this.l+lA*(t??1),this.opacity)},darker(t){return new Zu(this.h,this.c,this.l-lA*(t??1),this.opacity)},rgb(){return Ace(this).rgb()}}));const nR=t=>()=>t;function _ce(t,e){return function(r){return t+r*e}}function uGe(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function hGe(t,e){var r=e-t;return r?_ce(t,r>180||r<-180?r-360*Math.round(r/360):r):nR(isNaN(t)?e:t)}function dGe(t){return(t=+t)==1?$w:function(e,r){return r-e?uGe(e,r,t):nR(isNaN(e)?r:e)}}function $w(t,e){var r=e-t;return r?_ce(t,r):nR(isNaN(t)?e:t)}const cA=(function t(e){var r=dGe(e);function n(i,a){var s=r((i=tO(i)).r,(a=tO(a)).r),o=r(i.g,a.g),l=r(i.b,a.b),u=$w(i.opacity,a.opacity);return function(h){return i.r=s(h),i.g=o(h),i.b=l(h),i.opacity=u(h),i+""}}return n.gamma=t,n})(1);function fGe(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(a){for(i=0;i<r;++i)n[i]=t[i]*(1-a)+e[i]*a;return n}}function pGe(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function gGe(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,i=new Array(n),a=new Array(r),s;for(s=0;s<n;++s)i[s]=Oz(t[s],e[s]);for(;s<r;++s)a[s]=e[s];return function(o){for(s=0;s<n;++s)a[s]=i[s](o);return a}}function mGe(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function Bl(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function yGe(t,e){var r={},n={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?r[i]=Oz(t[i],e[i]):n[i]=e[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var nO=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,OM=new RegExp(nO.source,"g");function vGe(t){return function(){return t}}function bGe(t){return function(e){return t(e)+""}}function Rce(t,e){var r=nO.lastIndex=OM.lastIndex=0,n,i,a,s=-1,o=[],l=[];for(t=t+"",e=e+"";(n=nO.exec(t))&&(i=OM.exec(e));)(a=i.index)>r&&(a=e.slice(r,a),o[s]?o[s]+=a:o[++s]=a),(n=n[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,l.push({i:s,x:Bl(n,i)})),r=OM.lastIndex;return r<e.length&&(a=e.slice(r),o[s]?o[s]+=a:o[++s]=a),o.length<2?l[0]?bGe(l[0].x):vGe(e):(e=l.length,function(u){for(var h=0,d;h<e;++h)o[(d=l[h]).i]=d.x(u);return o.join("")})}function Oz(t,e){var r=typeof e,n;return e==null||r==="boolean"?nR(e):(r==="number"?Bl:r==="string"?(n=_0(e))?(e=n,cA):Rce:e instanceof _0?cA:e instanceof Date?mGe:pGe(e)?fGe:Array.isArray(e)?gGe:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?yGe:Bl)(t,e)}function xGe(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}var Bj=180/Math.PI,iO={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Lce(t,e,r,n,i,a){var s,o,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*r+e*n)&&(r-=t*l,n-=e*l),(o=Math.sqrt(r*r+n*n))&&(r/=o,n/=o,l/=o),t*n<e*r&&(t=-t,e=-e,l=-l,s=-s),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*Bj,skewX:Math.atan(l)*Bj,scaleX:s,scaleY:o}}var xE;function TGe(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?iO:Lce(e.a,e.b,e.c,e.d,e.e,e.f)}function wGe(t){return t==null||(xE||(xE=document.createElementNS("http://www.w3.org/2000/svg","g")),xE.setAttribute("transform",t),!(t=xE.transform.baseVal.consolidate()))?iO:(t=t.matrix,Lce(t.a,t.b,t.c,t.d,t.e,t.f))}function Mce(t,e,r,n){function i(u){return u.length?u.pop()+" ":""}function a(u,h,d,f,p,g){if(u!==d||h!==f){var m=p.push("translate(",null,e,null,r);g.push({i:m-4,x:Bl(u,d)},{i:m-2,x:Bl(h,f)})}else(d||f)&&p.push("translate("+d+e+f+r)}function s(u,h,d,f){u!==h?(u-h>180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:Bl(u,h)})):h&&d.push(i(d)+"rotate("+h+n)}function o(u,h,d,f){u!==h?f.push({i:d.push(i(d)+"skewX(",null,n)-2,x:Bl(u,h)}):h&&d.push(i(d)+"skewX("+h+n)}function l(u,h,d,f,p,g){if(u!==d||h!==f){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:Bl(u,d)},{i:m-2,x:Bl(h,f)})}else(d!==1||f!==1)&&p.push(i(p)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=t(u),h=t(h),a(u.translateX,u.translateY,h.translateX,h.translateY,d,f),s(u.rotate,h.rotate,d,f),o(u.skewX,h.skewX,d,f),l(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(p){for(var g=-1,m=f.length,y;++g<m;)d[(y=f[g]).i]=y.x(p);return d.join("")}}}var CGe=Mce(TGe,"px, ","px)","deg)"),kGe=Mce(wGe,", ",")",")");function SGe(t){return function(e,r){var n=t((e=rO(e)).h,(r=rO(r)).h),i=$w(e.c,r.c),a=$w(e.l,r.l),s=$w(e.opacity,r.opacity);return function(o){return e.h=n(o),e.c=i(o),e.l=a(o),e.opacity=s(o),e+""}}}const EGe=SGe(hGe);var Cb=0,WT=0,eT=0,Ice=1e3,uA,HT,hA=0,R0=0,iR=0,AC=typeof performance=="object"&&performance.now?performance:Date,Nce=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function $z(){return R0||(Nce(AGe),R0=AC.now()+iR)}function AGe(){R0=0}function dA(){this._call=this._time=this._next=null}dA.prototype=Dce.prototype={constructor:dA,restart:function(t,e,r){if(typeof t!="function")throw new TypeError("callback is not a function");r=(r==null?$z():+r)+(e==null?0:+e),!this._next&&HT!==this&&(HT?HT._next=this:uA=this,HT=this),this._call=t,this._time=r,aO()},stop:function(){this._call&&(this._call=null,this._time=1/0,aO())}};function Dce(t,e,r){var n=new dA;return n.restart(t,e,r),n}function _Ge(){$z(),++Cb;for(var t=uA,e;t;)(e=R0-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Cb}function Fj(){R0=(hA=AC.now())+iR,Cb=WT=0;try{_Ge()}finally{Cb=0,LGe(),R0=0}}function RGe(){var t=AC.now(),e=t-hA;e>Ice&&(iR-=e,hA=t)}function LGe(){for(var t,e=uA,r,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:uA=r);HT=t,aO(n)}function aO(t){if(!Cb){WT&&(WT=clearTimeout(WT));var e=t-R0;e>24?(t<1/0&&(WT=setTimeout(Fj,t-AC.now()-iR)),eT&&(eT=clearInterval(eT))):(eT||(hA=AC.now(),eT=setInterval(RGe,Ice)),Cb=1,Nce(Fj))}}function zj(t,e,r){var n=new dA;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var MGe=sce("start","end","cancel","interrupt"),IGe=[],Oce=0,Vj=1,sO=2,q4=3,Gj=4,oO=5,U4=6;function aR(t,e,r,n,i,a){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;NGe(t,r,{name:e,index:n,group:i,on:MGe,tween:IGe,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Oce})}function Pz(t,e){var r=dc(t,e);if(r.state>Oce)throw new Error("too late; already scheduled");return r}function ou(t,e){var r=dc(t,e);if(r.state>q4)throw new Error("too late; already running");return r}function dc(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function NGe(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=Dce(a,0,r.time);function a(u){r.state=Vj,r.timer.restart(s,r.delay,r.time),r.delay<=u&&s(u-r.delay)}function s(u){var h,d,f,p;if(r.state!==Vj)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===q4)return zj(s);p.state===Gj?(p.state=U4,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+h<e&&(p.state=U4,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete n[h])}if(zj(function(){r.state===q4&&(r.state=Gj,r.timer.restart(o,r.delay,r.time),o(u))}),r.state=sO,r.on.call("start",t,t.__data__,r.index,r.group),r.state===sO){for(r.state=q4,i=new Array(f=r.tween.length),h=0,d=-1;h<f;++h)(p=r.tween[h].value.call(t,t.__data__,r.index,r.group))&&(i[++d]=p);i.length=d+1}}function o(u){for(var h=u<r.duration?r.ease.call(null,u/r.duration):(r.timer.restart(l),r.state=oO,1),d=-1,f=i.length;++d<f;)i[d].call(t,h);r.state===oO&&(r.on.call("end",t,t.__data__,r.index,r.group),l())}function l(){r.state=U4,r.timer.stop(),delete n[e];for(var u in n)return;delete t.__transition}}function DGe(t,e){var r=t.__transition,n,i,a=!0,s;if(r){e=e==null?null:e+"";for(s in r){if((n=r[s]).name!==e){a=!1;continue}i=n.state>sO&&n.state<oO,n.state=U4,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete r[s]}a&&delete t.__transition}}function OGe(t){return this.each(function(){DGe(this,t)})}function $Ge(t,e){var r,n;return function(){var i=ou(this,t),a=i.tween;if(a!==r){n=r=a;for(var s=0,o=n.length;s<o;++s)if(n[s].name===e){n=n.slice(),n.splice(s,1);break}}i.tween=n}}function PGe(t,e,r){var n,i;if(typeof r!="function")throw new Error;return function(){var a=ou(this,t),s=a.tween;if(s!==n){i=(n=s).slice();for(var o={name:e,value:r},l=0,u=i.length;l<u;++l)if(i[l].name===e){i[l]=o;break}l===u&&i.push(o)}a.tween=i}}function BGe(t,e){var r=this._id;if(t+="",arguments.length<2){for(var n=dc(this.node(),r).tween,i=0,a=n.length,s;i<a;++i)if((s=n[i]).name===t)return s.value;return null}return this.each((e==null?$Ge:PGe)(r,t,e))}function Bz(t,e,r){var n=t._id;return t.each(function(){var i=ou(this,n);(i.value||(i.value={}))[e]=r.apply(this,arguments)}),function(i){return dc(i,n).value[e]}}function $ce(t,e){var r;return(typeof e=="number"?Bl:e instanceof _0?cA:(r=_0(e))?(e=r,cA):Rce)(t,e)}function FGe(t){return function(){this.removeAttribute(t)}}function zGe(t){return function(){this.removeAttributeNS(t.space,t.local)}}function VGe(t,e,r){var n,i=r+"",a;return function(){var s=this.getAttribute(t);return s===i?null:s===n?a:a=e(n=s,r)}}function GGe(t,e,r){var n,i=r+"",a;return function(){var s=this.getAttributeNS(t.space,t.local);return s===i?null:s===n?a:a=e(n=s,r)}}function WGe(t,e,r){var n,i,a;return function(){var s,o=r(this),l;return o==null?void this.removeAttribute(t):(s=this.getAttribute(t),l=o+"",s===l?null:s===n&&l===i?a:(i=l,a=e(n=s,o)))}}function HGe(t,e,r){var n,i,a;return function(){var s,o=r(this),l;return o==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),l=o+"",s===l?null:s===n&&l===i?a:(i=l,a=e(n=s,o)))}}function qGe(t,e){var r=tR(t),n=r==="transform"?kGe:$ce;return this.attrTween(t,typeof e=="function"?(r.local?HGe:WGe)(r,n,Bz(this,"attr."+t,e)):e==null?(r.local?zGe:FGe)(r):(r.local?GGe:VGe)(r,n,e))}function UGe(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}function YGe(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}function XGe(t,e){var r,n;function i(){var a=e.apply(this,arguments);return a!==n&&(r=(n=a)&&YGe(t,a)),r}return i._value=e,i}function jGe(t,e){var r,n;function i(){var a=e.apply(this,arguments);return a!==n&&(r=(n=a)&&UGe(t,a)),r}return i._value=e,i}function KGe(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;var n=tR(t);return this.tween(r,(n.local?XGe:jGe)(n,e))}function ZGe(t,e){return function(){Pz(this,t).delay=+e.apply(this,arguments)}}function QGe(t,e){return e=+e,function(){Pz(this,t).delay=e}}function JGe(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?ZGe:QGe)(e,t)):dc(this.node(),e).delay}function eWe(t,e){return function(){ou(this,t).duration=+e.apply(this,arguments)}}function tWe(t,e){return e=+e,function(){ou(this,t).duration=e}}function rWe(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?eWe:tWe)(e,t)):dc(this.node(),e).duration}function nWe(t,e){if(typeof e!="function")throw new Error;return function(){ou(this,t).ease=e}}function iWe(t){var e=this._id;return arguments.length?this.each(nWe(e,t)):dc(this.node(),e).ease}function aWe(t,e){return function(){var r=e.apply(this,arguments);if(typeof r!="function")throw new Error;ou(this,t).ease=r}}function sWe(t){if(typeof t!="function")throw new Error;return this.each(aWe(this._id,t))}function oWe(t){typeof t!="function"&&(t=cce(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var a=e[i],s=a.length,o=n[i]=[],l,u=0;u<s;++u)(l=a[u])&&t.call(l,l.__data__,u,a)&&o.push(l);return new gh(n,this._parents,this._name,this._id)}function lWe(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,n=e.length,i=r.length,a=Math.min(n,i),s=new Array(n),o=0;o<a;++o)for(var l=e[o],u=r[o],h=l.length,d=s[o]=new Array(h),f,p=0;p<h;++p)(f=l[p]||u[p])&&(d[p]=f);for(;o<n;++o)s[o]=e[o];return new gh(s,this._parents,this._name,this._id)}function cWe(t){return(t+"").trim().split(/^|\s+/).every(function(e){var r=e.indexOf(".");return r>=0&&(e=e.slice(0,r)),!e||e==="start"})}function uWe(t,e,r){var n,i,a=cWe(e)?Pz:ou;return function(){var s=a(this,t),o=s.on;o!==n&&(i=(n=o).copy()).on(e,r),s.on=i}}function hWe(t,e){var r=this._id;return arguments.length<2?dc(this.node(),r).on.on(t):this.each(uWe(r,t,e))}function dWe(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function fWe(){return this.on("end.remove",dWe(this._id))}function pWe(t){var e=this._name,r=this._id;typeof t!="function"&&(t=Nz(t));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s<i;++s)for(var o=n[s],l=o.length,u=a[s]=new Array(l),h,d,f=0;f<l;++f)(h=o[f])&&(d=t.call(h,h.__data__,f,o))&&("__data__"in h&&(d.__data__=h.__data__),u[f]=d,aR(u[f],e,r,f,u,dc(h,r)));return new gh(a,this._parents,e,r)}function gWe(t){var e=this._name,r=this._id;typeof t!="function"&&(t=lce(t));for(var n=this._groups,i=n.length,a=[],s=[],o=0;o<i;++o)for(var l=n[o],u=l.length,h,d=0;d<u;++d)if(h=l[d]){for(var f=t.call(h,h.__data__,d,l),p,g=dc(h,r),m=0,y=f.length;m<y;++m)(p=f[m])&&aR(p,e,r,m,f,g);a.push(f),s.push(h)}return new gh(a,s,e,r)}var mWe=Xk.prototype.constructor;function yWe(){return new mWe(this._groups,this._parents)}function vWe(t,e){var r,n,i;return function(){var a=wb(this,t),s=(this.style.removeProperty(t),wb(this,t));return a===s?null:a===r&&s===n?i:i=e(r=a,n=s)}}function Pce(t){return function(){this.style.removeProperty(t)}}function bWe(t,e,r){var n,i=r+"",a;return function(){var s=wb(this,t);return s===i?null:s===n?a:a=e(n=s,r)}}function xWe(t,e,r){var n,i,a;return function(){var s=wb(this,t),o=r(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(t),wb(this,t))),s===l?null:s===n&&l===i?a:(i=l,a=e(n=s,o))}}function TWe(t,e){var r,n,i,a="style."+e,s="end."+a,o;return function(){var l=ou(this,t),u=l.on,h=l.value[a]==null?o||(o=Pce(e)):void 0;(u!==r||i!==h)&&(n=(r=u).copy()).on(s,i=h),l.on=n}}function wWe(t,e,r){var n=(t+="")=="transform"?CGe:$ce;return e==null?this.styleTween(t,vWe(t,n)).on("end.style."+t,Pce(t)):typeof e=="function"?this.styleTween(t,xWe(t,n,Bz(this,"style."+t,e))).each(TWe(this._id,t)):this.styleTween(t,bWe(t,n,e),r).on("end.style."+t,null)}function CWe(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}function kWe(t,e,r){var n,i;function a(){var s=e.apply(this,arguments);return s!==i&&(n=(i=s)&&CWe(t,s,r)),n}return a._value=e,a}function SWe(t,e,r){var n="style."+(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;return this.tween(n,kWe(t,e,r??""))}function EWe(t){return function(){this.textContent=t}}function AWe(t){return function(){var e=t(this);this.textContent=e??""}}function _We(t){return this.tween("text",typeof t=="function"?AWe(Bz(this,"text",t)):EWe(t==null?"":t+""))}function RWe(t){return function(e){this.textContent=t.call(this,e)}}function LWe(t){var e,r;function n(){var i=t.apply(this,arguments);return i!==r&&(e=(r=i)&&RWe(i)),e}return n._value=t,n}function MWe(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,LWe(t))}function IWe(){for(var t=this._name,e=this._id,r=Bce(),n=this._groups,i=n.length,a=0;a<i;++a)for(var s=n[a],o=s.length,l,u=0;u<o;++u)if(l=s[u]){var h=dc(l,e);aR(l,t,r,u,s,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new gh(n,this._parents,t,r)}function NWe(){var t,e,r=this,n=r._id,i=r.size();return new Promise(function(a,s){var o={value:s},l={value:function(){--i===0&&a()}};r.each(function(){var u=ou(this,n),h=u.on;h!==t&&(e=(t=h).copy(),e._.cancel.push(o),e._.interrupt.push(o),e._.end.push(l)),u.on=e}),i===0&&a()})}var DWe=0;function gh(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function Bce(){return++DWe}var _u=Xk.prototype;gh.prototype={constructor:gh,select:pWe,selectAll:gWe,selectChild:_u.selectChild,selectChildren:_u.selectChildren,filter:oWe,merge:lWe,selection:yWe,transition:IWe,call:_u.call,nodes:_u.nodes,node:_u.node,size:_u.size,empty:_u.empty,each:_u.each,on:hWe,attr:qGe,attrTween:KGe,style:wWe,styleTween:SWe,text:_We,textTween:MWe,remove:fWe,tween:BGe,delay:JGe,duration:rWe,ease:iWe,easeVarying:sWe,end:NWe,[Symbol.iterator]:_u[Symbol.iterator]};function OWe(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var $We={time:null,delay:0,duration:250,ease:OWe};function PWe(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}function BWe(t){var e,r;t instanceof gh?(e=t._id,t=t._name):(e=Bce(),(r=$We).time=$z(),t=t==null?null:t+"");for(var n=this._groups,i=n.length,a=0;a<i;++a)for(var s=n[a],o=s.length,l,u=0;u<o;++u)(l=s[u])&&aR(l,t,e,u,s,r||PWe(l,e));return new gh(n,this._parents,t,e)}Xk.prototype.interrupt=OGe;Xk.prototype.transition=BWe;const lO=Math.PI,cO=2*lO,sp=1e-6,FWe=cO-sp;function Fce(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}function zWe(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Fce;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;i<a;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}let VWe=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?Fce:zWe(e)}moveTo(e,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,r){this._append`L${this._x1=+e},${this._y1=+r}`}quadraticCurveTo(e,r,n,i){this._append`Q${+e},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(e,r,n,i,a,s){this._append`C${+e},${+r},${+n},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(e,r,n,i,a){if(e=+e,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,o=this._y1,l=n-e,u=i-r,h=s-e,d=o-r,f=h*h+d*d;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(f>sp)if(!(Math.abs(d*l-u*h)>sp)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let p=n-s,g=i-o,m=l*l+u*u,y=p*p+g*g,v=Math.sqrt(m),T=Math.sqrt(f),b=a*Math.tan((lO-Math.acos((m+f-y)/(2*v*T)))/2),w=b/T,C=b/v;Math.abs(w-1)>sp&&this._append`L${e+w*h},${r+w*d}`,this._append`A${a},${a},0,0,${+(d*p>h*g)},${this._x1=e+C*l},${this._y1=r+C*u}`}}arc(e,r,n,i,a,s){if(e=+e,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),l=n*Math.sin(i),u=e+o,h=r+l,d=1^s,f=s?i-a:a-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>sp||Math.abs(this._y1-h)>sp)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%cO+cO),f>FWe?this._append`A${n},${n},0,1,${d},${e-o},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=h}`:f>sp&&this._append`A${n},${n},0,${+(f>=lO)},${d},${this._x1=e+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function GWe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function fA(t,e){if(!isFinite(t)||t===0)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function kb(t){return t=fA(Math.abs(t)),t?t[1]:NaN}function WWe(t,e){return function(r,n){for(var i=r.length,a=[],s=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),a.push(r.substring(i-=o,i+o)),!((l+=o+1)>n));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function HWe(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var qWe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function pA(t){if(!(e=qWe.exec(t)))throw new Error("invalid format: "+t);var e;return new Fz({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]})}pA.prototype=Fz.prototype;function Fz(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+""}Fz.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 UWe(t){e:for(var e=t.length,r=1,n=-1,i;r<e;++r)switch(t[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+t[r])break e;n>0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var gA;function YWe(t,e){var r=fA(t,e);if(!r)return gA=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(gA=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+fA(t,Math.max(0,e+a-1))[0]}function Wj(t,e){var r=fA(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const Hj={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:GWe,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)=>Wj(t*100,e),r:Wj,s:YWe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function qj(t){return t}var Uj=Array.prototype.map,Yj=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function XWe(t){var e=t.grouping===void 0||t.thousands===void 0?qj:WWe(Uj.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?qj:HWe(Uj.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(d,f){d=pA(d);var p=d.fill,g=d.align,m=d.sign,y=d.symbol,v=d.zero,T=d.width,b=d.comma,w=d.precision,C=d.trim,S=d.type;S==="n"?(b=!0,S="g"):Hj[S]||(w===void 0&&(w=12),C=!0,S="g"),(v||p==="0"&&g==="=")&&(v=!0,p="0",g="=");var k=(f&&f.prefix!==void 0?f.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),E=(y==="$"?n:/[%p]/.test(S)?s:"")+(f&&f.suffix!==void 0?f.suffix:""),_=Hj[S],M=/[defgprs%]/.test(S);w=w===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function L(P){var D=k,R=E,I,$,O;if(S==="c")R=_(P)+R,P="";else{P=+P;var N=P<0||1/P<0;if(P=isNaN(P)?l:_(Math.abs(P),w),C&&(P=UWe(P)),N&&+P==0&&m!=="+"&&(N=!1),D=(N?m==="("?m:o:m==="-"||m==="("?"":m)+D,R=(S==="s"&&!isNaN(P)&&gA!==void 0?Yj[8+gA/3]:"")+R+(N&&m==="("?")":""),M){for(I=-1,$=P.length;++I<$;)if(O=P.charCodeAt(I),48>O||O>57){R=(O===46?i+P.slice(I+1):P.slice(I))+R,P=P.slice(0,I);break}}}b&&!v&&(P=e(P,1/0));var F=D.length+P.length+R.length,z=F<T?new Array(T-F+1).join(p):"";switch(b&&v&&(P=e(z+P,z.length?T-R.length:1/0),z=""),g){case"<":P=D+P+R+z;break;case"=":P=D+z+P+R;break;case"^":P=z.slice(0,F=z.length>>1)+D+P+R+z.slice(F);break;default:P=z+D+P+R;break}return a(P)}return L.toString=function(){return d+""},L}function h(d,f){var p=Math.max(-8,Math.min(8,Math.floor(kb(f)/3)))*3,g=Math.pow(10,-p),m=u((d=pA(d),d.type="f",d),{suffix:Yj[8+p/3]});return function(y){return m(g*y)}}return{format:u,formatPrefix:h}}var TE,Cp,zce;jWe({thousands:",",grouping:[3],currency:["$",""]});function jWe(t){return TE=XWe(t),Cp=TE.format,zce=TE.formatPrefix,TE}function KWe(t){return Math.max(0,-kb(Math.abs(t)))}function ZWe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(kb(e)/3)))*3-kb(Math.abs(t)))}function QWe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,kb(e)-kb(t))+1}function JWe(t){var e=0,r=t.children,n=r&&r.length;if(!n)e=1;else for(;--n>=0;)e+=r[n].value;t.value=e}function eHe(){return this.eachAfter(JWe)}function tHe(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function rHe(t,e){for(var r=this,n=[r],i,a,s=-1;r=n.pop();)if(t.call(e,r,++s,this),i=r.children)for(a=i.length-1;a>=0;--a)n.push(i[a]);return this}function nHe(t,e){for(var r=this,n=[r],i=[],a,s,o,l=-1;r=n.pop();)if(i.push(r),a=r.children)for(s=0,o=a.length;s<o;++s)n.push(a[s]);for(;r=i.pop();)t.call(e,r,++l,this);return this}function iHe(t,e){let r=-1;for(const n of this)if(t.call(e,n,++r,this))return n}function aHe(t){return this.eachAfter(function(e){for(var r=+t(e.data)||0,n=e.children,i=n&&n.length;--i>=0;)r+=n[i].value;e.value=r})}function sHe(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function oHe(t){for(var e=this,r=lHe(e,t),n=[e];e!==r;)e=e.parent,n.push(e);for(var i=n.length;t!==r;)n.splice(i,0,t),t=t.parent;return n}function lHe(t,e){if(t===e)return t;var r=t.ancestors(),n=e.ancestors(),i=null;for(t=r.pop(),e=n.pop();t===e;)i=t,t=r.pop(),e=n.pop();return i}function cHe(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function uHe(){return Array.from(this)}function hHe(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function dHe(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*fHe(){var t=this,e,r=[t],n,i,a;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,n=t.children)for(i=0,a=n.length;i<a;++i)r.push(n[i]);while(r.length)}function zz(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=mHe)):e===void 0&&(e=gHe);for(var r=new mA(t),n,i=[r],a,s,o,l;n=i.pop();)if((s=e(n.data))&&(l=(s=Array.from(s)).length))for(n.children=s,o=l-1;o>=0;--o)i.push(a=s[o]=new mA(s[o])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(vHe)}function pHe(){return zz(this).eachBefore(yHe)}function gHe(t){return t.children}function mHe(t){return Array.isArray(t)?t[1]:null}function yHe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function vHe(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function mA(t){this.data=t,this.depth=this.height=0,this.parent=null}mA.prototype=zz.prototype={constructor:mA,count:eHe,each:tHe,eachAfter:nHe,eachBefore:rHe,find:iHe,sum:aHe,sort:sHe,path:oHe,ancestors:cHe,descendants:uHe,leaves:hHe,links:dHe,copy:pHe,[Symbol.iterator]:fHe};function bHe(t){if(typeof t!="function")throw new Error;return t}function tT(){return 0}function rT(t){return function(){return t}}function xHe(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function THe(t,e,r,n,i){for(var a=t.children,s,o=-1,l=a.length,u=t.value&&(n-e)/t.value;++o<l;)s=a[o],s.y0=r,s.y1=i,s.x0=e,s.x1=e+=s.value*u}function wHe(t,e,r,n,i){for(var a=t.children,s,o=-1,l=a.length,u=t.value&&(i-r)/t.value;++o<l;)s=a[o],s.x0=e,s.x1=n,s.y0=r,s.y1=r+=s.value*u}var CHe=(1+Math.sqrt(5))/2;function kHe(t,e,r,n,i,a){for(var s=[],o=e.children,l,u,h=0,d=0,f=o.length,p,g,m=e.value,y,v,T,b,w,C,S;h<f;){p=i-r,g=a-n;do y=o[d++].value;while(!y&&d<f);for(v=T=y,C=Math.max(g/p,p/g)/(m*t),S=y*y*C,w=Math.max(T/S,S/v);d<f;++d){if(y+=u=o[d].value,u<v&&(v=u),u>T&&(T=u),S=y*y*C,b=Math.max(T/S,S/v),b>w){y-=u;break}w=b}s.push(l={value:y,dice:p<g,children:o.slice(h,d)}),l.dice?THe(l,r,n,i,m?n+=g*y/m:a):wHe(l,r,n,m?r+=p*y/m:i,a),m-=y,h=d}return s}const SHe=(function t(e){function r(n,i,a,s,o){kHe(e,n,i,a,s,o)}return r.ratio=function(n){return t((n=+n)>1?n:1)},r})(CHe);function EHe(){var t=SHe,e=!1,r=1,n=1,i=[0],a=tT,s=tT,o=tT,l=tT,u=tT;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(xHe),f}function d(f){var p=i[f.depth],g=f.x0+p,m=f.y0+p,y=f.x1-p,v=f.y1-p;y<g&&(g=y=(g+y)/2),v<m&&(m=v=(m+v)/2),f.x0=g,f.y0=m,f.x1=y,f.y1=v,f.children&&(p=i[f.depth+1]=a(f)/2,g+=u(f)-p,m+=s(f)-p,y-=o(f)-p,v-=l(f)-p,y<g&&(g=y=(g+y)/2),v<m&&(m=v=(m+v)/2),t(f,g,m,y,v))}return h.round=function(f){return arguments.length?(e=!!f,h):e},h.size=function(f){return arguments.length?(r=+f[0],n=+f[1],h):[r,n]},h.tile=function(f){return arguments.length?(t=bHe(f),h):t},h.padding=function(f){return arguments.length?h.paddingInner(f).paddingOuter(f):h.paddingInner()},h.paddingInner=function(f){return arguments.length?(a=typeof f=="function"?f:rT(+f),h):a},h.paddingOuter=function(f){return arguments.length?h.paddingTop(f).paddingRight(f).paddingBottom(f).paddingLeft(f):h.paddingTop()},h.paddingTop=function(f){return arguments.length?(s=typeof f=="function"?f:rT(+f),h):s},h.paddingRight=function(f){return arguments.length?(o=typeof f=="function"?f:rT(+f),h):o},h.paddingBottom=function(f){return arguments.length?(l=typeof f=="function"?f:rT(+f),h):l},h.paddingLeft=function(f){return arguments.length?(u=typeof f=="function"?f:rT(+f),h):u},h}function sR(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const Xj=Symbol("implicit");function h0(){var t=new Sj,e=[],r=[],n=Xj;function i(a){let s=t.get(a);if(s===void 0){if(n!==Xj)return n;t.set(a,s=e.push(a)-1)}return r[s%r.length]}return i.domain=function(a){if(!arguments.length)return e.slice();e=[],t=new Sj;for(const s of a)t.has(s)||t.set(s,e.push(s)-1);return i},i.range=function(a){return arguments.length?(r=Array.from(a),i):r.slice()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return h0(e,r).unknown(n)},sR.apply(i,arguments),i}function uO(){var t=h0().unknown(void 0),e=t.domain,r=t.range,n=0,i=1,a,s,o=!1,l=0,u=0,h=.5;delete t.unknown;function d(){var f=e().length,p=i<n,g=p?i:n,m=p?n:i;a=(m-g)/Math.max(1,f-l+u*2),o&&(a=Math.floor(a)),g+=(m-g-a*(f-l))*h,s=a*(1-l),o&&(g=Math.round(g),s=Math.round(s));var y=ize(f).map(function(v){return g+a*v});return r(p?y.reverse():y)}return t.domain=function(f){return arguments.length?(e(f),d()):e()},t.range=function(f){return arguments.length?([n,i]=f,n=+n,i=+i,d()):[n,i]},t.rangeRound=function(f){return[n,i]=f,n=+n,i=+i,o=!0,d()},t.bandwidth=function(){return s},t.step=function(){return a},t.round=function(f){return arguments.length?(o=!!f,d()):o},t.padding=function(f){return arguments.length?(l=Math.min(1,u=+f),d()):l},t.paddingInner=function(f){return arguments.length?(l=Math.min(1,f),d()):l},t.paddingOuter=function(f){return arguments.length?(u=+f,d()):u},t.align=function(f){return arguments.length?(h=Math.max(0,Math.min(1,f)),d()):h},t.copy=function(){return uO(e(),[n,i]).round(o).paddingInner(l).paddingOuter(u).align(h)},sR.apply(d(),arguments)}function AHe(t){return function(){return t}}function _He(t){return+t}var jj=[0,1];function Wm(t){return t}function hO(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:AHe(isNaN(e)?NaN:.5)}function RHe(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function LHe(t,e,r){var n=t[0],i=t[1],a=e[0],s=e[1];return i<n?(n=hO(i,n),a=r(s,a)):(n=hO(n,i),a=r(a,s)),function(o){return a(n(o))}}function MHe(t,e,r){var n=Math.min(t.length,e.length)-1,i=new Array(n),a=new Array(n),s=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<n;)i[s]=hO(t[s],t[s+1]),a[s]=r(e[s],e[s+1]);return function(o){var l=XFe(t,o,1,n)-1;return a[l](i[l](o))}}function Vce(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function IHe(){var t=jj,e=jj,r=Oz,n,i,a,s=Wm,o,l,u;function h(){var f=Math.min(t.length,e.length);return s!==Wm&&(s=RHe(t[0],t[f-1])),o=f>2?MHe:LHe,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?a:(l||(l=o(t.map(n),e,r)))(n(s(f)))}return d.invert=function(f){return s(i((u||(u=o(e,t.map(n),Bl)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,_He),h()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),h()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),r=xGe,h()},d.clamp=function(f){return arguments.length?(s=f?!0:Wm,h()):s!==Wm},d.interpolate=function(f){return arguments.length?(r=f,h()):r},d.unknown=function(f){return arguments.length?(a=f,d):a},function(f,p){return n=f,i=p,h()}}function Gce(){return IHe()(Wm,Wm)}function NHe(t,e,r,n){var i=QD(t,e,r),a;switch(n=pA(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=ZWe(i,s))&&(n.precision=a),zce(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=QWe(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=KWe(i))&&(n.precision=a-(n.type==="%")*2);break}}return Cp(n)}function DHe(t){var e=t.domain;return t.ticks=function(r){var n=e();return tze(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return NHe(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,a=n.length-1,s=n[i],o=n[a],l,u,h=10;for(o<s&&(u=s,s=o,o=u,u=i,i=a,a=u);h-- >0;){if(u=ZD(s,o,r),u===l)return n[i]=s,n[a]=o,e(n);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;l=u}return t},t}function Sb(){var t=Gce();return t.copy=function(){return Vce(t,Sb())},sR.apply(t,arguments),DHe(t)}function OHe(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],s;return a<i&&(s=r,r=n,n=s,s=i,i=a,a=s),t[r]=e.floor(i),t[n]=e.ceil(a),t}const $M=new Date,PM=new Date;function ua(t,e,r,n){function i(a){return t(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const s=i(a),o=i.ceil(a);return a-s<o-a?s:o},i.offset=(a,s)=>(e(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,o)=>{const l=[];if(a=i.ceil(a),o=o==null?1:Math.floor(o),!(a<s)||!(o>0))return l;let u;do l.push(u=new Date(+a)),e(a,o),t(a);while(u<a&&a<s);return l},i.filter=a=>ua(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;e(s,-1),!a(s););else for(;--o>=0;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>($M.setTime(+a),PM.setTime(+s),t($M),t(PM),Math.floor(r($M,PM))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const Eb=ua(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Eb.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?ua(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):Eb);Eb.range;const Qu=1e3,hl=Qu*60,Ju=hl*60,mh=Ju*24,Vz=mh*7,Kj=mh*30,BM=mh*365,_d=ua(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Qu)},(t,e)=>(e-t)/Qu,t=>t.getUTCSeconds());_d.range;const _C=ua(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Qu)},(t,e)=>{t.setTime(+t+e*hl)},(t,e)=>(e-t)/hl,t=>t.getMinutes());_C.range;const $He=ua(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*hl)},(t,e)=>(e-t)/hl,t=>t.getUTCMinutes());$He.range;const RC=ua(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Qu-t.getMinutes()*hl)},(t,e)=>{t.setTime(+t+e*Ju)},(t,e)=>(e-t)/Ju,t=>t.getHours());RC.range;const PHe=ua(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Ju)},(t,e)=>(e-t)/Ju,t=>t.getUTCHours());PHe.range;const L0=ua(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*hl)/mh,t=>t.getDate()-1);L0.range;const Gz=ua(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/mh,t=>t.getUTCDate()-1);Gz.range;const BHe=ua(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/mh,t=>Math.floor(t/mh));BHe.range;function rg(t){return ua(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*hl)/Vz)}const Kk=rg(0),LC=rg(1),Wce=rg(2),Hce=rg(3),M0=rg(4),qce=rg(5),Uce=rg(6);Kk.range;LC.range;Wce.range;Hce.range;M0.range;qce.range;Uce.range;function ng(t){return ua(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/Vz)}const Yce=ng(0),yA=ng(1),FHe=ng(2),zHe=ng(3),Ab=ng(4),VHe=ng(5),GHe=ng(6);Yce.range;yA.range;FHe.range;zHe.range;Ab.range;VHe.range;GHe.range;const MC=ua(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());MC.range;const WHe=ua(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());WHe.range;const yh=ua(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());yh.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ua(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});yh.range;const I0=ua(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());I0.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ua(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});I0.range;function HHe(t,e,r,n,i,a){const s=[[_d,1,Qu],[_d,5,5*Qu],[_d,15,15*Qu],[_d,30,30*Qu],[a,1,hl],[a,5,5*hl],[a,15,15*hl],[a,30,30*hl],[i,1,Ju],[i,3,3*Ju],[i,6,6*Ju],[i,12,12*Ju],[n,1,mh],[n,2,2*mh],[r,1,Vz],[e,1,Kj],[e,3,3*Kj],[t,1,BM]];function o(u,h,d){const f=h<u;f&&([u,h]=[h,u]);const p=d&&typeof d.range=="function"?d:l(u,h,d),g=p?p.range(u,+h+1):[];return f?g.reverse():g}function l(u,h,d){const f=Math.abs(h-u)/d,p=Iz(([,,y])=>y).right(s,f);if(p===s.length)return t.every(QD(u/BM,h/BM,d));if(p===0)return Eb.every(Math.max(QD(u,h,d),1));const[g,m]=s[f/s[p-1][2]<s[p][2]/f?p-1:p];return g.every(m)}return[o,l]}const[qHe,UHe]=HHe(yh,MC,Kk,L0,RC,_C);function FM(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 zM(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 nT(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function YHe(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,a=t.days,s=t.shortDays,o=t.months,l=t.shortMonths,u=iT(i),h=aT(i),d=iT(a),f=aT(a),p=iT(s),g=aT(s),m=iT(o),y=aT(o),v=iT(l),T=aT(l),b={a:O,A:N,b:F,B:z,c:null,d:rK,e:rK,f:mqe,g:Eqe,G:_qe,H:fqe,I:pqe,j:gqe,L:Xce,m:yqe,M:vqe,p:V,q:B,Q:aK,s:sK,S:bqe,u:xqe,U:Tqe,V:wqe,w:Cqe,W:kqe,x:null,X:null,y:Sqe,Y:Aqe,Z:Rqe,"%":iK},w={a:G,A:H,b:q,B:Z,c:null,d:nK,e:nK,f:Nqe,g:Wqe,G:qqe,H:Lqe,I:Mqe,j:Iqe,L:Kce,m:Dqe,M:Oqe,p:Y,q:ie,Q:aK,s:sK,S:$qe,u:Pqe,U:Bqe,V:Fqe,w:zqe,W:Vqe,x:null,X:null,y:Gqe,Y:Hqe,Z:Uqe,"%":iK},C={a:M,A:L,b:P,B:D,c:R,d:eK,e:eK,f:cqe,g:Jj,G:Qj,H:tK,I:tK,j:aqe,L:lqe,m:iqe,M:sqe,p:_,q:nqe,Q:hqe,s:dqe,S:oqe,u:QHe,U:JHe,V:eqe,w:ZHe,W:tqe,x:I,X:$,y:Jj,Y:Qj,Z:rqe,"%":uqe};b.x=S(r,b),b.X=S(n,b),b.c=S(e,b),w.x=S(r,w),w.X=S(n,w),w.c=S(e,w);function S(K,Q){return function(te){var J=[],ge=-1,ee=0,Re=K.length,Ie,Be,ce;for(te instanceof Date||(te=new Date(+te));++ge<Re;)K.charCodeAt(ge)===37&&(J.push(K.slice(ee,ge)),(Be=Zj[Ie=K.charAt(++ge)])!=null?Ie=K.charAt(++ge):Be=Ie==="e"?" ":"0",(ce=Q[Ie])&&(Ie=ce(te,Be)),J.push(Ie),ee=ge+1);return J.push(K.slice(ee,ge)),J.join("")}}function k(K,Q){return function(te){var J=nT(1900,void 0,1),ge=E(J,K,te+="",0),ee,Re;if(ge!=te.length)return null;if("Q"in J)return new Date(J.Q);if("s"in J)return new Date(J.s*1e3+("L"in J?J.L:0));if(Q&&!("Z"in J)&&(J.Z=0),"p"in J&&(J.H=J.H%12+J.p*12),J.m===void 0&&(J.m="q"in J?J.q:0),"V"in J){if(J.V<1||J.V>53)return null;"w"in J||(J.w=1),"Z"in J?(ee=zM(nT(J.y,0,1)),Re=ee.getUTCDay(),ee=Re>4||Re===0?yA.ceil(ee):yA(ee),ee=Gz.offset(ee,(J.V-1)*7),J.y=ee.getUTCFullYear(),J.m=ee.getUTCMonth(),J.d=ee.getUTCDate()+(J.w+6)%7):(ee=FM(nT(J.y,0,1)),Re=ee.getDay(),ee=Re>4||Re===0?LC.ceil(ee):LC(ee),ee=L0.offset(ee,(J.V-1)*7),J.y=ee.getFullYear(),J.m=ee.getMonth(),J.d=ee.getDate()+(J.w+6)%7)}else("W"in J||"U"in J)&&("w"in J||(J.w="u"in J?J.u%7:"W"in J?1:0),Re="Z"in J?zM(nT(J.y,0,1)).getUTCDay():FM(nT(J.y,0,1)).getDay(),J.m=0,J.d="W"in J?(J.w+6)%7+J.W*7-(Re+5)%7:J.w+J.U*7-(Re+6)%7);return"Z"in J?(J.H+=J.Z/100|0,J.M+=J.Z%100,zM(J)):FM(J)}}function E(K,Q,te,J){for(var ge=0,ee=Q.length,Re=te.length,Ie,Be;ge<ee;){if(J>=Re)return-1;if(Ie=Q.charCodeAt(ge++),Ie===37){if(Ie=Q.charAt(ge++),Be=C[Ie in Zj?Q.charAt(ge++):Ie],!Be||(J=Be(K,te,J))<0)return-1}else if(Ie!=te.charCodeAt(J++))return-1}return J}function _(K,Q,te){var J=u.exec(Q.slice(te));return J?(K.p=h.get(J[0].toLowerCase()),te+J[0].length):-1}function M(K,Q,te){var J=p.exec(Q.slice(te));return J?(K.w=g.get(J[0].toLowerCase()),te+J[0].length):-1}function L(K,Q,te){var J=d.exec(Q.slice(te));return J?(K.w=f.get(J[0].toLowerCase()),te+J[0].length):-1}function P(K,Q,te){var J=v.exec(Q.slice(te));return J?(K.m=T.get(J[0].toLowerCase()),te+J[0].length):-1}function D(K,Q,te){var J=m.exec(Q.slice(te));return J?(K.m=y.get(J[0].toLowerCase()),te+J[0].length):-1}function R(K,Q,te){return E(K,e,Q,te)}function I(K,Q,te){return E(K,r,Q,te)}function $(K,Q,te){return E(K,n,Q,te)}function O(K){return s[K.getDay()]}function N(K){return a[K.getDay()]}function F(K){return l[K.getMonth()]}function z(K){return o[K.getMonth()]}function V(K){return i[+(K.getHours()>=12)]}function B(K){return 1+~~(K.getMonth()/3)}function G(K){return s[K.getUTCDay()]}function H(K){return a[K.getUTCDay()]}function q(K){return l[K.getUTCMonth()]}function Z(K){return o[K.getUTCMonth()]}function Y(K){return i[+(K.getUTCHours()>=12)]}function ie(K){return 1+~~(K.getUTCMonth()/3)}return{format:function(K){var Q=S(K+="",b);return Q.toString=function(){return K},Q},parse:function(K){var Q=k(K+="",!1);return Q.toString=function(){return K},Q},utcFormat:function(K){var Q=S(K+="",w);return Q.toString=function(){return K},Q},utcParse:function(K){var Q=k(K+="",!0);return Q.toString=function(){return K},Q}}}var Zj={"-":"",_:" ",0:"0"},_a=/^\s*\d+/,XHe=/^%/,jHe=/[\\^$*+?|[\]().{}]/g;function fn(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function KHe(t){return t.replace(jHe,"\\$&")}function iT(t){return new RegExp("^(?:"+t.map(KHe).join("|")+")","i")}function aT(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function ZHe(t,e,r){var n=_a.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function QHe(t,e,r){var n=_a.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function JHe(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function eqe(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function tqe(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function Qj(t,e,r){var n=_a.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Jj(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function rqe(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function nqe(t,e,r){var n=_a.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function iqe(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function eK(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function aqe(t,e,r){var n=_a.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function tK(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function sqe(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function oqe(t,e,r){var n=_a.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function lqe(t,e,r){var n=_a.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function cqe(t,e,r){var n=_a.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function uqe(t,e,r){var n=XHe.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function hqe(t,e,r){var n=_a.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function dqe(t,e,r){var n=_a.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function rK(t,e){return fn(t.getDate(),e,2)}function fqe(t,e){return fn(t.getHours(),e,2)}function pqe(t,e){return fn(t.getHours()%12||12,e,2)}function gqe(t,e){return fn(1+L0.count(yh(t),t),e,3)}function Xce(t,e){return fn(t.getMilliseconds(),e,3)}function mqe(t,e){return Xce(t,e)+"000"}function yqe(t,e){return fn(t.getMonth()+1,e,2)}function vqe(t,e){return fn(t.getMinutes(),e,2)}function bqe(t,e){return fn(t.getSeconds(),e,2)}function xqe(t){var e=t.getDay();return e===0?7:e}function Tqe(t,e){return fn(Kk.count(yh(t)-1,t),e,2)}function jce(t){var e=t.getDay();return e>=4||e===0?M0(t):M0.ceil(t)}function wqe(t,e){return t=jce(t),fn(M0.count(yh(t),t)+(yh(t).getDay()===4),e,2)}function Cqe(t){return t.getDay()}function kqe(t,e){return fn(LC.count(yh(t)-1,t),e,2)}function Sqe(t,e){return fn(t.getFullYear()%100,e,2)}function Eqe(t,e){return t=jce(t),fn(t.getFullYear()%100,e,2)}function Aqe(t,e){return fn(t.getFullYear()%1e4,e,4)}function _qe(t,e){var r=t.getDay();return t=r>=4||r===0?M0(t):M0.ceil(t),fn(t.getFullYear()%1e4,e,4)}function Rqe(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+fn(e/60|0,"0",2)+fn(e%60,"0",2)}function nK(t,e){return fn(t.getUTCDate(),e,2)}function Lqe(t,e){return fn(t.getUTCHours(),e,2)}function Mqe(t,e){return fn(t.getUTCHours()%12||12,e,2)}function Iqe(t,e){return fn(1+Gz.count(I0(t),t),e,3)}function Kce(t,e){return fn(t.getUTCMilliseconds(),e,3)}function Nqe(t,e){return Kce(t,e)+"000"}function Dqe(t,e){return fn(t.getUTCMonth()+1,e,2)}function Oqe(t,e){return fn(t.getUTCMinutes(),e,2)}function $qe(t,e){return fn(t.getUTCSeconds(),e,2)}function Pqe(t){var e=t.getUTCDay();return e===0?7:e}function Bqe(t,e){return fn(Yce.count(I0(t)-1,t),e,2)}function Zce(t){var e=t.getUTCDay();return e>=4||e===0?Ab(t):Ab.ceil(t)}function Fqe(t,e){return t=Zce(t),fn(Ab.count(I0(t),t)+(I0(t).getUTCDay()===4),e,2)}function zqe(t){return t.getUTCDay()}function Vqe(t,e){return fn(yA.count(I0(t)-1,t),e,2)}function Gqe(t,e){return fn(t.getUTCFullYear()%100,e,2)}function Wqe(t,e){return t=Zce(t),fn(t.getUTCFullYear()%100,e,2)}function Hqe(t,e){return fn(t.getUTCFullYear()%1e4,e,4)}function qqe(t,e){var r=t.getUTCDay();return t=r>=4||r===0?Ab(t):Ab.ceil(t),fn(t.getUTCFullYear()%1e4,e,4)}function Uqe(){return"+0000"}function iK(){return"%"}function aK(t){return+t}function sK(t){return Math.floor(+t/1e3)}var Hg,vA;Yqe({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 Yqe(t){return Hg=YHe(t),vA=Hg.format,Hg.parse,Hg.utcFormat,Hg.utcParse,Hg}function Xqe(t){return new Date(t)}function jqe(t){return t instanceof Date?+t:+new Date(+t)}function Qce(t,e,r,n,i,a,s,o,l,u){var h=Gce(),d=h.invert,f=h.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),T=u("%b %d"),b=u("%B"),w=u("%Y");function C(S){return(l(S)<S?p:o(S)<S?g:s(S)<S?m:a(S)<S?y:n(S)<S?i(S)<S?v:T:r(S)<S?b:w)(S)}return h.invert=function(S){return new Date(d(S))},h.domain=function(S){return arguments.length?f(Array.from(S,jqe)):f().map(Xqe)},h.ticks=function(S){var k=f();return t(k[0],k[k.length-1],S??10)},h.tickFormat=function(S,k){return k==null?C:u(k)},h.nice=function(S){var k=f();return(!S||typeof S.range!="function")&&(S=e(k[0],k[k.length-1],S??10)),S?f(OHe(k,S)):h},h.copy=function(){return Vce(h,Qce(t,e,r,n,i,a,s,o,l,u))},h}function Kqe(){return sR.apply(Qce(qHe,UHe,yh,MC,Kk,L0,RC,_C,_d,vA).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Zqe(t){for(var e=t.length/6|0,r=new Array(e),n=0;n<e;)r[n]="#"+t.slice(n*6,++n*6);return r}const Qqe=Zqe("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function Mi(t){return function(){return t}}const oK=Math.abs,is=Math.atan2,Wf=Math.cos,Jqe=Math.max,VM=Math.min,mc=Math.sin,Hm=Math.sqrt,ls=1e-12,IC=Math.PI,bA=IC/2,Y4=2*IC;function eUe(t){return t>1?0:t<-1?IC:Math.acos(t)}function lK(t){return t>=1?bA:t<=-1?-bA:Math.asin(t)}function Jce(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new VWe(e)}function tUe(t){return t.innerRadius}function rUe(t){return t.outerRadius}function nUe(t){return t.startAngle}function iUe(t){return t.endAngle}function aUe(t){return t&&t.padAngle}function sUe(t,e,r,n,i,a,s,o){var l=r-t,u=n-e,h=s-i,d=o-a,f=d*l-h*u;if(!(f*f<ls))return f=(h*(e-a)-d*(t-i))/f,[t+f*l,e+f*u]}function wE(t,e,r,n,i,a,s){var o=t-r,l=e-n,u=(s?a:-a)/Hm(o*o+l*l),h=u*l,d=-u*o,f=t+h,p=e+d,g=r+h,m=n+d,y=(f+g)/2,v=(p+m)/2,T=g-f,b=m-p,w=T*T+b*b,C=i-a,S=f*m-g*p,k=(b<0?-1:1)*Hm(Jqe(0,C*C*w-S*S)),E=(S*b-T*k)/w,_=(-S*T-b*k)/w,M=(S*b+T*k)/w,L=(-S*T+b*k)/w,P=E-y,D=_-v,R=M-y,I=L-v;return P*P+D*D>R*R+I*I&&(E=M,_=L),{cx:E,cy:_,x01:-h,y01:-d,x11:E*(i/C-1),y11:_*(i/C-1)}}function _b(){var t=tUe,e=rUe,r=Mi(0),n=null,i=nUe,a=iUe,s=aUe,o=null,l=Jce(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-bA,m=a.apply(this,arguments)-bA,y=oK(m-g),v=m>g;if(o||(o=h=l()),p<f&&(d=p,p=f,f=d),!(p>ls))o.moveTo(0,0);else if(y>Y4-ls)o.moveTo(p*Wf(g),p*mc(g)),o.arc(0,0,p,g,m,!v),f>ls&&(o.moveTo(f*Wf(m),f*mc(m)),o.arc(0,0,f,m,g,v));else{var T=g,b=m,w=g,C=m,S=y,k=y,E=s.apply(this,arguments)/2,_=E>ls&&(n?+n.apply(this,arguments):Hm(f*f+p*p)),M=VM(oK(p-f)/2,+r.apply(this,arguments)),L=M,P=M,D,R;if(_>ls){var I=lK(_/f*mc(E)),$=lK(_/p*mc(E));(S-=I*2)>ls?(I*=v?1:-1,w+=I,C-=I):(S=0,w=C=(g+m)/2),(k-=$*2)>ls?($*=v?1:-1,T+=$,b-=$):(k=0,T=b=(g+m)/2)}var O=p*Wf(T),N=p*mc(T),F=f*Wf(C),z=f*mc(C);if(M>ls){var V=p*Wf(b),B=p*mc(b),G=f*Wf(w),H=f*mc(w),q;if(y<IC)if(q=sUe(O,N,G,H,V,B,F,z)){var Z=O-q[0],Y=N-q[1],ie=V-q[0],K=B-q[1],Q=1/mc(eUe((Z*ie+Y*K)/(Hm(Z*Z+Y*Y)*Hm(ie*ie+K*K)))/2),te=Hm(q[0]*q[0]+q[1]*q[1]);L=VM(M,(f-te)/(Q-1)),P=VM(M,(p-te)/(Q+1))}else L=P=0}k>ls?P>ls?(D=wE(G,H,O,N,p,P,v),R=wE(V,B,F,z,p,P,v),o.moveTo(D.cx+D.x01,D.cy+D.y01),P<M?o.arc(D.cx,D.cy,P,is(D.y01,D.x01),is(R.y01,R.x01),!v):(o.arc(D.cx,D.cy,P,is(D.y01,D.x01),is(D.y11,D.x11),!v),o.arc(0,0,p,is(D.cy+D.y11,D.cx+D.x11),is(R.cy+R.y11,R.cx+R.x11),!v),o.arc(R.cx,R.cy,P,is(R.y11,R.x11),is(R.y01,R.x01),!v))):(o.moveTo(O,N),o.arc(0,0,p,T,b,!v)):o.moveTo(O,N),!(f>ls)||!(S>ls)?o.lineTo(F,z):L>ls?(D=wE(F,z,V,B,f,-L,v),R=wE(O,N,G,H,f,-L,v),o.lineTo(D.cx+D.x01,D.cy+D.y01),L<M?o.arc(D.cx,D.cy,L,is(D.y01,D.x01),is(R.y01,R.x01),!v):(o.arc(D.cx,D.cy,L,is(D.y01,D.x01),is(D.y11,D.x11),!v),o.arc(0,0,f,is(D.cy+D.y11,D.cx+D.x11),is(R.cy+R.y11,R.cx+R.x11),v),o.arc(R.cx,R.cy,L,is(R.y11,R.x11),is(R.y01,R.x01),!v))):o.arc(0,0,f,C,w,v)}if(o.closePath(),h)return o=null,h+""||null}return u.centroid=function(){var h=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-IC/2;return[Wf(d)*h,mc(d)*h]},u.innerRadius=function(h){return arguments.length?(t=typeof h=="function"?h:Mi(+h),u):t},u.outerRadius=function(h){return arguments.length?(e=typeof h=="function"?h:Mi(+h),u):e},u.cornerRadius=function(h){return arguments.length?(r=typeof h=="function"?h:Mi(+h),u):r},u.padRadius=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:Mi(+h),u):n},u.startAngle=function(h){return arguments.length?(i=typeof h=="function"?h:Mi(+h),u):i},u.endAngle=function(h){return arguments.length?(a=typeof h=="function"?h:Mi(+h),u):a},u.padAngle=function(h){return arguments.length?(s=typeof h=="function"?h:Mi(+h),u):s},u.context=function(h){return arguments.length?(o=h??null,u):o},u}function eue(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function tue(t){this._context=t}tue.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 Pw(t){return new tue(t)}function oUe(t){return t[0]}function lUe(t){return t[1]}function NC(t,e){var r=Mi(!0),n=null,i=Pw,a=null,s=Jce(o);t=typeof t=="function"?t:t===void 0?oUe:Mi(t),e=typeof e=="function"?e:e===void 0?lUe:Mi(e);function o(l){var u,h=(l=eue(l)).length,d,f=!1,p;for(n==null&&(a=i(p=s())),u=0;u<=h;++u)!(u<h&&r(d=l[u],u,l))===f&&((f=!f)?a.lineStart():a.lineEnd()),f&&a.point(+t(d,u,l),+e(d,u,l));if(p)return a=null,p+""||null}return o.x=function(l){return arguments.length?(t=typeof l=="function"?l:Mi(+l),o):t},o.y=function(l){return arguments.length?(e=typeof l=="function"?l:Mi(+l),o):e},o.defined=function(l){return arguments.length?(r=typeof l=="function"?l:Mi(!!l),o):r},o.curve=function(l){return arguments.length?(i=l,n!=null&&(a=i(n)),o):i},o.context=function(l){return arguments.length?(l==null?n=a=null:a=i(n=l),o):n},o}function cUe(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function uUe(t){return t}function hUe(){var t=uUe,e=cUe,r=null,n=Mi(0),i=Mi(Y4),a=Mi(0);function s(o){var l,u=(o=eue(o)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),y=Math.min(Y4,Math.max(-Y4,i.apply(this,arguments)-m)),v,T=Math.min(Math.abs(y)/u,a.apply(this,arguments)),b=T*(y<0?-1:1),w;for(l=0;l<u;++l)(w=g[p[l]=l]=+t(o[l],l,o))>0&&(f+=w);for(e!=null?p.sort(function(C,S){return e(g[C],g[S])}):r!=null&&p.sort(function(C,S){return r(o[C],o[S])}),l=0,d=f?(y-u*b)/f:0;l<u;++l,m=v)h=p[l],w=g[h],v=m+(w>0?w*d:0)+b,g[h]={data:o[h],index:l,value:w,startAngle:m,endAngle:v,padAngle:T};return g}return s.value=function(o){return arguments.length?(t=typeof o=="function"?o:Mi(+o),s):t},s.sortValues=function(o){return arguments.length?(e=o,r=null,s):e},s.sort=function(o){return arguments.length?(r=o,e=null,s):r},s.startAngle=function(o){return arguments.length?(n=typeof o=="function"?o:Mi(+o),s):n},s.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:Mi(+o),s):i},s.padAngle=function(o){return arguments.length?(a=typeof o=="function"?o:Mi(+o),s):a},s}class rue{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function nue(t){return new rue(t,!0)}function iue(t){return new rue(t,!1)}function Jd(){}function xA(t,e,r){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+r)/6)}function oR(t){this._context=t}oR.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:xA(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:xA(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function DC(t){return new oR(t)}function aue(t){this._context=t}aue.prototype={areaStart:Jd,areaEnd:Jd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:xA(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function dUe(t){return new aue(t)}function sue(t){this._context=t}sue.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(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:xA(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function fUe(t){return new sue(t)}function oue(t,e){this._basis=new oR(t),this._beta=e}oue.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n=t[0],i=e[0],a=t[r]-n,s=e[r]-i,o=-1,l;++o<=r;)l=o/r,this._basis.point(this._beta*t[o]+(1-this._beta)*(n+l*a),this._beta*e[o]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const pUe=(function t(e){function r(n){return e===1?new oR(n):new oue(n,e)}return r.beta=function(n){return t(+n)},r})(.85);function TA(t,e,r){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-r),t._x2,t._y2)}function Wz(t,e){this._context=t,this._k=(1-e)/6}Wz.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:TA(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:TA(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 lue=(function t(e){function r(n){return new Wz(n,e)}return r.tension=function(n){return t(+n)},r})(0);function Hz(t,e){this._context=t,this._k=(1-e)/6}Hz.prototype={areaStart:Jd,areaEnd:Jd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:TA(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 gUe=(function t(e){function r(n){return new Hz(n,e)}return r.tension=function(n){return t(+n)},r})(0);function qz(t,e){this._context=t,this._k=(1-e)/6}qz.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(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:TA(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 mUe=(function t(e){function r(n){return new qz(n,e)}return r.tension=function(n){return t(+n)},r})(0);function Uz(t,e,r){var n=t._x1,i=t._y1,a=t._x2,s=t._y2;if(t._l01_a>ls){var o=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);n=(n*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>ls){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*u+t._x1*t._l23_2a-e*t._l12_2a)/h,s=(s*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,s,t._x2,t._y2)}function cue(t,e){this._context=t,this._alpha=e}cue.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 r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:Uz(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 uue=(function t(e){function r(n){return e?new cue(n,e):new Wz(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function hue(t,e){this._context=t,this._alpha=e}hue.prototype={areaStart:Jd,areaEnd:Jd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=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 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Uz(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 yUe=(function t(e){function r(n){return e?new hue(n,e):new Hz(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function due(t,e){this._context=t,this._alpha=e}due.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(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Uz(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 vUe=(function t(e){function r(n){return e?new due(n,e):new qz(n,0)}return r.alpha=function(n){return t(+n)},r})(.5);function fue(t){this._context=t}fue.prototype={areaStart:Jd,areaEnd:Jd,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function bUe(t){return new fue(t)}function cK(t){return t<0?-1:1}function uK(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),s=(r-t._y1)/(i||n<0&&-0),o=(a*i+s*n)/(n+i);return(cK(a)+cK(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function hK(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function GM(t,e,r){var n=t._x0,i=t._y0,a=t._x1,s=t._y1,o=(a-n)/3;t._context.bezierCurveTo(n+o,i+o*e,a-o,s-o*r,a,s)}function wA(t){this._context=t}wA.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:GM(this,this._t0,hK(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 r=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,GM(this,hK(this,r=uK(this,t,e)),r);break;default:GM(this,this._t0,r=uK(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function pue(t){this._context=new gue(t)}(pue.prototype=Object.create(wA.prototype)).point=function(t,e){wA.prototype.point.call(this,e,t)};function gue(t){this._context=t}gue.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}};function mue(t){return new wA(t)}function yue(t){return new pue(t)}function vue(t){this._context=t}vue.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=dK(t),i=dK(e),a=0,s=1;s<r;++a,++s)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],t[s],e[s]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function dK(t){var e,r=t.length-1,n,i=new Array(r),a=new Array(r),s=new Array(r);for(i[0]=0,a[0]=2,s[0]=t[0]+2*t[1],e=1;e<r-1;++e)i[e]=1,a[e]=4,s[e]=4*t[e]+2*t[e+1];for(i[r-1]=2,a[r-1]=7,s[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=i[e]/a[e-1],a[e]-=n,s[e]-=n*s[e-1];for(i[r-1]=s[r-1]/a[r-1],e=r-2;e>=0;--e)i[e]=(s[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e<r-1;++e)a[e]=2*t[e+1]-i[e+1];return[i,a]}function bue(t){return new vue(t)}function lR(t,e){this._context=t,this._t=e}lR.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 r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function xue(t){return new lR(t,.5)}function Tue(t){return new lR(t,0)}function wue(t){return new lR(t,1)}function qT(t,e,r){this.k=t,this.x=e,this.y=r}qT.prototype={constructor:qT,scale:function(t){return t===1?this:new qT(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new qT(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+")"}};qT.prototype;var xs=x(t=>{var i;const{securityLevel:e}=Fe();let r=ut("body");if(e==="sandbox"){const s=((i=ut(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=ut(s.body)}return r.select(`#${t}`)},"selectSvgElement");function Yz(t){return typeof t>"u"||t===null}x(Yz,"isNothing");function Cue(t){return typeof t=="object"&&t!==null}x(Cue,"isObject");function kue(t){return Array.isArray(t)?t:Yz(t)?[]:[t]}x(kue,"toArray");function Sue(t,e){var r,n,i,a;if(e)for(a=Object.keys(e),r=0,n=a.length;r<n;r+=1)i=a[r],t[i]=e[i];return t}x(Sue,"extend");function Eue(t,e){var r="",n;for(n=0;n<e;n+=1)r+=t;return r}x(Eue,"repeat");function Aue(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}x(Aue,"isNegativeZero");var xUe=Yz,TUe=Cue,wUe=kue,CUe=Eue,kUe=Aue,SUe=Sue,aa={isNothing:xUe,isObject:TUe,toArray:wUe,repeat:CUe,isNegativeZero:kUe,extend:SUe};function Xz(t,e){var r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`
`+t.mark.snippet),n+" "+r):n}x(Xz,"formatError");function Rb(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=Xz(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}x(Rb,"YAMLException$1");Rb.prototype=Object.create(Error.prototype);Rb.prototype.constructor=Rb;Rb.prototype.toString=x(function(e){return this.name+": "+Xz(this,e)},"toString");var po=Rb;function X4(t,e,r,n,i){var a="",s="",o=Math.floor(i/2)-1;return n-e>o&&(a=" ... ",e=n-o+a.length),r-n>o&&(s=" ...",r=n+o-s.length),{str:a+t.slice(e,r).replace(/\t/g,"→")+s,pos:n-e+a.length}}x(X4,"getLine");function j4(t,e){return aa.repeat(" ",e-t.length)+t}x(j4,"padStart");function _ue(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],a,s=-1;a=r.exec(t.buffer);)i.push(a.index),n.push(a.index+a[0].length),t.position<=a.index&&s<0&&(s=n.length-2);s<0&&(s=n.length-1);var o="",l,u,h=Math.min(t.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+h+3);for(l=1;l<=e.linesBefore&&!(s-l<0);l++)u=X4(t.buffer,n[s-l],i[s-l],t.position-(n[s]-n[s-l]),d),o=aa.repeat(" ",e.indent)+j4((t.line-l+1).toString(),h)+" | "+u.str+`
`+o;for(u=X4(t.buffer,n[s],i[s],t.position,d),o+=aa.repeat(" ",e.indent)+j4((t.line+1).toString(),h)+" | "+u.str+`
`,o+=aa.repeat("-",e.indent+h+3+u.pos)+`^
`,l=1;l<=e.linesAfter&&!(s+l>=i.length);l++)u=X4(t.buffer,n[s+l],i[s+l],t.position-(n[s]-n[s+l]),d),o+=aa.repeat(" ",e.indent)+j4((t.line+l+1).toString(),h)+" | "+u.str+`
`;return o.replace(/\n$/,"")}x(_ue,"makeSnippet");var EUe=_ue,AUe=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],_Ue=["scalar","sequence","mapping"];function Rue(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}x(Rue,"compileStyleAliases");function Lue(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(AUe.indexOf(r)===-1)throw new po('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=Rue(e.styleAliases||null),_Ue.indexOf(this.kind)===-1)throw new po('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}x(Lue,"Type$1");var ds=Lue;function dO(t,e){var r=[];return t[e].forEach(function(n){var i=r.length;r.forEach(function(a,s){a.tag===n.tag&&a.kind===n.kind&&a.multi===n.multi&&(i=s)}),r[i]=n}),r}x(dO,"compileList");function Mue(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function n(i){i.multi?(t.multi[i.kind].push(i),t.multi.fallback.push(i)):t[i.kind][i.tag]=t.fallback[i.tag]=i}for(x(n,"collectType"),e=0,r=arguments.length;e<r;e+=1)arguments[e].forEach(n);return t}x(Mue,"compileMap");function CA(t){return this.extend(t)}x(CA,"Schema$1");CA.prototype.extend=x(function(e){var r=[],n=[];if(e instanceof ds)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(r=r.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new po("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(a){if(!(a instanceof ds))throw new po("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(a.loadKind&&a.loadKind!=="scalar")throw new po("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(a.multi)throw new po("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(a){if(!(a instanceof ds))throw new po("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(CA.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=dO(i,"implicit"),i.compiledExplicit=dO(i,"explicit"),i.compiledTypeMap=Mue(i.compiledImplicit,i.compiledExplicit),i},"extend");var RUe=CA,LUe=new ds("tag:yaml.org,2002:str",{kind:"scalar",construct:x(function(t){return t!==null?t:""},"construct")}),MUe=new ds("tag:yaml.org,2002:seq",{kind:"sequence",construct:x(function(t){return t!==null?t:[]},"construct")}),IUe=new ds("tag:yaml.org,2002:map",{kind:"mapping",construct:x(function(t){return t!==null?t:{}},"construct")}),NUe=new RUe({explicit:[LUe,MUe,IUe]});function Iue(t){if(t===null)return!0;var e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}x(Iue,"resolveYamlNull");function Nue(){return null}x(Nue,"constructYamlNull");function Due(t){return t===null}x(Due,"isNull");var DUe=new ds("tag:yaml.org,2002:null",{kind:"scalar",resolve:Iue,construct:Nue,predicate:Due,represent:{canonical:x(function(){return"~"},"canonical"),lowercase:x(function(){return"null"},"lowercase"),uppercase:x(function(){return"NULL"},"uppercase"),camelcase:x(function(){return"Null"},"camelcase"),empty:x(function(){return""},"empty")},defaultStyle:"lowercase"});function Oue(t){if(t===null)return!1;var e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}x(Oue,"resolveYamlBoolean");function $ue(t){return t==="true"||t==="True"||t==="TRUE"}x($ue,"constructYamlBoolean");function Pue(t){return Object.prototype.toString.call(t)==="[object Boolean]"}x(Pue,"isBoolean");var OUe=new ds("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Oue,construct:$ue,predicate:Pue,represent:{lowercase:x(function(t){return t?"true":"false"},"lowercase"),uppercase:x(function(t){return t?"TRUE":"FALSE"},"uppercase"),camelcase:x(function(t){return t?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function Bue(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}x(Bue,"isHexCode");function Fue(t){return 48<=t&&t<=55}x(Fue,"isOctCode");function zue(t){return 48<=t&&t<=57}x(zue,"isDecCode");function Vue(t){if(t===null)return!1;var e=t.length,r=0,n=!1,i;if(!e)return!1;if(i=t[r],(i==="-"||i==="+")&&(i=t[++r]),i==="0"){if(r+1===e)return!0;if(i=t[++r],i==="b"){for(r++;r<e;r++)if(i=t[r],i!=="_"){if(i!=="0"&&i!=="1")return!1;n=!0}return n&&i!=="_"}if(i==="x"){for(r++;r<e;r++)if(i=t[r],i!=="_"){if(!Bue(t.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}if(i==="o"){for(r++;r<e;r++)if(i=t[r],i!=="_"){if(!Fue(t.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}}if(i==="_")return!1;for(;r<e;r++)if(i=t[r],i!=="_"){if(!zue(t.charCodeAt(r)))return!1;n=!0}return!(!n||i==="_")}x(Vue,"resolveYamlInteger");function Gue(t){var e=t,r=1,n;if(e.indexOf("_")!==-1&&(e=e.replace(/_/g,"")),n=e[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),e=e.slice(1),n=e[0]),e==="0")return 0;if(n==="0"){if(e[1]==="b")return r*parseInt(e.slice(2),2);if(e[1]==="x")return r*parseInt(e.slice(2),16);if(e[1]==="o")return r*parseInt(e.slice(2),8)}return r*parseInt(e,10)}x(Gue,"constructYamlInteger");function Wue(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!aa.isNegativeZero(t)}x(Wue,"isInteger");var $Ue=new ds("tag:yaml.org,2002:int",{kind:"scalar",resolve:Vue,construct:Gue,predicate:Wue,represent:{binary:x(function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:x(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:x(function(t){return t.toString(10)},"decimal"),hexadecimal:x(function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),PUe=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Hue(t){return!(t===null||!PUe.test(t)||t[t.length-1]==="_")}x(Hue,"resolveYamlFloat");function que(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}x(que,"constructYamlFloat");var BUe=/^[-+]?[0-9]+e/;function Uue(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(aa.isNegativeZero(t))return"-0.0";return r=t.toString(10),BUe.test(r)?r.replace("e",".e"):r}x(Uue,"representYamlFloat");function Yue(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||aa.isNegativeZero(t))}x(Yue,"isFloat");var FUe=new ds("tag:yaml.org,2002:float",{kind:"scalar",resolve:Hue,construct:que,predicate:Yue,represent:Uue,defaultStyle:"lowercase"}),Xue=NUe.extend({implicit:[DUe,OUe,$Ue,FUe]}),zUe=Xue,jue=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Kue=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Zue(t){return t===null?!1:jue.exec(t)!==null||Kue.exec(t)!==null}x(Zue,"resolveYamlTimestamp");function Que(t){var e,r,n,i,a,s,o,l=0,u=null,h,d,f;if(e=jue.exec(t),e===null&&(e=Kue.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(a=+e[4],s=+e[5],o=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(h=+e[10],d=+(e[11]||0),u=(h*60+d)*6e4,e[9]==="-"&&(u=-u)),f=new Date(Date.UTC(r,n,i,a,s,o,l)),u&&f.setTime(f.getTime()-u),f}x(Que,"constructYamlTimestamp");function Jue(t){return t.toISOString()}x(Jue,"representYamlTimestamp");var VUe=new ds("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Zue,construct:Que,instanceOf:Date,represent:Jue});function ehe(t){return t==="<<"||t===null}x(ehe,"resolveYamlMerge");var GUe=new ds("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ehe}),jz=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
\r`;function the(t){if(t===null)return!1;var e,r,n=0,i=t.length,a=jz;for(r=0;r<i;r++)if(e=a.indexOf(t.charAt(r)),!(e>64)){if(e<0)return!1;n+=6}return n%8===0}x(the,"resolveYamlBinary");function rhe(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=jz,s=0,o=[];for(e=0;e<i;e++)e%4===0&&e&&(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|a.indexOf(n.charAt(e));return r=i%4*6,r===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):r===18?(o.push(s>>10&255),o.push(s>>2&255)):r===12&&o.push(s>>4&255),new Uint8Array(o)}x(rhe,"constructYamlBinary");function nhe(t){var e="",r=0,n,i,a=t.length,s=jz;for(n=0;n<a;n++)n%3===0&&n&&(e+=s[r>>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]),r=(r<<8)+t[n];return i=a%3,i===0?(e+=s[r>>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]):i===2?(e+=s[r>>10&63],e+=s[r>>4&63],e+=s[r<<2&63],e+=s[64]):i===1&&(e+=s[r>>2&63],e+=s[r<<4&63],e+=s[64],e+=s[64]),e}x(nhe,"representYamlBinary");function ihe(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}x(ihe,"isBinary");var WUe=new ds("tag:yaml.org,2002:binary",{kind:"scalar",resolve:the,construct:rhe,predicate:ihe,represent:nhe}),HUe=Object.prototype.hasOwnProperty,qUe=Object.prototype.toString;function ahe(t){if(t===null)return!0;var e=[],r,n,i,a,s,o=t;for(r=0,n=o.length;r<n;r+=1){if(i=o[r],s=!1,qUe.call(i)!=="[object Object]")return!1;for(a in i)if(HUe.call(i,a))if(!s)s=!0;else return!1;if(!s)return!1;if(e.indexOf(a)===-1)e.push(a);else return!1}return!0}x(ahe,"resolveYamlOmap");function she(t){return t!==null?t:[]}x(she,"constructYamlOmap");var UUe=new ds("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ahe,construct:she}),YUe=Object.prototype.toString;function ohe(t){if(t===null)return!0;var e,r,n,i,a,s=t;for(a=new Array(s.length),e=0,r=s.length;e<r;e+=1){if(n=s[e],YUe.call(n)!=="[object Object]"||(i=Object.keys(n),i.length!==1))return!1;a[e]=[i[0],n[i[0]]]}return!0}x(ohe,"resolveYamlPairs");function lhe(t){if(t===null)return[];var e,r,n,i,a,s=t;for(a=new Array(s.length),e=0,r=s.length;e<r;e+=1)n=s[e],i=Object.keys(n),a[e]=[i[0],n[i[0]]];return a}x(lhe,"constructYamlPairs");var XUe=new ds("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:ohe,construct:lhe}),jUe=Object.prototype.hasOwnProperty;function che(t){if(t===null)return!0;var e,r=t;for(e in r)if(jUe.call(r,e)&&r[e]!==null)return!1;return!0}x(che,"resolveYamlSet");function uhe(t){return t!==null?t:{}}x(uhe,"constructYamlSet");var KUe=new ds("tag:yaml.org,2002:set",{kind:"mapping",resolve:che,construct:uhe}),hhe=zUe.extend({implicit:[VUe,GUe],explicit:[WUe,UUe,XUe,KUe]}),ef=Object.prototype.hasOwnProperty,kA=1,dhe=2,fhe=3,SA=4,WM=1,ZUe=2,fK=3,QUe=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,JUe=/[\x85\u2028\u2029]/,eYe=/[,\[\]\{\}]/,phe=/^(?:!|!!|![a-z\-]+!)$/i,ghe=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function fO(t){return Object.prototype.toString.call(t)}x(fO,"_class");function Kl(t){return t===10||t===13}x(Kl,"is_EOL");function Wd(t){return t===9||t===32}x(Wd,"is_WHITE_SPACE");function Os(t){return t===9||t===32||t===10||t===13}x(Os,"is_WS_OR_EOL");function Kp(t){return t===44||t===91||t===93||t===123||t===125}x(Kp,"is_FLOW_INDICATOR");function mhe(t){var e;return 48<=t&&t<=57?t-48:(e=t|32,97<=e&&e<=102?e-97+10:-1)}x(mhe,"fromHexCode");function yhe(t){return t===120?2:t===117?4:t===85?8:0}x(yhe,"escapedHexLen");function vhe(t){return 48<=t&&t<=57?t-48:-1}x(vhe,"fromDecimalCode");function pO(t){return t===48?"\0":t===97?"\x07":t===98?"\b":t===116||t===9?" ":t===110?`
`:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"…":t===95?" ":t===76?"\u2028":t===80?"\u2029":""}x(pO,"simpleEscapeSequence");function bhe(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}x(bhe,"charFromCodepoint");function Kz(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}x(Kz,"setProperty");var xhe=new Array(256),The=new Array(256);for(Hf=0;Hf<256;Hf++)xhe[Hf]=pO(Hf)?1:0,The[Hf]=pO(Hf);var Hf;function whe(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||hhe,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}x(whe,"State$1");function Zz(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=EUe(r),new po(e,r)}x(Zz,"generateError");function ar(t,e){throw Zz(t,e)}x(ar,"throwError");function OC(t,e){t.onWarning&&t.onWarning.call(null,Zz(t,e))}x(OC,"throwWarning");var pK={YAML:x(function(e,r,n){var i,a,s;e.version!==null&&ar(e,"duplication of %YAML directive"),n.length!==1&&ar(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&ar(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),s=parseInt(i[2],10),a!==1&&ar(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&OC(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:x(function(e,r,n){var i,a;n.length!==2&&ar(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],phe.test(i)||ar(e,"ill-formed tag handle (first argument) of the TAG directive"),ef.call(e.tagMap,i)&&ar(e,'there is a previously declared suffix for "'+i+'" tag handle'),ghe.test(a)||ar(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{ar(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a},"handleTagDirective")};function uh(t,e,r,n){var i,a,s,o;if(e<r){if(o=t.input.slice(e,r),n)for(i=0,a=o.length;i<a;i+=1)s=o.charCodeAt(i),s===9||32<=s&&s<=1114111||ar(t,"expected valid JSON character");else QUe.test(o)&&ar(t,"the stream contains non-printable characters");t.result+=o}}x(uh,"captureSegment");function gO(t,e,r,n){var i,a,s,o;for(aa.isObject(r)||ar(t,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(r),s=0,o=i.length;s<o;s+=1)a=i[s],ef.call(e,a)||(Kz(e,a,r[a]),n[a]=!0)}x(gO,"mergeMappings");function Zp(t,e,r,n,i,a,s,o,l){var u,h;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),u=0,h=i.length;u<h;u+=1)Array.isArray(i[u])&&ar(t,"nested arrays are not supported inside keys"),typeof i=="object"&&fO(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&fO(i)==="[object Object]"&&(i="[object Object]"),i=String(i),e===null&&(e={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(u=0,h=a.length;u<h;u+=1)gO(t,e,a[u],r);else gO(t,e,a,r);else!t.json&&!ef.call(r,i)&&ef.call(e,i)&&(t.line=s||t.line,t.lineStart=o||t.lineStart,t.position=l||t.position,ar(t,"duplicated mapping key")),Kz(e,i,a),delete r[i];return e}x(Zp,"storeMappingPair");function cR(t){var e;e=t.input.charCodeAt(t.position),e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):ar(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}x(cR,"readLineBreak");function Ni(t,e,r){for(var n=0,i=t.input.charCodeAt(t.position);i!==0;){for(;Wd(i);)i===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),i=t.input.charCodeAt(++t.position);if(e&&i===35)do i=t.input.charCodeAt(++t.position);while(i!==10&&i!==13&&i!==0);if(Kl(i))for(cR(t),i=t.input.charCodeAt(t.position),n++,t.lineIndent=0;i===32;)t.lineIndent++,i=t.input.charCodeAt(++t.position);else break}return r!==-1&&n!==0&&t.lineIndent<r&&OC(t,"deficient indentation"),n}x(Ni,"skipSeparationSpace");function Zk(t){var e=t.position,r;return r=t.input.charCodeAt(e),!!((r===45||r===46)&&r===t.input.charCodeAt(e+1)&&r===t.input.charCodeAt(e+2)&&(e+=3,r=t.input.charCodeAt(e),r===0||Os(r)))}x(Zk,"testDocumentSeparator");function uR(t,e){e===1?t.result+=" ":e>1&&(t.result+=aa.repeat(`
`,e-1))}x(uR,"writeFoldedLines");function Che(t,e,r){var n,i,a,s,o,l,u,h,d=t.kind,f=t.result,p;if(p=t.input.charCodeAt(t.position),Os(p)||Kp(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=t.input.charCodeAt(t.position+1),Os(i)||r&&Kp(i)))return!1;for(t.kind="scalar",t.result="",a=s=t.position,o=!1;p!==0;){if(p===58){if(i=t.input.charCodeAt(t.position+1),Os(i)||r&&Kp(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),Os(n))break}else{if(t.position===t.lineStart&&Zk(t)||r&&Kp(p))break;if(Kl(p))if(l=t.line,u=t.lineStart,h=t.lineIndent,Ni(t,!1,-1),t.lineIndent>=e){o=!0,p=t.input.charCodeAt(t.position);continue}else{t.position=s,t.line=l,t.lineStart=u,t.lineIndent=h;break}}o&&(uh(t,a,s,!1),uR(t,t.line-l),a=s=t.position,o=!1),Wd(p)||(s=t.position+1),p=t.input.charCodeAt(++t.position)}return uh(t,a,s,!1),t.result?!0:(t.kind=d,t.result=f,!1)}x(Che,"readPlainScalar");function khe(t,e){var r,n,i;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(uh(t,n,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)n=t.position,t.position++,i=t.position;else return!0;else Kl(r)?(uh(t,n,i,!0),uR(t,Ni(t,!1,e)),n=i=t.position):t.position===t.lineStart&&Zk(t)?ar(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);ar(t,"unexpected end of the stream within a single quoted scalar")}x(khe,"readSingleQuotedScalar");function She(t,e){var r,n,i,a,s,o;if(o=t.input.charCodeAt(t.position),o!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(o=t.input.charCodeAt(t.position))!==0;){if(o===34)return uh(t,r,t.position,!0),t.position++,!0;if(o===92){if(uh(t,r,t.position,!0),o=t.input.charCodeAt(++t.position),Kl(o))Ni(t,!1,e);else if(o<256&&xhe[o])t.result+=The[o],t.position++;else if((s=yhe(o))>0){for(i=s,a=0;i>0;i--)o=t.input.charCodeAt(++t.position),(s=mhe(o))>=0?a=(a<<4)+s:ar(t,"expected hexadecimal character");t.result+=bhe(a),t.position++}else ar(t,"unknown escape sequence");r=n=t.position}else Kl(o)?(uh(t,r,n,!0),uR(t,Ni(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Zk(t)?ar(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}ar(t,"unexpected end of the stream within a double quoted scalar")}x(She,"readDoubleQuotedScalar");function Ehe(t,e){var r=!0,n,i,a,s=t.tag,o,l=t.anchor,u,h,d,f,p,g=Object.create(null),m,y,v,T;if(T=t.input.charCodeAt(t.position),T===91)h=93,p=!1,o=[];else if(T===123)h=125,p=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),T=t.input.charCodeAt(++t.position);T!==0;){if(Ni(t,!0,e),T=t.input.charCodeAt(t.position),T===h)return t.position++,t.tag=s,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=o,!0;r?T===44&&ar(t,"expected the node content, but found ','"):ar(t,"missed comma between flow collection entries"),y=m=v=null,d=f=!1,T===63&&(u=t.input.charCodeAt(t.position+1),Os(u)&&(d=f=!0,t.position++,Ni(t,!0,e))),n=t.line,i=t.lineStart,a=t.position,N0(t,e,kA,!1,!0),y=t.tag,m=t.result,Ni(t,!0,e),T=t.input.charCodeAt(t.position),(f||t.line===n)&&T===58&&(d=!0,T=t.input.charCodeAt(++t.position),Ni(t,!0,e),N0(t,e,kA,!1,!0),v=t.result),p?Zp(t,o,g,y,m,v,n,i,a):d?o.push(Zp(t,null,g,y,m,v,n,i,a)):o.push(m),Ni(t,!0,e),T=t.input.charCodeAt(t.position),T===44?(r=!0,T=t.input.charCodeAt(++t.position)):r=!1}ar(t,"unexpected end of the stream within a flow collection")}x(Ehe,"readFlowCollection");function Ahe(t,e){var r,n,i=WM,a=!1,s=!1,o=e,l=0,u=!1,h,d;if(d=t.input.charCodeAt(t.position),d===124)n=!1;else if(d===62)n=!0;else return!1;for(t.kind="scalar",t.result="";d!==0;)if(d=t.input.charCodeAt(++t.position),d===43||d===45)WM===i?i=d===43?fK:ZUe:ar(t,"repeat of a chomping mode identifier");else if((h=vhe(d))>=0)h===0?ar(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?ar(t,"repeat of an indentation width identifier"):(o=e+h-1,s=!0);else break;if(Wd(d)){do d=t.input.charCodeAt(++t.position);while(Wd(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!Kl(d)&&d!==0)}for(;d!==0;){for(cR(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!s||t.lineIndent<o)&&d===32;)t.lineIndent++,d=t.input.charCodeAt(++t.position);if(!s&&t.lineIndent>o&&(o=t.lineIndent),Kl(d)){l++;continue}if(t.lineIndent<o){i===fK?t.result+=aa.repeat(`
`,a?1+l:l):i===WM&&a&&(t.result+=`
`);break}for(n?Wd(d)?(u=!0,t.result+=aa.repeat(`
`,a?1+l:l)):u?(u=!1,t.result+=aa.repeat(`
`,l+1)):l===0?a&&(t.result+=" "):t.result+=aa.repeat(`
`,l):t.result+=aa.repeat(`
`,a?1+l:l),a=!0,s=!0,l=0,r=t.position;!Kl(d)&&d!==0;)d=t.input.charCodeAt(++t.position);uh(t,r,t.position,!1)}return!0}x(Ahe,"readBlockScalar");function mO(t,e){var r,n=t.tag,i=t.anchor,a=[],s,o=!1,l;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=a),l=t.input.charCodeAt(t.position);l!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,ar(t,"tab characters must not be used in indentation")),!(l!==45||(s=t.input.charCodeAt(t.position+1),!Os(s))));){if(o=!0,t.position++,Ni(t,!0,-1)&&t.lineIndent<=e){a.push(null),l=t.input.charCodeAt(t.position);continue}if(r=t.line,N0(t,e,fhe,!1,!0),a.push(t.result),Ni(t,!0,-1),l=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&l!==0)ar(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return o?(t.tag=n,t.anchor=i,t.kind="sequence",t.result=a,!0):!1}x(mO,"readBlockSequence");function _he(t,e,r){var n,i,a,s,o,l,u=t.tag,h=t.anchor,d={},f=Object.create(null),p=null,g=null,m=null,y=!1,v=!1,T;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=d),T=t.input.charCodeAt(t.position);T!==0;){if(!y&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,ar(t,"tab characters must not be used in indentation")),n=t.input.charCodeAt(t.position+1),a=t.line,(T===63||T===58)&&Os(n))T===63?(y&&(Zp(t,d,f,p,g,null,s,o,l),p=g=m=null),v=!0,y=!0,i=!0):y?(y=!1,i=!0):ar(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,T=n;else{if(s=t.line,o=t.lineStart,l=t.position,!N0(t,r,dhe,!1,!0))break;if(t.line===a){for(T=t.input.charCodeAt(t.position);Wd(T);)T=t.input.charCodeAt(++t.position);if(T===58)T=t.input.charCodeAt(++t.position),Os(T)||ar(t,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(Zp(t,d,f,p,g,null,s,o,l),p=g=m=null),v=!0,y=!1,i=!1,p=t.tag,g=t.result;else if(v)ar(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=u,t.anchor=h,!0}else if(v)ar(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=u,t.anchor=h,!0}if((t.line===a||t.lineIndent>e)&&(y&&(s=t.line,o=t.lineStart,l=t.position),N0(t,e,SA,!0,i)&&(y?g=t.result:m=t.result),y||(Zp(t,d,f,p,g,m,s,o,l),p=g=m=null),Ni(t,!0,-1),T=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&T!==0)ar(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return y&&Zp(t,d,f,p,g,null,s,o,l),v&&(t.tag=u,t.anchor=h,t.kind="mapping",t.result=d),v}x(_he,"readBlockMapping");function Rhe(t){var e,r=!1,n=!1,i,a,s;if(s=t.input.charCodeAt(t.position),s!==33)return!1;if(t.tag!==null&&ar(t,"duplication of a tag property"),s=t.input.charCodeAt(++t.position),s===60?(r=!0,s=t.input.charCodeAt(++t.position)):s===33?(n=!0,i="!!",s=t.input.charCodeAt(++t.position)):i="!",e=t.position,r){do s=t.input.charCodeAt(++t.position);while(s!==0&&s!==62);t.position<t.length?(a=t.input.slice(e,t.position),s=t.input.charCodeAt(++t.position)):ar(t,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!Os(s);)s===33&&(n?ar(t,"tag suffix cannot contain exclamation marks"):(i=t.input.slice(e-1,t.position+1),phe.test(i)||ar(t,"named tag handle cannot contain such characters"),n=!0,e=t.position+1)),s=t.input.charCodeAt(++t.position);a=t.input.slice(e,t.position),eYe.test(a)&&ar(t,"tag suffix cannot contain flow indicator characters")}a&&!ghe.test(a)&&ar(t,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{ar(t,"tag name is malformed: "+a)}return r?t.tag=a:ef.call(t.tagMap,i)?t.tag=t.tagMap[i]+a:i==="!"?t.tag="!"+a:i==="!!"?t.tag="tag:yaml.org,2002:"+a:ar(t,'undeclared tag handle "'+i+'"'),!0}x(Rhe,"readTagProperty");function Lhe(t){var e,r;if(r=t.input.charCodeAt(t.position),r!==38)return!1;for(t.anchor!==null&&ar(t,"duplication of an anchor property"),r=t.input.charCodeAt(++t.position),e=t.position;r!==0&&!Os(r)&&!Kp(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&ar(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}x(Lhe,"readAnchorProperty");function Mhe(t){var e,r,n;if(n=t.input.charCodeAt(t.position),n!==42)return!1;for(n=t.input.charCodeAt(++t.position),e=t.position;n!==0&&!Os(n)&&!Kp(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&ar(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),ef.call(t.anchorMap,r)||ar(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],Ni(t,!0,-1),!0}x(Mhe,"readAlias");function N0(t,e,r,n,i){var a,s,o,l=1,u=!1,h=!1,d,f,p,g,m,y;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,a=s=o=SA===r||fhe===r,n&&Ni(t,!0,-1)&&(u=!0,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)),l===1)for(;Rhe(t)||Lhe(t);)Ni(t,!0,-1)?(u=!0,o=a,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)):o=!1;if(o&&(o=u||i),(l===1||SA===r)&&(kA===r||dhe===r?m=e:m=e+1,y=t.position-t.lineStart,l===1?o&&(mO(t,y)||_he(t,y,m))||Ehe(t,m)?h=!0:(s&&Ahe(t,m)||khe(t,m)||She(t,m)?h=!0:Mhe(t)?(h=!0,(t.tag!==null||t.anchor!==null)&&ar(t,"alias node should not have any properties")):Che(t,m,kA===r)&&(h=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):l===0&&(h=o&&mO(t,y))),t.tag===null)t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);else if(t.tag==="?"){for(t.result!==null&&t.kind!=="scalar"&&ar(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),d=0,f=t.implicitTypes.length;d<f;d+=1)if(g=t.implicitTypes[d],g.resolve(t.result)){t.result=g.construct(t.result),t.tag=g.tag,t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);break}}else if(t.tag!=="!"){if(ef.call(t.typeMap[t.kind||"fallback"],t.tag))g=t.typeMap[t.kind||"fallback"][t.tag];else for(g=null,p=t.typeMap.multi[t.kind||"fallback"],d=0,f=p.length;d<f;d+=1)if(t.tag.slice(0,p[d].tag.length)===p[d].tag){g=p[d];break}g||ar(t,"unknown tag !<"+t.tag+">"),t.result!==null&&g.kind!==t.kind&&ar(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):ar(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||h}x(N0,"composeNode");function Ihe(t){var e=t.position,r,n,i,a=!1,s;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(s=t.input.charCodeAt(t.position))!==0&&(Ni(t,!0,-1),s=t.input.charCodeAt(t.position),!(t.lineIndent>0||s!==37));){for(a=!0,s=t.input.charCodeAt(++t.position),r=t.position;s!==0&&!Os(s);)s=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&ar(t,"directive name must not be less than one character in length");s!==0;){for(;Wd(s);)s=t.input.charCodeAt(++t.position);if(s===35){do s=t.input.charCodeAt(++t.position);while(s!==0&&!Kl(s));break}if(Kl(s))break;for(r=t.position;s!==0&&!Os(s);)s=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}s!==0&&cR(t),ef.call(pK,n)?pK[n](t,n,i):OC(t,'unknown document directive "'+n+'"')}if(Ni(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Ni(t,!0,-1)):a&&ar(t,"directives end mark is expected"),N0(t,t.lineIndent-1,SA,!1,!0),Ni(t,!0,-1),t.checkLineBreaks&&JUe.test(t.input.slice(e,t.position))&&OC(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Zk(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Ni(t,!0,-1));return}if(t.position<t.length-1)ar(t,"end of the stream or a document separator is expected");else return}x(Ihe,"readDocument");function Qz(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));var r=new whe(t,e),n=t.indexOf("\0");for(n!==-1&&(r.position=n,ar(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)Ihe(r);return r.documents}x(Qz,"loadDocuments");function tYe(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);var n=Qz(t,r);if(typeof e!="function")return n;for(var i=0,a=n.length;i<a;i+=1)e(n[i])}x(tYe,"loadAll$1");function Nhe(t,e){var r=Qz(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new po("expected a single document in the stream, but found more")}}x(Nhe,"load$1");var rYe=Nhe,nYe={load:rYe},Dhe=Object.prototype.toString,Ohe=Object.prototype.hasOwnProperty,Jz=65279,iYe=9,$C=10,aYe=13,sYe=32,oYe=33,lYe=34,yO=35,cYe=37,uYe=38,hYe=39,dYe=42,$he=44,fYe=45,EA=58,pYe=61,gYe=62,mYe=63,yYe=64,Phe=91,Bhe=93,vYe=96,Fhe=123,bYe=124,zhe=125,Ts={};Ts[0]="\\0";Ts[7]="\\a";Ts[8]="\\b";Ts[9]="\\t";Ts[10]="\\n";Ts[11]="\\v";Ts[12]="\\f";Ts[13]="\\r";Ts[27]="\\e";Ts[34]='\\"';Ts[92]="\\\\";Ts[133]="\\N";Ts[160]="\\_";Ts[8232]="\\L";Ts[8233]="\\P";var xYe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],TYe=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Vhe(t,e){var r,n,i,a,s,o,l;if(e===null)return{};for(r={},n=Object.keys(e),i=0,a=n.length;i<a;i+=1)s=n[i],o=String(e[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),l=t.compiledTypeMap.fallback[s],l&&Ohe.call(l.styleAliases,o)&&(o=l.styleAliases[o]),r[s]=o;return r}x(Vhe,"compileStyleMap");function Ghe(t){var e,r,n;if(e=t.toString(16).toUpperCase(),t<=255)r="x",n=2;else if(t<=65535)r="u",n=4;else if(t<=4294967295)r="U",n=8;else throw new po("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+aa.repeat("0",n-e.length)+e}x(Ghe,"encodeHex");var wYe=1,PC=2;function Whe(t){this.schema=t.schema||hhe,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=aa.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=Vhe(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?PC:wYe,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}x(Whe,"State");function vO(t,e){for(var r=aa.repeat(" ",e),n=0,i=-1,a="",s,o=t.length;n<o;)i=t.indexOf(`
`,n),i===-1?(s=t.slice(n),n=o):(s=t.slice(n,i+1),n=i+1),s.length&&s!==`
`&&(a+=r),a+=s;return a}x(vO,"indentString");function AA(t,e){return`
`+aa.repeat(" ",t.indent*e)}x(AA,"generateNextLine");function Hhe(t,e){var r,n,i;for(r=0,n=t.implicitTypes.length;r<n;r+=1)if(i=t.implicitTypes[r],i.resolve(e))return!0;return!1}x(Hhe,"testImplicitResolving");function BC(t){return t===sYe||t===iYe}x(BC,"isWhitespace");function Lb(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==Jz||65536<=t&&t<=1114111}x(Lb,"isPrintable");function bO(t){return Lb(t)&&t!==Jz&&t!==aYe&&t!==$C}x(bO,"isNsCharOrWhitespace");function xO(t,e,r){var n=bO(t),i=n&&!BC(t);return(r?n:n&&t!==$he&&t!==Phe&&t!==Bhe&&t!==Fhe&&t!==zhe)&&t!==yO&&!(e===EA&&!i)||bO(e)&&!BC(e)&&t===yO||e===EA&&i}x(xO,"isPlainSafe");function qhe(t){return Lb(t)&&t!==Jz&&!BC(t)&&t!==fYe&&t!==mYe&&t!==EA&&t!==$he&&t!==Phe&&t!==Bhe&&t!==Fhe&&t!==zhe&&t!==yO&&t!==uYe&&t!==dYe&&t!==oYe&&t!==bYe&&t!==pYe&&t!==gYe&&t!==hYe&&t!==lYe&&t!==cYe&&t!==yYe&&t!==vYe}x(qhe,"isPlainSafeFirst");function Uhe(t){return!BC(t)&&t!==EA}x(Uhe,"isPlainSafeLast");function qm(t,e){var r=t.charCodeAt(e),n;return r>=55296&&r<=56319&&e+1<t.length&&(n=t.charCodeAt(e+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}x(qm,"codePointAt");function eV(t){var e=/^\n* /;return e.test(t)}x(eV,"needIndentIndicator");var Yhe=1,TO=2,Xhe=3,jhe=4,vm=5;function Khe(t,e,r,n,i,a,s,o){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=qhe(qm(t,0))&&Uhe(qm(t,t.length-1));if(e||s)for(l=0;l<t.length;u>=65536?l+=2:l++){if(u=qm(t,l),!Lb(u))return vm;m=m&&xO(u,h,o),h=u}else{for(l=0;l<t.length;u>=65536?l+=2:l++){if(u=qm(t,l),u===$C)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!Lb(u))return vm;m=m&&xO(u,h,o),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!s&&!i(t)?Yhe:a===PC?vm:TO:r>9&&eV(t)?vm:s?a===PC?vm:TO:f?jhe:Xhe}x(Khe,"chooseScalarStyle");function Zhe(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===PC?'""':"''";if(!t.noCompatMode&&(xYe.indexOf(e)!==-1||TYe.test(e)))return t.quotingType===PC?'"'+e+'"':"'"+e+"'";var a=t.indent*Math.max(1,r),s=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),o=n||t.flowLevel>-1&&r>=t.flowLevel;function l(u){return Hhe(t,u)}switch(x(l,"testAmbiguity"),Khe(e,o,t.indent,s,l,t.quotingType,t.forceQuotes&&!n,i)){case Yhe:return e;case TO:return"'"+e.replace(/'/g,"''")+"'";case Xhe:return"|"+wO(e,t.indent)+CO(vO(e,a));case jhe:return">"+wO(e,t.indent)+CO(vO(Qhe(e,s),a));case vm:return'"'+Jhe(e)+'"';default:throw new po("impossible error: invalid scalar style")}})()}x(Zhe,"writeScalar");function wO(t,e){var r=eV(t)?String(e):"",n=t[t.length-1]===`
`,i=n&&(t[t.length-2]===`
`||t===`
`),a=i?"+":n?"":"-";return r+a+`
`}x(wO,"blockHeader");function CO(t){return t[t.length-1]===`
`?t.slice(0,-1):t}x(CO,"dropEndingNewline");function Qhe(t,e){for(var r=/(\n+)([^\n]*)/g,n=(function(){var u=t.indexOf(`
`);return u=u!==-1?u:t.length,r.lastIndex=u,kO(t.slice(0,u),e)})(),i=t[0]===`
`||t[0]===" ",a,s;s=r.exec(t);){var o=s[1],l=s[2];a=l[0]===" ",n+=o+(!i&&!a&&l!==""?`
`:"")+kO(l,e),i=a}return n}x(Qhe,"foldString");function kO(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,n,i=0,a,s=0,o=0,l="";n=r.exec(t);)o=n.index,o-i>e&&(a=s>i?s:o,l+=`
`+t.slice(i,a),i=a+1),s=o;return l+=`
`,t.length-i>e&&s>i?l+=t.slice(i,s)+`
`+t.slice(s+1):l+=t.slice(i),l.slice(1)}x(kO,"foldLine");function Jhe(t){for(var e="",r=0,n,i=0;i<t.length;r>=65536?i+=2:i++)r=qm(t,i),n=Ts[r],!n&&Lb(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||Ghe(r);return e}x(Jhe,"escapeString");function ede(t,e,r){var n="",i=t.tag,a,s,o;for(a=0,s=r.length;a<s;a+=1)o=r[a],t.replacer&&(o=t.replacer.call(r,String(a),o)),(Kc(t,e,o,!1,!1)||typeof o>"u"&&Kc(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}x(ede,"writeFlowSequence");function SO(t,e,r,n){var i="",a=t.tag,s,o,l;for(s=0,o=r.length;s<o;s+=1)l=r[s],t.replacer&&(l=t.replacer.call(r,String(s),l)),(Kc(t,e+1,l,!0,!0,!1,!0)||typeof l>"u"&&Kc(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=AA(t,e)),t.dump&&$C===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=a,t.dump=i||"[]"}x(SO,"writeBlockSequence");function tde(t,e,r){var n="",i=t.tag,a=Object.keys(r),s,o,l,u,h;for(s=0,o=a.length;s<o;s+=1)h="",n!==""&&(h+=", "),t.condenseFlow&&(h+='"'),l=a[s],u=r[l],t.replacer&&(u=t.replacer.call(r,l,u)),Kc(t,e,l,!1,!1)&&(t.dump.length>1024&&(h+="? "),h+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Kc(t,e,u,!1,!1)&&(h+=t.dump,n+=h));t.tag=i,t.dump="{"+n+"}"}x(tde,"writeFlowMapping");function rde(t,e,r,n){var i="",a=t.tag,s=Object.keys(r),o,l,u,h,d,f;if(t.sortKeys===!0)s.sort();else if(typeof t.sortKeys=="function")s.sort(t.sortKeys);else if(t.sortKeys)throw new po("sortKeys must be a boolean or a function");for(o=0,l=s.length;o<l;o+=1)f="",(!n||i!=="")&&(f+=AA(t,e)),u=s[o],h=r[u],t.replacer&&(h=t.replacer.call(r,u,h)),Kc(t,e+1,u,!0,!0,!0)&&(d=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,d&&(t.dump&&$C===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,d&&(f+=AA(t,e)),Kc(t,e+1,h,!0,d)&&(t.dump&&$C===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=a,t.dump=i||"{}"}x(rde,"writeBlockMapping");function EO(t,e,r){var n,i,a,s,o,l;for(i=r?t.explicitTypes:t.implicitTypes,a=0,s=i.length;a<s;a+=1)if(o=i[a],(o.instanceOf||o.predicate)&&(!o.instanceOf||typeof e=="object"&&e instanceof o.instanceOf)&&(!o.predicate||o.predicate(e))){if(r?o.multi&&o.representName?t.tag=o.representName(e):t.tag=o.tag:t.tag="?",o.represent){if(l=t.styleMap[o.tag]||o.defaultStyle,Dhe.call(o.represent)==="[object Function]")n=o.represent(e,l);else if(Ohe.call(o.represent,l))n=o.represent[l](e,l);else throw new po("!<"+o.tag+'> tag resolver accepts not "'+l+'" style');t.dump=n}return!0}return!1}x(EO,"detectType");function Kc(t,e,r,n,i,a,s){t.tag=null,t.dump=r,EO(t,r,!1)||EO(t,r,!0);var o=Dhe.call(t.dump),l=n,u;n&&(n=t.flowLevel<0||t.flowLevel>e);var h=o==="[object Object]"||o==="[object Array]",d,f;if(h&&(d=t.duplicates.indexOf(r),f=d!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(i=!1),f&&t.usedDuplicates[d])t.dump="*ref_"+d;else{if(h&&f&&!t.usedDuplicates[d]&&(t.usedDuplicates[d]=!0),o==="[object Object]")n&&Object.keys(t.dump).length!==0?(rde(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(tde(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!s&&e>0?SO(t,e-1,t.dump,i):SO(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(ede(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&Zhe(t,t.dump,e,a,l);else{if(o==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new po("unacceptable kind of an object to dump "+o)}t.tag!==null&&t.tag!=="?"&&(u=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",t.dump=u+" "+t.dump)}return!0}x(Kc,"writeNode");function nde(t,e){var r=[],n=[],i,a;for(_A(t,r,n),i=0,a=n.length;i<a;i+=1)e.duplicates.push(r[n[i]]);e.usedDuplicates=new Array(a)}x(nde,"getDuplicateReferences");function _A(t,e,r){var n,i,a;if(t!==null&&typeof t=="object")if(i=e.indexOf(t),i!==-1)r.indexOf(i)===-1&&r.push(i);else if(e.push(t),Array.isArray(t))for(i=0,a=t.length;i<a;i+=1)_A(t[i],e,r);else for(n=Object.keys(t),i=0,a=n.length;i<a;i+=1)_A(t[n[i]],e,r)}x(_A,"inspectNode");function CYe(t,e){e=e||{};var r=new Whe(e);r.noRefs||nde(t,r);var n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),Kc(r,0,n,!0,!0)?r.dump+`
`:""}x(CYe,"dump$1");function kYe(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}x(kYe,"renamed");var hR=Xue,dR=nYe.load;/*! Bundled license information:
js-yaml/dist/js-yaml.mjs:
(*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *)
*/var SYe=x(t=>{const{handDrawnSeed:e}=Fe();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),yx=x(t=>{const e=EYe([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),EYe=x(t=>{const e=new Map;return t.forEach(r=>{const[n,i]=r.split(":");e.set(n.trim(),i==null?void 0:i.trim())}),e},"styles2Map"),tV=x(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),zt=x(t=>{const{stylesArray:e}=yx(t),r=[],n=[],i=[],a=[];return e.forEach(s=>{const o=s[0];tV(o)?r.push(s.join(":")+" !important"):(n.push(s.join(":")+" !important"),o.includes("stroke")&&i.push(s.join(":")+" !important"),o==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}},"styles2String"),Wt=x((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=Fe(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=yx(t);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||i,seed:n,strokeWidth:((l=s.get("stroke-width"))==null?void 0:l.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:AYe(s.get("stroke-dasharray"))},e)},"userNodeOverrides"),AYe=x(t=>{if(!t)return[0,0];const e=t.trim().split(/\s+/).map(Number);if(e.length===1){const i=isNaN(e[0])?0:e[0];return[i,i]}const r=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1];return[r,n]},"getStrokeDashArray"),CE={},Ji={},gK;function _Ye(){return gK||(gK=1,Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.BLANK_URL=Ji.relativeFirstCharacters=Ji.whitespaceEscapeCharsRegex=Ji.urlSchemeRegex=Ji.ctrlCharactersRegex=Ji.htmlCtrlEntityRegex=Ji.htmlEntitiesRegex=Ji.invalidProtocolRegex=void 0,Ji.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Ji.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Ji.htmlCtrlEntityRegex=/&(newline|tab);/gi,Ji.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Ji.urlSchemeRegex=/^.+(:|&colon;)/gim,Ji.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Ji.relativeFirstCharacters=[".","/"],Ji.BLANK_URL="about:blank"),Ji}var mK;function RYe(){if(mK)return CE;mK=1,Object.defineProperty(CE,"__esModule",{value:!0}),CE.sanitizeUrl=a;var t=_Ye();function e(s){return t.relativeFirstCharacters.indexOf(s[0])>-1}function r(s){var o=s.replace(t.ctrlCharactersRegex,"");return o.replace(t.htmlEntitiesRegex,function(l,u){return String.fromCharCode(u)})}function n(s){return URL.canParse(s)}function i(s){try{return decodeURIComponent(s)}catch{return s}}function a(s){if(!s)return t.BLANK_URL;var o,l=i(s.trim());do l=r(l).replace(t.htmlCtrlEntityRegex,"").replace(t.ctrlCharactersRegex,"").replace(t.whitespaceEscapeCharsRegex,"").trim(),l=i(l),o=l.match(t.ctrlCharactersRegex)||l.match(t.htmlEntitiesRegex)||l.match(t.htmlCtrlEntityRegex)||l.match(t.whitespaceEscapeCharsRegex);while(o&&o.length>0);var u=l;if(!u)return t.BLANK_URL;if(e(u))return u;var h=u.trimStart(),d=h.match(t.urlSchemeRegex);if(!d)return u;var f=d[0].toLowerCase().trim();if(t.invalidProtocolRegex.test(f))return t.BLANK_URL;var p=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return p;if(f==="http:"||f==="https:"){if(!n(p))return t.BLANK_URL;var g=new URL(p);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return p}return CE}var ig=RYe();function LYe(t){return Array.isArray(t)}function HM(t){var r;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const n=t[Symbol.toStringTag];return n==null||!((r=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&r.writable)?!1:t.toString()===`[object ${n}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function MYe(){}function ide(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Qk(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const ade="[object RegExp]",rV="[object String]",nV="[object Number]",iV="[object Boolean]",aV="[object Arguments]",sde="[object Symbol]",ode="[object Date]",lde="[object Map]",cde="[object Set]",ude="[object Array]",hde="[object ArrayBuffer]",dde="[object Object]",fde="[object DataView]",pde="[object Uint8Array]",gde="[object Uint8ClampedArray]",mde="[object Uint16Array]",yde="[object Uint32Array]",vde="[object Int8Array]",bde="[object Int16Array]",xde="[object Int32Array]",Tde="[object Float32Array]",wde="[object Float64Array]",yK=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function sV(t){return typeof yK.Buffer<"u"&&yK.Buffer.isBuffer(t)}function IYe(t){return Number.isSafeInteger(t)&&t>=0}function Cde(t){return t!=null&&typeof t!="function"&&IYe(t.length)}function NYe(t){return t==="__proto__"}function fR(t){return t==null||typeof t!="object"&&typeof t!="function"}function oV(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function DYe(t,e){return Um(t,void 0,t,new Map,e)}function Um(t,e,r,n=new Map,i=void 0){const a=i==null?void 0:i(t,e,r,n);if(a!==void 0)return a;if(fR(t))return t;if(n.has(t))return n.get(t);if(Array.isArray(t)){const s=new Array(t.length);n.set(t,s);for(let o=0;o<t.length;o++)s[o]=Um(t[o],o,r,n,i);return Object.hasOwn(t,"index")&&(s.index=t.index),Object.hasOwn(t,"input")&&(s.input=t.input),s}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const s=new RegExp(t.source,t.flags);return s.lastIndex=t.lastIndex,s}if(t instanceof Map){const s=new Map;n.set(t,s);for(const[o,l]of t)s.set(o,Um(l,o,r,n,i));return s}if(t instanceof Set){const s=new Set;n.set(t,s);for(const o of t)s.add(Um(o,void 0,r,n,i));return s}if(sV(t))return t.subarray();if(oV(t)){const s=new(Object.getPrototypeOf(t)).constructor(t.length);n.set(t,s);for(let o=0;o<t.length;o++)s[o]=Um(t[o],o,r,n,i);return s}if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){const s=new DataView(t.buffer.slice(0),t.byteOffset,t.byteLength);return n.set(t,s),Nl(s,t,r,n,i),s}if(typeof File<"u"&&t instanceof File){const s=new File([t],t.name,{type:t.type});return n.set(t,s),Nl(s,t,r,n,i),s}if(typeof Blob<"u"&&t instanceof Blob){const s=new Blob([t],{type:t.type});return n.set(t,s),Nl(s,t,r,n,i),s}if(t instanceof Error){const s=structuredClone(t);return n.set(t,s),s.message=t.message,s.name=t.name,s.stack=t.stack,s.cause=t.cause,s.constructor=t.constructor,Nl(s,t,r,n,i),s}if(t instanceof Boolean){const s=new Boolean(t.valueOf());return n.set(t,s),Nl(s,t,r,n,i),s}if(t instanceof Number){const s=new Number(t.valueOf());return n.set(t,s),Nl(s,t,r,n,i),s}if(t instanceof String){const s=new String(t.valueOf());return n.set(t,s),Nl(s,t,r,n,i),s}if(typeof t=="object"&&OYe(t)){const s=Object.create(Object.getPrototypeOf(t));return n.set(t,s),Nl(s,t,r,n,i),s}return t}function Nl(t,e,r=t,n,i){const a=[...Object.keys(e),...ide(e)];for(let s=0;s<a.length;s++){const o=a[s],l=Object.getOwnPropertyDescriptor(t,o);(l==null||l.writable)&&(t[o]=Um(e[o],o,r,n,i))}}function OYe(t){switch(Qk(t)){case aV:case ude:case hde:case fde:case iV:case ode:case Tde:case wde:case vde:case bde:case xde:case lde:case nV:case dde:case ade:case cde:case rV:case sde:case pde:case gde:case mde:case yde:return!0;default:return!1}}function $Ye(t,e){return DYe(t,(r,n,i,a)=>{if(typeof t=="object"){if(Qk(t)==="[object Object]"&&typeof t.constructor!="function"){const s={};return a.set(t,s),Nl(s,t,i,a),s}switch(Object.prototype.toString.call(t)){case nV:case rV:case iV:{const s=new t.constructor(t==null?void 0:t.valueOf());return Nl(s,t),s}case aV:{const s={};return Nl(s,t),s.length=t.length,s[Symbol.iterator]=t[Symbol.iterator],s}default:return}}})}function vK(t){return $Ye(t)}function AO(t){return t!==null&&typeof t=="object"&&Qk(t)==="[object Arguments]"}function _O(t){return typeof t=="object"&&t!==null}function PYe(t){return _O(t)&&Cde(t)}function Bw(t){return oV(t)}function BYe(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function Jk(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");const r=function(...n){const i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);const s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(Jk.Cache||Map),r}Jk.Cache=Map;function FYe(t){if(fR(t))return t;const e=Qk(t);if(!zYe(t))return{};if(LYe(t)){const n=Array.from(t);return t.length>0&&typeof t[0]=="string"&&Object.hasOwn(t,"index")&&(n.index=t.index,n.input=t.input),n}if(Bw(t)){const n=t,i=n.constructor;return new i(n.buffer,n.byteOffset,n.length)}if(e==="[object ArrayBuffer]")return new ArrayBuffer(t.byteLength);if(e==="[object DataView]"){const n=t,i=n.buffer,a=n.byteOffset,s=n.byteLength,o=new ArrayBuffer(s),l=new Uint8Array(i,a,s);return new Uint8Array(o).set(l),new DataView(o)}if(e==="[object Boolean]"||e==="[object Number]"||e==="[object String]"){const n=t.constructor,i=new n(t.valueOf());return e==="[object String]"?GYe(i,t):qM(i,t),i}if(e==="[object Date]")return new Date(Number(t));if(e==="[object RegExp]"){const n=t,i=new RegExp(n.source,n.flags);return i.lastIndex=n.lastIndex,i}if(e==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(t));if(e==="[object Map]"){const n=t,i=new Map;return n.forEach((a,s)=>{i.set(s,a)}),i}if(e==="[object Set]"){const n=t,i=new Set;return n.forEach(a=>{i.add(a)}),i}if(e==="[object Arguments]"){const n=t,i={};return qM(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}const r={};return WYe(r,t),qM(r,t),VYe(r,t),r}function zYe(t){switch(Qk(t)){case aV:case ude:case hde:case fde:case iV:case ode:case Tde:case wde:case vde:case bde:case xde:case lde:case nV:case dde:case ade:case cde:case rV:case sde:case pde:case gde:case mde:case yde:return!0;default:return!1}}function qM(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function VYe(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n<r.length;n++){const i=r[n];Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}}function GYe(t,e){const r=e.valueOf().length;for(const n in e)Object.hasOwn(e,n)&&(Number.isNaN(Number(n))||Number(n)>=r)&&(t[n]=e[n])}function WYe(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function HYe(t){if(fR(t))return t;if(Array.isArray(t)||oV(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t);if(e==null)return Object.assign(Object.create(e),t);const r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){const n=new r(t);return n.lastIndex=t.lastIndex,n}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){let n;return t instanceof AggregateError?n=new r(t.errors,t.message,{cause:t.cause}):n=new r(t.message,{cause:t.cause}),n.stack=t.stack,Object.assign(n,t),n}return typeof File<"u"&&t instanceof File?new r([t],t.name,{type:t.type,lastModified:t.lastModified}):typeof t=="object"?Object.assign(Object.create(e),t):t}function qYe(t,...e){const r=e.slice(0,-1),n=e[e.length-1];let i=t;for(let a=0;a<r.length;a++){const s=r[a];i=K4(i,s,n,new Map)}return i}function K4(t,e,r,n){if(fR(t)&&(t=Object(t)),e==null||typeof e!="object")return t;if(n.has(e))return HYe(n.get(e));if(n.set(e,t),Array.isArray(e)){e=e.slice();for(let a=0;a<e.length;a++)e[a]=e[a]??void 0}const i=[...Object.keys(e),...ide(e)];for(let a=0;a<i.length;a++){const s=i[a];if(NYe(s))continue;let o=e[s],l=t[s];if(AO(o)&&(o={...o}),AO(l)&&(l={...l}),sV(o)&&(o=vK(o)),Array.isArray(o))if(Array.isArray(l)){const h=[],d=Reflect.ownKeys(l);for(let f=0;f<d.length;f++){const p=d[f];h[p]=l[p]}l=h}else if(PYe(l)){const h=[];for(let d=0;d<l.length;d++)h[d]=l[d];l=h}else l=[];const u=r(l,o,s,t,e,n);u!==void 0?t[s]=u:Array.isArray(o)||_O(l)&&_O(o)&&(HM(l)||HM(o)||Bw(l)||Bw(o))?t[s]=K4(l,o,r,n):l==null&&HM(o)?t[s]=K4({},o,r,n):l==null&&Bw(o)?t[s]=vK(o):(l===void 0||o!==void 0)&&(t[s]=o)}return t}function UYe(t,...e){return qYe(t,...e,MYe)}function bK(t){if(t==null)return!0;if(Cde(t))return typeof t.splice!="function"&&typeof t!="string"&&!sV(t)&&!Bw(t)&&!AO(t)?!1:t.length===0;if(typeof t=="object"||typeof t=="function"){if(t instanceof Map||t instanceof Set)return t.size===0;const e=Object.keys(t);return BYe(t)?e.filter(r=>r!=="constructor").length===0:e.length===0}return!0}var kde="​",YYe={curveBasis:DC,curveBasisClosed:dUe,curveBasisOpen:fUe,curveBumpX:nue,curveBumpY:iue,curveBundle:pUe,curveCardinalClosed:gUe,curveCardinalOpen:mUe,curveCardinal:lue,curveCatmullRomClosed:yUe,curveCatmullRomOpen:vUe,curveCatmullRom:uue,curveLinear:Pw,curveLinearClosed:bUe,curveMonotoneX:mue,curveMonotoneY:yue,curveNatural:bue,curveStep:xue,curveStepAfter:wue,curveStepBefore:Tue},XYe=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,jYe=x(function(t,e){const r=Sde(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const s=r.map(o=>o.args);J5(s),n=Wi(n,[...s])}else n=r.args;if(!n)return;let i=kz(t,e);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),Sde=x(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${XYe.source})(?=[}][%]{2}).*
`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),le.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let a;const s=[];for(;(a=Ow.exec(t))!==null;)if(a.index===Ow.lastIndex&&Ow.lastIndex++,a&&!e||e&&((r=a[1])!=null&&r.match(e))||e&&((n=a[2])!=null&&n.match(e))){const o=a[1]?a[1]:a[2],l=a[3]?a[3].trim():a[4]?JSON.parse(a[4].trim()):null;s.push({type:o,args:l})}return s.length===0?{type:t,args:null}:s.length===1?s[0]:s}catch(i){return le.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),KYe=x(function(t){return t.replace(Ow,"")},"removeDirectives"),ZYe=x(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function lV(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return YYe[r]??e}x(lV,"interpolateToCurve");function Ede(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?ig.sanitizeUrl(r):r}x(Ede,"formatUrl");var QYe=x((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let s=0;s<n;s++)if(a=a[r[s]],!a){le.error(`Function name: ${t} not found in window`);return}a[i](...e)},"runFunc");function cV(t,e){return!t||!e?0:Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}x(cV,"distance");function Ade(t){let e,r=0;t.forEach(i=>{r+=cV(i,e),e=i});const n=r/2;return uV(t,n)}x(Ade,"traverseEdge");function _de(t){return t.length===1?t[0]:Ade(t)}x(_de,"calcLabelPosition");var xK=x((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),uV=x((t,e)=>{let r,n=e;for(const i of t){if(r){const a=cV(i,r);if(a===0)return r;if(a<n)n-=a;else{const s=n/a;if(s<=0)return r;if(s>=1)return{x:i.x,y:i.y};if(s>0&&s<1)return{x:xK((1-s)*r.x+s*i.x,5),y:xK((1-s)*r.y+s*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),JYe=x((t,e,r)=>{le.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=uV(e,25),a=t?10:5,s=Math.atan2(e[0].y-i.y,e[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(s)*a+(e[0].x+i.x)/2,o.y=-Math.cos(s)*a+(e[0].y+i.y)/2,o},"calcCardinalityPosition");function Rde(t,e,r){const n=structuredClone(r);le.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,a=uV(n,i),s=10+t*.5,o=Math.atan2(n[0].y-a.y,n[0].x-a.x),l={x:0,y:0};return e==="start_left"?(l.x=Math.sin(o+Math.PI)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o+Math.PI)*s+(n[0].y+a.y)/2):e==="end_right"?(l.x=Math.sin(o-Math.PI)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o-Math.PI)*s+(n[0].y+a.y)/2-5):e==="end_left"?(l.x=Math.sin(o)*s+(n[0].x+a.x)/2-5,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2-5):(l.x=Math.sin(o)*s+(n[0].x+a.x)/2,l.y=-Math.cos(o)*s+(n[0].y+a.y)/2),l}x(Rde,"calcTerminalLabelPosition");function hV(t){let e="",r="";for(const n of t)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":e=e+n+";");return{style:e,labelStyle:r}}x(hV,"getStylesFromArray");var TK=0,Lde=x(()=>(TK++,"id-"+Math.random().toString(36).substr(2,12)+"-"+TK),"generateId");function Mde(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}x(Mde,"makeRandomHex");var Ide=x(t=>Mde(t.length),"random"),eXe=x(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),tXe=x(function(t,e){const r=e.text.replace(At.lineBreakRegex," "),[,n]=Oh(e.fontSize),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.style("text-anchor",e.anchor),i.style("font-family",e.fontFamily),i.style("font-size",n),i.style("font-weight",e.fontWeight),i.attr("fill",e.fill),e.class!==void 0&&i.attr("class",e.class);const a=i.append("tspan");return a.attr("x",e.x+e.textMargin*2),a.attr("fill",e.fill),a.text(r),i},"drawSimpleText"),Fw=Jk((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),At.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach((s,o)=>{const l=zs(`${s} `,r),u=zs(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=rXe(s,e,"-",r);i.push(a,...f),a=p}else u+l>=e?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");o+1===n.length&&i.push(a)}),i.filter(s=>s!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),rXe=Jk((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],a=[];let s="";return i.forEach((o,l)=>{const u=`${s}${o}`;if(zs(u,n)>=e){const d=l+1,f=i.length===d,p=`${u}${r}`;a.push(f?u:p),s=""}else s=u}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function RA(t,e){return pR(t,e).height}x(RA,"calculateTextHeight");function zs(t,e){return pR(t,e).width}x(zs,"calculateTextWidth");var pR=Jk((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=Oh(r),s=["sans-serif",n],o=t.split(At.lineBreakRegex),l=[],u=ut("body");if(!u.remove)return{width:0,height:0,lineHeight:0};const h=u.append("svg");for(const f of s){let p=0;const g={width:0,height:0,lineHeight:0};for(const m of o){const y=eXe();y.text=m||kde;const v=tXe(h,y).style("font-size",a).style("font-weight",i).style("font-family",f),T=(v._groups||v)[0][0].getBBox();if(T.width===0&&T.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,T.width)),p=Math.round(T.height),g.height+=p,g.lineHeight=Math.round(Math.max(g.lineHeight,p))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),Hy,nXe=(Hy=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},x(Hy,"InitIDGenerator"),Hy),kE,iXe=x(function(t){return kE=kE||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),kE.innerHTML=t,unescape(kE.textContent)},"entityDecode");function dV(t){return"str"in t}x(dV,"isDetailedError");var aXe=x((t,e,r,n)=>{var a;if(!n)return;const i=(a=t.node())==null?void 0:a.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),Oh=x(t=>{if(typeof t=="number")return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function ri(t,e){return UYe({},t,e)}x(ri,"cleanAndMerge");var yr={assignWithDepth:Wi,wrapLabel:Fw,calculateTextHeight:RA,calculateTextWidth:zs,calculateTextDimensions:pR,cleanAndMerge:ri,detectInit:jYe,detectDirective:Sde,isSubstringInArray:ZYe,interpolateToCurve:lV,calcLabelPosition:_de,calcCardinalityPosition:JYe,calcTerminalLabelPosition:Rde,formatUrl:Ede,getStylesFromArray:hV,generateId:Lde,random:Ide,runFunc:QYe,entityDecode:iXe,insertTitle:aXe,isLabelCoordinateInPath:Nde,parseFontSize:Oh,InitIDGenerator:nXe},sXe=x(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),e},"encodeEntities"),vh=x(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),dy=x((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function Ca(t){return t??null}x(Ca,"handleUndefinedAttr");function Nde(t,e){const r=Math.round(t.x),n=Math.round(t.y),i=e.replace(/(\d+\.\d+)/g,a=>Math.round(parseFloat(a)).toString());return i.includes(r.toString())||i.includes(n.toString())}x(Nde,"isLabelCoordinateInPath");var vx=x(({flowchart:t})=>{var i,a;const e=((i=t==null?void 0:t.subGraphTitleMargin)==null?void 0:i.top)??0,r=((a=t==null?void 0:t.subGraphTitleMargin)==null?void 0:a.bottom)??0,n=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins");async function fV(t,e){const r=t.getElementsByTagName("img");if(!r||r.length===0)return;const n=e.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...r].map(i=>new Promise(a=>{function s(){if(i.style.display="flex",i.style.flexDirection="column",n){const o=Fe().fontSize?Fe().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=Vr.fontSize]=Oh(o),h=u*l+"px";i.style.minWidth=h,i.style.maxWidth=h}else i.style.width="100%";a(i)}x(s,"setupImage"),setTimeout(()=>{i.complete&&s()}),i.addEventListener("error",s),i.addEventListener("load",s)})))}x(fV,"configureLabelImages");const oXe=Object.freeze({left:0,top:0,width:16,height:16}),LA=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Dde=Object.freeze({...oXe,...LA}),lXe=Object.freeze({...Dde,body:"",hidden:!1}),cXe=Object.freeze({width:null,height:null}),uXe=Object.freeze({...cXe,...LA}),hXe=(t,e,r,n="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;n=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const o=i.pop(),l=i.pop(),u={provider:i.length>0?i[0]:n,prefix:l,name:o};return UM(u)?u:null}const a=i[0],s=a.split("-");if(s.length>1){const o={provider:n,prefix:s.shift(),name:s.join("-")};return UM(o)?o:null}if(r&&n===""){const o={provider:n,prefix:"",name:a};return UM(o,r)?o:null}return null},UM=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function dXe(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const n=((t.rotate||0)+(e.rotate||0))%4;return n&&(r.rotate=n),r}function wK(t,e){const r=dXe(t,e);for(const n in lXe)n in LA?n in t&&!(n in r)&&(r[n]=LA[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function fXe(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function a(s){if(r[s])return i[s]=[];if(!(s in i)){i[s]=null;const o=n[s]&&n[s].parent,l=o&&a(o);l&&(i[s]=[o].concat(l))}return i[s]}return(e||Object.keys(r).concat(Object.keys(n))).forEach(a),i}function CK(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function s(o){a=wK(n[o]||i[o],a)}return s(e),r.forEach(s),wK(t,a)}function pXe(t,e){if(t.icons[e])return CK(t,e,[]);const r=fXe(t,[e])[e];return r?CK(t,e,r):null}const gXe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,mXe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function kK(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;const n=t.split(gXe);if(n===null||!n.length)return t;const i=[];let a=n.shift(),s=mXe.test(a);for(;;){if(s){const o=parseFloat(a);isNaN(o)?i.push(a):i.push(Math.ceil(o*e*r)/r)}else i.push(a);if(a=n.shift(),a===void 0)return i.join("");s=!s}}function yXe(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),a=t.indexOf("</"+e);if(i===-1||a===-1)break;const s=t.indexOf(">",a);if(s===-1)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(s+1)}return{defs:r,content:t}}function vXe(t,e){return t?"<defs>"+t+"</defs>"+e:e}function bXe(t,e,r){const n=yXe(t);return vXe(n.defs,e+n.content+r)}const xXe=t=>t==="unset"||t==="undefined"||t==="none";function TXe(t,e){const r={...Dde,...t},n={...uXe,...e},i={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,n].forEach(m=>{const y=[],v=m.hFlip,T=m.vFlip;let b=m.rotate;v?T?b+=2:(y.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),y.push("scale(-1 1)"),i.top=i.left=0):T&&(y.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),y.push("scale(1 -1)"),i.top=i.left=0);let w;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:w=i.height/2+i.top,y.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:y.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:w=i.width/2+i.left,y.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}b%2===1&&(i.left!==i.top&&(w=i.left,i.left=i.top,i.top=w),i.width!==i.height&&(w=i.width,i.width=i.height,i.height=w)),y.length&&(a=bXe(a,'<g transform="'+y.join(" ")+'">',"</g>"))});const s=n.width,o=n.height,l=i.width,u=i.height;let h,d;s===null?(d=o===null?"1em":o==="auto"?u:o,h=kK(d,l/u)):(h=s==="auto"?l:s,d=o===null?kK(h,u/l):o==="auto"?u:o);const f={},p=(m,y)=>{xXe(y)||(f[m]=y.toString())};p("width",h),p("height",d);const g=[i.left,i.top,l,u];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:a}}const wXe=/\sid="(\S+)"/g,SK=new Map;function CXe(t){t=t.replace(/[0-9]+$/,"")||"a";const e=SK.get(t)||0;return SK.set(t,e+1),e?`${t}${e}`:t}function kXe(t){const e=[];let r;for(;r=wXe.exec(t);)e.push(r[1]);if(!e.length)return t;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(i=>{const a=CXe(i),s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+n+"$3")}),t=t.replace(new RegExp(n,"g"),""),t}function SXe(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in e)r+=" "+n+'="'+e[n]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+t+"</svg>"}var Ode={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},RO=new Map,$de=new Map,pV=x(t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(le.debug("Registering icon pack:",e.name),"loader"in e)$de.set(e.name,e.loader);else if("icons"in e)RO.set(e.name,e.icons);else throw le.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),Pde=x(async(t,e)=>{const r=hXe(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);const n=r.prefix||e;if(!n)throw new Error(`Icon name must contain a prefix: ${t}`);let i=RO.get(n);if(!i){const s=$de.get(n);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await s(),prefix:n},RO.set(n,i)}catch(o){throw le.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=pXe(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),EXe=x(async t=>{try{return await Pde(t),!0}catch{return!1}},"isIconAvailable"),bh=x(async(t,e,r)=>{let n;try{n=await Pde(t,e==null?void 0:e.fallbackPrefix)}catch(s){le.error(s),n=Ode}const i=TXe(n,e),a=SXe(kXe(i.body),{...i.attributes,...r});return Wr(a,Xt())},"getIconSVG");function gV(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ag=gV();function Bde(t){ag=t}var zw={exec:()=>null};function pn(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace($s.caret,"$1"),r=r.replace(i,s),n},getRegex:()=>new RegExp(r,e)};return n}var AXe=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),$s={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},_Xe=/^(?:[ \t]*(?:\n|$))+/,RXe=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,LXe=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,eS=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,MXe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,mV=/(?:[*+-]|\d{1,9}[.)])/,Fde=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zde=pn(Fde).replace(/bull/g,mV).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),IXe=pn(Fde).replace(/bull/g,mV).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),yV=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,NXe=/^[^\n]+/,vV=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,DXe=pn(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",vV).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),OXe=pn(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,mV).getRegex(),gR="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",bV=/\x3C!--(?:-?>|[\s\S]*?(?:-->|$))/,$Xe=pn("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",bV).replace("tag",gR).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Vde=pn(yV).replace("hr",eS).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",gR).getRegex(),PXe=pn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Vde).getRegex(),xV={blockquote:PXe,code:RXe,def:DXe,fences:LXe,heading:MXe,hr:eS,html:$Xe,lheading:zde,list:OXe,newline:_Xe,paragraph:Vde,table:zw,text:NXe},EK=pn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",eS).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",gR).getRegex(),BXe={...xV,lheading:IXe,table:EK,paragraph:pn(yV).replace("hr",eS).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",EK).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",gR).getRegex()},FXe={...xV,html:pn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",bV).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:zw,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:pn(yV).replace("hr",eS).replace("heading",` *#{1,6} *[^
]`).replace("lheading",zde).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zXe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,VXe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Gde=/^( {2,}|\\)\n(?!\s*$)/,GXe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,mR=/[\p{P}\p{S}]/u,TV=/[\s\p{P}\p{S}]/u,Wde=/[^\s\p{P}\p{S}]/u,WXe=pn(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,TV).getRegex(),Hde=/(?!~)[\p{P}\p{S}]/u,HXe=/(?!~)[\s\p{P}\p{S}]/u,qXe=/(?:[^\s\p{P}\p{S}]|~)/u,UXe=pn(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",AXe?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),qde=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,YXe=pn(qde,"u").replace(/punct/g,mR).getRegex(),XXe=pn(qde,"u").replace(/punct/g,Hde).getRegex(),Ude="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",jXe=pn(Ude,"gu").replace(/notPunctSpace/g,Wde).replace(/punctSpace/g,TV).replace(/punct/g,mR).getRegex(),KXe=pn(Ude,"gu").replace(/notPunctSpace/g,qXe).replace(/punctSpace/g,HXe).replace(/punct/g,Hde).getRegex(),ZXe=pn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Wde).replace(/punctSpace/g,TV).replace(/punct/g,mR).getRegex(),QXe=pn(/\\(punct)/,"gu").replace(/punct/g,mR).getRegex(),JXe=pn(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),eje=pn(bV).replace("(?:-->|$)","-->").getRegex(),tje=pn("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",eje).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),MA=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,rje=pn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",MA).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Yde=pn(/^!?\[(label)\]\[(ref)\]/).replace("label",MA).replace("ref",vV).getRegex(),Xde=pn(/^!?\[(ref)\](?:\[\])?/).replace("ref",vV).getRegex(),nje=pn("reflink|nolink(?!\\()","g").replace("reflink",Yde).replace("nolink",Xde).getRegex(),AK=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,wV={_backpedal:zw,anyPunctuation:QXe,autolink:JXe,blockSkip:UXe,br:Gde,code:VXe,del:zw,emStrongLDelim:YXe,emStrongRDelimAst:jXe,emStrongRDelimUnd:ZXe,escape:zXe,link:rje,nolink:Xde,punctuation:WXe,reflink:Yde,reflinkSearch:nje,tag:tje,text:GXe,url:zw},ije={...wV,link:pn(/^!?\[(label)\]\((.*?)\)/).replace("label",MA).getRegex(),reflink:pn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",MA).getRegex()},LO={...wV,emStrongRDelimAst:KXe,emStrongLDelim:XXe,url:pn(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",AK).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:pn(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",AK).getRegex()},aje={...LO,br:pn(Gde).replace("{2,}","*").getRegex(),text:pn(LO.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},SE={normal:xV,gfm:BXe,pedantic:FXe},sT={normal:wV,gfm:LO,breaks:aje,pedantic:ije},sje={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},_K=t=>sje[t];function Tc(t,e){if(e){if($s.escapeTest.test(t))return t.replace($s.escapeReplace,_K)}else if($s.escapeTestNoEncode.test(t))return t.replace($s.escapeReplaceNoEncode,_K);return t}function RK(t){try{t=encodeURI(t).replace($s.percentDecode,"%")}catch{return null}return t}function LK(t,e){var a;let r=t.replace($s.findPipe,(s,o,l)=>{let u=!1,h=o;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split($s.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace($s.slashPipe,"|");return n}function oT(t,e,r){let n=t.length;if(n===0)return"";let i=0;for(;i<n&&t.charAt(n-i-1)===e;)i++;return t.slice(0,n-i)}function oje(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])r++;else if(t[n]===e[1]&&(r--,r<0))return n;return r>0?-2:-1}function MK(t,e,r,n,i){let a=e.href,s=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:s,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function lje(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(`
`).map(a=>{let s=a.match(r.other.beginningSpace);if(s===null)return a;let[o]=s;return o.length>=i.length?a.slice(i.length):a}).join(`
`)}var IA=class{constructor(e){jt(this,"options");jt(this,"rules");jt(this,"lexer");this.options=e||ag}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:oT(n,`
`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=lje(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:i}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let i=oT(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:oT(r[0],`
`)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=oT(r[0],`
`).split(`
`),i="",a="",s=[];for(;n.length>0;){let o=!1,l=[],u;for(u=0;u<n.length;u++)if(this.rules.other.blockquoteStart.test(n[u]))l.push(n[u]),o=!0;else if(!o)l.push(n[u]);else break;n=n.slice(u);let h=l.join(`
`),d=h.replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
${h}`:h,a=a?`${a}
${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,s,!0),this.lexer.state.top=f,n.length===0)break;let p=s.at(-1);if((p==null?void 0:p.type)==="code")break;if((p==null?void 0:p.type)==="blockquote"){let g=p,m=g.raw+`
`+n.join(`
`),y=this.blockquote(m);s[s.length-1]=y,i=i.substring(0,i.length-g.raw.length)+y.raw,a=a.substring(0,a.length-g.text.length)+y.text;break}else if((p==null?void 0:p.type)==="list"){let g=p,m=g.raw+`
`+n.join(`
`),y=this.list(m);s[s.length-1]=y,i=i.substring(0,i.length-p.raw.length)+y.raw,a=a.substring(0,a.length-g.raw.length)+y.raw,n=m.substring(s.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:i,tokens:s,text:a}}}list(e){let r=this.rules.block.list.exec(e);if(r){let n=r[1].trim(),i=n.length>1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;e;){let u=!1,h="",d="";if(!(r=s.exec(e))||this.rules.block.hr.test(e))break;h=r[0],e=e.substring(h.length);let f=r[2].split(`
`,1)[0].replace(this.rules.other.listReplaceTabs,T=>" ".repeat(3*T.length)),p=e.split(`
`,1)[0],g=!f.trim(),m=0;if(this.options.pedantic?(m=2,d=f.trimStart()):g?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=f.slice(m),m+=r[1].length),g&&this.rules.other.blankLine.test(p)&&(h+=p+`
`,e=e.substring(p.length+1),u=!0),!u){let T=this.rules.other.nextBulletRegex(m),b=this.rules.other.hrRegex(m),w=this.rules.other.fencesBeginRegex(m),C=this.rules.other.headingBeginRegex(m),S=this.rules.other.htmlBeginRegex(m);for(;e;){let k=e.split(`
`,1)[0],E;if(p=k,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),E=p):E=p.replace(this.rules.other.tabCharGlobal," "),w.test(p)||C.test(p)||S.test(p)||T.test(p)||b.test(p))break;if(E.search(this.rules.other.nonSpaceChar)>=m||!p.trim())d+=`
`+E.slice(m);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(f)||C.test(f)||b.test(f))break;d+=`
`+p}!g&&!p.trim()&&(g=!0),h+=k+`
`,e=e.substring(k.length+1),f=E.slice(m)}}a.loose||(o?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0));let y=null,v;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(v=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:h,task:!!y,checked:v,loose:!1,text:d,tokens:[]}),a.raw+=h}let l=a.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let u=0;u<a.items.length;u++)if(this.lexer.state.top=!1,a.items[u].tokens=this.lexer.blockTokens(a.items[u].text,[]),!a.loose){let h=a.items[u].tokens.filter(f=>f.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));a.loose=d}if(a.loose)for(let u=0;u<a.items.length;u++)a.items[u].loose=!0;return a}}html(e){let r=this.rules.block.html.exec(e);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(e){let r=this.rules.block.def.exec(e);if(r){let n=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:i,title:a}}}table(e){var o;let r=this.rules.block.table.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let n=LK(r[1]),i=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(o=r[3])!=null&&o.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],s={type:"table",raw:r[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let l of i)this.rules.other.tableAlignRight.test(l)?s.align.push("right"):this.rules.other.tableAlignCenter.test(l)?s.align.push("center"):this.rules.other.tableAlignLeft.test(l)?s.align.push("left"):s.align.push(null);for(let l=0;l<n.length;l++)s.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:s.align[l]});for(let l of a)s.rows.push(LK(l,s.header.length).map((u,h)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:s.align[h]})));return s}}lheading(e){let r=this.rules.block.lheading.exec(e);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(e){let r=this.rules.block.paragraph.exec(e);if(r){let n=r[1].charAt(r[1].length-1)===`
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=oT(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=oje(r[2],"()");if(s===-2)return;if(s>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),MK(r,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[i.toLowerCase()];if(!a){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return MK(n,a,n[0],this.lexer,this.rules)}}emStrong(e,r,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,s,o,l=a,u=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*e.length+a);(i=h.exec(r))!=null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(o=[...s].length,i[3]||i[4]){l+=o;continue}else if((i[5]||i[6])&&a%3&&!((a+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let d=[...i[0]][0].length,f=e.slice(0,a+i.index+d+o);if(Math.min(a,o)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){let r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let n,i;return r[2]==="@"?(n=r[1],i="mailto:"+n):(n=r[1],i=n),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let r;if(r=this.rules.inline.url.exec(e)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let s;do s=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(s!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},Fl=class MO{constructor(e){jt(this,"tokens");jt(this,"options");jt(this,"state");jt(this,"tokenizer");jt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ag,this.options.tokenizer=this.options.tokenizer||new IA,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:$s,block:SE.normal,inline:sT.normal};this.options.pedantic?(r.block=SE.pedantic,r.inline=sT.pedantic):this.options.gfm&&(r.block=SE.gfm,this.options.breaks?r.inline=sT.breaks:r.inline=sT.gfm),this.tokenizer.rules=r}static get rules(){return{block:SE,inline:sT}}static lex(e,r){return new MO(r).lex(e)}static lexInline(e,r){return new MO(r).inlineTokens(e)}lex(e){e=e.replace($s.carriageReturn,`
`),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],n=!1){var i,a,s;for(this.options.pedantic&&(e=e.replace($s.tabCharGlobal," ").replace($s.spaceLine,""));e;){let o;if((a=(i=this.options.extensions)==null?void 0:i.block)!=null&&a.some(u=>(o=u.call({lexer:this},e,r))?(e=e.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let u=r.at(-1);o.raw.length===1&&u!==void 0?u.raw+=`
`:r.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
`)?"":`
`)+o.raw,u.text+=`
`+o.text,this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
`)?"":`
`)+o.raw,u.text+=`
`+o.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),r.push(o);continue}let l=e;if((s=this.options.extensions)!=null&&s.startBlock){let u=1/0,h=e.slice(1),d;this.options.extensions.startBlock.forEach(f=>{d=f.call({lexer:this},h),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(l=e.substring(0,u+1))}if(this.state.top&&(o=this.tokenizer.paragraph(l))){let u=r.at(-1);n&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=(u.raw.endsWith(`
`)?"":`
`)+o.raw,u.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o),n=l.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let u=r.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
`)?"":`
`)+o.raw,u.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,u,h,d,f;let n=e,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((u=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:u.call({lexer:this},n))??n;let s=!1,o="";for(;e;){s||(o=""),s=!1;let p;if((d=(h=this.options.extensions)==null?void 0:h.inline)!=null&&d.some(m=>(p=m.call({lexer:this},e,r))?(e=e.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=r.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(p=this.tokenizer.emStrong(e,n,o)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.del(e)){e=e.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),r.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),r.push(p);continue}let g=e;if((f=this.options.extensions)!=null&&f.startInline){let m=1/0,y=e.slice(1),v;this.options.extensions.startInline.forEach(T=>{v=T.call({lexer:this},y),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(o=p.raw.slice(-1)),s=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):r.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},NA=class{constructor(e){jt(this,"options");jt(this,"parser");this.options=e||ag}space(e){return""}code({text:e,lang:r,escaped:n}){var s;let i=(s=(r||"").match($s.notSpaceStart))==null?void 0:s[0],a=e.replace($s.endingNewline,"")+`
`;return i?'<pre><code class="language-'+Tc(i)+'">'+(n?a:Tc(a,!0))+`</code></pre>
`:"<pre><code>"+(n?a:Tc(a,!0))+`</code></pre>
`}blockquote({tokens:e}){return`<blockquote>
${this.parser.parse(e)}</blockquote>
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:r}){return`<h${r}>${this.parser.parseInline(e)}</h${r}>
`}hr(e){return`<hr>
`}list(e){let r=e.ordered,n=e.start,i="";for(let o=0;o<e.items.length;o++){let l=e.items[o];i+=this.listitem(l)}let a=r?"ol":"ul",s=r&&n!==1?' start="'+n+'"':"";return"<"+a+s+`>
`+i+"</"+a+`>
`}listitem(e){var n;let r="";if(e.task){let i=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+Tc(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(e.tokens,!!e.loose),`<li>${r}</li>
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
`}table(e){let r="",n="";for(let a=0;a<e.header.length;a++)n+=this.tablecell(e.header[a]);r+=this.tablerow({text:n});let i="";for(let a=0;a<e.rows.length;a++){let s=e.rows[a];n="";for(let o=0;o<s.length;o++)n+=this.tablecell(s[o]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
<thead>
`+r+`</thead>
`+i+`</table>
`}tablerow({text:e}){return`<tr>
${e}</tr>
`}tablecell(e){let r=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+r+`</${n}>
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Tc(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),a=RK(e);if(a===null)return i;e=a;let s='<a href="'+e+'"';return r&&(s+=' title="'+Tc(r)+'"'),s+=">"+i+"</a>",s}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=RK(e);if(a===null)return Tc(n);e=a;let s=`<img src="${e}" alt="${n}"`;return r&&(s+=` title="${Tc(r)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Tc(e.text)}},CV=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},zl=class IO{constructor(e){jt(this,"options");jt(this,"renderer");jt(this,"textRenderer");this.options=e||ag,this.options.renderer=this.options.renderer||new NA,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new CV}static parse(e,r){return new IO(r).parse(e)}static parseInline(e,r){return new IO(r).parseInline(e)}parse(e,r=!0){var i,a;let n="";for(let s=0;s<e.length;s++){let o=e[s];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[o.type]){let u=o,h=this.options.extensions.renderers[u.type].call({parser:this},u);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(u.type)){n+=h||"";continue}}let l=o;switch(l.type){case"space":{n+=this.renderer.space(l);continue}case"hr":{n+=this.renderer.hr(l);continue}case"heading":{n+=this.renderer.heading(l);continue}case"code":{n+=this.renderer.code(l);continue}case"table":{n+=this.renderer.table(l);continue}case"blockquote":{n+=this.renderer.blockquote(l);continue}case"list":{n+=this.renderer.list(l);continue}case"html":{n+=this.renderer.html(l);continue}case"def":{n+=this.renderer.def(l);continue}case"paragraph":{n+=this.renderer.paragraph(l);continue}case"text":{let u=l,h=this.renderer.text(u);for(;s+1<e.length&&e[s+1].type==="text";)u=e[++s],h+=`
`+this.renderer.text(u);r?n+=this.renderer.paragraph({type:"paragraph",raw:h,text:h,tokens:[{type:"text",raw:h,text:h,escaped:!0}]}):n+=h;continue}default:{let u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}parseInline(e,r=this.renderer){var i,a;let n="";for(let s=0;s<e.length;s++){let o=e[s];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[o.type]){let u=this.options.extensions.renderers[o.type].call({parser:this},o);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=u||"";continue}}let l=o;switch(l.type){case"escape":{n+=r.text(l);break}case"html":{n+=r.html(l);break}case"link":{n+=r.link(l);break}case"image":{n+=r.image(l);break}case"strong":{n+=r.strong(l);break}case"em":{n+=r.em(l);break}case"codespan":{n+=r.codespan(l);break}case"br":{n+=r.br(l);break}case"del":{n+=r.del(l);break}case"text":{n+=r.text(l);break}default:{let u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}},M4,UT=(M4=class{constructor(e){jt(this,"options");jt(this,"block");this.options=e||ag}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Fl.lex:Fl.lexInline}provideParser(){return this.block?zl.parse:zl.parseInline}},jt(M4,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),jt(M4,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),M4),cje=class{constructor(...e){jt(this,"defaults",gV());jt(this,"options",this.setOptions);jt(this,"parse",this.parseMarkdown(!0));jt(this,"parseInline",this.parseMarkdown(!1));jt(this,"Parser",zl);jt(this,"Renderer",NA);jt(this,"TextRenderer",CV);jt(this,"Lexer",Fl);jt(this,"Tokenizer",IA);jt(this,"Hooks",UT);this.use(...e)}walkTokens(e,r){var i,a;let n=[];for(let s of e)switch(n=n.concat(r.call(this,s)),s.type){case"table":{let o=s;for(let l of o.header)n=n.concat(this.walkTokens(l.tokens,r));for(let l of o.rows)for(let u of l)n=n.concat(this.walkTokens(u.tokens,r));break}case"list":{let o=s;n=n.concat(this.walkTokens(o.items,r));break}default:{let o=s;(a=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&a[o.type]?this.defaults.extensions.childTokens[o.type].forEach(l=>{let u=o[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,r)))}}return n}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let s=r.renderers[a.name];s?r.renderers[a.name]=function(...o){let l=a.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=r[a.level];s?s.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),i.extensions=r),n.renderer){let a=this.defaults.renderer||new NA(this.defaults);for(let s in n.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=n.renderer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new IA(this.defaults);for(let s in n.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=n.tokenizer[o],u=a[o];a[o]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new UT;for(let s in n.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=n.hooks[o],u=a[o];UT.passThroughHooks.has(s)?a[o]=h=>{if(this.defaults.async&&UT.passThroughHooksRespectAsync.has(s))return(async()=>{let f=await l.call(a,h);return u.call(a,f)})();let d=l.call(a,h);return u.call(a,d)}:a[o]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(a,h);return f===!1&&(f=await u.apply(a,h)),f})();let d=l.apply(a,h);return d===!1&&(d=u.apply(a,h)),d}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),a&&(l=l.concat(a.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return Fl.lex(e,r??this.defaults)}parser(e,r){return zl.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},a={...this.defaults,...i},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let o=a.hooks?await a.hooks.preprocess(r):r,l=await(a.hooks?await a.hooks.provideLexer():e?Fl.lex:Fl.lexInline)(o,a),u=a.hooks?await a.hooks.processAllTokens(l):l;a.walkTokens&&await Promise.all(this.walkTokens(u,a.walkTokens));let h=await(a.hooks?await a.hooks.provideParser():e?zl.parse:zl.parseInline)(u,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(s);try{a.hooks&&(r=a.hooks.preprocess(r));let o=(a.hooks?a.hooks.provideLexer():e?Fl.lex:Fl.lexInline)(r,a);a.hooks&&(o=a.hooks.processAllTokens(o)),a.walkTokens&&this.walkTokens(o,a.walkTokens);let l=(a.hooks?a.hooks.provideParser():e?zl.parse:zl.parseInline)(o,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(o){return s(o)}}}onError(e,r){return n=>{if(n.message+=`
Please report this to https://github.com/markedjs/marked.`,e){let i="<p>An error occurred:</p><pre>"+Tc(n.message+"",!0)+"</pre>";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},D0=new cje;function wn(t,e){return D0.parse(t,e)}wn.options=wn.setOptions=function(t){return D0.setOptions(t),wn.defaults=D0.defaults,Bde(wn.defaults),wn};wn.getDefaults=gV;wn.defaults=ag;wn.use=function(...t){return D0.use(...t),wn.defaults=D0.defaults,Bde(wn.defaults),wn};wn.walkTokens=function(t,e){return D0.walkTokens(t,e)};wn.parseInline=D0.parseInline;wn.Parser=zl;wn.parser=zl.parse;wn.Renderer=NA;wn.TextRenderer=CV;wn.Lexer=Fl;wn.lexer=Fl.lex;wn.Tokenizer=IA;wn.Hooks=UT;wn.parse=wn;wn.options;wn.setOptions;wn.use;wn.walkTokens;wn.parseInline;zl.parse;Fl.lex;function jde(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=Array.from(typeof t=="string"?[t]:t);n[n.length-1]=n[n.length-1].replace(/\r?\n([\t ]*)$/,"");var i=n.reduce(function(o,l){var u=l.match(/\n([\t ]+|(?!\s).)/g);return u?o.concat(u.map(function(h){var d,f;return(f=(d=h.match(/[\t ]/g))===null||d===void 0?void 0:d.length)!==null&&f!==void 0?f:0})):o},[]);if(i.length){var a=new RegExp(`
[ ]{`.concat(Math.min.apply(Math,i),"}"),"g");n=n.map(function(o){return o.replace(a,`
`)})}n[0]=n[0].replace(/^\r?\n/,"");var s=n[0];return e.forEach(function(o,l){var u=s.match(/(?:^|\n)( *)$/),h=u?u[1]:"",d=o;typeof o=="string"&&o.includes(`
`)&&(d=String(o).split(`
`).map(function(f,p){return p===0?f:"".concat(h).concat(f)}).join(`
`)),s+=d+n[l+1]}),s}function Kde(t,{markdownAutoWrap:e}){const n=t.replace(/<br\/>/g,`
`).replace(/\n{2,}/g,`
`);return jde(n)}x(Kde,"preprocessMarkdown");function Zde(t){return t.split(/\\n|\n|<br\s*\/?>/gi).map(e=>{var r;return((r=e.trim().match(/<[^>]+>|[^\s<>]+/g))==null?void 0:r.map(n=>({content:n,type:"normal"})))??[]})}x(Zde,"nonMarkdownToLines");function Qde(t,e={}){const r=Kde(t,e),n=wn.lexer(r),i=[[]];let a=0;function s(o,l="normal"){o.type==="text"?o.text.split(`
`).forEach((h,d)=>{d!==0&&(a++,i.push([])),h.split(" ").forEach(f=>{f=f.replace(/&#39;/g,"'"),f&&i[a].push({content:f,type:l})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(u=>{s(u,o.type)}):o.type==="html"&&i[a].push({content:o.text,type:"normal"})}return x(s,"processNode"),n.forEach(o=>{var l;o.type==="paragraph"?(l=o.tokens)==null||l.forEach(u=>{s(u)}):o.type==="html"?i[a].push({content:o.text,type:"normal"}):i[a].push({content:o.raw,type:"normal"})}),i}x(Qde,"markdownToLines");function Jde(t){return t?`<p>${t.replace(/\\n|\n/g,"<br />")}</p>`:""}x(Jde,"nonMarkdownToHTML");function efe(t,{markdownAutoWrap:e}={}){const r=wn.lexer(t);function n(i){var a,s,o;return i.type==="text"?e===!1?i.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):i.text.replace(/\n */g,"<br/>"):i.type==="strong"?`<strong>${(a=i.tokens)==null?void 0:a.map(n).join("")}</strong>`:i.type==="em"?`<em>${(s=i.tokens)==null?void 0:s.map(n).join("")}</em>`:i.type==="paragraph"?`<p>${(o=i.tokens)==null?void 0:o.map(n).join("")}</p>`:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(le.warn(`Unsupported markdown: ${i.type}`),i.raw)}return x(n,"output"),r.map(n).join("")}x(efe,"markdownToHTML");function tfe(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}x(tfe,"splitTextToChars");function rfe(t,e){const r=tfe(e.content);return kV(t,[],r,e.type)}x(rfe,"splitWordToFitWidth");function kV(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...a]=r,s=[...e,i];return t([{content:s.join(""),type:n}])?kV(t,s,a,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}x(kV,"splitWordToFitWidthRecursion");function nfe(t,e){if(t.some(({content:r})=>r.includes(`
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return DA(t,e)}x(nfe,"splitLineToFitWidth");function DA(t,e,r=[],n=[]){if(t.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";t[0].content===" "&&(i=" ",t.shift());const a=t.shift()??{content:" ",type:"normal"},s=[...n];if(i!==""&&s.push({content:i,type:"normal"}),s.push(a),e(s))return DA(t,e,r,s);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[o,l]=rfe(e,a);r.push([o]),l.content&&t.unshift(l)}return DA(t,e,r)}x(DA,"splitLineToFitWidthRecursion");function NO(t,e){e&&t.attr("style",e)}x(NO,"applyStyle");var IK=16384;async function ife(t,e,r,n,i=!1,a=Xt()){const s=t.append("foreignObject");s.attr("width",`${Math.min(10*r,IK)}px`),s.attr("height",`${Math.min(10*r,IK)}px`);const o=s.append("xhtml:div"),l=$i(e.label)?await eR(e.label.replace(At.lineBreakRegex,`
`),a):Wr(e.label,a),u=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),NO(h,e.labelStyle),h.attr("class",`${u} ${n}`),NO(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(o.style("max-width",r+"px"),o.style("text-align","center")),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg");let d=o.node().getBoundingClientRect();return d.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),d=o.node().getBoundingClientRect()),s.node()}x(ife,"addHtmlSpan");function yR(t,e,r,n=!1){const i=t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return n&&i.attr("text-anchor","middle"),i}x(yR,"createTspan");function afe(t,e,r){const n=t.append("text"),i=yR(n,1,e);vR(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}x(afe,"computeWidthOfText");function sfe(t,e,r){var s;const n=t.append("text"),i=yR(n,1,e);vR(i,[{content:r,type:"normal"}]);const a=(s=i.node())==null?void 0:s.getBoundingClientRect();return a&&n.remove(),a}x(sfe,"computeDimensionOfText");function ofe(t,e,r,n=!1,i=!1){const s=e.append("g"),o=s.insert("rect").attr("class","background").attr("style","stroke: none"),l=s.append("text").attr("y","-10.1");i&&l.attr("text-anchor","middle");let u=0;for(const h of r){const d=x(p=>afe(s,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:nfe(h,d);for(const p of f){const g=yR(l,u,1.1,i);vR(g,p),u++}}if(n){const h=l.node().getBBox(),d=2;return o.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),s.node()}else return l.node()}x(ofe,"createFormattedText");function DO(t){const e=/&(amp|lt|gt);/g;return t.replace(e,(r,n)=>{switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}x(DO,"decodeHTMLEntities");function vR(t,e){t.text(""),e.forEach((r,n)=>{const i=t.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(DO(r.content)):i.text(" "+DO(r.content))})}x(vR,"updateTextContentAndStyles");async function lfe(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,s)=>(r.push((async()=>{const o=`${a}:${s}`;return await EXe(o)?await bh(o,void 0,{class:"label-icon"}):`<i class='${Wr(i,e).replace(":"," ")}'></i>`})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}x(lfe,"replaceIconSubstring");var ws=x(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,markdown:s=!0,isNode:o=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(le.debug("XYZ createText",e,r,n,i,a,o,"addSvgBackground: ",u),a){const d=s?efe(e,h):Jde(e),f=await lfe(vh(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:o,label:$i(e)?p:f,labelStyle:r.replace("fill:","color:")};return await ife(t,g,l,i,u,h)}else{const d=vh(e.replace(/<br\s*\/?>/g,"<br/>")),f=s?Qde(d.replace("<br>","<br/>"),h):Zde(d),p=ofe(l,t,f,e?u:!1,!o);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ut(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");ut(p).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");ut(p).select("text").attr("style",m)}return n?ut(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):ut(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function YM(t,e,r){if(t&&t.length){const[n,i]=e,a=Math.PI/180*r,s=Math.cos(a),o=Math.sin(a);for(const l of t){const[u,h]=l;l[0]=(u-n)*s-(h-i)*o+n,l[1]=(u-n)*o+(h-i)*s+i}}}function uje(t,e){return t[0]===e[0]&&t[1]===e[1]}function hje(t,e,r,n=1){const i=r,a=Math.max(e,.1),s=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,o=[0,0];if(i)for(const u of s)YM(u,o,i);const l=(function(u,h,d){const f=[];for(const T of u){const b=[...T];uje(b[0],b[b.length-1])||b.push([b[0][0],b[0][1]]),b.length>2&&f.push(b)}const p=[];h=Math.max(h,.1);const g=[];for(const T of f)for(let b=0;b<T.length-1;b++){const w=T[b],C=T[b+1];if(w[1]!==C[1]){const S=Math.min(w[1],C[1]);g.push({ymin:S,ymax:Math.max(w[1],C[1]),x:S===w[1]?w[0]:C[0],islope:(C[0]-w[0])/(C[1]-w[1])})}}if(g.sort(((T,b)=>T.ymin<b.ymin?-1:T.ymin>b.ymin?1:T.x<b.x?-1:T.x>b.x?1:T.ymax===b.ymax?0:(T.ymax-b.ymax)/Math.abs(T.ymax-b.ymax))),!g.length)return p;let m=[],y=g[0].ymin,v=0;for(;m.length||g.length;){if(g.length){let T=-1;for(let b=0;b<g.length&&!(g[b].ymin>y);b++)T=b;g.splice(0,T+1).forEach((b=>{m.push({s:y,edge:b})}))}if(m=m.filter((T=>!(T.edge.ymax<=y))),m.sort(((T,b)=>T.edge.x===b.edge.x?0:(T.edge.x-b.edge.x)/Math.abs(T.edge.x-b.edge.x))),(d!==1||v%h==0)&&m.length>1)for(let T=0;T<m.length;T+=2){const b=T+1;if(b>=m.length)break;const w=m[T].edge,C=m[b].edge;p.push([[Math.round(w.x),y],[Math.round(C.x),y]])}y+=d,m.forEach((T=>{T.edge.x=T.edge.x+d*T.edge.islope})),v++}return p})(s,a,n);if(i){for(const u of s)YM(u,o,-i);(function(u,h,d){const f=[];u.forEach((p=>f.push(...p))),YM(f,h,d)})(l,o,-i)}return l}function tS(t,e){var r;const n=e.hachureAngle+90;let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=i),hje(t,i,n,a||1)}class SV{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=tS(e,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(e,r){const n=[];for(const i of e)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}}function bR(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}class dje extends SV{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=tS(e,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,s=[],o=.5*n*Math.cos(a),l=.5*n*Math.sin(a);for(const[u,h]of i)bR([u,h])&&s.push([[u[0]-o,u[1]+l],[...h]],[[u[0]+o,u[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}}class fje extends SV{fillPolygons(e,r){const n=this._fillPolygons(e,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(e,i);return n.ops=n.ops.concat(a.ops),n}}let pje=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=tS(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(e,r){const n=[];let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const s=i/4;for(const o of e){const l=bR(o),u=l/i,h=Math.ceil(u)-1,d=l-h*i,f=(o[0][0]+o[1][0])/2-i/4,p=Math.min(o[0][1],o[1][1]);for(let g=0;g<h;g++){const m=p+d+g*i,y=f-s+2*Math.random()*s,v=m-s+2*Math.random()*s,T=this.helper.ellipse(y,v,a,a,r);n.push(...T.ops)}}return{type:"fillSketch",ops:n}}},gje=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=tS(e,r);return{type:"fillSketch",ops:this.dashedLine(n,r)}}dashedLine(e,r){const n=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,i=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,a=[];return e.forEach((s=>{const o=bR(s),l=Math.floor(o/(n+i)),u=(o+i-l*(n+i))/2;let h=s[0],d=s[1];h[0]>d[0]&&(h=s[1],d=s[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p<l;p++){const g=p*(n+i),m=g+n,y=[h[0]+g*Math.cos(f)+u*Math.cos(f),h[1]+g*Math.sin(f)+u*Math.sin(f)],v=[h[0]+m*Math.cos(f)+u*Math.cos(f),h[1]+m*Math.sin(f)+u*Math.sin(f)];a.push(...this.helper.doubleLineOps(y[0],y[1],v[0],v[1],r))}})),a}};class mje{constructor(e){this.helper=e}fillPolygons(e,r){const n=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,i=r.zigzagOffset<0?n:r.zigzagOffset,a=tS(e,r=Object.assign({},r,{hachureGap:n+i}));return{type:"fillSketch",ops:this.zigzagLines(a,i,r)}}zigzagLines(e,r,n){const i=[];return e.forEach((a=>{const s=bR(a),o=Math.round(s/(2*r));let l=a[0],u=a[1];l[0]>u[0]&&(l=a[1],u=a[0]);const h=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let d=0;d<o;d++){const f=2*d*r,p=2*(d+1)*r,g=Math.sqrt(2*Math.pow(r,2)),m=[l[0]+f*Math.cos(h),l[1]+f*Math.sin(h)],y=[l[0]+p*Math.cos(h),l[1]+p*Math.sin(h)],v=[m[0]+g*Math.cos(h+Math.PI/4),m[1]+g*Math.sin(h+Math.PI/4)];i.push(...this.helper.doubleLineOps(m[0],m[1],v[0],v[1],n),...this.helper.doubleLineOps(v[0],v[1],y[0],y[1],n))}})),i}}const io={};let yje=class{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}};const vje=0,XM=1,NK=2,EE={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function jM(t,e){return t.type===e}function EV(t){const e=[],r=(function(s){const o=new Array;for(;s!=="";)if(s.match(/^([ \t\r\n,]+)/))s=s.substr(RegExp.$1.length);else if(s.match(/^([aAcChHlLmMqQsStTvVzZ])/))o[o.length]={type:vje,text:RegExp.$1},s=s.substr(RegExp.$1.length);else{if(!s.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];o[o.length]={type:XM,text:`${parseFloat(RegExp.$1)}`},s=s.substr(RegExp.$1.length)}return o[o.length]={type:NK,text:""},o})(t);let n="BOD",i=0,a=r[i];for(;!jM(a,NK);){let s=0;const o=[];if(n==="BOD"){if(a.text!=="M"&&a.text!=="m")return EV("M0,0"+t);i++,s=EE[a.text],n=a.text}else jM(a,XM)?s=EE[n]:(i++,s=EE[a.text],n=a.text);if(!(i+s<r.length))throw new Error("Path data ended short");for(let l=i;l<i+s;l++){const u=r[l];if(!jM(u,XM))throw new Error("Param not a number: "+n+","+u.text);o[o.length]=+u.text}if(typeof EE[n]!="number")throw new Error("Bad segment: "+n);{const l={key:n,data:o};e.push(l),i+=s,a=r[i],n==="M"&&(n="L"),n==="m"&&(n="l")}}return e}function cfe(t){let e=0,r=0,n=0,i=0;const a=[];for(const{key:s,data:o}of t)switch(s){case"M":a.push({key:"M",data:[...o]}),[e,r]=o,[n,i]=o;break;case"m":e+=o[0],r+=o[1],a.push({key:"M",data:[e,r]}),n=e,i=r;break;case"L":a.push({key:"L",data:[...o]}),[e,r]=o;break;case"l":e+=o[0],r+=o[1],a.push({key:"L",data:[e,r]});break;case"C":a.push({key:"C",data:[...o]}),e=o[4],r=o[5];break;case"c":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"C",data:l}),e=l[4],r=l[5];break}case"Q":a.push({key:"Q",data:[...o]}),e=o[2],r=o[3];break;case"q":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"Q",data:l}),e=l[2],r=l[3];break}case"A":a.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],a.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":a.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...o]}),e=o[2],r=o[3];break;case"s":{const l=o.map(((u,h)=>h%2?u+r:u+e));a.push({key:"S",data:l}),e=l[2],r=l[3];break}case"T":a.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,r=i}return a}function ufe(t){const e=[];let r="",n=0,i=0,a=0,s=0,o=0,l=0;for(const{key:u,data:h}of t){switch(u){case"M":e.push({key:"M",data:[...h]}),[n,i]=h,[a,s]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],o=h[2],l=h[3];break;case"L":e.push({key:"L",data:[...h]}),[n,i]=h;break;case"H":n=h[0],e.push({key:"L",data:[n,i]});break;case"V":i=h[0],e.push({key:"L",data:[n,i]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=n+(n-o),f=i+(i-l)):(d=n,f=i),e.push({key:"C",data:[d,f,...h]}),o=h[0],l=h[1],n=h[2],i=h[3];break}case"T":{const[d,f]=h;let p=0,g=0;r==="Q"||r==="T"?(p=n+(n-o),g=i+(i-l)):(p=n,g=i);const m=n+2*(p-n)/3,y=i+2*(g-i)/3,v=d+2*(p-d)/3,T=f+2*(g-f)/3;e.push({key:"C",data:[m,y,v,T,d,f]}),o=p,l=g,n=d,i=f;break}case"Q":{const[d,f,p,g]=h,m=n+2*(d-n)/3,y=i+2*(f-i)/3,v=p+2*(d-p)/3,T=g+2*(f-g)/3;e.push({key:"C",data:[m,y,v,T,p,g]}),o=d,l=f,n=p,i=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),p=h[2],g=h[3],m=h[4],y=h[5],v=h[6];d===0||f===0?(e.push({key:"C",data:[n,i,y,v,y,v]}),n=y,i=v):(n!==y||i!==v)&&(hfe(n,i,y,v,d,f,p,g,m).forEach((function(T){e.push({key:"C",data:T})})),n=y,i=v);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=s}r=u}return e}function lT(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function hfe(t,e,r,n,i,a,s,o,l,u){const h=(d=s,Math.PI*d/180);var d;let f=[],p=0,g=0,m=0,y=0;if(u)[p,g,m,y]=u;else{[t,e]=lT(t,e,-h),[r,n]=lT(r,n,-h);const D=(t-r)/2,R=(e-n)/2;let I=D*D/(i*i)+R*R/(a*a);I>1&&(I=Math.sqrt(I),i*=I,a*=I);const $=i*i,O=a*a,N=$*O-$*R*R-O*D*D,F=$*R*R+O*D*D,z=(o===l?-1:1)*Math.sqrt(Math.abs(N/F));m=z*i*R/a+(t+r)/2,y=z*-a*D/i+(e+n)/2,p=Math.asin(parseFloat(((e-y)/a).toFixed(9))),g=Math.asin(parseFloat(((n-y)/a).toFixed(9))),t<m&&(p=Math.PI-p),r<m&&(g=Math.PI-g),p<0&&(p=2*Math.PI+p),g<0&&(g=2*Math.PI+g),l&&p>g&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let v=g-p;if(Math.abs(v)>120*Math.PI/180){const D=g,R=r,I=n;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=hfe(r=m+i*Math.cos(g),n=y+a*Math.sin(g),R,I,i,a,s,0,l,[g,D,m,y])}v=g-p;const T=Math.cos(p),b=Math.sin(p),w=Math.cos(g),C=Math.sin(g),S=Math.tan(v/4),k=4/3*i*S,E=4/3*a*S,_=[t,e],M=[t+k*b,e-E*T],L=[r+k*C,n-E*w],P=[r,n];if(M[0]=2*_[0]-M[0],M[1]=2*_[1]-M[1],u)return[M,L,P].concat(f);{f=[M,L,P].concat(f);const D=[];for(let R=0;R<f.length;R+=3){const I=lT(f[R][0],f[R][1],h),$=lT(f[R+1][0],f[R+1][1],h),O=lT(f[R+2][0],f[R+2][1],h);D.push([I[0],I[1],$[0],$[1],O[0],O[1]])}return D}}const bje={randOffset:function(t,e){return wr(t,e)},randOffsetWithRange:function(t,e,r){return OA(t,e,r)},ellipse:function(t,e,r,n,i){const a=ffe(r,n,i);return OO(t,e,i,a).opset},doubleLineOps:function(t,e,r,n,i){return tf(t,e,r,n,i,!0)}};function dfe(t,e,r,n,i){return{type:"path",ops:tf(t,e,r,n,i)}}function Z4(t,e,r){const n=(t||[]).length;if(n>2){const i=[];for(let a=0;a<n-1;a++)i.push(...tf(t[a][0],t[a][1],t[a+1][0],t[a+1][1],r));return e&&i.push(...tf(t[n-1][0],t[n-1][1],t[0][0],t[0][1],r)),{type:"path",ops:i}}return n===2?dfe(t[0][0],t[0][1],t[1][0],t[1][1],r):{type:"path",ops:[]}}function xje(t,e,r,n,i){return(function(a,s){return Z4(a,!0,s)})([[t,e],[t+r,e],[t+r,e+n],[t,e+n]],i)}function DK(t,e){if(t.length){const r=typeof t[0][0]=="number"?[t]:t,n=AE(r[0],1*(1+.2*e.roughness),e),i=e.disableMultiStroke?[]:AE(r[0],1.5*(1+.22*e.roughness),PK(e));for(let a=1;a<r.length;a++){const s=r[a];if(s.length){const o=AE(s,1*(1+.2*e.roughness),e),l=e.disableMultiStroke?[]:AE(s,1.5*(1+.22*e.roughness),PK(e));for(const u of o)u.op!=="move"&&n.push(u);for(const u of l)u.op!=="move"&&i.push(u)}}return{type:"path",ops:n.concat(i)}}return{type:"path",ops:[]}}function ffe(t,e,r){const n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),i=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*n)),a=2*Math.PI/i;let s=Math.abs(t/2),o=Math.abs(e/2);const l=1-r.curveFitting;return s+=wr(s*l,r),o+=wr(o*l,r),{increment:a,rx:s,ry:o}}function OO(t,e,r,n){const[i,a]=BK(n.increment,t,e,n.rx,n.ry,1,n.increment*OA(.1,OA(.4,1,r),r),r);let s=$A(i,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[o]=BK(n.increment,t,e,n.rx,n.ry,1.5,0,r),l=$A(o,null,r);s=s.concat(l)}return{estimatedPoints:a,opset:{type:"path",ops:s}}}function OK(t,e,r,n,i,a,s,o,l){const u=t,h=e;let d=Math.abs(r/2),f=Math.abs(n/2);d+=wr(.01*d,l),f+=wr(.01*f,l);let p=i,g=a;for(;p<0;)p+=2*Math.PI,g+=2*Math.PI;g-p>2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-p)/2),v=FK(y,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const T=FK(y,u,h,d,f,p,g,1.5,l);v.push(...T)}return s&&(o?v.push(...tf(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...tf(u,h,u+d*Math.cos(g),h+f*Math.sin(g),l)):v.push({op:"lineTo",data:[u,h]},{op:"lineTo",data:[u+d*Math.cos(p),h+f*Math.sin(p)]})),{type:"path",ops:v}}function $K(t,e){const r=ufe(cfe(EV(t))),n=[];let i=[0,0],a=[0,0];for(const{key:s,data:o}of r)switch(s){case"M":a=[o[0],o[1]],i=[o[0],o[1]];break;case"L":n.push(...tf(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]];break;case"C":{const[l,u,h,d,f,p]=o;n.push(...Tje(l,u,h,d,f,p,a,e)),a=[f,p];break}case"Z":n.push(...tf(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function KM(t,e){const r=[];for(const n of t)if(n.length){const i=e.maxRandomnessOffset||0,a=n.length;if(a>2){r.push({op:"move",data:[n[0][0]+wr(i,e),n[0][1]+wr(i,e)]});for(let s=1;s<a;s++)r.push({op:"lineTo",data:[n[s][0]+wr(i,e),n[s][1]+wr(i,e)]})}}return{type:"fillPath",ops:r}}function qg(t,e){return(function(r,n){let i=r.fillStyle||"hachure";if(!io[i])switch(i){case"zigzag":io[i]||(io[i]=new dje(n));break;case"cross-hatch":io[i]||(io[i]=new fje(n));break;case"dots":io[i]||(io[i]=new pje(n));break;case"dashed":io[i]||(io[i]=new gje(n));break;case"zigzag-line":io[i]||(io[i]=new mje(n));break;default:i="hachure",io[i]||(io[i]=new SV(n))}return io[i]})(e,bje).fillPolygons(t,e)}function PK(t){const e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}function pfe(t){return t.randomizer||(t.randomizer=new yje(t.seed||0)),t.randomizer.next()}function OA(t,e,r,n=1){return r.roughness*n*(pfe(r)*(e-t)+t)}function wr(t,e,r=1){return OA(-t,t,e,r)}function tf(t,e,r,n,i,a=!1){const s=a?i.disableMultiStrokeFill:i.disableMultiStroke,o=$O(t,e,r,n,i,!0,!1);if(s)return o;const l=$O(t,e,r,n,i,!0,!0);return o.concat(l)}function $O(t,e,r,n,i,a,s){const o=Math.pow(t-r,2)+Math.pow(e-n,2),l=Math.sqrt(o);let u=1;u=l<200?1:l>500?.4:-.0016668*l+1.233334;let h=i.maxRandomnessOffset||0;h*h*100>o&&(h=l/10);const d=h/2,f=.2+.2*pfe(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=wr(p,i,u),g=wr(g,i,u);const m=[],y=()=>wr(d,i,u),v=()=>wr(h,i,u),T=i.preserveVertices;return s?m.push({op:"move",data:[t+(T?0:y()),e+(T?0:y())]}):m.push({op:"move",data:[t+(T?0:wr(h,i,u)),e+(T?0:wr(h,i,u))]}),s?m.push({op:"bcurveTo",data:[p+t+(r-t)*f+y(),g+e+(n-e)*f+y(),p+t+2*(r-t)*f+y(),g+e+2*(n-e)*f+y(),r+(T?0:y()),n+(T?0:y())]}):m.push({op:"bcurveTo",data:[p+t+(r-t)*f+v(),g+e+(n-e)*f+v(),p+t+2*(r-t)*f+v(),g+e+2*(n-e)*f+v(),r+(T?0:v()),n+(T?0:v())]}),m}function AE(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+wr(e,r),t[0][1]+wr(e,r)]),n.push([t[0][0]+wr(e,r),t[0][1]+wr(e,r)]);for(let i=1;i<t.length;i++)n.push([t[i][0]+wr(e,r),t[i][1]+wr(e,r)]),i===t.length-1&&n.push([t[i][0]+wr(e,r),t[i][1]+wr(e,r)]);return $A(n,null,r)}function $A(t,e,r){const n=t.length,i=[];if(n>3){const a=[],s=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let o=1;o+2<n;o++){const l=t[o];a[0]=[l[0],l[1]],a[1]=[l[0]+(s*t[o+1][0]-s*t[o-1][0])/6,l[1]+(s*t[o+1][1]-s*t[o-1][1])/6],a[2]=[t[o+1][0]+(s*t[o][0]-s*t[o+2][0])/6,t[o+1][1]+(s*t[o][1]-s*t[o+2][1])/6],a[3]=[t[o+1][0],t[o+1][1]],i.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}}else n===3?(i.push({op:"move",data:[t[1][0],t[1][1]]}),i.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):n===2&&i.push(...$O(t[0][0],t[0][1],t[1][0],t[1][1],r,!0,!0));return i}function BK(t,e,r,n,i,a,s,o){const l=[],u=[];if(o.roughness===0){t/=4,u.push([e+n*Math.cos(-t),r+i*Math.sin(-t)]);for(let h=0;h<=2*Math.PI;h+=t){const d=[e+n*Math.cos(h),r+i*Math.sin(h)];l.push(d),u.push(d)}u.push([e+n*Math.cos(0),r+i*Math.sin(0)]),u.push([e+n*Math.cos(t),r+i*Math.sin(t)])}else{const h=wr(.5,o)-Math.PI/2;u.push([wr(a,o)+e+.9*n*Math.cos(h-t),wr(a,o)+r+.9*i*Math.sin(h-t)]);const d=2*Math.PI+h-.01;for(let f=h;f<d;f+=t){const p=[wr(a,o)+e+n*Math.cos(f),wr(a,o)+r+i*Math.sin(f)];l.push(p),u.push(p)}u.push([wr(a,o)+e+n*Math.cos(h+2*Math.PI+.5*s),wr(a,o)+r+i*Math.sin(h+2*Math.PI+.5*s)]),u.push([wr(a,o)+e+.98*n*Math.cos(h+s),wr(a,o)+r+.98*i*Math.sin(h+s)]),u.push([wr(a,o)+e+.9*n*Math.cos(h+.5*s),wr(a,o)+r+.9*i*Math.sin(h+.5*s)])}return[u,l]}function FK(t,e,r,n,i,a,s,o,l){const u=a+wr(.1,l),h=[];h.push([wr(o,l)+e+.9*n*Math.cos(u-t),wr(o,l)+r+.9*i*Math.sin(u-t)]);for(let d=u;d<=s;d+=t)h.push([wr(o,l)+e+n*Math.cos(d),wr(o,l)+r+i*Math.sin(d)]);return h.push([e+n*Math.cos(s),r+i*Math.sin(s)]),h.push([e+n*Math.cos(s),r+i*Math.sin(s)]),$A(h,null,l)}function Tje(t,e,r,n,i,a,s,o){const l=[],u=[o.maxRandomnessOffset||1,(o.maxRandomnessOffset||1)+.3];let h=[0,0];const d=o.disableMultiStroke?1:2,f=o.preserveVertices;for(let p=0;p<d;p++)p===0?l.push({op:"move",data:[s[0],s[1]]}):l.push({op:"move",data:[s[0]+(f?0:wr(u[0],o)),s[1]+(f?0:wr(u[0],o))]}),h=f?[i,a]:[i+wr(u[p],o),a+wr(u[p],o)],l.push({op:"bcurveTo",data:[t+wr(u[p],o),e+wr(u[p],o),r+wr(u[p],o),n+wr(u[p],o),h[0],h[1]]});return l}function cT(t){return[...t]}function zK(t,e=0){const r=t.length;if(r<3)throw new Error("A curve must have at least three points.");const n=[];if(r===3)n.push(cT(t[0]),cT(t[1]),cT(t[2]),cT(t[2]));else{const i=[];i.push(t[0],t[0]);for(let o=1;o<t.length;o++)i.push(t[o]),o===t.length-1&&i.push(t[o]);const a=[],s=1-e;n.push(cT(i[0]));for(let o=1;o+2<i.length;o++){const l=i[o];a[0]=[l[0],l[1]],a[1]=[l[0]+(s*i[o+1][0]-s*i[o-1][0])/6,l[1]+(s*i[o+1][1]-s*i[o-1][1])/6],a[2]=[i[o+1][0]+(s*i[o][0]-s*i[o+2][0])/6,i[o+1][1]+(s*i[o][1]-s*i[o+2][1])/6],a[3]=[i[o+1][0],i[o+1][1]],n.push(a[1],a[2],a[3])}}return n}function Q4(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function wje(t,e,r){const n=Q4(e,r);if(n===0)return Q4(t,e);let i=((t[0]-e[0])*(r[0]-e[0])+(t[1]-e[1])*(r[1]-e[1]))/n;return i=Math.max(0,Math.min(1,i)),Q4(t,op(e,r,i))}function op(t,e,r){return[t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function PO(t,e,r,n){const i=n||[];if((function(o,l){const u=o[l+0],h=o[l+1],d=o[l+2],f=o[l+3];let p=3*h[0]-2*u[0]-f[0];p*=p;let g=3*h[1]-2*u[1]-f[1];g*=g;let m=3*d[0]-2*f[0]-u[0];m*=m;let y=3*d[1]-2*f[1]-u[1];return y*=y,p<m&&(p=m),g<y&&(g=y),p+g})(t,e)<r){const o=t[e+0];i.length?(a=i[i.length-1],s=o,Math.sqrt(Q4(a,s))>1&&i.push(o)):i.push(o),i.push(t[e+3])}else{const l=t[e+0],u=t[e+1],h=t[e+2],d=t[e+3],f=op(l,u,.5),p=op(u,h,.5),g=op(h,d,.5),m=op(f,p,.5),y=op(p,g,.5),v=op(m,y,.5);PO([l,f,m,v],0,r,i),PO([v,y,g,d],0,r,i)}var a,s;return i}function Cje(t,e){return PA(t,0,t.length,e)}function PA(t,e,r,n,i){const a=i||[],s=t[e],o=t[r-1];let l=0,u=1;for(let h=e+1;h<r-1;++h){const d=wje(t[h],s,o);d>l&&(l=d,u=h)}return Math.sqrt(l)>n?(PA(t,e,u+1,n,a),PA(t,u,r,n,a)):(a.length||a.push(s),a.push(o)),a}function ZM(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let a=0;a<i;a++)PO(t,3*a,e,n);return r&&r>0?PA(n,0,n.length,r):n}const Ao="none";class BA{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,r,n){return{shape:e,sets:r||[],options:n||this.defaultOptions}}line(e,r,n,i,a){const s=this._o(a);return this._d("line",[dfe(e,r,n,i,s)],s)}rectangle(e,r,n,i,a){const s=this._o(a),o=[],l=xje(e,r,n,i,s);if(s.fill){const u=[[e,r],[e+n,r],[e+n,r+i],[e,r+i]];s.fillStyle==="solid"?o.push(KM([u],s)):o.push(qg([u],s))}return s.stroke!==Ao&&o.push(l),this._d("rectangle",o,s)}ellipse(e,r,n,i,a){const s=this._o(a),o=[],l=ffe(n,i,s),u=OO(e,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=OO(e,r,s,l).opset;h.type="fillPath",o.push(h)}else o.push(qg([u.estimatedPoints],s));return s.stroke!==Ao&&o.push(u.opset),this._d("ellipse",o,s)}circle(e,r,n,i){const a=this.ellipse(e,r,n,n,i);return a.shape="circle",a}linearPath(e,r){const n=this._o(r);return this._d("linearPath",[Z4(e,!1,n)],n)}arc(e,r,n,i,a,s,o=!1,l){const u=this._o(l),h=[],d=OK(e,r,n,i,a,s,o,!0,u);if(o&&u.fill)if(u.fillStyle==="solid"){const f=Object.assign({},u);f.disableMultiStroke=!0;const p=OK(e,r,n,i,a,s,!0,!1,f);p.type="fillPath",h.push(p)}else h.push((function(f,p,g,m,y,v,T){const b=f,w=p;let C=Math.abs(g/2),S=Math.abs(m/2);C+=wr(.01*C,T),S+=wr(.01*S,T);let k=y,E=v;for(;k<0;)k+=2*Math.PI,E+=2*Math.PI;E-k>2*Math.PI&&(k=0,E=2*Math.PI);const _=(E-k)/T.curveStepCount,M=[];for(let L=k;L<=E;L+=_)M.push([b+C*Math.cos(L),w+S*Math.sin(L)]);return M.push([b+C*Math.cos(E),w+S*Math.sin(E)]),M.push([b,w]),qg([M],T)})(e,r,n,i,a,s,u));return u.stroke!==Ao&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],a=DK(e,n);if(n.fill&&n.fill!==Ao)if(n.fillStyle==="solid"){const s=DK(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=[],o=e;if(o.length){const l=typeof o[0][0]=="number"?[o]:o;for(const u of l)u.length<3?s.push(...u):u.length===3?s.push(...ZM(zK([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):s.push(...ZM(zK(u),10,(1+n.roughness)/2))}s.length&&i.push(qg([s],n))}return n.stroke!==Ao&&i.push(a),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],a=Z4(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(KM([e],n)):i.push(qg([e],n))),n.stroke!==Ao&&i.push(a),this._d("polygon",i,n)}path(e,r){const n=this._o(r),i=[];if(!e)return this._d("path",i,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=n.fill&&n.fill!=="transparent"&&n.fill!==Ao,s=n.stroke!==Ao,o=!!(n.simplification&&n.simplification<1),l=(function(h,d,f){const p=ufe(cfe(EV(h))),g=[];let m=[],y=[0,0],v=[];const T=()=>{v.length>=4&&m.push(...ZM(v,d)),v=[]},b=()=>{T(),m.length&&(g.push(m),m=[])};for(const{key:C,data:S}of p)switch(C){case"M":b(),y=[S[0],S[1]],m.push(y);break;case"L":T(),m.push([S[0],S[1]]);break;case"C":if(!v.length){const k=m.length?m[m.length-1]:y;v.push([k[0],k[1]])}v.push([S[0],S[1]]),v.push([S[2],S[3]]),v.push([S[4],S[5]]);break;case"Z":T(),m.push([y[0],y[1]])}if(b(),!f)return g;const w=[];for(const C of g){const S=Cje(C,f);S.length&&w.push(S)}return w})(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),u=$K(e,n);if(a)if(n.fillStyle==="solid")if(l.length===1){const h=$K(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else i.push(KM(l,n));else i.push(qg(l,n));return s&&(o?l.forEach((h=>{i.push(Z4(h,!1,n))})):i.push(u)),this._d("path",i,n)}opsToPath(e,r){let n="";for(const i of e.ops){const a=typeof r=="number"&&r>=0?i.data.map((s=>+s.toFixed(r))):i.data;switch(i.op){case"move":n+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":n+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":n+=`L${a[0]} ${a[1]} `}}return n.trim()}toPaths(e){const r=e.sets||[],n=e.options||this.defaultOptions,i=[];for(const a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Ao};break;case"fillPath":s={d:this.opsToPath(a),stroke:Ao,strokeWidth:0,fill:n.fill||Ao};break;case"fillSketch":s=this.fillSketch(a,n)}s&&i.push(s)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||Ao,strokeWidth:n,fill:Ao}}_mergedShape(e){return e.filter(((r,n)=>n===0||r.op!=="move"))}}class kje{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new BA(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,a=e.options.fixedDecimalPlaceDigits;for(const s of r)switch(s.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,s,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const o=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,a,o),i.restore();break}case"fillSketch":this.fillSketch(i,s,n)}}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=i,this._drawToContext(e,r,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,n,i="nonzero"){e.beginPath();for(const a of r.ops){const s=typeof n=="number"&&n>=0?a.data.map((o=>+o.toFixed(n))):a.data;switch(a.op){case"move":e.moveTo(s[0],s[1]);break;case"bcurveTo":e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":e.lineTo(s[0],s[1])}}r.type==="fillPath"?e.fill(i):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s),s}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s),s}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s),s}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a),a}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n),n}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n),n}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u),u}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n),n}path(e,r){const n=this.gen.path(e,r);return this.draw(n),n}}const _E="http://www.w3.org/2000/svg";class Sje{constructor(e,r){this.svg=e,this.gen=new BA(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(_E,"g"),s=e.options.fixedDecimalPlaceDigits;for(const o of r){let l=null;switch(o.type){case"path":l=i.createElementNS(_E,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke",n.stroke),l.setAttribute("stroke-width",n.strokeWidth+""),l.setAttribute("fill","none"),n.strokeLineDash&&l.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":l=i.createElementNS(_E,"path"),l.setAttribute("d",this.opsToPath(o,s)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",n.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(i,o,n)}l&&a.appendChild(l)}return a}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);const a=e.createElementNS(_E,"path");return a.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),a.setAttribute("stroke",n.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),n.fillLineDash&&a.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,n,i,a){const s=this.gen.line(e,r,n,i,a);return this.draw(s)}rectangle(e,r,n,i,a){const s=this.gen.rectangle(e,r,n,i,a);return this.draw(s)}ellipse(e,r,n,i,a){const s=this.gen.ellipse(e,r,n,i,a);return this.draw(s)}circle(e,r,n,i){const a=this.gen.circle(e,r,n,i);return this.draw(a)}linearPath(e,r){const n=this.gen.linearPath(e,r);return this.draw(n)}polygon(e,r){const n=this.gen.polygon(e,r);return this.draw(n)}arc(e,r,n,i,a,s,o=!1,l){const u=this.gen.arc(e,r,n,i,a,s,o,l);return this.draw(u)}curve(e,r){const n=this.gen.curve(e,r);return this.draw(n)}path(e,r){const n=this.gen.path(e,r);return this.draw(n)}}var Gt={canvas:(t,e)=>new kje(t,e),svg:(t,e)=>new Sje(t,e),generator:t=>new BA(t),newSeed:()=>BA.newSeed()},xr=x(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||su((p=Fe())==null?void 0:p.htmlLabels);r?n=r:n="node default";const a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),s=a.insert("g").attr("class","label").attr("style",Ca(e.labelStyle));let o;e.label===void 0?o="":o=typeof e.label=="string"?e.label:e.label[0];const l=!!e.icon||!!e.img,u=e.labelType==="markdown",h=await ws(s,Wr(vh(o),Fe()),{useHtmlLabels:i,width:e.width||((g=Fe().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},Fe());let d=h.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=h.children[0],y=ut(h);await fV(m,o),d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height)}return i?s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):s.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&s.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:d,halfPadding:f,label:s}},"labelHelper"),QM=x(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??xn(Fe()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await ws(i,Wr(vh(e),Fe()),{useHtmlLabels:n,width:r.width||((u=(l=Fe())==null?void 0:l.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let s=a.getBBox();const o=r.padding/2;if(xn(Fe())){const h=a.children[0],d=ut(a);s=h.getBoundingClientRect(),d.attr("width",s.width),d.attr("height",s.height)}return n?i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):i.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:s,halfPadding:o,label:i}},"insertLabel"),Kt=x((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),fr=x((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function Zr(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}x(Zr,"createPathFromPoints");function rf(t,e,r,n,i,a){const s=[],l=r-t,u=n-e,h=l/a,d=2*Math.PI/h,f=e+u/2;for(let p=0;p<=50;p++){const g=p/50,m=t+g*l,y=f+i*Math.sin(d*(m-t));s.push({x:m,y})}return s}x(rf,"generateFullSineWavePoints");function FC(t,e,r,n,i,a){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;d<n;d++){const f=o+d*h,p=t+r*Math.cos(f),g=e+r*Math.sin(f);s.push({x:-p,y:-g})}return s}x(FC,"generateCirclePoints");function BO(t){const e=Array.from(t.childNodes).filter(l=>l.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=e.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",n);const i=e.find(l=>l.getAttribute("fill")!=="none"),a=e.find(l=>l.getAttribute("stroke")!=="none"),s=x((l,u)=>(l==null?void 0:l.getAttribute(u))??void 0,"getAttr");if(i){const l={fill:s(i,"fill"),"fill-opacity":s(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}if(a){const l={stroke:s(a,"stroke"),"stroke-width":s(a,"stroke-width")??"1","stroke-opacity":s(a,"stroke-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}const o=document.createElementNS("http://www.w3.org/2000/svg","g");return o.appendChild(r),o}x(BO,"mergePaths");var Eje=x((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),sg=Eje,Aje=x(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=Fe(),o=xn(s);return await ws(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Rd=Aje,wf=x((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD"),_je=x(async(t,e)=>{const r=Fe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,o=s,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=zt(e),f=t.insert("g").attr("class","cluster swimlane "+(e.cssClasses||"")).attr("id",e.id).attr("data-id",e.id).attr("data-et","cluster").attr("data-look",e.look),p=su(r.flowchart.htmlLabels),g=e.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),y=await ws(m,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0,width:e.width});let v=y.getBBox();if(p){const D=y.children[0],R=ut(y);v=D.getBoundingClientRect(),R.attr("width",v.width),R.attr("height",v.height)}const T=e.padding??0,b=e.width<=v.width+T?v.width+T:e.width;e.width<=v.width+T?e.diff=(b-e.width)/2-T:e.diff=-T;const w=e.height,C=e.y-w/2,S=e.y+w/2,k=e.x-b/2,E=e.swimlaneContentTop!==void 0?e.swimlaneContentTop:C+w/3,_=g?4:0,M=v.height+2*_;let L,P;if(g){const D=Math.max(M,v.height+2*_),R=k+D,I=Math.max(0,b-D);if(e.look==="handDrawn"){const N=Gt.svg(f),F=Wt(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),z=Wt(e,{roughness:.7,fill:"none",stroke:o,seed:i}),V=N.rectangle(k,C,D,w,F);L=f.insert(()=>V,":first-child");const B=N.rectangle(R,C,I,w,z);P=f.insert(()=>B,":first-child"),L.select("path:nth-child(2)").attr("style",h.join(";")),L.select("path").attr("style",d.join(";").replace("fill","stroke"))}else L=f.insert("rect",":first-child"),P=f.insert("rect",":first-child"),L.attr("class","swimlane-title").attr("style",u).attr("x",k).attr("y",C).attr("width",D).attr("height",w).attr("fill",a).attr("stroke",o),P.attr("class","swimlane-body").attr("style",u).attr("x",R).attr("y",C).attr("width",I).attr("height",w).attr("fill","none").attr("stroke",o);const $=k+D/2,O=e.y;m.attr("transform",`translate(${$}, ${O}) rotate(-90) translate(${-v.width/2}, ${-v.height/2})`)}else{const D=Math.max(0,E-C),R=Math.min(M,D),I=C+R,$=Math.max(0,S-I),O=e.x-b/2;if(e.look==="handDrawn"){const z=Gt.svg(f),V=Wt(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),B=Wt(e,{roughness:.7,fill:"none",stroke:o,seed:i}),G=z.rectangle(O,C,b,R,V);L=f.insert(()=>G,":first-child");const H=z.rectangle(O,I,b,$,B);P=f.insert(()=>H,":first-child"),L.select("path:nth-child(2)").attr("style",h.join(";")),L.select("path").attr("style",d.join(";").replace("fill","stroke"))}else L=f.insert("rect",":first-child"),P=f.insert("rect",":first-child"),L.attr("class","swimlane-title").attr("style",u).attr("x",O).attr("y",C).attr("width",b).attr("height",R).attr("fill",a).attr("stroke",o),P.attr("class","swimlane-body").attr("style",u).attr("x",O).attr("y",I).attr("width",b).attr("height",$).attr("fill","none").attr("stroke",o);const N=e.x-v.width/2,F=C+(R-v.height)/2;m.attr("transform",`translate(${N}, ${F})`)}if(le.trace("Swimlane data ",e,JSON.stringify(e)),l){const D=m.select("span");D&&D.attr("style",l)}return e.offsetX=0,e.width=b,e.height=w,e.offsetY=v.height-T/2,e.intersect=function(D){return sg(e,D)},{cluster:f,labelBBox:v}},"swimlane"),gfe=x(async(t,e)=>{le.info("Creating subgraph rect for ",e.id,e);const r=Fe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=zt(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=xn(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await ws(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await Rd(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(xn(r)){const k=g.children[0],E=ut(g);m=k.getBoundingClientRect(),E.attr("width",m.width),E.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,T=e.x-y/2,b=e.y-v/2;le.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const k=Gt.svg(d),E=Wt(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),_=k.path(wf(T,b,y,v,0),E);w=d.insert(()=>(le.debug("Rough node insert CXC",_),_),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",T).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:C}=vx(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+C})`),o){const k=p.select("span");k&&k.attr("style",o)}const S=w.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(k){return sg(e,k)},{cluster:d,labelBBox:m}},"rect"),Rje=x((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.domId),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");const s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(o){return sg(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),Lje=x(async(t,e)=>{const r=Fe(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:o,nodeBorder:l}=n,u=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-id",e.id).attr("data-look",e.look),h=u.insert("g",":first-child"),d=u.insert("g").attr("class","cluster-label");let f=u.append("rect");const p=await Rd(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(xn(r)){const _=p.children[0],M=ut(p);g=_.getBoundingClientRect(),M.attr("width",g.width),M.attr("height",g.height)}const m=0*e.padding,y=m/2,v=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+m;e.width<=g.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;const T=e.height+m,b=e.height+m-g.height-6,w=e.x-v/2,C=e.y-T/2;e.width=v;const S=e.y-e.height/2-y+g.height+2;let k;if(e.look==="handDrawn"){const _=e.cssClasses.includes("statediagram-cluster-alt"),M=Gt.svg(u),L=e.rx||e.ry?M.path(wf(w,C,v,T,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:i}):M.rectangle(w,C,v,T,{seed:i});k=u.insert(()=>L,":first-child");const P=M.rectangle(w,S,v,b,{fill:_?a:s,fillStyle:_?"hachure":"solid",stroke:l,seed:i});k=u.insert(()=>L,":first-child"),f=u.insert(()=>P)}else k=h.insert("rect",":first-child"),k.attr("class","outer").attr("x",w).attr("y",C).attr("width",v).attr("height",T).attr("data-look",e.look),f.attr("class","inner").attr("x",w).attr("y",S).attr("width",v).attr("height",b);d.attr("transform",`translate(${e.x-g.width/2}, ${C+1-(xn(r)?0:3)})`);const E=k.node().getBBox();return e.height=E.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(_){return sg(e,_)},{cluster:u,labelBBox:g}},"roundedWithTitle"),Mje=x(async(t,e)=>{le.info("Creating subgraph rect for ",e.id,e);const r=Fe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:o,nodeStyles:l,borderStyles:u,backgroundStyles:h}=zt(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.domId).attr("data-look",e.look),f=xn(r),p=d.insert("g").attr("class","cluster-label "),g=await ws(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(xn(r)){const k=g.children[0],E=ut(g);m=k.getBoundingClientRect(),E.attr("width",m.width),E.attr("height",m.height)}const y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const v=e.height,T=e.x-y/2,b=e.y-v/2;le.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const k=Gt.svg(d),E=Wt(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),_=k.path(wf(T,b,y,v,e.rx),E);w=d.insert(()=>(le.debug("Rough node insert CXC",_),_),":first-child"),w.select("path:nth-child(2)").attr("style",u.join(";")),w.select("path").attr("style",h.join(";").replace("fill","stroke"))}else w=d.insert("rect",":first-child"),w.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",T).attr("y",b).attr("width",y).attr("height",v);const{subGraphTitleTopMargin:C}=vx(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+C})`),o){const k=p.select("span");k&&k.attr("style",o)}const S=w.node().getBBox();return e.offsetX=0,e.width=S.width,e.height=S.height,e.offsetY=m.height-e.padding/2,e.intersect=function(k){return sg(e,k)},{cluster:d,labelBBox:m}},"kanbanSection"),Ije=x((t,e)=>{const r=Fe(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),o=s.insert("g",":first-child"),l=0*e.padding,u=e.width+l;e.diff=-e.padding;const h=e.height+l,d=e.x-u/2,f=e.y-h/2;e.width=u;let p;if(e.look==="handDrawn"){const y=Gt.svg(s).rectangle(d,f,u,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=s.insert(()=>y,":first-child")}else{p=o.insert("rect",":first-child");let m="outer";e.look,m="divider",p.attr("class",m).attr("x",d).attr("y",f).attr("width",u).attr("height",h).attr("data-look",e.look)}const g=p.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(m){return sg(e,m)},{cluster:s,labelBBox:{}}},"divider"),Nje=gfe,Dje={rect:gfe,squareRect:Nje,roundedWithTitle:Lje,noteGroup:Rje,divider:Ije,kanbanSection:Mje,swimlane:_je},mfe=new Map,xR=x(async(t,e)=>{const r=e.shape||"rect",n=await Dje[r](t,e);return mfe.set(e.id,n),n},"insertCluster"),yfe=x(()=>{mfe=new Map},"clear");function vfe(t,e){return t.intersect(e)}x(vfe,"intersectNode");var Oje=vfe;function bfe(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x<i&&(u=-u);var h=Math.abs(e*r*o/l);return n.y<a&&(h=-h),{x:i+u,y:a+h}}x(bfe,"intersectEllipse");var xfe=bfe;function Tfe(t,e,r){return xfe(t,e,e,r)}x(Tfe,"intersectCircle");var $je=Tfe;function wfe(t,e,r,n){{const i=e.y-t.y,a=t.x-e.x,s=e.x*t.y-t.x*e.y,o=i*r.x+a*r.y+s,l=i*n.x+a*n.y+s,u=1e-6;if(o!==0&&l!==0&&FO(o,l))return;const h=n.y-r.y,d=r.x-n.x,f=n.x*r.y-r.x*n.y,p=h*t.x+d*t.y+f,g=h*e.x+d*e.y+f;if(Math.abs(p)<u&&Math.abs(g)<u&&FO(p,g))return;const m=i*d-h*a;if(m===0)return;const y=Math.abs(m/2);let v=a*f-d*s;const T=v<0?(v-y)/m:(v+y)/m;v=h*s-i*f;const b=v<0?(v-y)/m:(v+y)/m;return{x:T,y:b}}}x(wfe,"intersectLine");function FO(t,e){return t*e>0}x(FO,"sameSign");var Pje=wfe;function Cfe(t,e,r){let n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(h){s=Math.min(s,h.x),o=Math.min(o,h.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));let l=n-t.width/2-s,u=i-t.height/2-o;for(let h=0;h<e.length;h++){let d=e[h],f=e[h<e.length-1?h+1:0],p=Pje(t,r,{x:l+d.x,y:u+d.y},{x:l+f.x,y:u+f.y});p&&a.push(p)}return a.length?(a.length>1&&a.sort(function(h,d){let f=h.x-r.x,p=h.y-r.y,g=Math.sqrt(f*f+p*p),m=d.x-r.x,y=d.y-r.y,v=Math.sqrt(m*m+y*y);return g<v?-1:g===v?0:1}),a[0]):t}x(Cfe,"intersectPolygon");var Bje=Cfe,Bt={node:Oje,circle:$je,ellipse:xfe,polygon:Bje,rect:sg};function kfe(t,e){const{labelStyles:r}=zt(e);e.labelStyle=r;const n=fr(e);let i=n;n||(i="anchor");const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=1,{cssStyles:o}=e,l=Gt.svg(a),u=Wt(e,{fill:"black",stroke:"none",fillStyle:"solid"});e.look!=="handDrawn"&&(u.roughness=0);const h=l.circle(0,0,s*2,u),d=a.insert(()=>h,":first-child");return d.attr("class","anchor").attr("style",Ca(o)),Kt(e,d),e.intersect=function(f){return le.info("Circle intersect",e,s,f),Bt.circle(e,s,f)},a}x(kfe,"anchor");function zO(t,e,r,n,i,a,s){const l=(t+r)/2,u=(e+n)/2,h=Math.atan2(n-e,r-t),d=(r-t)/2,f=(n-e)/2,p=d/i,g=f/a,m=Math.sqrt(p**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),v=l+y*a*Math.sin(h)*(s?-1:1),T=u-y*i*Math.cos(h)*(s?-1:1),b=Math.atan2((e-T)/a,(t-v)/i);let C=Math.atan2((n-T)/a,(r-v)/i)-b;s&&C<0&&(C+=2*Math.PI),!s&&C>0&&(C-=2*Math.PI);const S=[];for(let k=0;k<20;k++){const E=k/19,_=b+E*C,M=v+i*Math.cos(_),L=T+a*Math.sin(_);S.push({x:M,y:L})}return S}x(zO,"generateArcPoints");function Sfe(t,e,r){const[n,i]=[e,r].sort((a,s)=>s-a);return i*(1-Math.sqrt(1-(t/n/2)**2))}x(Sfe,"calculateArcSagitta");async function Efe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=x(_=>_+s,"calcTotalHeight"),l=x(_=>{const M=_/2;return[M/(2.5+_/50),M]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await xr(t,e,fr(e)),d=o(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=Sfe(d,f,p),y=(e!=null&&e.width?e==null?void 0:e.width:h.width)+a*2+g-g,v=d,{cssStyles:T}=e,b=[{x:y/2,y:-v/2},{x:-y/2,y:-v/2},...zO(-y/2,-v/2,-y/2,v/2,f,p,!1),{x:y/2,y:v/2},...zO(y/2,v/2,y/2,-v/2,f,p,!0)],w=Gt.svg(u),C=Wt(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const S=Zr(b),k=w.path(S,C),E=u.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),T&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",T),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(${f/2}, 0)`),Kt(e,E),e.intersect=function(_){return Bt.polygon(e,b,_)},u}x(Efe,"bowTieRect");function $h(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}x($h,"insertPolygonShape");var RE=12;async function Afe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?28:i,s=e.look==="neo"?24:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a+RE),h=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),d=0,f=u,p=-h,g=0,m=[{x:d+RE,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+RE},{x:d+RE,y:p}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const T=Gt.svg(o),b=Wt(e,{}),w=Zr(m),C=T.path(w,b);y=o.insert(()=>C,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),v&&y.attr("style",v)}else y=$h(o,u,h,m);return n&&y.attr("style",n),Kt(e,y),e.intersect=function(T){return Bt.polygon(e,m,T)},o}x(Afe,"card");function _fe(t,e){const{nodeStyles:r}=zt(e);e.label="";const n=t.insert("g").attr("class",fr(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,a=Math.max(28,e.width??0),s=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],o=Gt.svg(n),l=Wt(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=Zr(s),h=o.path(u,l),d=n.insert(()=>h,":first-child");return i&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",i),r&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(f){return Bt.polygon(e,s,f)},n}x(_fe,"choice");async function AV(t,e,r){const{labelStyles:n,nodeStyles:i}=zt(e);e.labelStyle=n;const{shapeSvg:a,bbox:s,halfPadding:o}=await xr(t,e,fr(e)),l=16,u=(r==null?void 0:r.padding)??o,h=e.look==="neo"?s.width/2+l*2:s.width/2+u;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Gt.svg(a),g=Wt(e,{}),m=p.circle(0,0,h*2,g);d=a.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",Ca(f))}else d=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0);return Kt(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return Bt.circle(p,m,g)},e.intersect=function(p){return le.info("Circle intersect",e,h,p),Bt.circle(e,h,p)},a}x(AV,"circle");function Rfe(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=t*2,i={x:n/2*e,y:n/2*r},a={x:-(n/2)*e,y:n/2*r},s={x:-(n/2)*e,y:-(n/2)*r},o={x:n/2*e,y:-(n/2)*r};return`M ${a.x},${a.y} L ${o.x},${o.y}
M ${i.x},${i.y} L ${s.x},${s.y}`}x(Rfe,"createLine");function Lfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",fr(e)).attr("id",e.domId??e.id),a=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:s}=e,o=Gt.svg(i),l=Wt(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=o.circle(0,0,a*2,l),h=Rfe(a),d=o.path(h,l),f=i.insert(()=>u,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),s&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",s),n&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",n),Kt(e,f),e.intersect=function(p){return le.info("crossedCircle intersect",e,{radius:a,point:p}),Bt.circle(e,a,p)},i}x(Lfe,"crossedCircle");function Pu(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;d<n;d++){const f=o+d*h,p=t+r*Math.cos(f),g=e+r*Math.sin(f);s.push({x:-p,y:-g})}return s}x(Pu,"generateCirclePoints");async function Mfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await xr(t,e,fr(e)),o=e.look==="neo"?18:e.padding??0,l=e.look==="neo"?12:e.padding??0,u=a.width+o,h=a.height+l,d=Math.max(5,h*.1),{cssStyles:f}=e,p=[...Pu(u/2,-h/2,d,30,-90,0),{x:-u/2-d,y:d},...Pu(u/2+d*2,-d,d,20,-180,-270),...Pu(u/2+d*2,d,d,20,-90,-180),{x:-u/2-d,y:-h/2},...Pu(u/2,h/2,d,20,0,90)],g=[{x:u/2,y:-h/2-d},{x:-u/2,y:-h/2-d},...Pu(u/2,-h/2,d,20,-90,0),{x:-u/2-d,y:-d},...Pu(u/2+u*.1,-d,d,20,-180,-270),...Pu(u/2+u*.1,d,d,20,-90,-180),{x:-u/2-d,y:h/2},...Pu(u/2,h/2,d,20,0,90),{x:-u/2,y:h/2+d},{x:u/2,y:h/2+d}],m=Gt.svg(i),y=Wt(e,{fill:"none"});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const T=Zr(p).replace("Z",""),b=m.path(T,y),w=Zr(g),C=m.path(w,{...y}),S=i.insert("g",":first-child");return S.insert(()=>C,":first-child").attr("stroke-opacity",0),S.insert(()=>b,":first-child"),S.attr("class","text"),f&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${d}, 0)`),s.attr("transform",`translate(${-u/2+d-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Kt(e,S),e.intersect=function(k){return Bt.polygon(e,g,k)},i}x(Mfe,"curlyBraceLeft");function Bu(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;d<n;d++){const f=o+d*h,p=t+r*Math.cos(f),g=e+r*Math.sin(f);s.push({x:p,y:g})}return s}x(Bu,"generateCirclePoints");async function Ife(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await xr(t,e,fr(e)),o=e.look==="neo"?18:e.padding??0,l=e.look==="neo"?12:e.padding??0,u=a.width+(e.look==="neo"?o*2:o),h=a.height+(e.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:f}=e,p=[...Bu(u/2,-h/2,d,20,-90,0),{x:u/2+d,y:-d},...Bu(u/2+d*2,-d,d,20,-180,-270),...Bu(u/2+d*2,d,d,20,-90,-180),{x:u/2+d,y:h/2},...Bu(u/2,h/2,d,20,0,90)],g=[{x:-u/2,y:-h/2-d},{x:u/2,y:-h/2-d},...Bu(u/2,-h/2,d,20,-90,0),{x:u/2+d,y:-d},...Bu(u/2+d*2,-d,d,20,-180,-270),...Bu(u/2+d*2,d,d,20,-90,-180),{x:u/2+d,y:h/2},...Bu(u/2,h/2,d,20,0,90),{x:u/2,y:h/2+d},{x:-u/2,y:h/2+d}],m=Gt.svg(i),y=Wt(e,{fill:"none"});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const T=Zr(p).replace("Z",""),b=m.path(T,y),w=Zr(g),C=m.path(w,{...y}),S=i.insert("g",":first-child");return S.insert(()=>C,":first-child").attr("stroke-opacity",0),S.insert(()=>b,":first-child"),S.attr("class","text"),f&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${-d}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Kt(e,S),e.intersect=function(k){return Bt.polygon(e,g,k)},i}x(Ife,"curlyBraceRight");function Pa(t,e,r,n=100,i=0,a=180){const s=[],o=i*Math.PI/180,h=(a*Math.PI/180-o)/(n-1);for(let d=0;d<n;d++){const f=o+d*h,p=t+r*Math.cos(f),g=e+r*Math.sin(f);s.push({x:-p,y:-g})}return s}x(Pa,"generateCirclePoints");async function Nfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await xr(t,e,fr(e)),o=e.look==="neo"?18:e.padding??0,l=e.look==="neo"?12:e.padding??0,u=a.width+(e.look==="neo"?o*2:o),h=a.height+(e.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:f}=e,p=[...Pa(u/2,-h/2,d,30,-90,0),{x:-u/2-d,y:d},...Pa(u/2+d*2,-d,d,20,-180,-270),...Pa(u/2+d*2,d,d,20,-90,-180),{x:-u/2-d,y:-h/2},...Pa(u/2,h/2,d,20,0,90)],g=[...Pa(-u/2+d+d/2,-h/2,d,20,-90,-180),{x:u/2-d/2,y:d},...Pa(-u/2-d/2,-d,d,20,0,90),...Pa(-u/2-d/2,d,d,20,-90,0),{x:u/2-d/2,y:-d},...Pa(-u/2+d+d/2,h/2,d,30,-180,-270)],m=[{x:u/2,y:-h/2-d},{x:-u/2,y:-h/2-d},...Pa(u/2,-h/2,d,20,-90,0),{x:-u/2-d,y:-d},...Pa(u/2+d*2,-d,d,20,-180,-270),...Pa(u/2+d*2,d,d,20,-90,-180),{x:-u/2-d,y:h/2},...Pa(u/2,h/2,d,20,0,90),{x:-u/2,y:h/2+d},{x:u/2-d-d/2,y:h/2+d},...Pa(-u/2+d+d/2,-h/2,d,20,-90,-180),{x:u/2-d/2,y:d},...Pa(-u/2-d/2,-d,d,20,0,90),...Pa(-u/2-d/2,d,d,20,-90,0),{x:u/2-d/2,y:-d},...Pa(-u/2+d+d/2,h/2,d,30,-180,-270)],y=Gt.svg(i),v=Wt(e,{fill:"none"});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const b=Zr(p).replace("Z",""),w=y.path(b,v),S=Zr(g).replace("Z",""),k=y.path(S,v),E=Zr(m),_=y.path(E,{...v}),M=i.insert("g",":first-child");return M.insert(()=>_,":first-child").attr("stroke-opacity",0),M.insert(()=>w,":first-child"),M.insert(()=>k,":first-child"),M.attr("class","text"),f&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",n),M.attr("transform",`translate(${d-d/4}, 0)`),s.attr("transform",`translate(${-u/2+(e.padding??0)/2-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Kt(e,M),e.intersect=function(L){return Bt.polygon(e,m,L)},i}x(Nfe,"curlyBraces");async function Dfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=20,l=5,{shapeSvg:u,bbox:h}=await xr(t,e,fr(e)),d=Math.max(o,(h.width+a*2)*1.25,(e==null?void 0:e.width)??0),f=Math.max(l,h.height+s*2,(e==null?void 0:e.height)??0),p=f/2,{cssStyles:g}=e,m=Gt.svg(u),y=Wt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=d,T=f,b=v-p,w=T/4,C=[{x:b,y:0},{x:w,y:0},{x:0,y:T/2},{x:w,y:T},{x:b,y:T},...FC(-b,-T/2,p,50,270,90)],S=Zr(C),k=m.path(S,y),E=u.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&E.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&E.selectChildren("path").attr("style",n),E.attr("transform",`translate(${-d/2}, ${-f/2})`),Kt(e,E),e.intersect=function(_){return Bt.polygon(e,C,_)},u}x(Dfe,"curvedTrapezoid");var Fje=x((t,e,r,n,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),zje=x((t,e,r,n,i,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),Vje=x((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),VK=8,GK=8;async function Ofe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?24:i,s=e.look==="neo"?24:i;if(e.width||e.height){const y=e.width??0;e.width=(e.width??0)-s,e.width<GK&&(e.width=GK);const T=y/2/(2.5+y/50);e.height=(e.height??0)-a-T*3,e.height<VK&&(e.height=VK)}const{shapeSvg:o,bbox:l,label:u}=await xr(t,e,fr(e)),h=(e.width?e.width:l.width)+s,d=h/2,f=d/(2.5+h/50),p=(e.height?e.height:l.height)+a+f;let g;const{cssStyles:m}=e;if(e.look==="handDrawn"){const y=Gt.svg(o),v=zje(0,0,h,p,d,f),T=Vje(0,f,h,p,d,f),b=Wt(e,{}),w=y.path(v,b),C=y.path(T,Wt(e,{fill:"none"}));g=o.insert(()=>C,":first-child"),g=o.insert(()=>w,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=Fje(0,0,h,p,d,f);g=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Ca(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Kt(e,g),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(e.padding??0)/1.5-(l.y-(l.top??0))})`),e.intersect=function(y){const v=Bt.rect(e,y),T=v.x-(e.x??0);if(d!=0&&(Math.abs(T)<(e.width??0)/2||Math.abs(T)==(e.width??0)/2&&Math.abs(v.y-(e.y??0))>(e.height??0)/2-f)){let b=f*f*(1-T*T/(d*d));b>0&&(b=Math.sqrt(b)),b=f-b,y.y-(e.y??0)>0&&(b=-b),v.y+=b}return v},o}x(Ofe,"cylinder");async function bx(t,e,r){const{labelStyles:n,nodeStyles:i}=zt(e);e.labelStyle=n;const{shapeSvg:a,bbox:s}=await xr(t,e,fr(e)),o=Math.max(s.width+r.labelPaddingX*2,(e==null?void 0:e.width)||0),l=Math.max(s.height+r.labelPaddingY*2,(e==null?void 0:e.height)||0),u=-o/2,h=-l/2;let d,{rx:f,ry:p}=e;const{cssStyles:g}=e;if(r!=null&&r.rx&&r.ry&&(f=r.rx,p=r.ry),e.look==="handDrawn"){const m=Gt.svg(a),y=Wt(e,{}),v=f||p?m.path(wf(u,h,o,l,f||0),y):m.rectangle(u,h,o,l,y);d=a.insert(()=>v,":first-child"),d.attr("class","basic label-container").attr("style",Ca(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",Ca(f)).attr("ry",Ca(p)).attr("x",u).attr("y",h).attr("width",o).attr("height",l);return Kt(e,d),e.calcIntersect=function(m,y){return Bt.rect(m,y)},e.intersect=function(m){return Bt.rect(e,m)},a}x(bx,"drawRect");async function $fe(t,e){const{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:a,width:s,height:o}=e,l={rx:0,ry:0,labelPaddingX:n??(a??0)*2,labelPaddingY:i??a??0},u=await bx(t,e,l);if(e.look==="handDrawn"){const p=Gt.svg(u),g=Wt(e,{}),m=u.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return u;let v=null;if(y instanceof SVGGraphicsElement)v=y.getBBox();else return u;return u.insert(()=>p.line(v.x,v.y,v.x+v.width,v.y,g),".basic.label-container g.label"),u.insert(()=>p.line(v.x,v.y+v.height,v.x+v.width,v.y+v.height,g),".basic.label-container g.label"),m.remove(),u}const h=u.select(".basic.label-container"),d=(Number(h.attr("width"))||s)??0,f=(Number(h.attr("height"))||o)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),u}x($fe,"datastore");async function Pfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?16:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await xr(t,e,fr(e)),u=o.width+i,h=o.height+a,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=Gt.svg(s),y=Wt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],T=m.polygon(v.map(w=>[w.x,w.y]),y),b=s.insert(()=>T,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),l.attr("transform",`translate(${f+(e.padding??0)/2-(o.x-(o.left??0))}, ${p+d+(e.padding??0)/2-(o.y-(o.top??0))})`),Kt(e,b),e.intersect=function(w){return Bt.rect(e,w)},s}x(Pfe,"dividedRectangle");async function Bfe(t,e){var p,g;const{labelStyles:r,nodeStyles:n}=zt(e),i=e.look==="neo"?12:5;e.labelStyle=r;const a=e.padding??0,s=e.look==="neo"?16:a,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=(e!=null&&e.width?(e==null?void 0:e.width)/2:l.width/2)+(s??0),h=u-i;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const m=Gt.svg(o),y=Wt(e,{roughness:.2,strokeWidth:2.5}),v=Wt(e,{roughness:.2,strokeWidth:1.5}),T=m.circle(0,0,u*2,y),b=m.circle(0,0,h*2,v);d=o.insert("g",":first-child"),d.attr("class",Ca(e.cssClasses)).attr("style",Ca(f)),(p=d.node())==null||p.appendChild(T),(g=d.node())==null||g.appendChild(b)}else{d=o.insert("g",":first-child");const m=d.insert("circle",":first-child"),y=d.insert("circle");d.attr("class","basic label-container").attr("style",n),m.attr("class","outer-circle").attr("style",n).attr("r",u).attr("cx",0).attr("cy",0),y.attr("class","inner-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0)}return Kt(e,d),e.intersect=function(m){return le.info("DoubleCircle intersect",e,u,m),Bt.circle(e,u,m)},o}x(Bfe,"doublecircle");function Ffe(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=zt(e);e.label="",e.labelStyle=n;const a=t.insert("g").attr("class",fr(e)).attr("id",e.domId??e.id),s=7,{cssStyles:o}=e,l=Gt.svg(a),{nodeBorder:u}=r,h=Wt(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,s*2,h),f=a.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${u} !important;`),o&&o.length>0&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",o),i&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",i),Kt(e,f),e.intersect=function(p){return le.info("filledCircle intersect",e,{radius:s,point:p}),Bt.circle(e,s,p)},a}x(Ffe,"filledCircle");var WK=10,HK=10;async function zfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.height=(e==null?void 0:e.height)??0,e.height<WK&&(e.height=WK),e.width=((e==null?void 0:e.width)??0)-a-a/2,e.width<HK&&(e.width=HK));const{shapeSvg:s,bbox:o,label:l}=await xr(t,e,fr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+(a??0),h=e!=null&&e.height?e==null?void 0:e.height:u+o.height,d=h,f=[{x:0,y:-h},{x:d,y:-h},{x:d/2,y:0}],{cssStyles:p}=e,g=Gt.svg(s),m=Wt(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=Zr(f),v=g.path(y,m),T=s.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return p&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),e.width=u,e.height=h,Kt(e,T),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-h/2+(e.padding??0)/2+(o.y-(o.top??0))})`),e.intersect=function(b){return le.info("Triangle intersect",e,f,b),Bt.polygon(e,f,b)},s}x(zfe,"flippedTriangle");function Vfe(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=zt(e);e.label="";const s=t.insert("g").attr("class",fr(e)).attr("id",e.domId??e.id),{cssStyles:o}=e;let l=Math.max(70,(e==null?void 0:e.width)??0),u=Math.max(10,(e==null?void 0:e.height)??0);r==="LR"&&(l=Math.max(10,(e==null?void 0:e.width)??0),u=Math.max(70,(e==null?void 0:e.height)??0));const h=-1*l/2,d=-1*u/2,f=Gt.svg(s),p=Wt(e,{stroke:i.lineColor,fill:i.lineColor});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=f.rectangle(h,d,l,u,p),m=s.insert(()=>g,":first-child");o&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",o),a&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",a),Kt(e,m);const y=(n==null?void 0:n.padding)??0;return e.width&&e.height&&(e.width+=y/2||0,e.height+=y/2||0),e.intersect=function(v){return Bt.rect(e,v)},s}x(Vfe,"forkJoin");async function Gfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=15,a=10,s=e.look==="neo"?16:e.padding??0,o=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.height=((e==null?void 0:e.height)??0)-o*2,e.height<a&&(e.height=a),e.width=((e==null?void 0:e.width)??0)-s*2,e.width<i&&(e.width=i));const{shapeSvg:l,bbox:u}=await xr(t,e,fr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:Math.max(i,u.width))+s*2,d=(e!=null&&e.height?e==null?void 0:e.height:Math.max(a,u.height))+o*2,f=d/2,{cssStyles:p}=e,g=Gt.svg(l),m=Wt(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-h/2,y:-d/2},{x:h/2-f,y:-d/2},...FC(-h/2+f,0,f,50,90,270),{x:h/2-f,y:d/2},{x:-h/2,y:d/2}],v=Zr(y),T=g.path(v,m),b=l.insert(()=>T,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),Kt(e,b),e.intersect=function(w){return le.info("Pill intersect",e,{radius:f,point:w}),Bt.polygon(e,y,w)},l}x(Gfe,"halfRoundedRectangle");var Gje=x((t,e,r,n,i)=>[`M${t+i},${e}`,`L${t+r-i},${e}`,`L${t+r},${e-n/2}`,`L${t+r-i},${e-n}`,`L${t+i},${e-n}`,`L${t},${e-n/2}`,"Z"].join(" "),"createHexagonPathD");async function Wfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e),i=e.look==="neo"?3.5:4;e.labelStyle=r;const a=e.padding??0,s=70,o=32,l=e.look==="neo"?s:a,u=e.look==="neo"?o:a;if(e.width||e.height){const b=(e.height??0)/i;e.width=((e==null?void 0:e.width)??0)-2*b-u,e.height=(e.height??0)-l}const{shapeSvg:h,bbox:d}=await xr(t,e,fr(e)),f=(e!=null&&e.height?e==null?void 0:e.height:d.height)+l,p=f/i,g=(e!=null&&e.width?e==null?void 0:e.width:d.width)+2*p+u,m=[{x:p,y:0},{x:g-p,y:0},{x:g,y:-f/2},{x:g-p,y:-f},{x:p,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:v}=e;if(e.look==="handDrawn"){const T=Gt.svg(h),b=Wt(e,{}),w=Gje(0,0,g,f,p),C=T.path(w,b);y=h.insert(()=>C,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),v&&y.attr("style",v)}else y=$h(h,g,f,m);return n&&y.attr("style",n),e.width=g,e.height=f,Kt(e,y),e.intersect=function(T){return Bt.polygon(e,m,T)},h}x(Wfe,"hexagon");async function Hfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await xr(t,e,fr(e)),a=Math.max(30,(e==null?void 0:e.width)??0),s=Math.max(30,(e==null?void 0:e.height)??0),{cssStyles:o}=e,l=Gt.svg(i),u=Wt(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const h=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],d=Zr(h),f=l.path(d,u),p=i.insert(()=>f,":first-child");return p.attr("class","basic label-container outer-path"),o&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",o),n&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-a/2}, ${-s/2})`),Kt(e,p),e.intersect=function(g){return le.info("Pill intersect",e,{points:h}),Bt.polygon(e,h,g)},i}x(Hfe,"hourglass");async function qfe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=zt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await xr(t,e,"icon-shape default"),f=e.pos==="t",p=o,g=o,{nodeBorder:m}=r,{stylesMap:y}=yx(e),v=-g/2,T=-p/2,b=e.label?8:0,w=Gt.svg(u),C=Wt(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const S=w.rectangle(v,T,g,p,C),k=Math.max(g,h.width),E=p+h.height+b,_=w.rectangle(-k/2,-E/2,k,E,{...C,fill:"transparent",stroke:"none"}),M=u.insert(()=>S,":first-child"),L=u.insert(()=>_);if(e.icon){const P=u.append("g");P.html(`<g>${await bh(e.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const D=P.node().getBBox(),R=D.width,I=D.height,$=D.x,O=D.y;P.attr("transform",`translate(${-R/2-$},${f?h.height/2+b/2-I/2-O:-h.height/2-b/2-I/2-O})`),P.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-E/2:E/2-h.height})`),M.attr("transform",`translate(0,${f?h.height/2+b/2:-h.height/2-b/2})`),Kt(e,L),e.intersect=function(P){if(le.info("iconSquare intersect",e,P),!e.label)return Bt.rect(e,P);const D=e.x??0,R=e.y??0,I=e.height??0;let $=[];return f?$=[{x:D-h.width/2,y:R-I/2},{x:D+h.width/2,y:R-I/2},{x:D+h.width/2,y:R-I/2+h.height+b},{x:D+g/2,y:R-I/2+h.height+b},{x:D+g/2,y:R+I/2},{x:D-g/2,y:R+I/2},{x:D-g/2,y:R-I/2+h.height+b},{x:D-h.width/2,y:R-I/2+h.height+b}]:$=[{x:D-g/2,y:R-I/2},{x:D+g/2,y:R-I/2},{x:D+g/2,y:R-I/2+p},{x:D+h.width/2,y:R-I/2+p},{x:D+h.width/2/2,y:R+I/2},{x:D-h.width/2,y:R+I/2},{x:D-h.width/2,y:R-I/2+p},{x:D-g/2,y:R-I/2+p}],Bt.polygon(e,$,P)},u}x(qfe,"icon");async function Ufe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=zt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,label:d}=await xr(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:v}=yx(e),T=Gt.svg(u),b=Wt(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const w=v.get("fill");b.stroke=w??y;const C=u.append("g");e.icon&&C.html(`<g>${await bh(e.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const S=C.node().getBBox(),k=S.width,E=S.height,_=S.x,M=S.y,L=Math.max(k,E)*Math.SQRT2+f*2,P=T.circle(0,0,L,b),D=Math.max(L,h.width),R=L+h.height+p,I=T.rectangle(-D/2,-R/2,D,R,{...b,fill:"transparent",stroke:"none"}),$=u.insert(()=>P,":first-child"),O=u.insert(()=>I);return C.attr("transform",`translate(${-k/2-_},${g?h.height/2+p/2-E/2-M:-h.height/2-p/2-E/2-M})`),C.attr("style",`color: ${v.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-R/2:R/2-h.height})`),$.attr("transform",`translate(0,${g?h.height/2+p/2:-h.height/2-p/2})`),Kt(e,O),e.intersect=function(N){return le.info("iconSquare intersect",e,N),Bt.rect(e,N)},u}x(Ufe,"iconCircle");async function Yfe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=zt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await xr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:T}=yx(e),b=-m/2,w=-g/2,C=e.label?8:0,S=Gt.svg(u),k=Wt(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const E=T.get("fill");k.stroke=E??v;const _=S.path(wf(b,w,m,g,5),k),M=Math.max(m,h.width),L=g+h.height+C,P=S.rectangle(-M/2,-L/2,M,L,{...k,fill:"transparent",stroke:"none"}),D=u.insert(()=>_,":first-child").attr("class","icon-shape2"),R=u.insert(()=>P);if(e.icon){const I=u.append("g");I.html(`<g>${await bh(e.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const $=I.node().getBBox(),O=$.width,N=$.height,F=$.x,z=$.y;I.attr("transform",`translate(${-O/2-F},${p?h.height/2+C/2-N/2-z:-h.height/2-C/2-N/2-z})`),I.attr("style",`color: ${T.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-L/2:L/2-h.height})`),D.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),Kt(e,R),e.intersect=function(I){if(le.info("iconSquare intersect",e,I),!e.label)return Bt.rect(e,I);const $=e.x??0,O=e.y??0,N=e.height??0;let F=[];return p?F=[{x:$-h.width/2,y:O-N/2},{x:$+h.width/2,y:O-N/2},{x:$+h.width/2,y:O-N/2+h.height+C},{x:$+m/2,y:O-N/2+h.height+C},{x:$+m/2,y:O+N/2},{x:$-m/2,y:O+N/2},{x:$-m/2,y:O-N/2+h.height+C},{x:$-h.width/2,y:O-N/2+h.height+C}]:F=[{x:$-m/2,y:O-N/2},{x:$+m/2,y:O-N/2},{x:$+m/2,y:O-N/2+g},{x:$+h.width/2,y:O-N/2+g},{x:$+h.width/2/2,y:O+N/2},{x:$-h.width/2,y:O+N/2},{x:$-h.width/2,y:O-N/2+g},{x:$-m/2,y:O-N/2+g}],Bt.polygon(e,F,I)},u}x(Yfe,"iconRounded");async function Xfe(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=zt(e);e.labelStyle=i;const a=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(a,s),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await xr(t,e,"icon-shape default"),p=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:v}=r,{stylesMap:T}=yx(e),b=-m/2,w=-g/2,C=e.label?8:0,S=Gt.svg(u),k=Wt(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const E=T.get("fill");k.stroke=E??v;const _=S.path(wf(b,w,m,g,.1),k),M=Math.max(m,h.width),L=g+h.height+C,P=S.rectangle(-M/2,-L/2,M,L,{...k,fill:"transparent",stroke:"none"}),D=u.insert(()=>_,":first-child"),R=u.insert(()=>P);if(e.icon){const I=u.append("g");I.html(`<g>${await bh(e.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const $=I.node().getBBox(),O=$.width,N=$.height,F=$.x,z=$.y;I.attr("transform",`translate(${-O/2-F},${p?h.height/2+C/2-N/2-z:-h.height/2-C/2-N/2-z})`),I.attr("style",`color: ${T.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-L/2:L/2-h.height})`),D.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),Kt(e,R),e.intersect=function(I){if(le.info("iconSquare intersect",e,I),!e.label)return Bt.rect(e,I);const $=e.x??0,O=e.y??0,N=e.height??0;let F=[];return p?F=[{x:$-h.width/2,y:O-N/2},{x:$+h.width/2,y:O-N/2},{x:$+h.width/2,y:O-N/2+h.height+C},{x:$+m/2,y:O-N/2+h.height+C},{x:$+m/2,y:O+N/2},{x:$-m/2,y:O+N/2},{x:$-m/2,y:O-N/2+h.height+C},{x:$-h.width/2,y:O-N/2+h.height+C}]:F=[{x:$-m/2,y:O-N/2},{x:$+m/2,y:O-N/2},{x:$+m/2,y:O-N/2+g},{x:$+h.width/2,y:O-N/2+g},{x:$+h.width/2/2,y:O+N/2},{x:$-h.width/2,y:O+N/2},{x:$-h.width/2,y:O-N/2+g},{x:$-m/2,y:O-N/2+g}],Bt.polygon(e,F,I)},u}x(Xfe,"iconSquare");async function jfe(t,e,{config:{flowchart:r}}){const n=new Image;n.src=(e==null?void 0:e.img)??"",await n.decode();const i=Number(n.naturalWidth.toString().replace("px","")),a=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/a;const{labelStyles:s}=zt(e);e.labelStyle=s;const o=r==null?void 0:r.wrappingWidth;e.defaultWidth=r==null?void 0:r.wrappingWidth;const l=Math.max(e.label?o??0:0,(e==null?void 0:e.assetWidth)??i),u=e.constraint==="on"&&e!=null&&e.assetHeight?e.assetHeight*e.imageAspectRatio:l,h=e.constraint==="on"?u/e.imageAspectRatio:(e==null?void 0:e.assetHeight)??a;e.width=Math.max(u,o??0);const{shapeSvg:d,bbox:f,label:p}=await xr(t,e,"image-shape default"),g=e.pos==="t",m=-u/2,y=-h/2,v=e.label?8:0,T=Gt.svg(d),b=Wt(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const w=T.rectangle(m,y,u,h,b),C=Math.max(u,f.width),S=h+f.height+v,k=T.rectangle(-C/2,-S/2,C,S,{...b,fill:"none",stroke:"none"}),E=d.insert(()=>w,":first-child"),_=d.insert(()=>k);if(e.img){const M=d.append("image");M.attr("href",e.img),M.attr("width",u),M.attr("height",h),M.attr("preserveAspectRatio","none"),M.attr("transform",`translate(${-u/2},${g?S/2-h:-S/2})`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-v/2:h/2-f.height/2+v/2})`),E.attr("transform",`translate(0,${g?f.height/2+v/2:-f.height/2-v/2})`),Kt(e,_),e.intersect=function(M){if(le.info("iconSquare intersect",e,M),!e.label)return Bt.rect(e,M);const L=e.x??0,P=e.y??0,D=e.height??0;let R=[];return g?R=[{x:L-f.width/2,y:P-D/2},{x:L+f.width/2,y:P-D/2},{x:L+f.width/2,y:P-D/2+f.height+v},{x:L+u/2,y:P-D/2+f.height+v},{x:L+u/2,y:P+D/2},{x:L-u/2,y:P+D/2},{x:L-u/2,y:P-D/2+f.height+v},{x:L-f.width/2,y:P-D/2+f.height+v}]:R=[{x:L-u/2,y:P-D/2},{x:L+u/2,y:P-D/2},{x:L+u/2,y:P-D/2+h},{x:L+f.width/2,y:P-D/2+h},{x:L+f.width/2/2,y:P+D/2},{x:L-f.width/2,y:P+D/2},{x:L-f.width/2,y:P-D/2+h},{x:L-u/2,y:P-D/2+h}],Bt.polygon(e,R,M)},d}x(jfe,"imageSquare");async function Kfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=Math.max(l.width+(s??0)*2,(e==null?void 0:e.width)??0),h=Math.max(l.height+(a??0)*2,(e==null?void 0:e.height)??0),d=[{x:0,y:0},{x:u,y:0},{x:u+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Gt.svg(o),m=Wt(e,{}),y=Zr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),p&&f.attr("style",p)}else f=$h(o,u,h,d);return n&&f.attr("style",n),e.width=u,e.height=h,Kt(e,f),e.intersect=function(g){return Bt.polygon(e,d,g)},o}x(Kfe,"inv_trapezoid");async function Zfe(t,e){const{shapeSvg:r,bbox:n,label:i}=await xr(t,e,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Kt(e,a),e.intersect=function(l){return Bt.rect(e,l)},r}x(Zfe,"labelRect");async function Qfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:0,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:-(3*u)/6,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Gt.svg(o),m=Wt(e,{}),y=Zr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=$h(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Kt(e,f),e.intersect=function(g){return Bt.polygon(e,d,g)},o}x(Qfe,"lean_left");async function Jfe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=i,s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h,y:0},{x:h+3*u/6,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Gt.svg(o),m=Wt(e,{}),y=Zr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=$h(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Kt(e,f),e.intersect=function(g){return Bt.polygon(e,d,g)},o}x(Jfe,"lean_right");function epe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",fr(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,s=Math.max(35,(e==null?void 0:e.width)??0),o=Math.max(35,(e==null?void 0:e.height)??0),l=7,u=[{x:s,y:0},{x:0,y:o+l/2},{x:s-2*l,y:o+l/2},{x:0,y:2*o},{x:s,y:o-l/2},{x:2*l,y:o-l/2}],h=Gt.svg(i),d=Wt(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=Zr(u),p=h.path(f,d),g=i.insert(()=>p,":first-child");return g.attr("class","outer-path"),a&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",a),n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(-${s/2},${-o})`),Kt(e,g),e.intersect=function(m){return le.info("lightningBolt intersect",e,m),Bt.polygon(e,u,m)},i}x(epe,"lightningBolt");var Wje=x((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),Hje=x((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),qje=x((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),qK=10,UK=10;async function tpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?24:i;if(e.width||e.height){const v=e.width??0;e.width=(e.width??0)-a,e.width<UK&&(e.width=UK);const b=v/2/(2.5+v/50);e.height=(e.height??0)-s-b*3,e.height<qK&&(e.height=qK)}const{shapeSvg:o,bbox:l,label:u}=await xr(t,e,fr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,d=h/2,f=d/(2.5+h/50),p=(e!=null&&e.height?e==null?void 0:e.height:l.height)+f+s*2,g=p*.1;let m;const{cssStyles:y}=e;if(e.look==="handDrawn"){const v=Gt.svg(o),T=Hje(0,0,h,p,d,f,g),b=qje(0,f,h,p,d,f),w=Wt(e,{}),C=v.path(T,w),S=v.path(b,w);o.insert(()=>S,":first-child").attr("class","line"),m=o.insert(()=>C,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const v=Wje(0,0,h,p,d,f,g);m=o.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",Ca(y)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Kt(e,m),u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),e.intersect=function(v){const T=Bt.rect(e,v),b=T.x-(e.x??0);if(d!=0&&(Math.abs(b)<(e.width??0)/2||Math.abs(b)==(e.width??0)/2&&Math.abs(T.y-(e.y??0))>(e.height??0)/2-f)){let w=f*f*(1-b*b/(d*d));w>0&&(w=Math.sqrt(w)),w=f-w,v.y-(e.y??0)>0&&(w=-w),T.y+=w}return T},o}x(tpe,"linedCylinder");async function rpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;if(e.width||e.height){const w=e.width;e.width=(w??0)*10/11-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10)}const{shapeSvg:o,bbox:l,label:u}=await xr(t,e,fr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+(a??0)*2,d=(e!=null&&e.height?e==null?void 0:e.height:l.height)+(s??0)*2,f=e.look==="neo"?d/4:d/8,p=d+f,{cssStyles:g}=e,m=Gt.svg(o),y=Wt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:-h/2-h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:p/2},...rf(-h/2-h/2*.1,p/2,h/2+h/2*.1,p/2,f,.8),{x:h/2+h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:-p/2},{x:-h/2,y:-p/2},{x:-h/2,y:p/2*1.1},{x:-h/2,y:-p/2}],T=m.polygon(v.map(w=>[w.x,w.y]),y),b=o.insert(()=>T,":first-child");return b.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),b.attr("transform",`translate(0,${-f/2})`),u.attr("transform",`translate(${-h/2+(e.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(e.padding??0)-f/2-(l.y-(l.top??0))})`),Kt(e,b),e.intersect=function(w){return Bt.polygon(e,v,w)},o}x(rpe,"linedWaveEdgedRect");async function npe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=e.look==="neo"?10:5;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-2*o,10),e.height=Math.max(((e==null?void 0:e.height)??0)-s*2-2*o,10));const{shapeSvg:l,bbox:u,label:h}=await xr(t,e,fr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+a*2+2*o,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+s*2+2*o,p=d-2*o,g=f-2*o,m=-p/2,y=-g/2,{cssStyles:v}=e,T=Gt.svg(l),b=Wt(e,{}),w=[{x:m-o,y:y+o},{x:m-o,y:y+g+o},{x:m+p-o,y:y+g+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y:y+g-o},{x:m+p+o,y:y+g-o},{x:m+p+o,y:y-o},{x:m+o,y:y-o},{x:m+o,y},{x:m,y},{x:m,y:y+o}],C=[{x:m,y:y+o},{x:m+p-o,y:y+o},{x:m+p-o,y:y+g},{x:m+p,y:y+g},{x:m+p,y},{x:m,y}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const S=Zr(w);let k=T.path(S,b);const E=Zr(C);let _=T.path(E,b);e.look!=="handDrawn"&&(k=BO(k),_=BO(_));const M=l.insert("g",":first-child");return M.insert(()=>k),M.insert(()=>_),M.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",n),h.attr("transform",`translate(${-(u.width/2)-o-(u.x-(u.left??0))}, ${-(u.height/2)+o-(u.y-(u.top??0))})`),Kt(e,M),e.intersect=function(L){return Bt.polygon(e,w,L)},l}x(npe,"multiRect");async function ipe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await xr(t,e,fr(e)),o=e.padding??0,l=e.look==="neo"?16:o,u=e.look==="neo"?12:o;let h=!0;(e.width||e.height)&&(h=!1,e.width=((e==null?void 0:e.width)??0)-l*2,e.height=((e==null?void 0:e.height)??0)-u*3);const d=Math.max(a.width,(e==null?void 0:e.width)??0)+l*2,f=Math.max(a.height,(e==null?void 0:e.height)??0)+u*3,p=e.look==="neo"?f/4:f/8,g=f+(h?p/2:-p/2),m=-d/2,y=-g/2,v=10,{cssStyles:T}=e,b=rf(m-v,y+g+v,m+d-v,y+g+v,p,.8),w=b==null?void 0:b[b.length-1],C=[{x:m-v,y:y+v},{x:m-v,y:y+g+v},...b,{x:m+d-v,y:w.y-v},{x:m+d,y:w.y-v},{x:m+d,y:w.y-2*v},{x:m+d+v,y:w.y-2*v},{x:m+d+v,y:y-v},{x:m+v,y:y-v},{x:m+v,y},{x:m,y},{x:m,y:y+v}],S=[{x:m,y:y+v},{x:m+d-v,y:y+v},{x:m+d-v,y:w.y-v},{x:m+d,y:w.y-v},{x:m+d,y},{x:m,y}],k=Gt.svg(i),E=Wt(e,{});e.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const _=Zr(C),M=k.path(_,E),L=Zr(S),P=k.path(L,E),D=i.insert(()=>M,":first-child");return D.insert(()=>P),D.attr("class","basic label-container outer-path"),T&&e.look!=="handDrawn"&&D.selectAll("path").attr("style",T),n&&e.look!=="handDrawn"&&D.selectAll("path").attr("style",n),D.attr("transform",`translate(0,${-p/2})`),s.attr("transform",`translate(${-(a.width/2)-v-(a.x-(a.left??0))}, ${-(a.height/2)+v-p/2-(a.y-(a.top??0))})`),Kt(e,D),e.intersect=function(R){return Bt.polygon(e,C,R)},i}x(ipe,"multiWaveEdgedRectangle");async function ape(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=zt(e);e.labelStyle=n,e.useHtmlLabels||xn(Xt())||(e.centerLabel=!0);const{shapeSvg:s,bbox:o,label:l}=await xr(t,e,fr(e)),u=Math.max(o.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),h=Math.max(o.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),d=-u/2,f=-h/2,{cssStyles:p}=e,g=Gt.svg(s),m=Wt(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.rectangle(d,f,u,h,m),v=s.insert(()=>y,":first-child");return v.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),p&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Kt(e,v),e.intersect=function(T){return Bt.rect(e,T)},s}x(ape,"note");var Uje=x((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function spe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await xr(t,e,fr(e)),s=a.width+(e.padding??0),o=a.height+(e.padding??0),l=s+o,u=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const p=Gt.svg(i),g=Wt(e,{}),m=Uje(0,0,l),y=p.path(m,g);d=i.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`),f&&d.attr("style",f)}else d=$h(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),Kt(e,d),e.calcIntersect=function(p,g){const m=p.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],v=Bt.polygon(p,y,g);return{x:v.x-.5,y:v.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},i}x(spe,"question");async function ope(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?21:i??0,s=e.look==="neo"?12:i??0,{shapeSvg:o,bbox:l,label:u}=await xr(t,e,fr(e)),h=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a),d=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?s*2:s),f=-h/2,p=-d/2,g=p/2,m=[{x:f+g,y:p},{x:f,y:0},{x:f+g,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:y}=e,v=Gt.svg(o),T=Wt(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const b=Zr(m),w=v.path(b,T),C=o.insert(()=>w,":first-child");return C.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(${-g/2},0)`),u.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),Kt(e,C),e.intersect=function(S){return Bt.polygon(e,m,S)},o}x(ope,"rect_left_inv_arrow");async function lpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;let i;e.cssClasses?i="node "+e.cssClasses:i="node default";const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=a.insert("g"),o=a.insert("g").attr("class","label").attr("style",n),l=e.description,u=e.label,h=await Rd(o,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(xn(Fe())){const E=h.children[0],_=ut(h);d=E.getBoundingClientRect(),_.attr("width",d.width),_.attr("height",d.height)}le.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await Rd(o,Array.isArray(f)?f.join("<br/>"):f,e.labelStyle,!0,!0),m=g.children[0],y=ut(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const v=(e.padding||0)/2;ut(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+v+5)+")"),ut(h).attr("transform","translate( "+(d.width<p.width?0:-(p.width-d.width)/2)+", 0)"),d=o.node().getBBox(),o.attr("transform","translate("+-d.width/2+", "+(-d.height/2-v+3)+")");const T=d.width+(e.padding||0),b=d.height+(e.padding||0),w=-d.width/2-v,C=-d.height/2-v;let S,k;if(e.look==="handDrawn"){const E=Gt.svg(a),_=Wt(e,{}),M=E.path(wf(w,C,T,b,e.rx||0),_),L=E.line(-d.width/2-v,-d.height/2-v+p.height+v,d.width/2+v,-d.height/2-v+p.height+v,_);k=a.insert(()=>(le.debug("Rough node insert CXC",M),L),":first-child"),S=a.insert(()=>(le.debug("Rough node insert CXC",M),M),":first-child")}else S=s.insert("rect",":first-child"),k=s.insert("line"),S.attr("class","outer title-state").attr("style",n).attr("x",-d.width/2-v).attr("y",-d.height/2-v).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),k.attr("class","divider").attr("x1",-d.width/2-v).attr("x2",d.width/2+v).attr("y1",-d.height/2-v+p.height+v).attr("y2",-d.height/2-v+p.height+v);return Kt(e,S),e.intersect=function(E){return Bt.rect(e,E)},a}x(lpe,"rectWithTitle");async function cpe(t,e,{config:{themeVariables:r}}){const n=(r==null?void 0:r.radius)??5,i={rx:n,ry:n,labelPaddingX:((e==null?void 0:e.padding)??0)*1,labelPaddingY:((e==null?void 0:e.padding)??0)*1};return bx(t,e,i)}x(cpe,"roundedRect");var qf=8;async function upe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0,{shapeSvg:s,bbox:o,label:l}=await xr(t,e,fr(e)),u=((e==null?void 0:e.width)??o.width)+i*2+(e.look==="neo"?qf:qf*2),h=((e==null?void 0:e.height)??o.height)+a*2,d=u-qf,f=h,p=qf-u/2,g=-h/2,{cssStyles:m}=e,y=Gt.svg(s),v=Wt(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=[{x:p,y:g},{x:p+d,y:g},{x:p+d,y:g+f},{x:p-qf,y:g+f},{x:p-qf,y:g},{x:p,y:g},{x:p,y:g+f}],b=y.polygon(T.map(C=>[C.x,C.y]),v),w=s.insert(()=>b,":first-child");return w.attr("class","basic label-container outer-path").attr("style",Ca(m)),n&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),m&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),l.attr("transform",`translate(${qf/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Kt(e,w),e.intersect=function(C){return Bt.rect(e,C)},s}x(upe,"shadedProcess");async function hpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2,10),e.height=Math.max(((e==null?void 0:e.height)??0)/1.5-s*2,10));const{shapeSvg:o,bbox:l,label:u}=await xr(t,e,fr(e)),h=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,d=((e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2)*1.5,f=h,p=d/1.5,g=-f/2,m=-p/2,{cssStyles:y}=e,v=Gt.svg(o),T=Wt(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const b=[{x:g,y:m},{x:g,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m-p/2}],w=Zr(b),C=v.path(w,T),S=o.insert(()=>C,":first-child");return S.attr("class","basic label-container outer-path"),y&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",y),n&&e.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),S.attr("transform",`translate(0, ${p/4})`),u.attr("transform",`translate(${-f/2+(e.padding??0)-(l.x-(l.left??0))}, ${-p/4+(e.padding??0)-(l.y-(l.top??0))})`),Kt(e,S),e.intersect=function(k){return Bt.polygon(e,b,k)},o}x(hpe,"slopedRect");async function dpe(t,e){const r=e.padding??0,n=e.look==="neo"?16:r*2,i=e.look==="neo"?12:r,a={rx:0,ry:0,labelPaddingX:e.labelPaddingX??n,labelPaddingY:i};return bx(t,e,a)}x(dpe,"squareRect");async function fpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?20:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=l.height+(e.look==="neo"?s*2:s),h=l.width+u/4+(e.look==="neo"?a*2:a),d=u/2,{cssStyles:f}=e,p=Gt.svg(o),g=Wt(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-u/2},{x:h/2-d,y:-u/2},...FC(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...FC(h/2-d,0,d,50,270,450)],y=Zr(m),v=p.path(y,g),T=o.insert(()=>v,":first-child");return T.attr("class","basic label-container outer-path"),f&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),Kt(e,T),e.intersect=function(b){return Bt.polygon(e,m,b)},o}x(fpe,"stadium");async function ppe(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return bx(t,e,r)}x(ppe,"state");function gpe(t,e,{config:{themeVariables:r}}){var T,b;const{labelStyles:n,nodeStyles:i}=zt(e);e.labelStyle=n;const{cssStyles:a}=e,{lineColor:s,stateBorder:o,nodeBorder:l,nodeShadow:u}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const h=t.insert("g").attr("class","node default").attr("id",e.domId??e.id),d=Gt.svg(h),f=Wt(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=d.circle(0,0,e.width,{...f,stroke:s,strokeWidth:2}),g=o??l,m=(e.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),v=h.insert(()=>p,":first-child");if(v.insert(()=>y),e.look!=="handDrawn"&&v.attr("class","outer-path"),a&&v.selectAll("path").attr("style",a),i&&v.selectAll("path").attr("style",i),e.width<25&&u&&e.look!=="handDrawn"){const w=((b=(T=t.node())==null?void 0:T.ownerSVGElement)==null?void 0:b.id)??"",C=w?`${w}-drop-shadow-small`:"drop-shadow-small";v.attr("style",`filter:url(#${C})`)}return Kt(e,v),e.intersect=function(w){return Bt.circle(e,(e.width??0)/2,w)},h}x(gpe,"stateEnd");function mpe(t,e,{config:{themeVariables:r}}){var o,l;const{lineColor:n,nodeShadow:i}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);const a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let s;if(e.look==="handDrawn"){const h=Gt.svg(a).circle(0,0,e.width,SYe(n));s=a.insert(()=>h),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14)}else s=a.insert("circle",":first-child"),s.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14);if(e.width<25&&i&&e.look!=="handDrawn"){const u=((l=(o=t.node())==null?void 0:o.ownerSVGElement)==null?void 0:l.id)??"",h=u?`${u}-drop-shadow-small`:"drop-shadow-small";s.attr("style",`filter:url(#${h})`)}return Kt(e,s),e.intersect=function(u){return Bt.circle(e,(e.width??7)/2,u)},a}x(mpe,"stateStart");var Ug=8;async function ype(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=(e==null?void 0:e.padding)??8,a=e.look==="neo"?28:i,s=e.look==="neo"?12:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=((e==null?void 0:e.width)??l.width)+2*Ug+a,h=((e==null?void 0:e.height)??l.height)+s,d=u-2*Ug,f=h,p=-u/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(e.look==="handDrawn"){const y=Gt.svg(o),v=Wt(e,{}),T=y.rectangle(p,g,d+16,f,v),b=y.line(p+Ug,g,p+Ug,g+f,v),w=y.line(p+Ug+d,g,p+Ug+d,g+f,v);o.insert(()=>b,":first-child"),o.insert(()=>w,":first-child");const C=o.insert(()=>T,":first-child"),{cssStyles:S}=e;C.attr("class","basic label-container").attr("style",Ca(S)),Kt(e,C)}else{const y=$h(o,d,f,m);n&&y.attr("style",n),Kt(e,y)}return e.intersect=function(y){return Bt.polygon(e,m,y)},o}x(ype,"subroutine");var JM=.2;async function vpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;(e.width||e.height)&&(e.height=Math.max(((e==null?void 0:e.height)??0)-s*2,10),e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-JM*(e.height+s*2),10));const{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s*2,h=JM*u,d=JM*u,p=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2+h-h,g=u,m=-p/2,y=-g/2,{cssStyles:v}=e,T=Gt.svg(o),b=Wt(e,{}),w=[{x:m-h/2,y},{x:m+p+h/2,y},{x:m+p+h/2,y:y+g},{x:m-h/2,y:y+g}],C=[{x:m+p-h/2,y:y+g},{x:m+p+h/2,y:y+g},{x:m+p+h/2,y:y+g-d}];e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const S=Zr(w),k=T.path(S,b),E=Zr(C),_=T.path(E,{...b,fillStyle:"solid"}),M=o.insert(()=>_,":first-child");return M.insert(()=>k,":first-child"),M.attr("class","basic label-container outer-path"),v&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",v),n&&e.look!=="handDrawn"&&M.selectAll("path").attr("style",n),Kt(e,M),e.intersect=function(L){return Bt.polygon(e,w,L)},o}x(vpe,"taggedRect");async function bpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:s}=await xr(t,e,fr(e)),o=Math.max(a.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),l=Math.max(a.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),u=l/8,h=.2*o,d=.2*l,f=l+u,{cssStyles:p}=e,g=Gt.svg(i),m=Wt(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-o/2-o/2*.1,y:f/2},...rf(-o/2-o/2*.1,f/2,o/2+o/2*.1,f/2,u,.8),{x:o/2+o/2*.1,y:-f/2},{x:-o/2-o/2*.1,y:-f/2}],v=-o/2+o/2*.1,T=-f/2-d*.4,b=[{x:v+o-h,y:(T+l)*1.3},{x:v+o,y:T+l-d},{x:v+o,y:(T+l)*.9},...rf(v+o,(T+l)*1.25,v+o-h,(T+l)*1.3,-l*.02,.5)],w=Zr(y),C=g.path(w,m),S=Zr(b),k=g.path(S,{...m,fillStyle:"solid"}),E=i.insert(()=>k,":first-child");return E.insert(()=>C,":first-child"),E.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(0,${-u/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-u/2-(a.y-(a.top??0))})`),Kt(e,E),e.intersect=function(_){return Bt.polygon(e,y,_)},i}x(bpe,"taggedWaveEdgedRectangle");async function xpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await xr(t,e,fr(e)),s=Math.max(a.width+(e.padding??0),(e==null?void 0:e.width)||0),o=Math.max(a.height+(e.padding??0),(e==null?void 0:e.height)||0),l=-s/2,u=-o/2,h=i.insert("rect",":first-child");return h.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",l).attr("y",u).attr("width",s).attr("height",o),Kt(e,h),e.intersect=function(d){return Bt.rect(e,d)},i}x(xpe,"text");var Yje=x((t,e,r,n,i,a)=>`M${t},${e}
a${i},${a} 0,0,1 0,${-n}
l${r},0
a${i},${a} 0,0,1 0,${n}
M${r},${-n}
a${i},${a} 0,0,0 0,${n}
l${-r},0`,"createCylinderPathD"),Xje=x((t,e,r,n,i,a)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),jje=x((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),YK=5,XK=10;async function Tpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?12:i/2;if(e.width||e.height){const m=e.height??0;e.height=(e.height??0)-a,e.height<YK&&(e.height=YK);const v=m/2/(2.5+m/50);e.width=(e.width??0)-a-v*3,e.width<XK&&(e.width=XK)}const{shapeSvg:s,bbox:o,label:l}=await xr(t,e,fr(e)),u=(e.height?e.height:o.height)+a,h=u/2,d=h/(2.5+u/50),f=(e.width?e.width:o.width)+d+a,{cssStyles:p}=e;let g;if(e.look==="handDrawn"){const m=Gt.svg(s),y=Xje(0,0,f,u,d,h),v=jje(0,0,f,u,d,h),T=m.path(y,Wt(e,{})),b=m.path(v,Wt(e,{fill:"none"}));g=s.insert(()=>b,":first-child"),g=s.insert(()=>T,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=Yje(0,0,f,u,d,h);g=s.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Ca(p)).attr("style",n),g.attr("class","basic label-container outer-path"),p&&g.selectAll("path").attr("style",p),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-f/2}, ${u/2} )`),l.attr("transform",`translate(${-(o.width/2)-d-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Kt(e,g),e.intersect=function(m){const y=Bt.rect(e,m),v=y.y-(e.y??0);if(h!=0&&(Math.abs(v)<(e.height??0)/2||Math.abs(v)==(e.height??0)/2&&Math.abs(y.x-(e.x??0))>(e.width??0)/2-d)){let T=d*d*(1-v*v/(h*h));T!=0&&(T=Math.sqrt(Math.abs(T))),T=d-T,m.x-(e.x??0)>0&&(T=-T),y.x+=T}return y},s}x(Tpe,"tiltedCylinder");async function wpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=(e.look==="neo",i),s=e.look==="neo"?i*2:i,{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+s,d=[{x:-3*u/6,y:0},{x:h+3*u/6,y:0},{x:h,y:-u},{x:0,y:-u}];let f;const{cssStyles:p}=e;if(e.look==="handDrawn"){const g=Gt.svg(o),m=Wt(e,{}),y=Zr(d),v=g.path(y,m);f=o.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=$h(o,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Kt(e,f),e.intersect=function(g){return Bt.polygon(e,d,g)},o}x(wpe,"trapezoid");async function Cpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i,o=15,l=5;(e.width||e.height)&&(e.height=(e.height??0)-s*2,e.height<l&&(e.height=l),e.width=(e.width??0)-a*2,e.width<o&&(e.width=o));const{shapeSvg:u,bbox:h}=await xr(t,e,fr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:h.width)+a*2,f=(e!=null&&e.height?e==null?void 0:e.height:h.height)+s*2,{cssStyles:p}=e,g=Gt.svg(u),m=Wt(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-d/2*.8,y:-f/2},{x:d/2*.8,y:-f/2},{x:d/2,y:-f/2*.6},{x:d/2,y:f/2},{x:-d/2,y:f/2},{x:-d/2,y:-f/2*.6}],v=Zr(y),T=g.path(v,m),b=u.insert(()=>T,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),Kt(e,b),e.intersect=function(w){return Bt.polygon(e,y,w)},u}x(Cpe,"trapezoidalPentagon");var jK=10,KK=10;async function kpe(t,e){var w;const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?i*2:i;(e.width||e.height)&&(e.width=(((e==null?void 0:e.width)??0)-a)/2,e.width<KK&&(e.width=KK),e.height=(e==null?void 0:e.height)??0,e.height<jK&&(e.height=jK));const{shapeSvg:s,bbox:o,label:l}=await xr(t,e,fr(e)),u=su((w=Fe().flowchart)==null?void 0:w.htmlLabels),h=(e!=null&&e.width?e==null?void 0:e.width:o.width)+a,d=e!=null&&e.height?e==null?void 0:e.height:h+o.height,f=d,p=[{x:0,y:0},{x:f,y:0},{x:f/2,y:-d}],{cssStyles:g}=e,m=Gt.svg(s),y=Wt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Zr(p),T=m.path(v,y),b=s.insert(()=>T,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),e.width=h,e.height=d,Kt(e,b),l.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${d/2-(o.height+(e.padding??0)/(u?2:1)-(o.y-(o.top??0)))})`),e.intersect=function(C){return le.info("Triangle intersect",e,p,C),Bt.polygon(e,p,C)},s}x(kpe,"triangle");async function Spe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?12:i;let o=!0;(e.width||e.height)&&(o=!1,e.width=((e==null?void 0:e.width)??0)-a*2,e.width<10&&(e.width=10),e.height=((e==null?void 0:e.height)??0)-s*2,e.height<10&&(e.height=10));const{shapeSvg:l,bbox:u,label:h}=await xr(t,e,fr(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+(a??0)*2,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+(s??0)*2,p=e.look==="neo"?f/4:f/8,g=f+(o?p:-p),{cssStyles:m}=e,v=14-d,T=v>0?v/2:0,b=Gt.svg(l),w=Wt(e,{});e.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const C=[{x:-d/2-T,y:g/2},...rf(-d/2-T,g/2,d/2+T,g/2,p,.8),{x:d/2+T,y:-g/2},{x:-d/2-T,y:-g/2}],S=Zr(C),k=b.path(S,w),E=l.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-d/2+(e.padding??0)-(u.x-(u.left??0))},${-f/2+(e.padding??0)-p-(u.y-(u.top??0))})`),Kt(e,E),e.intersect=function(_){return Bt.polygon(e,C,_)},l}x(Spe,"waveEdgedRectangle");async function Epe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,s=e.look==="neo"?20:i;if(e.width||e.height){e.width=(e==null?void 0:e.width)??0,e.width<20&&(e.width=20),e.height=(e==null?void 0:e.height)??0,e.height<10&&(e.height=10);const w=Math.min(e.height*.2,e.height/4);e.height=Math.ceil(e.height-s-w*(20/9)),e.width=e.width-a*2}const{shapeSvg:o,bbox:l}=await xr(t,e,fr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:l.width)+a*2,h=(e!=null&&e.height?e==null?void 0:e.height:l.height)+s,d=h/8,f=h+d*2,{cssStyles:p}=e,g=Gt.svg(o),m=Wt(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-u/2,y:f/2},...rf(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...rf(u/2,-f/2,-u/2,-f/2,d,-1)],v=Zr(y),T=g.path(v,m),b=o.insert(()=>T,":first-child");return b.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),Kt(e,b),e.intersect=function(w){return Bt.polygon(e,y,w)},o}x(Epe,"waveRectangle");var vi=10;async function Ape(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e.look==="neo"?16:e.padding??0,a=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-i*2-vi,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-vi,10));const{shapeSvg:s,bbox:o,label:l}=await xr(t,e,fr(e)),u=(e!=null&&e.width?e==null?void 0:e.width:o.width)+i*2+vi,h=(e!=null&&e.height?e==null?void 0:e.height:o.height)+a*2+vi,d=u-vi,f=h-vi,p=-d/2,g=-f/2,{cssStyles:m}=e,y=Gt.svg(s),v=Wt(e,{}),T=[{x:p-vi,y:g-vi},{x:p-vi,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-vi}],b=`M${p-vi},${g-vi} L${p+d},${g-vi} L${p+d},${g+f} L${p-vi},${g+f} L${p-vi},${g-vi}
M${p-vi},${g} L${p+d},${g}
M${p},${g-vi} L${p},${g+f}`;e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const w=y.path(b,v),C=s.insert(()=>w,":first-child");return C.attr("transform",`translate(${vi/2}, ${vi/2})`),C.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),l.attr("transform",`translate(${-(o.width/2)+vi/2-(o.x-(o.left??0))}, ${-(o.height/2)+vi/2-(o.y-(o.top??0))})`),Kt(e,C),e.intersect=function(S){return Bt.polygon(e,T,S)},s}x(Ape,"windowPane");var ZK=new Set(["redux-color","redux-dark-color"]),Kje=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function _V(t,e){var Z,Y,ie,K;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=Xt(),{rowEven:a,rowOdd:s,nodeBorder:o,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:Q}=Xt(),{background:te}=Q,J={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${te}`]};await _V(t,J)}const u=Xt();e.useHtmlLabels=u.htmlLabels;let h=((Z=u.er)==null?void 0:Z.diagramPadding)??10,d=((Y=u.er)==null?void 0:Y.entityPadding)??6;const{cssStyles:f}=e,{labelStyles:p,nodeStyles:g}=zt(e);if(r.attributes.length===0&&e.label){const Q={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};zs(e.label,u)+Q.labelPaddingX*2<u.er.minEntityWidth&&(e.width=u.er.minEntityWidth);const te=await bx(t,e,Q);if(n!=null&&ZK.has(n)){const J=r.colorIndex??0;te.attr("data-color-id",`color-${J%l.length}`)}if(!su(u.htmlLabels)){const J=te.select("text"),ge=(ie=J.node())==null?void 0:ie.getBBox();J.attr("transform",`translate(${-ge.width/2}, 0)`)}return te}u.htmlLabels||(h*=1.25,d*=1.25);let m=fr(e);m||(m="node default");const y=t.insert("g").attr("class",m).attr("id",e.domId||e.id),v=await bm(y,e.label??"",u,0,0,["name"],p);v.height+=d;let T=0;const b=[],w=[];let C=0,S=0,k=0,E=0,_=!0,M=!0;for(const Q of r.attributes){const te=await bm(y,Q.type,u,0,T,["attribute-type"],p);C=Math.max(C,te.width+h);const J=await bm(y,Q.name,u,0,T,["attribute-name"],p);S=Math.max(S,J.width+h);const ge=await bm(y,Q.keys.join(),u,0,T,["attribute-keys"],p);k=Math.max(k,ge.width+h);const ee=await bm(y,Q.comment,u,0,T,["attribute-comment"],p);E=Math.max(E,ee.width+h);const Re=Math.max(te.height,J.height,ge.height,ee.height)+d;w.push({yOffset:T,rowHeight:Re}),T+=Re}let L=4;k<=h&&(_=!1,k=0,L--),E<=h&&(M=!1,E=0,L--);const P=y.node().getBBox();if(v.width+h*2-(C+S+k+E)>0){const Q=v.width+h*2-(C+S+k+E);C+=Q/L,S+=Q/L,k>0&&(k+=Q/L),E>0&&(E+=Q/L)}const D=C+S+k+E,R=Gt.svg(y),I=Wt(e,{});e.look!=="handDrawn"&&(I.roughness=0,I.fillStyle="solid");let $=0;w.length>0&&($=w.reduce((Q,te)=>Q+((te==null?void 0:te.rowHeight)??0),0));const O=Math.max(P.width+h*2,(e==null?void 0:e.width)||0,D),N=Math.max(($??0)+v.height,(e==null?void 0:e.height)||0),F=-O/2,z=-N/2;if(y.selectAll("g:not(:first-child)").each((Q,te,J)=>{const ge=ut(J[te]),ee=ge.attr("transform");let Re=0,Ie=0;if(ee){const ce=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ee);ce&&(Re=parseFloat(ce[1]),Ie=parseFloat(ce[2]),ge.attr("class").includes("attribute-name")?Re+=C:ge.attr("class").includes("attribute-keys")?Re+=C+S:ge.attr("class").includes("attribute-comment")&&(Re+=C+S+k))}ge.attr("transform",`translate(${F+h/2+Re}, ${Ie+z+v.height+d/2})`)}),y.select(".name").attr("transform","translate("+-v.width/2+", "+(z+d/2)+")"),n!=null&&ZK.has(n)){const Q=r.colorIndex??0;y.attr("data-color-id",`color-${Q%l.length}`)}const V=R.rectangle(F,z,O,N,I),B=y.insert(()=>V,":first-child").attr("class","outer-path").attr("style",f.join(""));b.push(0);for(const[Q,te]of w.entries()){const ge=(Q+1)%2===0&&te.yOffset!==0,ee=R.rectangle(F,v.height+z+(te==null?void 0:te.yOffset),O,te==null?void 0:te.rowHeight,{...I,fill:ge?a:s,stroke:o});y.insert(()=>ee,"g.label").attr("style",f.join("")).attr("class",`row-rect-${ge?"even":"odd"}`)}const G=1e-4;let H=xm(F,v.height+z,O+F,v.height+z,G),q=R.polygon(H.map(Q=>[Q.x,Q.y]),I);if(y.insert(()=>q).attr("class","divider"),H=xm(C+F,v.height+z,C+F,N+z,G),q=R.polygon(H.map(Q=>[Q.x,Q.y]),I),y.insert(()=>q).attr("class","divider"),_){const Q=C+S+F;H=xm(Q,v.height+z,Q,N+z,G),q=R.polygon(H.map(te=>[te.x,te.y]),I),y.insert(()=>q).attr("class","divider")}if(M){const Q=C+S+k+F;H=xm(Q,v.height+z,Q,N+z,G),q=R.polygon(H.map(te=>[te.x,te.y]),I),y.insert(()=>q).attr("class","divider")}for(const Q of b){const te=v.height+z+Q;H=xm(F,te,O+F,te,G),q=R.polygon(H.map(J=>[J.x,J.y]),I),y.insert(()=>q).attr("class","divider")}if(Kt(e,B),g&&e.look!=="handDrawn")if(n!=null&&Kje.has(n))y.selectAll("path").attr("style",g);else{const Q=g.split(";"),te=(K=Q==null?void 0:Q.filter(J=>J.includes("stroke")))==null?void 0:K.map(J=>`${J}`).join("; ");y.selectAll("path").attr("style",te??""),y.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(Q){return Bt.rect(e,Q)},y}x(_V,"erBox");async function bm(t,e,r,n=0,i=0,a=[],s=""){const o=t.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",s);e!==fd(e)&&(e=fd(e),e=e.replaceAll("<","&lt;").replaceAll(">","&gt;"));const l=o.node().appendChild(await ws(o,e,{width:zs(e,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(e.includes("&lt;")||e.includes("&gt;")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let u=l.getBBox();if(su(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=ut(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}x(bm,"addText");function xm(t,e,r,n,i){return t===r?[{x:t-i/2,y:e},{x:t+i/2,y:e},{x:r+i/2,y:n},{x:r-i/2,y:n}]:[{x:t,y:e-i/2},{x:t,y:e+i/2},{x:r,y:n+i/2},{x:r,y:n-i/2}]}x(xm,"lineToPolygon");async function _pe(t,e,r,n,i=r.class.padding??12){const a=n?0:3,s=t.insert("g").attr("class",fr(e)).attr("id",e.domId||e.id);let o=null,l=null,u=null,h=null,d=0,f=0,p=0;if(o=s.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const T=e.annotations[0];await YT(o,{text:`«${T}»`},0),d=o.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await YT(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=s.insert("g").attr("class","members-group text");let m=0;for(const T of e.members){const b=await YT(u,T,m,[T.parseClassifier()]);m+=b+a}p=u.node().getBBox().height,p<=0&&(p=i/2),h=s.insert("g").attr("class","methods-group text");let y=0;for(const T of e.methods){const b=await YT(h,T,y,[T.parseClassifier()]);y+=b+a}let v=s.node().getBBox();if(o!==null){const T=o.node().getBBox();o.attr("transform",`translate(${-T.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),v=s.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),v=s.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),v=s.node().getBBox(),{shapeSvg:s,bbox:v}}x(_pe,"textHelper");async function YT(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=Xt();let s="useHtmlLabels"in e?e.useHtmlLabels:su(a.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!s&&o.startsWith("\\")&&(o=o.substring(1)),$i(o)&&(s=!0);const l=await ws(i,Lz(vh(o)),{width:zs(o,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a);let u,h=1;if(s){const d=l.children[0],f=ut(l);h=d.innerHTML.split("<br>").length,d.innerHTML.includes("</math>")&&(h+=d.innerHTML.split("<mrow>").length-1);const p=d.getElementsByTagName("img");if(p){const g=o.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...p].map(m=>new Promise(y=>{function v(){var T;if(m.style.display="flex",m.style.flexDirection="column",g){const b=((T=a.fontSize)==null?void 0:T.toString())??window.getComputedStyle(document.body).fontSize,C=parseInt(b,10)*5+"px";m.style.minWidth=C,m.style.maxWidth=C}else m.style.width="100%";y(m)}x(v,"setupImage"),setTimeout(()=>{m.complete&&v()}),m.addEventListener("error",v),m.addEventListener("load",v)})))}u=d.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{n.includes("font-weight: bolder")&&ut(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes("&gt"))&&(d.textContent=o[0]+o.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),u=l.getBBox()}return i.attr("transform","translate(0,"+(-u.height/(2*h)+r)+")"),u.height}x(YT,"addText");async function Rpe(t,e){var R,I;const r=Fe(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,s=a,o=e.useHtmlLabels??su(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await _pe(t,e,r,o,s),{labelStyles:d,nodeStyles:f}=zt(e);e.labelStyle=d,e.cssStyles=l.styles||"";const p=((R=l.styles)==null?void 0:R.join(";"))||f||"";e.cssStyles||(e.cssStyles=p.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!((I=r.class)!=null&&I.hideEmptyMembersBox),m=Gt.svg(u),y=Wt(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Math.max(e.width??0,h.width);let T=Math.max(e.height??0,h.height);const b=(e.height??0)>h.height;l.members.length===0&&l.methods.length===0?T+=s:l.members.length>0&&l.methods.length===0&&(T+=s*2);const w=-v/2,C=-T/2;let S=g?a*2:l.members.length===0&&l.methods.length===0?-a:0;b&&(S=a*2);const k=m.rectangle(w-a,C-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0),v+2*a,T+2*a+S,y),E=u.insert(()=>k,":first-child");E.attr("class","basic label-container outer-path");const _=E.node().getBBox(),M=u.select(".annotation-group").node().getBBox().height-(g?a/2:0)||0,L=u.select(".label-group").node().getBBox().height-(g?a/2:0)||0,P=u.select(".members-group").node().getBBox().height-(g?a/2:0)||0,D=(M+L+C+a-(C-a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0)))/2;if(u.selectAll(".text").each(($,O,N)=>{var H,q;const F=ut(N[O]),z=F.attr("transform");let V=0;if(z){const Y=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(z);Y&&(V=parseFloat(Y[2]))}let B=V+C+a-(g?a:l.members.length===0&&l.methods.length===0?-a/2:0);if(F.attr("class").includes("methods-group")){const Z=Math.max(P,s/2);b?B=Math.max(D,M+L+Z+C+s*2+a)+s*2:B=M+L+Z+C+s*4+a}l.members.length===0&&l.methods.length===0&&((H=r.class)!=null&&H.hideEmptyMembersBox)&&(l.annotations.length>0?B=V-s:B=V),o||(B-=4);let G=w;(F.attr("class").includes("label-group")||F.attr("class").includes("annotation-group"))&&(G=-((q=F.node())==null?void 0:q.getBBox().width)/2||0,u.selectAll("text").each(function(Z,Y,ie){window.getComputedStyle(ie[Y]).textAnchor==="middle"&&(G=0)})),F.attr("transform",`translate(${G}, ${B})`)}),l.members.length>0||l.methods.length>0||g){const $=M+L+C+a,O=m.line(_.x,$,_.x+_.width,$+.001,y);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(g||l.members.length>0||l.methods.length>0){const $=M+L+P+C+s*2+a,O=m.line(_.x,b?Math.max(D,$):$,_.x+_.width,(b?Math.max(D,$):$)+.001,y);u.insert(()=>O).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),E.select(":nth-child(2)").attr("style",p),u.selectAll(".divider").select("path").attr("style",p),e.labelStyle?u.selectAll("span").attr("style",e.labelStyle):u.selectAll("span").attr("style",p),!o){const $=RegExp(/color\s*:\s*([^;]*)/),O=$.exec(p);if(O){const N=O[0].replace("color","fill");u.selectAll("tspan").attr("style",N)}else if(d){const N=$.exec(d);if(N){const F=N[0].replace("color","fill");u.selectAll("tspan").attr("style",F)}}}return Kt(e,E),e.intersect=function($){return Bt.rect(e,$)},u}x(Rpe,"classBox");async function Lpe(t,e){var _,M;const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const i=e,a=e,s=20,o=20,l="verifyMethod"in e,u=fr(e),{themeVariables:h}=Fe(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await wc(p,`&lt;&lt;${i.type}&gt;&gt;`,0,e.labelStyle):g=await wc(p,"&lt;&lt;Element&gt;&gt;",0,e.labelStyle);let m=g;const y=await wc(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=y+o,l){const L=await wc(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=L;const P=await wc(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=P;const D=await wc(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=D,await wc(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const L=await wc(p,`${a.type?`Type: ${a.type}`:""}`,m,e.labelStyle);m+=L,await wc(p,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,m,e.labelStyle)}const v=(((_=p.node())==null?void 0:_.getBBox().width)??200)+s,T=(((M=p.node())==null?void 0:M.getBBox().height)??200)+s,b=-v/2,w=-T/2,C=Gt.svg(p),S=Wt(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const k=C.rectangle(b,w,v,T,S),E=p.insert(()=>k,":first-child");if(E.attr("class","basic label-container outer-path").attr("style",n),d!=null&&d.length){const L=e.colorIndex??0;p.attr("data-color-id",`color-${L%d.length}`)}if(p.selectAll(".label").each((L,P,D)=>{const R=ut(D[P]),I=R.attr("transform");let $=0,O=0;if(I){const V=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(I);V&&($=parseFloat(V[1]),O=parseFloat(V[2]))}const N=O-T/2;let F=b+s/2;(P===0||P===1)&&(F=$),R.attr("transform",`translate(${F}, ${N+s})`)}),m>g+y+o){const L=w+g+y+o;let P;if(e.look==="neo"){const I=[[b,L],[b+v,L],[b+v,L+.001],[b,L+.001]];P=C.polygon(I,S)}else P=C.line(b,L,b+v,L,S);p.insert(()=>P).attr("class","divider")}return Kt(e,E),e.intersect=function(L){return Bt.rect(e,L)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}x(Lpe,"requirementBox");async function wc(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),a=Fe(),s=a.htmlLabels??!0,o=await ws(i,Lz(vh(e)),{width:zs(e,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a);let l;if(s){const u=o.children[0],h=ut(o);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=o.children[0];for(const h of u.children)n&&h.setAttribute("style",n);l=o.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}x(wc,"addText");var Zje=x(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function Mpe(t,e,{config:r}){var P,D;const{labelStyles:n,nodeStyles:i}=zt(e);e.labelStyle=n||"";const a=10,s=e.width;e.width=(e.width??200)-10;const{shapeSvg:o,bbox:l,label:u}=await xr(t,e,fr(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((P=r==null?void 0:r.kanban)!=null&&P.ticketBaseUrl)&&(d=(D=r==null?void 0:r.kanban)==null?void 0:D.ticketBaseUrl.replace("#TICKET#",e.ticket),f=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const p={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let g,m;f?{label:g,bbox:m}=await QM(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await QM(o,"ticket"in e&&e.ticket||"",p);const{label:y,bbox:v}=await QM(o,"assigned"in e&&e.assigned||"",p);e.width=s;const T=10,b=(e==null?void 0:e.width)||0,w=Math.max(m.height,v.height)/2,C=Math.max(l.height+T*2,(e==null?void 0:e.height)||0)+w,S=-b/2,k=-C/2;u.attr("transform","translate("+(h-b/2)+", "+(-w-l.height/2)+")"),g.attr("transform","translate("+(h-b/2)+", "+(-w+l.height/2)+")"),y.attr("transform","translate("+(h+b/2-v.width-2*a)+", "+(-w+l.height/2)+")");let E;const{rx:_,ry:M}=e,{cssStyles:L}=e;if(e.look==="handDrawn"){const R=Gt.svg(o),I=Wt(e,{}),$=_||M?R.path(wf(S,k,b,C,_||0),I):R.rectangle(S,k,b,C,I);E=o.insert(()=>$,":first-child"),E.attr("class","basic label-container").attr("style",L||null)}else{E=o.insert("rect",":first-child"),E.attr("class","basic label-container __APA__").attr("style",i).attr("rx",_??5).attr("ry",M??5).attr("x",S).attr("y",k).attr("width",b).attr("height",C);const R="priority"in e&&e.priority;if(R){const I=o.append("line"),$=S+2,O=k+Math.floor((_??0)/2),N=k+C-Math.floor((_??0)/2);I.attr("x1",$).attr("y1",O).attr("x2",$).attr("y2",N).attr("stroke-width","4").attr("stroke",Zje(R))}}return Kt(e,E),e.height=C,e.intersect=function(R){return Bt.rect(e,R)},o}x(Mpe,"kanbanItem");async function Ipe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await xr(t,e,fr(e)),l=a.width+10*s,u=a.height+8*s,h=.15*l,{cssStyles:d}=e,f=a.width+20,p=a.height+20,g=Math.max(l,f),m=Math.max(u,p);o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let y;const v=`M0 0
a${h},${h} 1 0,0 ${g*.25},${-1*m*.1}
a${h},${h} 1 0,0 ${g*.25},0
a${h},${h} 1 0,0 ${g*.25},0
a${h},${h} 1 0,0 ${g*.25},${m*.1}
a${h},${h} 1 0,0 ${g*.15},${m*.33}
a${h*.8},${h*.8} 1 0,0 0,${m*.34}
a${h},${h} 1 0,0 ${-1*g*.15},${m*.33}
a${h},${h} 1 0,0 ${-1*g*.25},${m*.15}
a${h},${h} 1 0,0 ${-1*g*.25},0
a${h},${h} 1 0,0 ${-1*g*.25},0
a${h},${h} 1 0,0 ${-1*g*.25},${-1*m*.15}
a${h},${h} 1 0,0 ${-1*g*.1},${-1*m*.33}
a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34}
a${h},${h} 1 0,0 ${g*.1},${-1*m*.33}
H0 V0 Z`;if(e.look==="handDrawn"){const T=Gt.svg(i),b=Wt(e,{}),w=T.path(v,b);y=i.insert(()=>w,":first-child"),y.attr("class","basic label-container").attr("style",Ca(d))}else y=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),Kt(e,y),e.calcIntersect=function(T,b){return Bt.rect(T,b)},e.intersect=function(T){return le.info("Bang intersect",e,T),Bt.rect(e,T)},i}x(Ipe,"bang");async function Npe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await xr(t,e,fr(e)),l=a.width+2*s,u=a.height+2*s,h=.15*l,d=.25*l,f=.35*l,p=.2*l,{cssStyles:g}=e;let m;const y=`M0 0
a${h},${h} 0 0,1 ${l*.25},${-1*l*.1}
a${f},${f} 1 0,1 ${l*.4},${-1*l*.1}
a${d},${d} 1 0,1 ${l*.35},${l*.2}
a${h},${h} 1 0,1 ${l*.15},${u*.35}
a${p},${p} 1 0,1 ${-1*l*.15},${u*.65}
a${d},${h} 1 0,1 ${-1*l*.25},${l*.15}
a${f},${f} 1 0,1 ${-1*l*.5},0
a${h},${h} 1 0,1 ${-1*l*.25},${-1*l*.15}
a${h},${h} 1 0,1 ${-1*l*.1},${-1*u*.35}
a${p},${p} 1 0,1 ${l*.1},${-1*u*.65}
H0 V0 Z`;if(e.look==="handDrawn"){const v=Gt.svg(i),T=Wt(e,{}),b=v.path(y,T);m=i.insert(()=>b,":first-child"),m.attr("class","basic label-container").attr("style",Ca(g))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),m.attr("transform",`translate(${-l/2}, ${-u/2})`),Kt(e,m),e.calcIntersect=function(v,T){return Bt.rect(v,T)},e.intersect=function(v){return le.info("Cloud intersect",e,v),Bt.rect(e,v)},i}x(Npe,"cloud");async function Dpe(t,e){const{labelStyles:r,nodeStyles:n}=zt(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:s,label:o}=await xr(t,e,fr(e)),l=a.width+8*s,u=a.height+2*s,h=5,d=e.look==="neo"?`
M${-l/2} ${u/2-h}
v${-u+2*h}
q0,-${h} ${h},-${h}
h${l-2*h}
q${h},0 ${h},${h}
v${u-h}
H${-l/2}
Z
`:`
M${-l/2} ${u/2-h}
v${-u+2*h}
q0,-${h} ${h},-${h}
h${l-2*h}
q${h},0 ${h},${h}
v${u-2*h}
q0,${h} ${-h},${h}
h${-(l-2*h)}
q${-h},0 ${-h},${-h}
Z
`;if(!e.domId)throw new Error(`defaultMindmapNode: node "${e.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=i.append("path").attr("id",e.domId).attr("class","node-bkg node-"+e.type).attr("style",n).attr("d",d);return i.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",u/2).attr("x2",l/2).attr("y2",u/2),o.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>o.node()),Kt(e,f),e.calcIntersect=function(p,g){return Bt.rect(p,g)},e.intersect=function(p){return Bt.rect(e,p)},i}x(Dpe,"defaultMindmapNode");async function Ope(t,e){const r={padding:e.padding??0};return AV(t,e,r)}x(Ope,"mindmapCircle");var Qje=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:dpe},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:cpe},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:fpe},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:ype},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Ofe},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:$fe},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:AV},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Ipe},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Npe},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:spe},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Wfe},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Jfe},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Qfe},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:wpe},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Kfe},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Bfe},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:xpe},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Afe},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:upe},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:mpe},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:gpe},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Vfe},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Hfe},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Mfe},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Ife},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Nfe},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:epe},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Spe},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Gfe},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Tpe},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:tpe},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Dfe},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Pfe},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:kpe},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Ape},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Ffe},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:Cpe},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:zfe},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:hpe},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:ipe},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:npe},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Efe},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Lfe},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:bpe},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:vpe},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Epe},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:ope},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:rpe}],Jje=x(()=>{const e=[...Object.entries({state:ppe,choice:_fe,note:ape,rectWithTitle:lpe,labelRect:Zfe,iconSquare:Xfe,iconCircle:Ufe,icon:qfe,iconRounded:Yfe,imageSquare:jfe,anchor:kfe,kanbanItem:Mpe,mindmapCircle:Ope,defaultMindmapNode:Dpe,classBox:Rpe,erBox:_V,requirementBox:Lpe}),...Qje.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),$pe=Jje();function Ppe(t){return t in $pe}x(Ppe,"isValidShape");var TR=new Map;async function rS(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?$pe[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let s;r.config.securityLevel==="sandbox"?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s??null),i=await a(n,e,r)}else i=await a(t,e,r),n=i;return n.attr("data-look",Ca(e.look)),e.tooltip&&i.attr("title",e.tooltip),TR.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}x(rS,"insertNode");var eKe=x((t,e)=>{TR.set(e.id,t)},"setNodeElem"),Bpe=x(()=>{TR.clear()},"clear"),FA=x(t=>{const e=TR.get(t.id);le.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode"),Pc=x((t,e)=>{if(e)return"translate("+-t.width/2+", "+-t.height/2+")";const r=t.x??0,n=t.y??0;return"translate("+-(r+t.width/2)+", "+-(n+t.height/2)+")"},"computeLabelTransform"),ma={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},QK={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function XT(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=si(t),e=si(e);const[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-r,o=a-n;return{angle:Math.atan(o/s),deltaX:s,deltaY:o}}x(XT,"calculateDeltaAndAngle");var si=x(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),Fpe=x(t=>({x:x(function(e,r,n){let i=0;const a=si(n[0]).x<si(n[n.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(ma,t.arrowTypeStart)){const{angle:p,deltaX:g}=XT(n[0],n[1]);i=ma[t.arrowTypeStart]*Math.cos(p)*(g>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(ma,t.arrowTypeEnd)){const{angle:p,deltaX:g}=XT(n[n.length-1],n[n.length-2]);i=ma[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const s=Math.abs(si(e).x-si(n[n.length-1]).x),o=Math.abs(si(e).y-si(n[n.length-1]).y),l=Math.abs(si(e).x-si(n[0]).x),u=Math.abs(si(e).y-si(n[0]).y),h=ma[t.arrowTypeStart],d=ma[t.arrowTypeEnd],f=1;if(s<d&&s>0&&o<d){let p=d+f-s;p*=a==="right"?-1:1,i-=p}if(l<h&&l>0&&u<h){let p=h+f-l;p*=a==="right"?-1:1,i+=p}return si(e).x+i},"x"),y:x(function(e,r,n){let i=0;const a=si(n[0]).y<si(n[n.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(ma,t.arrowTypeStart)){const{angle:p,deltaY:g}=XT(n[0],n[1]);i=ma[t.arrowTypeStart]*Math.abs(Math.sin(p))*(g>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(ma,t.arrowTypeEnd)){const{angle:p,deltaY:g}=XT(n[n.length-1],n[n.length-2]);i=ma[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const s=Math.abs(si(e).y-si(n[n.length-1]).y),o=Math.abs(si(e).x-si(n[n.length-1]).x),l=Math.abs(si(e).y-si(n[0]).y),u=Math.abs(si(e).x-si(n[0]).x),h=ma[t.arrowTypeStart],d=ma[t.arrowTypeEnd],f=1;if(s<d&&s>0&&o<d){let p=d+f-s;p*=a==="up"?-1:1,i-=p}if(l<h&&l>0&&u<h){let p=h+f-l;p*=a==="up"?-1:1,i+=p}return si(e).y+i},"y")}),"getLineFunctionsWithOffset"),tKe=x((t,e,r,n,i,a=!1,s)=>{e.arrowTypeStart&&JK(t,"start",e.arrowTypeStart,r,n,i,a,s),e.arrowTypeEnd&&JK(t,"end",e.arrowTypeEnd,r,n,i,a,s)},"addEdgeMarkers"),rKe={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},nKe=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],JK=x((t,e,r,n,i,a,s=!1,o)=>{var g;const l=rKe[r],u=l&&nKe.includes(l.type);if(!l){le.warn(`Unknown arrow type: ${r}`);return}const h=l.type,p=`${i}_${a}-${h}${e==="start"?"Start":"End"}${s&&u?"-margin":""}`;if(o&&o.trim()!==""){const m=o.replace(/[^\dA-Za-z]/g,"_"),y=`${p}_${m}`;if(!document.getElementById(y)){const v=document.getElementById(p);if(v){const T=v.cloneNode(!0);T.id=y,T.querySelectorAll("path, circle, line").forEach(w=>{w.setAttribute("stroke",o),l.fill&&w.setAttribute("fill",o)}),(g=v.parentNode)==null||g.appendChild(T)}}t.attr(`marker-${e}`,`url(${n}#${y})`)}else t.attr(`marker-${e}`,`url(${n}#${p})`)},"addEdgeMarker"),iKe=x(t=>{var e,r;return typeof t=="string"?t:(r=(e=Fe())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),zC=new Map,Li=new Map,zpe=x(()=>{zC.clear(),Li.clear()},"clear"),uT=x(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),zA=x(async(t,e)=>{const r=Fe();let n=xn(r);const{labelStyles:i}=zt(e);e.labelStyle=i;const a=t.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label").attr("data-id",e.id),o=e.labelType==="markdown",u=await ws(t,e.label,{style:uT(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:o,width:o?void 0:void 0},r);s.node().appendChild(u),le.info("abc82",e,e.labelType);let h=u.getBBox(),d=h;if(n){const p=u.children[0],g=ut(u);h=p.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const p=ut(u).select("text").node();p&&typeof p.getBBox=="function"&&(d=p.getBBox())}s.attr("transform",Pc(d,n)),zC.set(e.id,a),e.width=h.width,e.height=h.height;let f;if(e.startLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Rd(g,e.startLabelLeft,uT(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=ut(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",Pc(y,n)),Li.get(e.id)||Li.set(e.id,{}),Li.get(e.id).startLeft=p,jT(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Rd(g,e.startLabelRight,uT(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=ut(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",Pc(y,n)),Li.get(e.id)||Li.set(e.id,{}),Li.get(e.id).startRight=p,jT(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Rd(p,e.endLabelLeft,uT(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=ut(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",Pc(y,n)),Li.get(e.id)||Li.set(e.id,{}),Li.get(e.id).endLeft=p,jT(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await Rd(p,e.endLabelRight,uT(e.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(n){const v=m.children[0],T=ut(m);y=v.getBoundingClientRect(),T.attr("width",y.width),T.attr("height",y.height)}g.attr("transform",Pc(y,n)),Li.get(e.id)||Li.set(e.id,{}),Li.get(e.id).endRight=p,jT(f,e.endLabelRight)}return u},"insertEdgeLabel");function jT(t,e){xn(Fe())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}x(jT,"setTerminalWidth");var Vpe=x((t,e)=>{le.debug("Moving label abc88 ",t.id,t.label,zC.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Fe(),{subGraphTitleTotalMargin:i}=vx(n);if(t.label){const a=zC.get(t.id);let s=t.x,o=t.y;if(r){const l=yr.calcLabelPosition(r);le.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=Li.get(t.id).startLeft;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=Li.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=Li.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=Li.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),aKe=x((t,e)=>{var s;if(!(t!=null&&t.isLabelEdge)||!((s=t==null?void 0:t.id)!=null&&s.endsWith("-to-label"))||!Array.isArray(e)||e.length!==2)return e;const[r,n]=e,i=Math.abs(n.x-r.x),a=Math.abs(n.y-r.y);return i<.001||a<.001?e:a>=i?[r,{x:r.x,y:n.y},n]:[r,{x:n.x,y:r.y},n]},"orthogonalizeToLabelClippedPoints"),sKe=x((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),oKe=x((t,e,r)=>{le.debug(`intersection calc abc89:
outsidePoint: ${JSON.stringify(e)}
insidePoint : ${JSON.stringify(r)}
node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.x<e.x?s-a:s+a;const l=t.height/2,u=Math.abs(e.y-r.y),h=Math.abs(e.x-r.x);if(Math.abs(i-e.y)*s>Math.abs(n-e.x)*l){let d=r.y<e.y?e.y-l-i:i-l-e.y;o=h*d/u;const f={x:r.x<e.x?r.x+o:r.x-h+o,y:r.y<e.y?r.y+u-d:r.y-u+d};return o===0&&(f.x=e.x,f.y=e.y),h===0&&(f.x=e.x),u===0&&(f.y=e.y),le.debug(`abc89 top/bottom calc, Q ${u}, q ${d}, R ${h}, r ${o}`,f),f}else{r.x<e.x?o=e.x-s-n:o=n-s-e.x;let d=u*o/h,f=r.x<e.x?r.x+h-o:r.x-h+o,p=r.y<e.y?r.y+d:r.y-d;return le.debug(`sides calc abc89, Q ${u}, q ${d}, R ${h}, r ${o}`,{_x:f,_y:p}),o===0&&(f=e.x,p=e.y),h===0&&(f=e.x),u===0&&(p=e.y),{x:f,y:p}}},"intersection"),eZ=x((t,e)=>{le.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(le.info("abc88 checking point",a,e),!sKe(e,a)&&!i){const s=oKe(e,n,a);le.debug("abc88 inside",a,n,s),le.debug("abc88 intersection",s,e);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)?le.warn("abc88 no intersect",s,r):r.push(s),i=!0}else le.warn("abc88 outside",a,n),n=a,i||r.push(a)}),le.debug("returning points",r),r},"cutPathAtIntersect");function Gpe(t){const e=[],r=[];for(let n=1;n<t.length-1;n++){const i=t[n-1],a=t[n],s=t[n+1];(i.x===a.x&&a.y===s.y&&Math.abs(a.x-s.x)>5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}x(Gpe,"extractCornerPoints");var tZ=x(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),s=r/a;return{x:e.x-s*n,y:e.y-s*i}},"findAdjacentPoint"),lKe=x(function(t){const{cornerPointPositions:e}=Gpe(t),r=[];for(let n=0;n<t.length;n++)if(e.includes(n)){const i=t[n-1],a=t[n+1],s=t[n],o=tZ(i,s,5),l=tZ(a,s,5),u=l.x-o.x,h=l.y-o.y;r.push(o);const d=Math.sqrt(2)*2;let f={x:s.x,y:s.y};if(Math.abs(a.x-i.x)>10&&Math.abs(a.y-i.y)>=10){le.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));const p=5;s.x===o.x?f={x:u<0?o.x-p+d:o.x+p-d,y:h<0?o.y-d:o.y+d}:f={x:u<0?o.x-d:o.x+d,y:h<0?o.y-p+d:o.y+p-d}}else le.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(f,l)}else r.push(t[n]);return r},"fixCorners"),cKe=x((t,e,r)=>{const n=t-e-r,i=2,a=2,s=i+a,o=Math.floor(n/s),l=Array(o).fill(`${i} ${a}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),RV=x(function(t,e,r,n,i,a,s,o=!1){var N;if(!s)throw new Error(`insertEdge: missing diagramId for edge "${e.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:u}=Fe();let h=e.points,d=!1;const f=i;var p=a;const g=[];for(const F in e.cssCompiledStyles)tV(F)||g.push(e.cssCompiledStyles[F]);if(u==="swimlane"){if(p.intersect&&f.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[f.intersect(h[0]),p.intersect(h[1])];else{const F=h.slice(1,-1),z=F[0],V=F[F.length-1],B=.5,G=Math.abs(h[h.length-1].x-V.x)<B&&Math.abs(h[h.length-1].y-V.y)<B,H=f.intersect(z),q=G?V:p.intersect(V),Z=Math.abs(q.x-V.x)<B&&Math.abs(q.y-V.y)<B,ie=Math.abs(H.x-z.x)<B&&Math.abs(H.y-z.y)<B?[]:[H],K=Z?[]:[q];h=[...ie,...F,...K]}h=aKe(e,h)}else p.intersect&&f.intersect&&!o&&(h=h.slice(1,e.points.length-1),h.unshift(f.intersect(h[0])),h.push(p.intersect(h[h.length-1])));const m=btoa(JSON.stringify(h));e.toCluster&&(le.info("to cluster abc88",r.get(e.toCluster)),h=eZ(e.points,r.get(e.toCluster).node),d=!0),e.fromCluster&&(le.debug("from cluster abc88",r.get(e.fromCluster),JSON.stringify(h,null,2)),h=eZ(h.reverse(),r.get(e.fromCluster).node).reverse(),d=!0);let y=h.filter(F=>!Number.isNaN(F.y));const v=iKe(e.curve);v!=="rounded"&&(y=lKe(y));let T=Pw;switch(v){case"linear":T=Pw;break;case"basis":T=DC;break;case"cardinal":T=lue;break;case"bumpX":T=nue;break;case"bumpY":T=iue;break;case"catmullRom":T=uue;break;case"monotoneX":T=mue;break;case"monotoneY":T=yue;break;case"natural":T=bue;break;case"step":T=xue;break;case"stepAfter":T=wue;break;case"stepBefore":T=Tue;break;case"rounded":T=Pw;break;default:T=DC}const{x:b,y:w}=Fpe(e),C=NC().x(b).y(w).curve(T);let S;switch(e.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-invisible";break;default:S="edge-thickness-normal"}switch(e.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break;default:S+=" edge-pattern-solid"}let k,E=v==="rounded"?Wpe(Hpe(y,e),5):C(y);const _=Array.isArray(e.style)?e.style:[e.style];let M=_.find(F=>F==null?void 0:F.startsWith("stroke:")),L="";e.animate&&(L="edge-animation-fast"),e.animation&&(L="edge-animation-"+e.animation);let P=!1;if(e.look==="handDrawn"){const F=Gt.svg(t);Object.assign([],y);const z=F.path(E,{roughness:.3,seed:l});S+=" transition",k=ut(z).select("path").attr("id",`${s}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(L?" "+L:"")).attr("style",_?_.reduce((B,G)=>B+";"+G,""):"");let V=k.attr("d");k.attr("d",V),t.node().appendChild(k.node())}else{const F=g.join(";"),z=_?_.reduce((Z,Y)=>Z+Y+";",""):"",V=(F?F+";"+z+";":z)+";"+(_?_.reduce((Z,Y)=>Z+";"+Y,""):"");k=t.append("path").attr("d",E).attr("id",`${s}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(L?" "+L:"")).attr("style",V),M=(N=V.match(/stroke:([^;]+)/))==null?void 0:N[1],P=e.animate===!0||!!e.animation||F.includes("animation");const B=k.node(),G=typeof B.getTotalLength=="function"?B.getTotalLength():0,H=QK[e.arrowTypeStart]||0,q=QK[e.arrowTypeEnd]||0;if(e.look==="neo"&&!P){const Y=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?cKe(G,H,q):`0 ${H} ${G-H-q} ${q}`}; stroke-dashoffset: 0;`;k.attr("style",Y+k.attr("style"))}}k.attr("data-edge",!0),k.attr("data-et","edge"),k.attr("data-id",e.id),k.attr("data-points",m),k.attr("data-look",Ca(e.look)),e.showPoints&&y.forEach(F=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",F.x).attr("cy",F.y)});let D="";(Fe().flowchart.arrowMarkerAbsolute||Fe().state.arrowMarkerAbsolute)&&(D=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,D=D.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),le.info("arrowTypeStart",e.arrowTypeStart),le.info("arrowTypeEnd",e.arrowTypeEnd);const R=!P&&(e==null?void 0:e.look)==="neo";tKe(k,e,D,s,n,R,M);const I=Math.floor(h.length/2),$=h[I];yr.isLabelCoordinateInPath($,k.attr("d"))||(d=!0);let O={};return d&&(O.updatedPath=h),O.originalPath=e.points,O},"insertEdge");function Wpe(t,e){if(t.length<2)return"";let r="";const n=t.length,i=1e-5;for(let a=0;a<n;a++){const s=t[a],o=t[a-1],l=t[a+1];if(a===0)r+=`M${s.x},${s.y}`;else if(a===n-1)r+=`L${s.x},${s.y}`;else{const u=s.x-o.x,h=s.y-o.y,d=l.x-s.x,f=l.y-s.y,p=Math.hypot(u,h),g=Math.hypot(d,f);if(p<i||g<i){r+=`L${s.x},${s.y}`;continue}const m=u/p,y=h/p,v=d/g,T=f/g,b=m*v+y*T,w=Math.max(-1,Math.min(1,b)),C=Math.acos(w);if(C<i||Math.abs(Math.PI-C)<i){r+=`L${s.x},${s.y}`;continue}const S=Math.min(e/Math.sin(C/2),p/2,g/2),k=s.x-m*S,E=s.y-y*S,_=s.x+v*S,M=s.y+T*S;r+=`L${k},${E}`,r+=`Q${s.x},${s.y} ${_},${M}`}}return r}x(Wpe,"generateRoundedPath");function VO(t,e){if(!t||!e)return{angle:0,deltaX:0,deltaY:0};const r=e.x-t.x,n=e.y-t.y;return{angle:Math.atan2(n,r),deltaX:r,deltaY:n}}x(VO,"calculateDeltaAndAngle");function Hpe(t,e){const r=t.map(i=>({...i}));if(t.length>=2&&ma[e.arrowTypeStart]){const i=ma[e.arrowTypeStart],a=t[0],s=t[1],{angle:o}=VO(a,s),l=i*Math.cos(o),u=i*Math.sin(o);r[0].x=a.x+l,r[0].y=a.y+u}const n=t.length;if(n>=2&&ma[e.arrowTypeEnd]){const i=ma[e.arrowTypeEnd],a=t[n-1],s=t[n-2],{angle:o}=VO(s,a),l=i*Math.cos(o),u=i*Math.sin(o);r[n-1].x=a.x-l,r[n-1].y=a.y-u}return r}x(Hpe,"applyMarkerOffsetsToPoints");var uKe=x((t,e,r,n)=>{e.forEach(i=>{NKe[i](t,r,n)})},"insertMarkers"),hKe=x((t,e,r)=>{le.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),t.append("marker").attr("id",r+"_"+e+"-extensionStart-margin").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd-margin").attr("class","marker extension "+e).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),dKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart-margin").attr("class","marker composition "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd-margin").attr("class","marker composition "+e).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),fKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart-margin").attr("class","marker aggregation "+e).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd-margin").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),pKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart-margin").attr("class","marker dependency "+e).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd-margin").attr("class","marker dependency "+e).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),gKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart-margin").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd-margin").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),mKe=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart-margin").attr("class","marker "+e).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),yKe=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleEnd-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart-margin").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),vKe=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossEnd-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),t.append("marker").attr("id",r+"_"+e+"-crossStart-margin").attr("class","marker cross "+e).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),bKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),xKe=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{transitionColor:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${a}`)},"barbNeo"),TKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),wKe=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),CKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),kKe=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),SKe=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${a}`)},"only_one_neo"),EKe=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");o.append("circle").attr("fill",s??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),o.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",s??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${a}`)},"zero_or_one_neo"),AKe=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${a}`),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${a}`)},"one_or_more_neo"),_Ke=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:s}=i,o=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");o.append("circle").attr("fill",s??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),o.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${a}`);const l=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",s??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${a}`)},"zero_or_more_neo"),RKe=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
L20,10
M20,10
L0,20`)},"requirement_arrow"),LKe=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{strokeWidth:a}=i;t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${a}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
L20,10
M20,10
L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),MKe=x((t,e,r)=>{const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),IKe=x((t,e,r)=>{const n=Xt(),{themeVariables:i}=n,{strokeWidth:a}=i,s=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),NKe={extension:hKe,composition:dKe,aggregation:fKe,dependency:pKe,lollipop:gKe,point:mKe,circle:yKe,cross:vKe,barb:bKe,barbNeo:xKe,only_one:TKe,zero_or_one:wKe,one_or_more:CKe,zero_or_more:kKe,only_one_neo:SKe,zero_or_one_neo:EKe,one_or_more_neo:AKe,zero_or_more_neo:_Ke,requirement_arrow:RKe,requirement_contains:MKe,requirement_arrow_neo:LKe,requirement_contains_neo:IKe},LV=uKe,DKe={common:At,getConfig:Xt,insertCluster:xR,insertEdge:RV,insertEdgeLabel:zA,insertMarkers:LV,insertNode:rS,interpolateToCurve:lV,labelHelper:xr,log:le,positionEdgeLabel:Vpe},VC={},qpe=x(t=>{for(const e of t)VC[e.name]=e},"registerLayoutLoaders"),OKe=x(()=>{qpe([{name:"dagre",loader:x(async()=>await tr(()=>Promise.resolve().then(()=>sut),void 0,import.meta.url),"loader")},{name:"swimlane",loader:x(async()=>await tr(()=>Promise.resolve().then(()=>vut),void 0,import.meta.url),"loader")},{name:"cose-bilkent",loader:x(async()=>await tr(()=>Promise.resolve().then(()=>lmt),void 0,import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");OKe();var xx=x(async(t,e,r)=>{if(!(t.layoutAlgorithm in VC))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);if(t.diagramId)for(const d of t.nodes){const f=d.domId||d.id;d.domId=`${t.diagramId}-${f}`}const n=VC[t.layoutAlgorithm],i=await n.loader(),{theme:a,themeVariables:s}=t.config,{useGradient:o,gradientStart:l,gradientStop:u}=s,h=e.attr("id");if(e.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a!=null&&a.includes("dark")?"#FFFFFF":"#000000"}`),e.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a!=null&&a.includes("dark")?"#FFFFFF":"#000000"}`),o){const d=e.append("linearGradient").attr("id",e.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}return i.render(t,e,DKe,{algorithm:n.algorithm},r)},"render"),nS=x((t="",{fallback:e="dagre"}={})=>{if(t in VC)return t;if(e in VC)return le.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm"),MV="comm",Upe="rule",Ype="decl",$Ke="@media",PKe="@import",BKe="@supports",FKe="@namespace",GO="@keyframes",Xpe="@layer",zKe="@scope",VKe=Math.abs,Vw=String.fromCharCode;function jpe(t){return t.trim()}function WO(t,e,r){return t.replace(e,r)}function fy(t,e){return t.charCodeAt(e)|0}function Mb(t,e,r){return t.slice(e,r)}function Lc(t){return t.length}function Kpe(t){return t.length}function LE(t,e){return e.push(t),t}var wR=1,Ib=1,Zpe=0,bl=0,Gi=0,Tx="";function IV(t,e,r,n,i,a,s,o){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:wR,column:Ib,length:s,return:"",siblings:o}}function GKe(){return Gi}function WKe(){return Gi=bl>0?fy(Tx,--bl):0,Ib--,Gi===10&&(Ib=1,wR--),Gi}function Zl(){return Gi=bl<Zpe?fy(Tx,bl++):0,Ib++,Gi===10&&(Ib=1,wR++),Gi}function Ld(){return fy(Tx,bl)}function J4(){return bl}function CR(t,e){return Mb(Tx,t,e)}function GC(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function HKe(t){return wR=Ib=1,Zpe=Lc(Tx=t),bl=0,[]}function qKe(t){return Tx="",t}function eI(t){return jpe(CR(bl-1,HO(t===91?t+2:t===40?t+1:t)))}function UKe(t){for(;(Gi=Ld())&&Gi<33;)Zl();return GC(t)>2||GC(Gi)>3?"":" "}function YKe(t,e){for(;--e&&Zl()&&!(Gi<48||Gi>102||Gi>57&&Gi<65||Gi>70&&Gi<97););return CR(t,J4()+(e<6&&Ld()==32&&Zl()==32))}function HO(t){for(;Zl();)switch(Gi){case t:return bl;case 34:case 39:t!==34&&t!==39&&HO(Gi);break;case 40:t===41&&HO(t);break;case 92:Zl();break}return bl}function XKe(t,e){for(;Zl()&&t+Gi!==57;)if(t+Gi===84&&Ld()===47)break;return"/*"+CR(e,bl-1)+"*"+Vw(t===47?t:Zl())}function jKe(t){for(;!GC(Ld());)Zl();return CR(t,bl)}function KKe(t){return qKe(e3("",null,null,null,[""],t=HKe(t),0,[0],t))}function e3(t,e,r,n,i,a,s,o,l){for(var u=0,h=0,d=s,f=0,p=0,g=0,m=1,y=1,v=1,T=0,b=0,w="",C=i,S=a,k=n,E=w;y;)switch(g=b,b=Zl()){case 40:g!=108&&fy(E,d-1)==58?(T++,E+="("):E+=eI(b);break;case 41:T--,E+=")";break;case 34:case 39:case 91:E+=eI(b);break;case 9:case 10:case 13:case 32:if(T>0){E+=Vw(b);break}E+=UKe(g);break;case 92:E+=YKe(J4()-1,7);continue;case 47:switch(Ld()){case 42:case 47:LE(ZKe(XKe(Zl(),J4()),e,r,l),l),(GC(g||1)==5||GC(Ld()||1)==5)&&Lc(E)&&Mb(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*m:o[u++]=Lc(E)*v;case 125*m:case 59:case 0:if(T>0&&b){E+=Vw(b);break}switch(b){case 0:case 125:y=0;case 59+h:v==-1&&(E=WO(E,/\f/g,"")),p>0&&(Lc(E)-d||m===0)&&LE(p>32?nZ(E+";",n,r,d-1,l):nZ(WO(E," ","")+";",n,r,d-2,l),l);break;case 59:E+=";";default:if(LE(k=rZ(E,e,r,u,h,i,o,w,C=[],S=[],d,a),a),b===123)if(h===0)e3(E,e,k,k,C,a,d,o,S);else{switch(f){case 99:if(fy(E,3)===110)break;case 108:if(fy(E,2)===97)break;default:h=0;case 100:case 109:case 115:}h?e3(t,k,k,n&&LE(rZ(t,k,k,0,0,i,o,w,i,C=[],d,S),S),i,S,d,o,n?C:S):e3(E,k,k,k,[""],S,0,o,S)}}u=h=p=0,m=v=1,w=E="",d=s;break;case 58:d=1+Lc(E),p=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&WKe()==125)continue}switch(E+=Vw(b),b*m){case 38:v=h>0?1:(E+="\f",-1);break;case 44:if(T>0)break;o[u++]=(Lc(E)-1)*v,v=1;break;case 64:Ld()===45&&(E+=eI(Zl())),f=Ld(),h=d=Lc(w=E+=jKe(J4())),b++;break;case 45:g===45&&Lc(E)==2&&(m=0)}}return a}function rZ(t,e,r,n,i,a,s,o,l,u,h,d){for(var f=i-1,p=i===0?a:[""],g=Kpe(p),m=0,y=0,v=0;m<n;++m)for(var T=0,b=Mb(t,f+1,f=VKe(y=s[m])),w=t;T<g;++T)(w=jpe(y>0?p[T]+" "+b:WO(b,/&\f/g,p[T])))&&(l[v++]=w);return IV(t,e,r,i===0?Upe:o,l,u,h,d)}function ZKe(t,e,r,n){return IV(t,e,r,MV,Vw(GKe()),Mb(t,2,-2),0,n)}function nZ(t,e,r,n,i){return IV(t,e,r,Ype,Mb(t,0,n),Mb(t,n+1,-1),n,i)}function qO(t,e){for(var r="",n=0;n<t.length;n++)r+=e(t[n],n,t,e)||"";return r}function QKe(t,e,r,n){switch(t.type){case Xpe:if(t.children.length)break;case PKe:case FKe:case Ype:return t.return=t.return||t.value;case MV:return"";case GO:return t.return=t.value+"{"+qO(t.children,n)+"}";case Upe:if(!Lc(t.value=t.props.join(",")))return""}return Lc(r=qO(t.children,n))?t.return=t.value+"{"+r+"}":""}function JKe(t){var e=Kpe(t);return function(r,n,i,a){for(var s="",o=0;o<e;o++)s+=t[o](r,n,i,a)||"";return s}}var Qpe="c4",eZe=x(t=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),tZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>nyt);return{diagram:e}},void 0,import.meta.url);return{id:Qpe,diagram:t}},"loader"),rZe={id:Qpe,detector:eZe,loader:tZe},nZe=rZe,Jpe="flowchart",iZe=x((t,e)=>{var r,n;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"?!1:/^\s*graph/.test(t)},"detector"),aZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>bW);return{diagram:e}},void 0,import.meta.url);return{id:Jpe,diagram:t}},"loader"),sZe={id:Jpe,detector:iZe,loader:aZe},oZe=sZe,e0e="flowchart-v2",lZe=x((t,e)=>{var r,n,i;return((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(t))},"detector"),cZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>bW);return{diagram:e}},void 0,import.meta.url);return{id:e0e,diagram:t}},"loader"),uZe={id:e0e,detector:lZe,loader:cZe},hZe=uZe,t0e="swimlane",dZe=x(t=>/^\s*swimlane-beta\b/.test(t),"detector"),fZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>vyt);return{diagram:e}},void 0,import.meta.url);return{id:t0e,diagram:t}},"loader"),pZe={id:t0e,detector:dZe,loader:fZe},gZe=pZe,r0e="er",mZe=x(t=>/^\s*erDiagram/.test(t),"detector"),yZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>Eyt);return{diagram:e}},void 0,import.meta.url);return{id:r0e,diagram:t}},"loader"),vZe={id:r0e,detector:mZe,loader:yZe},bZe=vZe,n0e="gitGraph",xZe=x(t=>/^\s*gitGraph/.test(t),"detector"),TZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>RAt);return{diagram:e}},void 0,import.meta.url);return{id:n0e,diagram:t}},"loader"),wZe={id:n0e,detector:xZe,loader:TZe},CZe=wZe,i0e="gantt",kZe=x(t=>/^\s*gantt/.test(t),"detector"),SZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>P_t);return{diagram:e}},void 0,import.meta.url);return{id:i0e,diagram:t}},"loader"),EZe={id:i0e,detector:kZe,loader:SZe},AZe=EZe,a0e="info",_Ze=x(t=>/^\s*info/.test(t),"detector"),RZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>q_t);return{diagram:e}},void 0,import.meta.url);return{id:a0e,diagram:t}},"loader"),LZe={id:a0e,detector:_Ze,loader:RZe},s0e="pie",MZe=x(t=>/^\s*pie/.test(t),"detector"),IZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>l6t);return{diagram:e}},void 0,import.meta.url);return{id:s0e,diagram:t}},"loader"),NZe={id:s0e,detector:MZe,loader:IZe},o0e="quadrantChart",DZe=x(t=>/^\s*quadrantChart/.test(t),"detector"),OZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>m6t);return{diagram:e}},void 0,import.meta.url);return{id:o0e,diagram:t}},"loader"),$Ze={id:o0e,detector:DZe,loader:OZe},PZe=$Ze,l0e="xychart",BZe=x(t=>/^\s*xychart(-beta)?/.test(t),"detector"),FZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>M6t);return{diagram:e}},void 0,import.meta.url);return{id:l0e,diagram:t}},"loader"),zZe={id:l0e,detector:BZe,loader:FZe},VZe=zZe,c0e="requirement",GZe=x(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),WZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>F6t);return{diagram:e}},void 0,import.meta.url);return{id:c0e,diagram:t}},"loader"),HZe={id:c0e,detector:GZe,loader:WZe},qZe=HZe,u0e="sequence",UZe=x(t=>/^\s*sequenceDiagram/.test(t),"detector"),YZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>DRt);return{diagram:e}},void 0,import.meta.url);return{id:u0e,diagram:t}},"loader"),XZe={id:u0e,detector:UZe,loader:YZe},jZe=XZe,h0e="class",KZe=x((t,e)=>{var r;return((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t)},"detector"),ZZe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>zRt);return{diagram:e}},void 0,import.meta.url);return{id:h0e,diagram:t}},"loader"),QZe={id:h0e,detector:KZe,loader:ZZe},JZe=QZe,d0e="classDiagram",eQe=x((t,e)=>{var r;return/^\s*classDiagram/.test(t)&&((r=e==null?void 0:e.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t)},"detector"),tQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>GRt);return{diagram:e}},void 0,import.meta.url);return{id:d0e,diagram:t}},"loader"),rQe={id:d0e,detector:eQe,loader:tQe},nQe=rQe,f0e="state",iQe=x((t,e)=>{var r;return((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t)},"detector"),aQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>MLt);return{diagram:e}},void 0,import.meta.url);return{id:f0e,diagram:t}},"loader"),sQe={id:f0e,detector:iQe,loader:aQe},oQe=sQe,p0e="stateDiagram",lQe=x((t,e)=>{var r;return!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&((r=e==null?void 0:e.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),cQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>NLt);return{diagram:e}},void 0,import.meta.url);return{id:p0e,diagram:t}},"loader"),uQe={id:p0e,detector:lQe,loader:cQe},hQe=uQe,g0e="journey",dQe=x(t=>/^\s*journey/.test(t),"detector"),fQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>t7t);return{diagram:e}},void 0,import.meta.url);return{id:g0e,diagram:t}},"loader"),pQe={id:g0e,detector:dQe,loader:fQe},gQe=pQe,mQe=x((t,e,r)=>{le.debug(`rendering svg for syntax error
`);const n=xs(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),Ai(n,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),m0e={draw:mQe},yQe=m0e,vQe={db:{},renderer:m0e,parser:{parse:x(()=>{},"parse")}},bQe=vQe,y0e="flowchart-elk",xQe=x((t,e={})=>{var r;return/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&((r=e==null?void 0:e.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(e.layout="elk",!0):!1},"detector"),TQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>bW);return{diagram:e}},void 0,import.meta.url);return{id:y0e,diagram:t}},"loader"),wQe={id:y0e,detector:xQe,loader:TQe},CQe=wQe,v0e="timeline",kQe=x(t=>/^\s*timeline/.test(t),"detector"),SQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>L7t);return{diagram:e}},void 0,import.meta.url);return{id:v0e,diagram:t}},"loader"),EQe={id:v0e,detector:kQe,loader:SQe},AQe=EQe,b0e="mindmap",_Qe=x(t=>/^\s*mindmap/.test(t),"detector"),RQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>U7t);return{diagram:e}},void 0,import.meta.url);return{id:b0e,diagram:t}},"loader"),LQe={id:b0e,detector:_Qe,loader:RQe},MQe=LQe,x0e="kanban",IQe=x(t=>/^\s*kanban/.test(t),"detector"),NQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>dMt);return{diagram:e}},void 0,import.meta.url);return{id:x0e,diagram:t}},"loader"),DQe={id:x0e,detector:IQe,loader:NQe},OQe=DQe,T0e="sankey",$Qe=x(t=>/^\s*sankey(-beta)?/.test(t),"detector"),PQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ZMt);return{diagram:e}},void 0,import.meta.url);return{id:T0e,diagram:t}},"loader"),BQe={id:T0e,detector:$Qe,loader:PQe},FQe=BQe,w0e="packet",zQe=x(t=>/^\s*packet(-beta)?/.test(t),"detector"),VQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>lIt);return{diagram:e}},void 0,import.meta.url);return{id:w0e,diagram:t}},"loader"),GQe={id:w0e,detector:zQe,loader:VQe},C0e="radar",WQe=x(t=>/^\s*radar-beta/.test(t),"detector"),HQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>RIt);return{diagram:e}},void 0,import.meta.url);return{id:C0e,diagram:t}},"loader"),qQe={id:C0e,detector:WQe,loader:HQe},k0e="block",UQe=x(t=>/^\s*block(-beta)?/.test(t),"detector"),YQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>rNt);return{diagram:e}},void 0,import.meta.url);return{id:k0e,diagram:t}},"loader"),XQe={id:k0e,detector:UQe,loader:YQe},jQe=XQe,S0e="treeView",KQe=x(t=>/^\s*treeView-beta/.test(t),"detector"),ZQe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ENt);return{diagram:e}},void 0,import.meta.url);return{id:S0e,diagram:t}},"loader"),QQe={id:S0e,detector:KQe,loader:ZQe},JQe=QQe,E0e="architecture",eJe=x(t=>/^\s*architecture/.test(t),"detector"),tJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>eDt);return{diagram:e}},void 0,import.meta.url);return{id:E0e,diagram:t}},"loader"),rJe={id:E0e,detector:eJe,loader:tJe},nJe=rJe,A0e="eventmodeling",iJe=x(t=>/^\s*eventmodeling/.test(t),"detector"),aJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>mDt);return{diagram:e}},void 0,import.meta.url);return{id:A0e,diagram:t}},"loader"),sJe={id:A0e,detector:iJe,loader:aJe},oJe=sJe,_0e="ishikawa",lJe=x(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),cJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>NDt);return{diagram:e}},void 0,import.meta.url);return{id:_0e,diagram:t}},"loader"),uJe={id:_0e,detector:lJe,loader:cJe},R0e="venn",hJe=x(t=>/^\s*venn-beta/.test(t),"detector"),dJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>vOt);return{diagram:e}},void 0,import.meta.url);return{id:R0e,diagram:t}},"loader"),fJe={id:R0e,detector:hJe,loader:dJe},pJe=fJe,L0e="treemap",gJe=x(t=>/^\s*treemap/.test(t),"detector"),mJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>ROt);return{diagram:e}},void 0,import.meta.url);return{id:L0e,diagram:t}},"loader"),yJe={id:L0e,detector:gJe,loader:mJe},M0e="wardley",vJe=x(t=>/^\s*wardley-beta/i.test(t),"detector"),bJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>VOt);return{diagram:e}},void 0,import.meta.url);return{id:M0e,diagram:t}},"loader"),xJe={id:M0e,detector:vJe,loader:bJe},TJe=xJe,I0e="cynefin",wJe=x(t=>/^\s*cynefin-beta(?:[\s:]|$)/.test(t),"detector"),CJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>i$t);return{diagram:e}},void 0,import.meta.url);return{id:I0e,diagram:t}},"loader"),kJe={id:I0e,detector:wJe,loader:CJe},N0e="railroad",SJe=x(t=>/^\s*railroad-beta/i.test(t),"detector"),EJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>R$t);return{diagram:e}},void 0,import.meta.url);return{id:N0e,diagram:t}},"loader"),AJe={id:N0e,detector:SJe,loader:EJe},D0e="railroadEbnf",_Je=x(t=>/^\s*railroad-ebnf-beta/i.test(t),"detector"),RJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>B$t);return{diagram:e}},void 0,import.meta.url);return{id:D0e,diagram:t}},"loader"),LJe={id:D0e,detector:_Je,loader:RJe},O0e="railroadAbnf",MJe=x(t=>/^\s*railroad-abnf-beta/i.test(t),"detector"),IJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>X$t);return{diagram:e}},void 0,import.meta.url);return{id:O0e,diagram:t}},"loader"),NJe={id:O0e,detector:MJe,loader:IJe},$0e="railroadPeg",DJe=x(t=>/^\s*railroad-peg-beta/i.test(t),"detector"),OJe=x(async()=>{const{diagram:t}=await tr(async()=>{const{diagram:e}=await Promise.resolve().then(()=>iPt);return{diagram:e}},void 0,import.meta.url);return{id:$0e,diagram:t}},"loader"),$Je={id:$0e,detector:DJe,loader:OJe},iZ=!1,kR=x(()=>{iZ||(iZ=!0,nA("error",bQe,t=>t.toLowerCase().trim()==="error"),nA("---",{db:{clear:x(()=>{},"clear")},styles:{},renderer:{draw:x(()=>{},"draw")},parser:{parse:x(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:x(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),qD(CQe,MQe,nJe),qD(nZe,OQe,nQe,JZe,bZe,AZe,LZe,NZe,qZe,jZe,gZe,hZe,oZe,AQe,CZe,hQe,oQe,gQe,PZe,FQe,GQe,VZe,jQe,oJe,JQe,qQe,uJe,yJe,AJe,LJe,NJe,$Je,pJe,TJe,kJe))},"addDiagrams"),PJe=x(async()=>{le.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(A0).map(async([r,{detector:n,loader:i}])=>{if(i)try{KD(r)}catch{try{const{diagram:a,id:s}=await i();nA(s,a,n)}catch(a){throw le.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete A0[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){le.error(`Failed to load ${e.length} external diagrams`);for(const r of e)le.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),BJe="graphics-document document";function P0e(t,e){t.attr("role",BJe),e!==""&&t.attr("aria-roledescription",e)}x(P0e,"setA11yDiagramInfo");function B0e(t,e,r,n){if(t.insert!==void 0){if(r){const i=`chart-desc-${n}`;t.attr("aria-describedby",i),t.insert("desc",":first-child").attr("id",i).text(r)}if(e){const i=`chart-title-${n}`;t.attr("aria-labelledby",i),t.insert("title",":first-child").attr("id",i).text(e)}}}x(B0e,"addSVGa11yTitleDescription");var g0,UO=(g0=class{constructor(e,r,n,i,a){this.type=e,this.text=r,this.db=n,this.parser=i,this.renderer=a}static async fromText(e,r={}){var u,h;const n=Xt(),i=kz(e,n);e=sXe(e)+`
`;try{KD(i)}catch{const d=kFe(i);if(!d)throw new Jle(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();nA(f,p)}const{db:a,parser:s,renderer:o,init:l}=KD(i);return s.parser&&(s.parser.yy=a),(u=a.clear)==null||u.call(a),l==null||l(n),r.title&&((h=a.setDiagramTitle)==null||h.call(a,r.title)),await s.parse(e),new g0(i,e,a,s,o)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},x(g0,"Diagram"),g0),aZ=[],FJe=x(()=>{aZ.forEach(t=>{t()}),aZ=[]},"attachFunctions"),zJe=x(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function F0e(t){const e=t.match(Qle);if(!e)return{text:t,metadata:{}};const r=e[1],n=r?e[2].split(`
`).map(s=>s.startsWith(r)?s.slice(r.length):s).join(`
`):e[2];let i=dR(n,{schema:hR})??{};i=typeof i=="object"&&!Array.isArray(i)?i:{};const a={};return i.displayMode&&(a.displayMode=i.displayMode.toString()),i.title&&(a.title=i.title.toString()),i.config&&(a.config=i.config),{text:t.slice(e[0].length),metadata:a}}x(F0e,"extractFrontMatter");var VJe=x(t=>t.replace(/\r\n?/g,`
`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),GJe=x(t=>{const{text:e,metadata:r}=F0e(t),{displayMode:n,title:i,config:a={}}=r;return n&&(a.gantt||(a.gantt={}),a.gantt.displayMode=n),{title:i,config:a,text:e}},"processFrontmatter"),WJe=x(t=>{const e=yr.detectInit(t)??{},r=yr.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:n})=>n==="wrap"):(r==null?void 0:r.type)==="wrap"&&(e.wrap=!0),{text:KYe(t),directive:e}},"processDirectives");function NV(t){const e=VJe(t),r=GJe(e),n=WJe(r.text),i=ri(r.config,n.directive);return t=zJe(n.text),{code:t,title:r.title,config:i}}x(NV,"preprocessDiagram");function z0e(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}x(z0e,"toBase64");var HJe=5e4,qJe="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",UJe="sandbox",YJe="loose",XJe="http://www.w3.org/2000/svg",jJe="http://www.w3.org/1999/xlink",KJe="http://www.w3.org/1999/xhtml",ZJe="100%",QJe="100%",JJe="border:0;margin:0;",eet="margin:0",tet="allow-top-navigation-by-user-activation allow-popups",ret='The "iframe" tag is not supported by your browser.',net=["foreignobject"],iet=["dominant-baseline"];function DV(t){const e=NV(t);return tA(),xFe(e.config??{}),e}x(DV,"processAndSetConfigs");async function V0e(t,e){kR();try{const{code:r,config:n}=DV(t);return{diagramType:(await W0e(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}x(V0e,"parse");var sZ=x((t,e,r=[])=>{const n=Ule(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),aet=x((t,e=new Map)=>{const r=new CSSStyleSheet;if(t.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${t.fontFamily}}`,r.cssRules.length),t.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${t.altFontFamily}}`,r.cssRules.length),e instanceof Map){const o=xn(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{bK(l.styles)||o.forEach(u=>{r.insertRule(sZ(l.id,u,l.styles),r.cssRules.length)}),bK(l.textStyles)||r.insertRule(sZ(l.id,"tspan",((l==null?void 0:l.textStyles)||[]).map(u=>u.replace("color","fill"))),r.cssRules.length)})}let n="";if(t.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const i=new CSSStyleSheet;i.replaceSync(t.themeCSS),n=XD(i)+`
`}else n+=`${t.themeCSS}
`;return n+XD(r)},"createCssStyles"),set=x((t,e)=>qO(KKe(`${t}{${e}}`),JKe([x(function(n,i,a,s){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===GO)return;n.props=n.props.map(o=>o===t&&Array.isArray(n.children)&&n.children.every(u=>u.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(u.props))||(o.startsWith(`${t} `)||o.startsWith(`${t}>`))&&!o.startsWith(`${t} ||`)?o:`${t} ${o}`)}else n.type.startsWith("@")&&([...[$Ke,BKe,Xpe,zKe,"@container","@starting-style"],GO].includes(n.type)||(le.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=MV))},"addNamespace"),QKe])),"compileCSS"),oet=x((t,e,r,n)=>{const i=aet(t,r),a=zFe(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return set(n,a)},"createUserStyles"),cet=x((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=vh(n),n=n.replace(/<br>/g,"<br/>"),n},"cleanUpSvgCode"),uet=x((t="",e)=>{var i,a;const r=(a=(i=e==null?void 0:e.viewBox)==null?void 0:i.baseVal)!=null&&a.height?e.viewBox.baseVal.height+"px":QJe,n=z0e(`<body style="${eet}">${t}</body>`);return`<iframe style="width:${ZJe};height:${r};${JJe}" src="data:text/html;charset=UTF-8;base64,${n}" sandbox="${tet}">
${ret}
</iframe>`},"putIntoIFrame"),oZ=x((t,e,r,n,i)=>{const a=t.append("div");a.attr("id",r),n&&a.attr("style",n);const s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns",XJe);return i&&s.attr("xmlns:xlink",i),s.append("g"),t},"appendDivSvgG");function YO(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}x(YO,"sandboxedIframe");var het=x((t,e,r,n)=>{var i,a,s;(i=t.getElementById(e))==null||i.remove(),(a=t.getElementById(r))==null||a.remove(),(s=t.getElementById(n))==null||s.remove()},"removeExistingElements"),det=x(async function(t,e,r){var P,D,R,I,$,O;kR();const n=DV(e);e=n.code;const i=Xt();le.debug(i),e.length>((i==null?void 0:i.maxTextSize)??HJe)&&(e=qJe);const a=`#${t}`,s="i"+t,o="#"+s,l="d"+t,u="#"+l,h=x(()=>{const F=ut(f?o:u).node();F&&"remove"in F&&F.remove()},"removeTempElements");let d=ut(document.body);const f=i.securityLevel===UJe,p=i.securityLevel===YJe,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const N=YO(ut(r),s);d=ut(N.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=ut(r);oZ(d,t,l,`font-family: ${g}`,jJe)}else{if(het(document,t,l,s),f){const N=YO(ut(document.body),s);d=ut(N.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=ut("body");oZ(d,t,l)}let m,y;try{m=await UO.fromText(e,{title:n.title})}catch(N){if(i.suppressErrorRendering)throw h(),N;m=await UO.fromText("error"),y=N}const v=d.select(u).node(),T=m.type,b=v.firstChild,w=b.firstChild,C=(D=(P=m.renderer).getClasses)==null?void 0:D.call(P,e,m),S=oet(i,T,C,a),k=document.createElement("style");k.innerHTML=S,b.insertBefore(k,w);try{await m.renderer.draw(e,t,"11.16.1",m)}catch(N){throw i.suppressErrorRendering?h():yQe.draw(e,t,"11.16.1"),N}const E=d.select(`${u} svg`),_=(I=(R=m.db).getAccTitle)==null?void 0:I.call(R),M=(O=($=m.db).getAccDescription)==null?void 0:O.call($);H0e(T,E,_,M),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",KJe);let L=d.select(u).node().innerHTML;if(le.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),L=cet(L,f,su(i.arrowMarkerAbsolute)),f){const N=d.select(u+" svg").node();L=uet(L,N)}else p||(L=ph.sanitize(L,{ADD_TAGS:net,ADD_ATTR:iet,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(FJe(),y)throw y;return h(),{diagramType:T,svg:L,bindFunctions:m.db.bindFunctions}},"render");function G0e(t={}){var n;const e=Wi({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),vFe(e),e!=null&&e.theme&&e.theme in ch?e.themeVariables=ch[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=ch.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?yFe(e):Yle();Tz(r.logLevel),kR()}x(G0e,"initialize");var W0e=x((t,e={})=>{const{code:r}=NV(t);return UO.fromText(r,e)},"getDiagramFromText");function H0e(t,e,r,n){P0e(e,t),B0e(e,r,n,e.attr("id"))}x(H0e,"addA11yInfo");var O0=Object.freeze({render:det,parse:V0e,getDiagramFromText:W0e,initialize:G0e,getConfig:Xt,setConfig:Xle,getSiteConfig:Yle,updateSiteConfig:bFe,reset:x(()=>{tA()},"reset"),globalReset:x(()=>{tA(Tb)},"globalReset"),defaultConfig:Tb});Tz(Xt().logLevel);tA(Xt());var fet=x((t,e,r)=>{le.warn(t),dV(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),q0e=x(async function(t={querySelector:".mermaid"}){try{await pet(t)}catch(e){if(dV(e)&&le.error(e.str),Oo.parseError&&Oo.parseError(e),!t.suppressErrors)throw le.error("Use the suppressErrors option to suppress these errors"),e}},"run"),pet=x(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=O0.getConfig();le.debug(`${t?"":"No "}Callback function found`);let i;if(r)i=r;else if(e)i=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");le.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(le.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),O0.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const a=new yr.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let s;const o=[];for(const l of Array.from(i)){if(le.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${a.next()}`;s=l.innerHTML,s=jde(yr.entityDecode(s)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=yr.detectInit(s);h&&le.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await j0e(u,s,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){fet(d,o,Oo.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),U0e=x(function(t){O0.initialize(t)},"initialize"),get=x(async function(t,e,r){le.warn("mermaid.init is deprecated. Please use run instead."),t&&U0e(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await q0e(n)},"init"),met=x(async(t,{lazyLoad:e=!0}={})=>{kR(),qD(...t),e===!1&&await PJe()},"registerExternalDiagrams"),Y0e=x(function(){if(Oo.startOnLoad){const{startOnLoad:t}=O0.getConfig();t&&Oo.run().catch(e=>le.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",Y0e,!1);var yet=x(function(t){Oo.parseError=t},"setParseErrorHandler"),VA=[],tI=!1,X0e=x(async()=>{if(!tI){for(tI=!0;VA.length>0;){const t=VA.shift();if(t)try{await t()}catch(e){le.error("Error executing queue",e)}}tI=!1}},"executeQueue"),vet=x(async(t,e)=>new Promise((r,n)=>{const i=x(()=>new Promise((a,s)=>{O0.parse(t,e).then(o=>{a(o),r(o)},o=>{var l;le.error("Error parsing",o),(l=Oo.parseError)==null||l.call(Oo,o),s(o),n(o)})}),"performCall");VA.push(i),X0e().catch(n)}),"parse"),j0e=x((t,e,r)=>new Promise((n,i)=>{const a=x(()=>new Promise((s,o)=>{O0.render(t,e,r).then(l=>{s(l),n(l)},l=>{var u;le.error("Error parsing",l),(u=Oo.parseError)==null||u.call(Oo,l),o(l),i(l)})}),"performCall");VA.push(a),X0e().catch(i)}),"render"),bet=x(()=>Object.keys(A0).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),Oo={startOnLoad:!0,mermaidAPI:O0,parse:vet,render:j0e,init:get,run:q0e,registerExternalDiagrams:met,registerLayoutLoaders:qpe,initialize:U0e,parseError:void 0,contentLoaded:Y0e,setParseErrorHandler:yet,detectType:kz,registerIconPacks:pV,getRegisteredDiagramsMetadata:bet},lZ=Oo;/*! Check if previously processed *//*!
* Wait for document loaded before starting the execution
*/function d0(t){try{const n=new URL(t,"http://edgeever.local").pathname.match(/^\/api\/v1\/resources\/([^/]+)(?:\/blob)?\/?$/);if(n!=null&&n[1])return decodeURIComponent(n[1])}catch{}const e=t.match(/\/api\/v1\/resources\/([^/?#]+)/);return e!=null&&e[1]&&e[1]!=="blob"?decodeURIComponent(e[1]):null}function OV(t,e){return/\/blob(?:$|[?#])/.test(t)||t.includes(`/resources/${e}/blob`)?t:t.startsWith("/api/v1/resources/")||t.includes("/api/v1/resources/")?`/api/v1/resources/${encodeURIComponent(e)}/blob`:t}function $V(t,e){const r=d0(t);return r?JSON.stringify({kind:"image",href:OV(t,r),filename:e.trim()||`image-${r}`,resourceId:r}):null}function xet(t,e){const r=d0(t);if(!r)return null;const n=e.replace(/^\s*(?:附件[::]|Attachment:)\s*/i,"").trim()||r;return JSON.stringify({kind:"attachment",href:OV(t,r),filename:n,resourceId:r})}const Tet=performance.now();let Ha="viewer",KT=!1;const GA=new Map;let wet=0;function dl(t){var e,r,n;try{(n=(r=(e=window.webkit)==null?void 0:e.messageHandlers)==null?void 0:r.edgeever)==null||n.postMessage(t)}catch{}}function WA(t){return t.startsWith("/api/")||t.includes("/api/v1/resources/")}function K0e(t){return!t||t.startsWith("data:")||t.startsWith("blob:")||t.startsWith("edgeever-res:")?!1:!!(WA(t)||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/"))}function Z0e(t){return new Promise(e=>{const r=`r${++wet}`;GA.set(r,e),dl({type:"loadResource",requestId:r,source:t}),setTimeout(()=>{GA.delete(r)&&e(null)},3e4)})}async function Cet(t){const e=Array.from(t.querySelectorAll("img[src]"));await Promise.all(e.map(async r=>{const n=r.getAttribute("src")||"";if(K0e(n)&&(r.dataset.originalSrc||(r.dataset.originalSrc=n),r.dataset.hydrating!=="1")){r.dataset.hydrating="1";try{const i=await Z0e(n);i&&r.setAttribute("src",i)}finally{delete r.dataset.hydrating}}}))}async function ket(t,e){const r=Array.from(t.querySelectorAll("pre code.language-mermaid, pre code[class*='mermaid']")),n=Array.from(t.querySelectorAll("pre")).filter(s=>{const o=s.textContent||"";return s.querySelector("code")&&/^(graph|sequenceDiagram|classDiagram|stateDiagram|erDiagram|journey|gantt|pie|mindmap|flowchart)/m.test(o.trim())}),i=new Set([...r.map(s=>s.parentElement).filter(Boolean),...n]);lZ.initialize({startOnLoad:!1,securityLevel:"strict",theme:e==="dark"?"dark":"default"});let a=0;for(const s of i){const o=(s.textContent||"").trim();if(o)try{const l=`mmd-${Date.now()}-${a++}`,{svg:u}=await lZ.render(l,o),h=document.createElement("div");h.className="edgeever-mermaid",h.innerHTML=u,s.replaceWith(h)}catch{}}}const Eet=[{label:"25%",width:25},{label:"50%",width:50},{label:"75%",width:75},{label:"100%",width:100}];function td(t){if(t==null||t==="")return null;const e=typeof t=="number"?t:Number.parseFloat(String(t).replace("%",""));return Number.isFinite(e)?Math.min(100,Math.max(10,Math.round(e))):null}function Q0e(t){return Math.min(100,Math.max(10,Math.round(t)))}function ME(t,e){const r=e==null?null:Q0e(e);if(r==null){t.style.removeProperty("width"),t.style.removeProperty("max-width"),t.style.removeProperty("--ee-image-width"),delete t.dataset.width,t.classList.remove("has-width");return}const n=`${r}%`;t.dataset.width=String(r),t.classList.add("has-width"),t.style.setProperty("--ee-image-width",n),t.style.setProperty("width",n),t.style.setProperty("max-width",n),t.style.setProperty("margin-left","auto"),t.style.setProperty("margin-right","auto"),t.style.setProperty("box-sizing","border-box"),t.style.setProperty("display","block")}function cZ(t,e){let r=0;const n=a=>{a.preventDefault(),a.stopPropagation(),typeof a.stopImmediatePropagation=="function"&&a.stopImmediatePropagation()},i=a=>{n(a);const s=Date.now();s-r<350||(r=s,e())};t.addEventListener("pointerdown",n),t.addEventListener("mousedown",n),t.addEventListener("touchstart",n,{passive:!1}),t.addEventListener("pointerup",i),t.addEventListener("click",i)}function Aet(){return G$e.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),width:{default:null,parseHTML:e=>td(e.getAttribute("data-width")??e.getAttribute("width")??e.style.width),renderHTML:e=>{const r=td(e.width);return r?{"data-width":String(r),style:`width: ${r}%`}:{}}}}},addNodeView(){return({editor:t,getPos:e,node:r})=>{let n=r;const i=document.createElement("figure");i.className="edgeever-image-node is-loading",i.contentEditable="false",i.setAttribute("role","img");const a=document.createElement("div");a.className="edgeever-image-loading";const s=document.createElement("span");s.className="edgeever-image-upload-spinner",a.append(s);const o=document.createElement("img");o.draggable=!1,o.hidden=!0;const l=document.createElement("button");l.type="button",l.className="edgeever-image-actions",l.contentEditable="false",l.hidden=!0,l.setAttribute("aria-label","图片操作"),l.textContent="⋯";const u=document.createElement("div");u.className="edgeever-image-size-controls",u.contentEditable="false",u.hidden=!0,u.setAttribute("role","group"),u.setAttribute("aria-label","图片宽度");const h=E=>{const _=e();if(typeof _!="number")return;const M=t.state.doc.nodeAt(_);if(!M||M.type.name!=="image")return;const L=Q0e(E);let P=t.state.tr.setNodeMarkup(_,void 0,{...M.attrs,width:L});try{P=P.setSelection(lr.create(P.doc,_))}catch{}t.view.dispatch(P),ME(i,L),f(L)},d=[];for(const E of Eet){const _=document.createElement("button");_.type="button",_.className="edgeever-image-size-button",_.textContent=E.label,_.setAttribute("aria-label",E.label),_.setAttribute("aria-pressed","false"),cZ(_,()=>h(E.width)),d.push({button:_,width:E.width}),u.append(_)}const f=E=>{for(const _ of d){const M=E!=null&&_.width===E;_.button.classList.toggle("is-active",M),_.button.setAttribute("aria-pressed",String(M))}},p=E=>{if(i.classList.toggle("is-loading",E==="loading"),i.classList.toggle("is-failed",E==="failed"),a.hidden=E==="ready",o.hidden=E!=="ready",l.hidden=E!=="ready",E==="failed"){a.replaceChildren();const _=document.createElement("span");_.className="edgeever-image-loading-label",_.textContent="图片加载失败",a.append(_),a.hidden=!1}else E==="loading"&&a.replaceChildren(s)},g=E=>{const _=String(E.src??"");return WA(_)||d0(_)?_:i.dataset.resourceHref||_},m=()=>{const E=i.dataset.resourceHref||o.dataset.originalSrc||g(n.attrs),_=$V(E,String(n.attrs.alt??"image"));if(_){dl({type:"resourcePress",targetJson:_});return}dl({type:"log",message:`image actions: no resource id for href=${E.slice(0,120)}`})},y=()=>{const E=i.dataset.resourceHref||o.dataset.originalSrc||g(n.attrs)||o.getAttribute("src")||"";E&&dl({type:"imagePreview",source:E,alt:String(n.attrs.alt??"")})};cZ(l,m);let v=0;const T=E=>{if(E.target instanceof Element&&E.target.closest(".edgeever-image-actions"))return;const _=Date.now();if(_-v<350)return;if(v=_,E.stopPropagation(),Ha==="viewer"||!t.isEditable){E.preventDefault(),y();return}E.preventDefault();const M=e();typeof M=="number"&&t.chain().setNodeSelection(M).run()};o.addEventListener("pointerdown",E=>E.stopPropagation()),o.addEventListener("click",T),o.addEventListener("pointerup",E=>{(E.pointerType==="touch"||E.pointerType==="pen")&&T(E)}),i.append(a,o,l,u);let b=0,w="",C=!1;const S=E=>{const _=String(E.alt??"");o.alt=_;const M=td(E.width);ME(i,M),f(M);const L=String(E.src??""),P=d0(L);P&&(i.dataset.resourceHref=OV(L,P),o.dataset.originalSrc=i.dataset.resourceHref)},k=E=>{b+=1;const _=b,M=String(E.src??"");w=M,S(E),p("loading"),u.hidden=!0;const L=P=>{_===b&&(o.onload=()=>{_===b&&(p("ready"),o.style.cursor=Ha==="viewer"||!t.isEditable?"zoom-in":"pointer",C&&t.isEditable&&Ha==="editor"&&(u.hidden=!1))},o.onerror=()=>{_===b&&p("failed")},o.src=P)};if(!M){p("failed");return}if(M.startsWith("data:")||M.startsWith("edgeever-res:")||M.startsWith("blob:")){L(M);return}if(K0e(M)){Z0e(M).then(P=>{_===b&&(P?L(P):p("failed"))});return}L(M)};return k(r.attrs),{dom:i,update:E=>{if(E.type.name!=="image")return!1;n=E;const _=String(E.attrs.src??"");return S(E.attrs),_!==w?k(E.attrs):(f(td(E.attrs.width)),ME(i,td(E.attrs.width))),!0},selectNode:()=>{var _,M;C=!0,i.classList.add("is-selected");const E=td((M=(_=t.state.selection.node)==null?void 0:_.attrs)==null?void 0:M.width)??td(i.dataset.width)??td(n.attrs.width);ME(i,E),t.isEditable&&Ha==="editor"&&!o.hidden&&(u.hidden=!1,f(E))},deselectNode:()=>{C=!1,i.classList.remove("is-selected"),u.hidden=!0},destroy:()=>{b+=1}}}}}).configure({inline:!1,allowBase64:!0})}function _et(t){return[F$e.configure({codeBlock:!1}),RDe.configure({languageClassPrefix:"language-"}),Aet(),r9e.configure({table:{resizable:!1}}),W$e.configure({placeholder:t}),rBe.configure({markedOptions:{gfm:!0}})]}const Ul=document.getElementById("editor"),rI=document.getElementById("toolbar"),Xr=new fDe({element:Ul,extensions:_et("开始书写…"),editable:!1,content:{type:"doc",content:[{type:"paragraph"}]},onUpdate:({editor:t})=>{KT||Ha!=="editor"||kp(t)},editorProps:{attributes:{class:"edgeever-prose",spellcheck:"true"},handleClick(t,e,r){return uZ(r,"click")},handleDOMEvents:{contextmenu(t,e){return uZ(e,"contextmenu")}}}});function uZ(t,e){const r=t.target;if(!r)return!1;if(r.closest(".edgeever-image-size-controls")||r.closest(".edgeever-image-actions")||r.closest(".edgeever-image-size-button"))return!0;const n=r.closest("a");if(n instanceof HTMLAnchorElement){const a=n.getAttribute("href")||"";if(WA(a)||d0(a)){const s=xet(a,n.textContent||"");if(s)return t.preventDefault(),t.stopPropagation(),dl({type:"resourcePress",targetJson:s}),!0}}const i=r.closest("img");if(i instanceof HTMLImageElement){if(i.closest("figure.edgeever-image-node")&&e==="click")return!1;const a=i.dataset.originalSrc||i.getAttribute("src")||"",s=i.dataset.originalSrc||(WA(a)||d0(a)?a:"");if(!s&&!d0(a))return Ha==="viewer"&&e==="click"&&a?(t.preventDefault(),dl({type:"imagePreview",source:a,alt:i.getAttribute("alt")||""}),!0):!1;const o=s||a,l=i.getAttribute("alt")||"image";if(e==="contextmenu"){const u=$V(o,l);if(u)return t.preventDefault(),t.stopPropagation(),dl({type:"resourcePress",targetJson:u}),!0}if(Ha==="viewer"&&e==="click")return t.preventDefault(),t.stopPropagation(),dl({type:"imagePreview",source:o,alt:l}),!0}return!1}(()=>{let t=null,e=null;const r=()=>{t&&clearTimeout(t),t=null,e=null};Ul.addEventListener("touchstart",n=>{var a;const i=(a=n.target)==null?void 0:a.closest("img");i instanceof HTMLImageElement&&(e=i,t=setTimeout(()=>{if(!e)return;const s=e.dataset.originalSrc||e.getAttribute("src")||"",o=$V(s,e.getAttribute("alt")||"image");o&&dl({type:"resourcePress",targetJson:o}),r()},480))},{passive:!0}),Ul.addEventListener("touchend",r,{passive:!0}),Ul.addEventListener("touchmove",r,{passive:!0}),Ul.addEventListener("touchcancel",r,{passive:!0})})();function kp(t){var e,r;try{const n=JSON.stringify(t.getJSON()),a=((r=(e=t.storage.markdown)==null?void 0:e.getMarkdown)==null?void 0:r.call(e))??t.getText({blockSeparator:`
`});dl({type:"change",contentMarkdown:a,contentJson:n})}catch(n){dl({type:"error",message:n instanceof Error?n.message:String(n)})}}function J0e(t){if(rI.classList.toggle("editor-mode",t),rI.innerHTML="",!t)return;const e=[{id:"bold",label:"B",run:()=>Xr.chain().focus().toggleBold().run()},{id:"bullet",label:"•",run:()=>Xr.chain().focus().toggleBulletList().run()},{id:"quote",label:"❝",run:()=>Xr.chain().focus().toggleBlockquote().run()},{id:"hr",label:"—",run:()=>Xr.chain().focus().setHorizontalRule().run()},{id:"h2",label:"H2",run:()=>Xr.chain().focus().toggleHeading({level:2}).run()},{id:"code",label:"</>",run:()=>Xr.chain().focus().toggleCodeBlock().run()}];for(const r of e){const n=document.createElement("button");n.type="button",n.textContent=r.label,n.dataset.action=r.id,n.addEventListener("click",()=>{r.run(),kp(Xr)}),rI.appendChild(n)}}async function hZ(t="light"){await Cet(Ul),Ha==="viewer"&&await ket(Ul,t)}const Ret={configure(t){const e=t.mode==="editor"?"editor":"viewer",r=e!==Ha;Ha=e,Xr.setEditable(Ha==="editor"),J0e(Ha==="editor"),document.documentElement.dataset.theme=t.theme||"light",document.body.classList.toggle("viewer-mode",Ha==="viewer"),document.body.classList.toggle("editor-mode",Ha==="editor"),t.placeholder&&Ul.setAttribute("data-placeholder",t.placeholder),Ha==="editor"&&r&&requestAnimationFrame(()=>{try{Xr.commands.focus("end")}catch{}})},setMarkdown(t){var e;KT=!0;try{Xr.commands.setContent(t||"",{contentType:"markdown"})}catch{try{const r=(e=Xr.storage.markdown)==null?void 0:e.manager;if(r)Xr.commands.setContent(r.parse(t||""));else throw new Error("no markdown manager")}catch{Xr.commands.setContent({type:"doc",content:[{type:"paragraph",content:t?[{type:"text",text:t}]:[]}]})}}Xr.setEditable(Ha==="editor"),KT=!1,hZ(document.documentElement.dataset.theme||"light")},setDocumentFromJSON(t){KT=!0;try{const e=JSON.parse(t);Xr.commands.setContent(e)}catch{Xr.commands.setContent({type:"doc",content:[{type:"paragraph"}]})}Xr.setEditable(Ha==="editor"),KT=!1,hZ(document.documentElement.dataset.theme||"light")},resolveResource(t,e){const r=GA.get(t);r&&(GA.delete(t),r(e))},getMarkdown(){var e,r;return((r=(e=Xr.storage.markdown)==null?void 0:e.getMarkdown)==null?void 0:r.call(e))??Xr.getText({blockSeparator:`
`})},getDocument(){return JSON.stringify(Xr.getJSON())},focusEnd(){var t;try{Xr.commands.focus("end")}catch{}try{const e=(t=Xr.view)==null?void 0:t.dom;e&&typeof e.focus=="function"&&e.focus({preventScroll:!0})}catch{}},flush(){kp(Xr)},exec(t){var r;const e={bold:()=>Xr.chain().focus().toggleBold().run(),bulletList:()=>Xr.chain().focus().toggleBulletList().run(),blockquote:()=>Xr.chain().focus().toggleBlockquote().run(),horizontalRule:()=>Xr.chain().focus().setHorizontalRule().run(),heading2:()=>Xr.chain().focus().toggleHeading({level:2}).run(),codeBlock:()=>Xr.chain().focus().toggleCodeBlock().run()};(r=e[t])==null||r.call(e),kp(Xr)},beginImageUpload(t,e){Xr.chain().focus().setImage({src:e,alt:t}).run();const r=Ul.querySelectorAll("img"),n=r[r.length-1];n&&(n.dataset.uploadId=t),kp(Xr)},completeImageUpload(t,e,r){Xr.chain().focus().setImage({src:e,alt:r||t||""}).run();const n=Ul.querySelectorAll("img"),i=n[n.length-1];i&&(i.dataset.originalSrc=e,delete i.dataset.uploadId),kp(Xr)},cancelImageUpload(t){const e=Ul.querySelector(`img[data-upload-id="${t}"]`);e==null||e.remove(),kp(Xr)}};window.EdgeEverEditor=Ret;J0e(!1);dl({type:"ready",startupMs:Math.round(performance.now()-Tet)});class _t extends Error{constructor(e,r){var n="KaTeX parse error: "+e,i,a,s=r&&r.loc;if(s&&s.start<=s.end){var o=s.lexer.input;i=s.start,a=s.end,i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=o.slice(i,a).replace(/[^]/g,"$&̲"),u;i>15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var h;a+15<o.length?h=o.slice(a,a+15)+"…":h=o.slice(a),n+=u+l+h}super(n),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,_t.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=e}}var Let=/([A-Z])/g,Met=t=>t.replace(Let,"-$1").toLowerCase(),Iet={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},Net=/[&><"']/g,fs=t=>String(t).replace(Net,e=>Iet[e]),t3=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?t3(t.body[0]):t:t.type==="font"?t3(t.body):t,Det=new Set(["mathord","textord","atom"]),Ph=t=>Det.has(t3(t).type),Oet=t=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},HA={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand <n>",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function $et(t){if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function Pet(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return $et(e)}function Bet(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:Pet(n)}class PV{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var r of Object.keys(HA)){var n=HA[r];n&&Bet(this,r,e,n)}}reportNonstrict(e,r,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,r,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new _t("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]"))}}useStrictBehavior(e,r,n){var i=this.strict;if(typeof i=="function")try{i=i(e,r,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+r+" ["+e+"]")),!1)}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var r=Oet(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class rd{constructor(e,r,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=r,this.cramped=n}sup(){return Oc[Fet[this.id]]}sub(){return Oc[zet[this.id]]}fracNum(){return Oc[Vet[this.id]]}fracDen(){return Oc[Get[this.id]]}cramp(){return Oc[Wet[this.id]]}text(){return Oc[Het[this.id]]}isTight(){return this.size>=2}}var BV=0,qA=1,py=2,hh=3,WC=4,fl=5,Nb=6,Ps=7,Oc=[new rd(BV,0,!1),new rd(qA,0,!0),new rd(py,1,!1),new rd(hh,1,!0),new rd(WC,2,!1),new rd(fl,2,!0),new rd(Nb,3,!1),new rd(Ps,3,!0)],Fet=[WC,fl,WC,fl,Nb,Ps,Nb,Ps],zet=[fl,fl,fl,fl,Ps,Ps,Ps,Ps],Vet=[py,hh,WC,fl,Nb,Ps,Nb,Ps],Get=[hh,hh,fl,fl,Ps,Ps,Ps,Ps],Wet=[qA,qA,hh,hh,fl,fl,Ps,Ps],Het=[BV,qA,py,hh,py,hh,py,hh],Ir={DISPLAY:Oc[BV],TEXT:Oc[py],SCRIPT:Oc[WC],SCRIPTSCRIPT:Oc[Nb]},XO=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function qet(t){for(var e=0;e<XO.length;e++)for(var r=XO[e],n=0;n<r.blocks.length;n++){var i=r.blocks[n];if(t>=i[0]&&t<=i[1])return r.name}return null}var r3=[];XO.forEach(t=>t.blocks.forEach(e=>r3.push(...e)));function ege(t){for(var e=0;e<r3.length;e+=2)if(t>=r3[e]&&t<=r3[e+1])return!0;return!1}var ta=t=>t+" "+t,Yg=80,Uet=function(e,r){return"M95,"+(622+e+r)+`
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l`+e/2.075+" -"+e+`
c5.3,-9.3,12,-14,20,-14
H400000v`+(40+e)+`H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},Yet=function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l`+e/2.084+" -"+e+`
c4.7,-7.3,11,-11,19,-11
H40000v`+(40+e)+`H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},Xet=function(e,r){return"M983 "+(10+e+r)+`
l`+e/3.13+" -"+e+`
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},jet=function(e,r){return"M424,"+(2398+e+r)+`
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
v`+(40+e)+`H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+r+`
h400000v`+(40+e)+"h-400000z"},Ket=function(e,r){return"M473,"+(2713+e+r)+`
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},Zet=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},Qet=function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+`
H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},Jet=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=Uet(r,Yg);break;case"sqrtSize1":i=Yet(r,Yg);break;case"sqrtSize2":i=Xet(r,Yg);break;case"sqrtSize3":i=jet(r,Yg);break;case"sqrtSize4":i=Ket(r,Yg);break;case"sqrtTall":i=Qet(r,Yg,n)}return i},ett=function(e,r){switch(e){case"⎜":return ta("M291 0 H417 V"+r+" H291z");case"∣":return ta("M145 0 H188 V"+r+" H145z");case"∥":return ta("M145 0 H188 V"+r+" H145z")+ta("M367 0 H410 V"+r+" H367z");case"⎟":return ta("M457 0 H583 V"+r+" H457z");case"⎢":return ta("M319 0 H403 V"+r+" H319z");case"⎥":return ta("M263 0 H347 V"+r+" H263z");case"⎪":return ta("M384 0 H504 V"+r+" H384z");case"⏐":return ta("M312 0 H355 V"+r+" H312z");case"‖":return ta("M257 0 H300 V"+r+" H257z")+ta("M478 0 H521 V"+r+" H478z");default:return""}},dZ={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
435 0h399565z`,leftgroupunder:`M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:ta("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:ta("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:ta("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:ta("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:ta("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:ta("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:ta("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:ta("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},ttt=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 v84 h347 v-84
H403z M403 1759 V0 H319 V1759 v`+r+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v1759 H0 v84 H347z
M347 1759 V0 H263 V1759 v`+r+" v1759 h84z";case"vert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+r+" v585 h43z";case"doublevert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+r+` v585 h43z
M367 15 v585 v`+r+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+r+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+r+` v1715 h263 v84 H319z
MM319 602 V0 H403 V602 v`+r+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+r+` v1799 H0 v-84 H319z
MM319 602 V0 H403 V602 v`+r+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v602 h84z
M403 1759 V0 H319 V1759 v`+r+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v602 h84z
M347 1759 V0 h-84 V1759 v`+r+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
-36,557 l0,`+(r+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
l0,-`+(r+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(r+9)+`
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function rtt(t){return"toText"in t}class wx{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),r=0;r<this.children.length;r++)e.appendChild(this.children[r].toNode());return e}toMarkup(){for(var e="",r=0;r<this.children.length;r++)e+=this.children[r].toMarkup();return e}toText(){return this.children.map(e=>{if(rtt(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var jO={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},ntt={ex:!0,em:!0,mu:!0},tge=function(e){return typeof e!="string"&&(e=e.unit),e in jO||e in ntt||e==="ex"},fi=function(e,r){var n;if(e.unit in jO)n=jO[e.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(e.unit==="mu")n=r.fontMetrics().cssEmPerMu;else{var i;if(r.style.isTight()?i=r.havingStyle(r.style.text()):i=r,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new _t("Invalid unit: '"+e.unit+"'");i!==r&&(n*=i.sizeMultiplier/r.sizeMultiplier)}return Math.min(e.number*n,r.maxSize)},Mt=function(e){return+e.toFixed(4)+"em"},nf=function(e){return e.filter(r=>r).join(" ")},FV=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=Met(n)+":"+i+";")}return r},rge=function(e,r,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},r){r.style.isTight()&&this.classes.push("mtight");var i=r.getColor();i&&(this.style.color=i)}},nge=function(e){var r=document.createElement(e);r.className=nf(this.classes),Object.assign(r.style,this.style);for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i<this.children.length;i++)r.appendChild(this.children[i].toNode());return r},itt=/[\s"'>/=\x00-\x1f]/,ige=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+fs(nf(this.classes))+'"');var n=FV(this.style);n&&(r+=' style="'+fs(n)+'"');for(var i of Object.keys(this.attributes)){if(itt.test(i))throw new _t("Invalid attribute name '"+i+"'");r+=" "+i+'="'+fs(this.attributes[i])+'"'}r+=">";for(var a=0;a<this.children.length;a++)r+=this.children[a].toMarkup();return r+="</"+e+">",r};class Cx{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,rge.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return nge.call(this,"span")}toMarkup(){return ige.call(this,"span")}}let SR=class{constructor(e,r,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,rge.call(this,r,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return nge.call(this,"a")}toMarkup(){return ige.call(this,"a")}};class att{constructor(e,r,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e='<img src="'+fs(this.src)+'"'+(' alt="'+fs(this.alt)+'"'),r=FV(this.style);return r&&(e+=' style="'+fs(r)+'"'),e+="'/>",e}}var stt={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class zo{constructor(e,r,n,i,a,s,o,l){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=r||0,this.depth=n||0,this.italic=i||0,this.skew=a||0,this.width=s||0,this.classes=o||[],this.style=l||{},this.maxFontSize=0;var u=qet(this.text.charCodeAt(0));u&&this.classes.push(u+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=stt[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),r=null;return this.italic>0&&(r=document.createElement("span"),r.style.marginRight=Mt(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=nf(this.classes)),Object.keys(this.style).length>0&&(r=r||document.createElement("span"),Object.assign(r.style,this.style)),r?(r.appendChild(e),r):e}toMarkup(){var e=!1,r="<span";this.classes.length&&(e=!0,r+=' class="',r+=fs(nf(this.classes)),r+='"');var n="";this.italic>0&&(n+="margin-right:"+Mt(this.italic)+";"),n+=FV(this.style),n&&(e=!0,r+=' style="'+fs(n)+'"');var i=fs(this.text);return e?(r+=">",r+=i,r+="</span>",r):i}}class xh{constructor(e,r){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=r||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"svg");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);for(var i=0;i<this.children.length;i++)r.appendChild(this.children[i].toNode());return r}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var r of Object.keys(this.attributes))e+=" "+r+'="'+fs(this.attributes[r])+'"';e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>",e}}class af{constructor(e,r){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=r}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"path");return this.alternate?r.setAttribute("d",this.alternate):r.setAttribute("d",dZ[this.pathName]),r}toMarkup(){return this.alternate?'<path d="'+fs(this.alternate)+'"/>':'<path d="'+fs(dZ[this.pathName])+'"/>'}}class KO{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",r=document.createElementNS(e,"line");for(var n of Object.keys(this.attributes))r.setAttribute(n,this.attributes[n]);return r}toMarkup(){var e="<line";for(var r of Object.keys(this.attributes))e+=" "+r+'="'+fs(this.attributes[r])+'"';return e+="/>",e}}function ott(t){if(t instanceof zo)return t;throw new Error("Expected symbolNode but got "+String(t)+".")}function ltt(t){if(t instanceof Cx)return t;throw new Error("Expected span<HtmlDomNode> but got "+String(t)+".")}var ctt=t=>t instanceof Cx||t instanceof SR||t instanceof wx,Bc={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},IE={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},fZ={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function age(t,e){Bc[t]=e}function zV(t,e,r){if(!Bc[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=Bc[e][n];if(!i&&t[0]in fZ&&(n=fZ[t[0]].charCodeAt(0),i=Bc[e][n]),!i&&r==="text"&&ege(n)&&(i=Bc[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var nI={};function utt(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!nI[e]){var r=nI[e]={cssEmPerMu:IE.quad[e]/18};for(var n in IE)IE.hasOwnProperty(n)&&(r[n]=IE[n][e])}return nI[e]}var li={math:{},text:{}};function U(t,e,r,n,i,a){li[t][i]={font:e,group:r,replace:n},a&&n&&(li[t][n]=li[t][i])}var re="math",Tt="text",ye="main",ze="ams",ui="accent-token",Vt="bin",Qs="close",kx="inner",hr="mathord",Qi="op-token",qo="open",iS="punct",We="rel",Bh="spacing",qe="textord";U(re,ye,We,"≡","\\equiv",!0);U(re,ye,We,"≺","\\prec",!0);U(re,ye,We,"≻","\\succ",!0);U(re,ye,We,"∼","\\sim",!0);U(re,ye,We,"⊥","\\perp");U(re,ye,We,"⪯","\\preceq",!0);U(re,ye,We,"⪰","\\succeq",!0);U(re,ye,We,"≃","\\simeq",!0);U(re,ye,We,"∣","\\mid",!0);U(re,ye,We,"≪","\\ll",!0);U(re,ye,We,"≫","\\gg",!0);U(re,ye,We,"≍","\\asymp",!0);U(re,ye,We,"∥","\\parallel");U(re,ye,We,"⋈","\\bowtie",!0);U(re,ye,We,"⌣","\\smile",!0);U(re,ye,We,"⊑","\\sqsubseteq",!0);U(re,ye,We,"⊒","\\sqsupseteq",!0);U(re,ye,We,"≐","\\doteq",!0);U(re,ye,We,"⌢","\\frown",!0);U(re,ye,We,"∋","\\ni",!0);U(re,ye,We,"∝","\\propto",!0);U(re,ye,We,"⊢","\\vdash",!0);U(re,ye,We,"⊣","\\dashv",!0);U(re,ye,We,"∋","\\owns");U(re,ye,iS,".","\\ldotp");U(re,ye,iS,"⋅","\\cdotp");U(re,ye,iS,"⋅","·");U(Tt,ye,qe,"⋅","·");U(re,ye,qe,"#","\\#");U(Tt,ye,qe,"#","\\#");U(re,ye,qe,"&","\\&");U(Tt,ye,qe,"&","\\&");U(re,ye,qe,"ℵ","\\aleph",!0);U(re,ye,qe,"∀","\\forall",!0);U(re,ye,qe,"ℏ","\\hbar",!0);U(re,ye,qe,"∃","\\exists",!0);U(re,ye,qe,"∇","\\nabla",!0);U(re,ye,qe,"♭","\\flat",!0);U(re,ye,qe,"ℓ","\\ell",!0);U(re,ye,qe,"♮","\\natural",!0);U(re,ye,qe,"♣","\\clubsuit",!0);U(re,ye,qe,"℘","\\wp",!0);U(re,ye,qe,"♯","\\sharp",!0);U(re,ye,qe,"♢","\\diamondsuit",!0);U(re,ye,qe,"ℜ","\\Re",!0);U(re,ye,qe,"♡","\\heartsuit",!0);U(re,ye,qe,"ℑ","\\Im",!0);U(re,ye,qe,"♠","\\spadesuit",!0);U(re,ye,qe,"§","\\S",!0);U(Tt,ye,qe,"§","\\S");U(re,ye,qe,"¶","\\P",!0);U(Tt,ye,qe,"¶","\\P");U(re,ye,qe,"†","\\dag");U(Tt,ye,qe,"†","\\dag");U(Tt,ye,qe,"†","\\textdagger");U(re,ye,qe,"‡","\\ddag");U(Tt,ye,qe,"‡","\\ddag");U(Tt,ye,qe,"‡","\\textdaggerdbl");U(re,ye,Qs,"⎱","\\rmoustache",!0);U(re,ye,qo,"⎰","\\lmoustache",!0);U(re,ye,Qs,"⟯","\\rgroup",!0);U(re,ye,qo,"⟮","\\lgroup",!0);U(re,ye,Vt,"∓","\\mp",!0);U(re,ye,Vt,"⊖","\\ominus",!0);U(re,ye,Vt,"⊎","\\uplus",!0);U(re,ye,Vt,"⊓","\\sqcap",!0);U(re,ye,Vt,"∗","\\ast");U(re,ye,Vt,"⊔","\\sqcup",!0);U(re,ye,Vt,"◯","\\bigcirc",!0);U(re,ye,Vt,"∙","\\bullet",!0);U(re,ye,Vt,"‡","\\ddagger");U(re,ye,Vt,"≀","\\wr",!0);U(re,ye,Vt,"⨿","\\amalg");U(re,ye,Vt,"&","\\And");U(re,ye,We,"⟵","\\longleftarrow",!0);U(re,ye,We,"⇐","\\Leftarrow",!0);U(re,ye,We,"⟸","\\Longleftarrow",!0);U(re,ye,We,"⟶","\\longrightarrow",!0);U(re,ye,We,"⇒","\\Rightarrow",!0);U(re,ye,We,"⟹","\\Longrightarrow",!0);U(re,ye,We,"↔","\\leftrightarrow",!0);U(re,ye,We,"⟷","\\longleftrightarrow",!0);U(re,ye,We,"⇔","\\Leftrightarrow",!0);U(re,ye,We,"⟺","\\Longleftrightarrow",!0);U(re,ye,We,"↦","\\mapsto",!0);U(re,ye,We,"⟼","\\longmapsto",!0);U(re,ye,We,"↗","\\nearrow",!0);U(re,ye,We,"↩","\\hookleftarrow",!0);U(re,ye,We,"↪","\\hookrightarrow",!0);U(re,ye,We,"↘","\\searrow",!0);U(re,ye,We,"↼","\\leftharpoonup",!0);U(re,ye,We,"⇀","\\rightharpoonup",!0);U(re,ye,We,"↙","\\swarrow",!0);U(re,ye,We,"↽","\\leftharpoondown",!0);U(re,ye,We,"⇁","\\rightharpoondown",!0);U(re,ye,We,"↖","\\nwarrow",!0);U(re,ye,We,"⇌","\\rightleftharpoons",!0);U(re,ze,We,"≮","\\nless",!0);U(re,ze,We,"","\\@nleqslant");U(re,ze,We,"","\\@nleqq");U(re,ze,We,"⪇","\\lneq",!0);U(re,ze,We,"≨","\\lneqq",!0);U(re,ze,We,"","\\@lvertneqq");U(re,ze,We,"⋦","\\lnsim",!0);U(re,ze,We,"⪉","\\lnapprox",!0);U(re,ze,We,"⊀","\\nprec",!0);U(re,ze,We,"⋠","\\npreceq",!0);U(re,ze,We,"⋨","\\precnsim",!0);U(re,ze,We,"⪹","\\precnapprox",!0);U(re,ze,We,"≁","\\nsim",!0);U(re,ze,We,"","\\@nshortmid");U(re,ze,We,"∤","\\nmid",!0);U(re,ze,We,"⊬","\\nvdash",!0);U(re,ze,We,"⊭","\\nvDash",!0);U(re,ze,We,"⋪","\\ntriangleleft");U(re,ze,We,"⋬","\\ntrianglelefteq",!0);U(re,ze,We,"⊊","\\subsetneq",!0);U(re,ze,We,"","\\@varsubsetneq");U(re,ze,We,"⫋","\\subsetneqq",!0);U(re,ze,We,"","\\@varsubsetneqq");U(re,ze,We,"≯","\\ngtr",!0);U(re,ze,We,"","\\@ngeqslant");U(re,ze,We,"","\\@ngeqq");U(re,ze,We,"⪈","\\gneq",!0);U(re,ze,We,"≩","\\gneqq",!0);U(re,ze,We,"","\\@gvertneqq");U(re,ze,We,"⋧","\\gnsim",!0);U(re,ze,We,"⪊","\\gnapprox",!0);U(re,ze,We,"⊁","\\nsucc",!0);U(re,ze,We,"⋡","\\nsucceq",!0);U(re,ze,We,"⋩","\\succnsim",!0);U(re,ze,We,"⪺","\\succnapprox",!0);U(re,ze,We,"≆","\\ncong",!0);U(re,ze,We,"","\\@nshortparallel");U(re,ze,We,"∦","\\nparallel",!0);U(re,ze,We,"⊯","\\nVDash",!0);U(re,ze,We,"⋫","\\ntriangleright");U(re,ze,We,"⋭","\\ntrianglerighteq",!0);U(re,ze,We,"","\\@nsupseteqq");U(re,ze,We,"⊋","\\supsetneq",!0);U(re,ze,We,"","\\@varsupsetneq");U(re,ze,We,"⫌","\\supsetneqq",!0);U(re,ze,We,"","\\@varsupsetneqq");U(re,ze,We,"⊮","\\nVdash",!0);U(re,ze,We,"⪵","\\precneqq",!0);U(re,ze,We,"⪶","\\succneqq",!0);U(re,ze,We,"","\\@nsubseteqq");U(re,ze,Vt,"⊴","\\unlhd");U(re,ze,Vt,"⊵","\\unrhd");U(re,ze,We,"↚","\\nleftarrow",!0);U(re,ze,We,"↛","\\nrightarrow",!0);U(re,ze,We,"⇍","\\nLeftarrow",!0);U(re,ze,We,"⇏","\\nRightarrow",!0);U(re,ze,We,"↮","\\nleftrightarrow",!0);U(re,ze,We,"⇎","\\nLeftrightarrow",!0);U(re,ze,We,"△","\\vartriangle");U(re,ze,qe,"ℏ","\\hslash");U(re,ze,qe,"▽","\\triangledown");U(re,ze,qe,"◊","\\lozenge");U(re,ze,qe,"Ⓢ","\\circledS");U(re,ze,qe,"®","\\circledR");U(Tt,ze,qe,"®","\\circledR");U(re,ze,qe,"∡","\\measuredangle",!0);U(re,ze,qe,"∄","\\nexists");U(re,ze,qe,"℧","\\mho");U(re,ze,qe,"Ⅎ","\\Finv",!0);U(re,ze,qe,"⅁","\\Game",!0);U(re,ze,qe,"‵","\\backprime");U(re,ze,qe,"▲","\\blacktriangle");U(re,ze,qe,"▼","\\blacktriangledown");U(re,ze,qe,"■","\\blacksquare");U(re,ze,qe,"⧫","\\blacklozenge");U(re,ze,qe,"★","\\bigstar");U(re,ze,qe,"∢","\\sphericalangle",!0);U(re,ze,qe,"∁","\\complement",!0);U(re,ze,qe,"ð","\\eth",!0);U(Tt,ye,qe,"ð","ð");U(re,ze,qe,"╱","\\diagup");U(re,ze,qe,"╲","\\diagdown");U(re,ze,qe,"□","\\square");U(re,ze,qe,"□","\\Box");U(re,ze,qe,"◊","\\Diamond");U(re,ze,qe,"¥","\\yen",!0);U(Tt,ze,qe,"¥","\\yen",!0);U(re,ze,qe,"✓","\\checkmark",!0);U(Tt,ze,qe,"✓","\\checkmark");U(re,ze,qe,"ℶ","\\beth",!0);U(re,ze,qe,"ℸ","\\daleth",!0);U(re,ze,qe,"ℷ","\\gimel",!0);U(re,ze,qe,"ϝ","\\digamma",!0);U(re,ze,qe,"ϰ","\\varkappa");U(re,ze,qo,"┌","\\@ulcorner",!0);U(re,ze,Qs,"┐","\\@urcorner",!0);U(re,ze,qo,"└","\\@llcorner",!0);U(re,ze,Qs,"┘","\\@lrcorner",!0);U(re,ze,We,"≦","\\leqq",!0);U(re,ze,We,"⩽","\\leqslant",!0);U(re,ze,We,"⪕","\\eqslantless",!0);U(re,ze,We,"≲","\\lesssim",!0);U(re,ze,We,"⪅","\\lessapprox",!0);U(re,ze,We,"≊","\\approxeq",!0);U(re,ze,Vt,"⋖","\\lessdot");U(re,ze,We,"⋘","\\lll",!0);U(re,ze,We,"≶","\\lessgtr",!0);U(re,ze,We,"⋚","\\lesseqgtr",!0);U(re,ze,We,"⪋","\\lesseqqgtr",!0);U(re,ze,We,"≑","\\doteqdot");U(re,ze,We,"≓","\\risingdotseq",!0);U(re,ze,We,"≒","\\fallingdotseq",!0);U(re,ze,We,"∽","\\backsim",!0);U(re,ze,We,"⋍","\\backsimeq",!0);U(re,ze,We,"⫅","\\subseteqq",!0);U(re,ze,We,"⋐","\\Subset",!0);U(re,ze,We,"⊏","\\sqsubset",!0);U(re,ze,We,"≼","\\preccurlyeq",!0);U(re,ze,We,"⋞","\\curlyeqprec",!0);U(re,ze,We,"≾","\\precsim",!0);U(re,ze,We,"⪷","\\precapprox",!0);U(re,ze,We,"⊲","\\vartriangleleft");U(re,ze,We,"⊴","\\trianglelefteq");U(re,ze,We,"⊨","\\vDash",!0);U(re,ze,We,"⊪","\\Vvdash",!0);U(re,ze,We,"⌣","\\smallsmile");U(re,ze,We,"⌢","\\smallfrown");U(re,ze,We,"≏","\\bumpeq",!0);U(re,ze,We,"≎","\\Bumpeq",!0);U(re,ze,We,"≧","\\geqq",!0);U(re,ze,We,"⩾","\\geqslant",!0);U(re,ze,We,"⪖","\\eqslantgtr",!0);U(re,ze,We,"≳","\\gtrsim",!0);U(re,ze,We,"⪆","\\gtrapprox",!0);U(re,ze,Vt,"⋗","\\gtrdot");U(re,ze,We,"⋙","\\ggg",!0);U(re,ze,We,"≷","\\gtrless",!0);U(re,ze,We,"⋛","\\gtreqless",!0);U(re,ze,We,"⪌","\\gtreqqless",!0);U(re,ze,We,"≖","\\eqcirc",!0);U(re,ze,We,"≗","\\circeq",!0);U(re,ze,We,"≜","\\triangleq",!0);U(re,ze,We,"∼","\\thicksim");U(re,ze,We,"≈","\\thickapprox");U(re,ze,We,"⫆","\\supseteqq",!0);U(re,ze,We,"⋑","\\Supset",!0);U(re,ze,We,"⊐","\\sqsupset",!0);U(re,ze,We,"≽","\\succcurlyeq",!0);U(re,ze,We,"⋟","\\curlyeqsucc",!0);U(re,ze,We,"≿","\\succsim",!0);U(re,ze,We,"⪸","\\succapprox",!0);U(re,ze,We,"⊳","\\vartriangleright");U(re,ze,We,"⊵","\\trianglerighteq");U(re,ze,We,"⊩","\\Vdash",!0);U(re,ze,We,"∣","\\shortmid");U(re,ze,We,"∥","\\shortparallel");U(re,ze,We,"≬","\\between",!0);U(re,ze,We,"⋔","\\pitchfork",!0);U(re,ze,We,"∝","\\varpropto");U(re,ze,We,"◀","\\blacktriangleleft");U(re,ze,We,"∴","\\therefore",!0);U(re,ze,We,"∍","\\backepsilon");U(re,ze,We,"▶","\\blacktriangleright");U(re,ze,We,"∵","\\because",!0);U(re,ze,We,"⋘","\\llless");U(re,ze,We,"⋙","\\gggtr");U(re,ze,Vt,"⊲","\\lhd");U(re,ze,Vt,"⊳","\\rhd");U(re,ze,We,"≂","\\eqsim",!0);U(re,ye,We,"⋈","\\Join");U(re,ze,We,"≑","\\Doteq",!0);U(re,ze,Vt,"∔","\\dotplus",!0);U(re,ze,Vt,"∖","\\smallsetminus");U(re,ze,Vt,"⋒","\\Cap",!0);U(re,ze,Vt,"⋓","\\Cup",!0);U(re,ze,Vt,"⩞","\\doublebarwedge",!0);U(re,ze,Vt,"⊟","\\boxminus",!0);U(re,ze,Vt,"⊞","\\boxplus",!0);U(re,ze,Vt,"⋇","\\divideontimes",!0);U(re,ze,Vt,"⋉","\\ltimes",!0);U(re,ze,Vt,"⋊","\\rtimes",!0);U(re,ze,Vt,"⋋","\\leftthreetimes",!0);U(re,ze,Vt,"⋌","\\rightthreetimes",!0);U(re,ze,Vt,"⋏","\\curlywedge",!0);U(re,ze,Vt,"⋎","\\curlyvee",!0);U(re,ze,Vt,"⊝","\\circleddash",!0);U(re,ze,Vt,"⊛","\\circledast",!0);U(re,ze,Vt,"⋅","\\centerdot");U(re,ze,Vt,"⊺","\\intercal",!0);U(re,ze,Vt,"⋒","\\doublecap");U(re,ze,Vt,"⋓","\\doublecup");U(re,ze,Vt,"⊠","\\boxtimes",!0);U(re,ze,We,"⇢","\\dashrightarrow",!0);U(re,ze,We,"⇠","\\dashleftarrow",!0);U(re,ze,We,"⇇","\\leftleftarrows",!0);U(re,ze,We,"⇆","\\leftrightarrows",!0);U(re,ze,We,"⇚","\\Lleftarrow",!0);U(re,ze,We,"↞","\\twoheadleftarrow",!0);U(re,ze,We,"↢","\\leftarrowtail",!0);U(re,ze,We,"↫","\\looparrowleft",!0);U(re,ze,We,"⇋","\\leftrightharpoons",!0);U(re,ze,We,"↶","\\curvearrowleft",!0);U(re,ze,We,"↺","\\circlearrowleft",!0);U(re,ze,We,"↰","\\Lsh",!0);U(re,ze,We,"⇈","\\upuparrows",!0);U(re,ze,We,"↿","\\upharpoonleft",!0);U(re,ze,We,"⇃","\\downharpoonleft",!0);U(re,ye,We,"⊶","\\origof",!0);U(re,ye,We,"⊷","\\imageof",!0);U(re,ze,We,"⊸","\\multimap",!0);U(re,ze,We,"↭","\\leftrightsquigarrow",!0);U(re,ze,We,"⇉","\\rightrightarrows",!0);U(re,ze,We,"⇄","\\rightleftarrows",!0);U(re,ze,We,"↠","\\twoheadrightarrow",!0);U(re,ze,We,"↣","\\rightarrowtail",!0);U(re,ze,We,"↬","\\looparrowright",!0);U(re,ze,We,"↷","\\curvearrowright",!0);U(re,ze,We,"↻","\\circlearrowright",!0);U(re,ze,We,"↱","\\Rsh",!0);U(re,ze,We,"⇊","\\downdownarrows",!0);U(re,ze,We,"↾","\\upharpoonright",!0);U(re,ze,We,"⇂","\\downharpoonright",!0);U(re,ze,We,"⇝","\\rightsquigarrow",!0);U(re,ze,We,"⇝","\\leadsto");U(re,ze,We,"⇛","\\Rrightarrow",!0);U(re,ze,We,"↾","\\restriction");U(re,ye,qe,"‘","`");U(re,ye,qe,"$","\\$");U(Tt,ye,qe,"$","\\$");U(Tt,ye,qe,"$","\\textdollar");U(re,ye,qe,"%","\\%");U(Tt,ye,qe,"%","\\%");U(re,ye,qe,"_","\\_");U(Tt,ye,qe,"_","\\_");U(Tt,ye,qe,"_","\\textunderscore");U(re,ye,qe,"∠","\\angle",!0);U(re,ye,qe,"∞","\\infty",!0);U(re,ye,qe,"′","\\prime");U(re,ye,qe,"△","\\triangle");U(re,ye,qe,"Γ","\\Gamma",!0);U(re,ye,qe,"Δ","\\Delta",!0);U(re,ye,qe,"Θ","\\Theta",!0);U(re,ye,qe,"Λ","\\Lambda",!0);U(re,ye,qe,"Ξ","\\Xi",!0);U(re,ye,qe,"Π","\\Pi",!0);U(re,ye,qe,"Σ","\\Sigma",!0);U(re,ye,qe,"Υ","\\Upsilon",!0);U(re,ye,qe,"Φ","\\Phi",!0);U(re,ye,qe,"Ψ","\\Psi",!0);U(re,ye,qe,"Ω","\\Omega",!0);U(re,ye,qe,"A","Α");U(re,ye,qe,"B","Β");U(re,ye,qe,"E","Ε");U(re,ye,qe,"Z","Ζ");U(re,ye,qe,"H","Η");U(re,ye,qe,"I","Ι");U(re,ye,qe,"K","Κ");U(re,ye,qe,"M","Μ");U(re,ye,qe,"N","Ν");U(re,ye,qe,"O","Ο");U(re,ye,qe,"P","Ρ");U(re,ye,qe,"T","Τ");U(re,ye,qe,"X","Χ");U(re,ye,qe,"¬","\\neg",!0);U(re,ye,qe,"¬","\\lnot");U(re,ye,qe,"⊤","\\top");U(re,ye,qe,"⊥","\\bot");U(re,ye,qe,"∅","\\emptyset");U(re,ze,qe,"∅","\\varnothing");U(re,ye,hr,"α","\\alpha",!0);U(re,ye,hr,"β","\\beta",!0);U(re,ye,hr,"γ","\\gamma",!0);U(re,ye,hr,"δ","\\delta",!0);U(re,ye,hr,"ϵ","\\epsilon",!0);U(re,ye,hr,"ζ","\\zeta",!0);U(re,ye,hr,"η","\\eta",!0);U(re,ye,hr,"θ","\\theta",!0);U(re,ye,hr,"ι","\\iota",!0);U(re,ye,hr,"κ","\\kappa",!0);U(re,ye,hr,"λ","\\lambda",!0);U(re,ye,hr,"μ","\\mu",!0);U(re,ye,hr,"ν","\\nu",!0);U(re,ye,hr,"ξ","\\xi",!0);U(re,ye,hr,"ο","\\omicron",!0);U(re,ye,hr,"π","\\pi",!0);U(re,ye,hr,"ρ","\\rho",!0);U(re,ye,hr,"σ","\\sigma",!0);U(re,ye,hr,"τ","\\tau",!0);U(re,ye,hr,"υ","\\upsilon",!0);U(re,ye,hr,"ϕ","\\phi",!0);U(re,ye,hr,"χ","\\chi",!0);U(re,ye,hr,"ψ","\\psi",!0);U(re,ye,hr,"ω","\\omega",!0);U(re,ye,hr,"ε","\\varepsilon",!0);U(re,ye,hr,"ϑ","\\vartheta",!0);U(re,ye,hr,"ϖ","\\varpi",!0);U(re,ye,hr,"ϱ","\\varrho",!0);U(re,ye,hr,"ς","\\varsigma",!0);U(re,ye,hr,"φ","\\varphi",!0);U(re,ye,Vt,"∗","*",!0);U(re,ye,Vt,"+","+");U(re,ye,Vt,"−","-",!0);U(re,ye,Vt,"⋅","\\cdot",!0);U(re,ye,Vt,"∘","\\circ",!0);U(re,ye,Vt,"÷","\\div",!0);U(re,ye,Vt,"±","\\pm",!0);U(re,ye,Vt,"×","\\times",!0);U(re,ye,Vt,"∩","\\cap",!0);U(re,ye,Vt,"∪","\\cup",!0);U(re,ye,Vt,"∖","\\setminus",!0);U(re,ye,Vt,"∧","\\land");U(re,ye,Vt,"∨","\\lor");U(re,ye,Vt,"∧","\\wedge",!0);U(re,ye,Vt,"∨","\\vee",!0);U(re,ye,qe,"√","\\surd");U(re,ye,qo,"⟨","\\langle",!0);U(re,ye,qo,"∣","\\lvert");U(re,ye,qo,"∥","\\lVert");U(re,ye,Qs,"?","?");U(re,ye,Qs,"!","!");U(re,ye,Qs,"⟩","\\rangle",!0);U(re,ye,Qs,"∣","\\rvert");U(re,ye,Qs,"∥","\\rVert");U(re,ye,We,"=","=");U(re,ye,We,":",":");U(re,ye,We,"≈","\\approx",!0);U(re,ye,We,"≅","\\cong",!0);U(re,ye,We,"≥","\\ge");U(re,ye,We,"≥","\\geq",!0);U(re,ye,We,"←","\\gets");U(re,ye,We,">","\\gt",!0);U(re,ye,We,"∈","\\in",!0);U(re,ye,We,"","\\@not");U(re,ye,We,"⊂","\\subset",!0);U(re,ye,We,"⊃","\\supset",!0);U(re,ye,We,"⊆","\\subseteq",!0);U(re,ye,We,"⊇","\\supseteq",!0);U(re,ze,We,"⊈","\\nsubseteq",!0);U(re,ze,We,"⊉","\\nsupseteq",!0);U(re,ye,We,"⊨","\\models");U(re,ye,We,"←","\\leftarrow",!0);U(re,ye,We,"≤","\\le");U(re,ye,We,"≤","\\leq",!0);U(re,ye,We,"<","\\lt",!0);U(re,ye,We,"→","\\rightarrow",!0);U(re,ye,We,"→","\\to");U(re,ze,We,"≱","\\ngeq",!0);U(re,ze,We,"≰","\\nleq",!0);U(re,ye,Bh," ","\\ ");U(re,ye,Bh," ","\\space");U(re,ye,Bh," ","\\nobreakspace");U(Tt,ye,Bh," ","\\ ");U(Tt,ye,Bh," "," ");U(Tt,ye,Bh," ","\\space");U(Tt,ye,Bh," ","\\nobreakspace");U(re,ye,Bh,"","\\nobreak");U(re,ye,Bh,"","\\allowbreak");U(re,ye,iS,",",",");U(re,ye,iS,";",";");U(re,ze,Vt,"⊼","\\barwedge",!0);U(re,ze,Vt,"⊻","\\veebar",!0);U(re,ye,Vt,"⊙","\\odot",!0);U(re,ye,Vt,"⊕","\\oplus",!0);U(re,ye,Vt,"⊗","\\otimes",!0);U(re,ye,qe,"∂","\\partial",!0);U(re,ye,Vt,"⊘","\\oslash",!0);U(re,ze,Vt,"⊚","\\circledcirc",!0);U(re,ze,Vt,"⊡","\\boxdot",!0);U(re,ye,Vt,"△","\\bigtriangleup");U(re,ye,Vt,"▽","\\bigtriangledown");U(re,ye,Vt,"†","\\dagger");U(re,ye,Vt,"⋄","\\diamond");U(re,ye,Vt,"⋆","\\star");U(re,ye,Vt,"◃","\\triangleleft");U(re,ye,Vt,"▹","\\triangleright");U(re,ye,qo,"{","\\{");U(Tt,ye,qe,"{","\\{");U(Tt,ye,qe,"{","\\textbraceleft");U(re,ye,Qs,"}","\\}");U(Tt,ye,qe,"}","\\}");U(Tt,ye,qe,"}","\\textbraceright");U(re,ye,qo,"{","\\lbrace");U(re,ye,Qs,"}","\\rbrace");U(re,ye,qo,"[","\\lbrack",!0);U(Tt,ye,qe,"[","\\lbrack",!0);U(re,ye,Qs,"]","\\rbrack",!0);U(Tt,ye,qe,"]","\\rbrack",!0);U(re,ye,qo,"(","\\lparen",!0);U(re,ye,Qs,")","\\rparen",!0);U(Tt,ye,qe,"<","\\textless",!0);U(Tt,ye,qe,">","\\textgreater",!0);U(re,ye,qo,"⌊","\\lfloor",!0);U(re,ye,Qs,"⌋","\\rfloor",!0);U(re,ye,qo,"⌈","\\lceil",!0);U(re,ye,Qs,"⌉","\\rceil",!0);U(re,ye,qe,"\\","\\backslash");U(re,ye,qe,"∣","|");U(re,ye,qe,"∣","\\vert");U(Tt,ye,qe,"|","\\textbar",!0);U(re,ye,qe,"∥","\\|");U(re,ye,qe,"∥","\\Vert");U(Tt,ye,qe,"∥","\\textbardbl");U(Tt,ye,qe,"~","\\textasciitilde");U(Tt,ye,qe,"\\","\\textbackslash");U(Tt,ye,qe,"^","\\textasciicircum");U(re,ye,We,"↑","\\uparrow",!0);U(re,ye,We,"⇑","\\Uparrow",!0);U(re,ye,We,"↓","\\downarrow",!0);U(re,ye,We,"⇓","\\Downarrow",!0);U(re,ye,We,"↕","\\updownarrow",!0);U(re,ye,We,"⇕","\\Updownarrow",!0);U(re,ye,Qi,"∐","\\coprod");U(re,ye,Qi,"⋁","\\bigvee");U(re,ye,Qi,"⋀","\\bigwedge");U(re,ye,Qi,"⨄","\\biguplus");U(re,ye,Qi,"⋂","\\bigcap");U(re,ye,Qi,"⋃","\\bigcup");U(re,ye,Qi,"∫","\\int");U(re,ye,Qi,"∫","\\intop");U(re,ye,Qi,"∬","\\iint");U(re,ye,Qi,"∭","\\iiint");U(re,ye,Qi,"∏","\\prod");U(re,ye,Qi,"∑","\\sum");U(re,ye,Qi,"⨂","\\bigotimes");U(re,ye,Qi,"⨁","\\bigoplus");U(re,ye,Qi,"⨀","\\bigodot");U(re,ye,Qi,"∮","\\oint");U(re,ye,Qi,"∯","\\oiint");U(re,ye,Qi,"∰","\\oiiint");U(re,ye,Qi,"⨆","\\bigsqcup");U(re,ye,Qi,"∫","\\smallint");U(Tt,ye,kx,"…","\\textellipsis");U(re,ye,kx,"…","\\mathellipsis");U(Tt,ye,kx,"…","\\ldots",!0);U(re,ye,kx,"…","\\ldots",!0);U(re,ye,kx,"⋯","\\@cdots",!0);U(re,ye,kx,"⋱","\\ddots",!0);U(re,ye,qe,"⋮","\\varvdots");U(Tt,ye,qe,"⋮","\\varvdots");U(re,ye,ui,"ˊ","\\acute");U(re,ye,ui,"ˋ","\\grave");U(re,ye,ui,"¨","\\ddot");U(re,ye,ui,"~","\\tilde");U(re,ye,ui,"ˉ","\\bar");U(re,ye,ui,"˘","\\breve");U(re,ye,ui,"ˇ","\\check");U(re,ye,ui,"^","\\hat");U(re,ye,ui,"⃗","\\vec");U(re,ye,ui,"˙","\\dot");U(re,ye,ui,"˚","\\mathring");U(re,ye,hr,"","\\@imath");U(re,ye,hr,"","\\@jmath");U(re,ye,qe,"ı","ı");U(re,ye,qe,"ȷ","ȷ");U(Tt,ye,qe,"ı","\\i",!0);U(Tt,ye,qe,"ȷ","\\j",!0);U(Tt,ye,qe,"ß","\\ss",!0);U(Tt,ye,qe,"æ","\\ae",!0);U(Tt,ye,qe,"œ","\\oe",!0);U(Tt,ye,qe,"ø","\\o",!0);U(Tt,ye,qe,"Æ","\\AE",!0);U(Tt,ye,qe,"Œ","\\OE",!0);U(Tt,ye,qe,"Ø","\\O",!0);U(Tt,ye,ui,"ˊ","\\'");U(Tt,ye,ui,"ˋ","\\`");U(Tt,ye,ui,"ˆ","\\^");U(Tt,ye,ui,"˜","\\~");U(Tt,ye,ui,"ˉ","\\=");U(Tt,ye,ui,"˘","\\u");U(Tt,ye,ui,"˙","\\.");U(Tt,ye,ui,"¸","\\c");U(Tt,ye,ui,"˚","\\r");U(Tt,ye,ui,"ˇ","\\v");U(Tt,ye,ui,"¨",'\\"');U(Tt,ye,ui,"˝","\\H");U(Tt,ye,ui,"◯","\\textcircled");var sge={"--":!0,"---":!0,"``":!0,"''":!0};U(Tt,ye,qe,"–","--",!0);U(Tt,ye,qe,"–","\\textendash");U(Tt,ye,qe,"—","---",!0);U(Tt,ye,qe,"—","\\textemdash");U(Tt,ye,qe,"‘","`",!0);U(Tt,ye,qe,"‘","\\textquoteleft");U(Tt,ye,qe,"’","'",!0);U(Tt,ye,qe,"’","\\textquoteright");U(Tt,ye,qe,"“","``",!0);U(Tt,ye,qe,"“","\\textquotedblleft");U(Tt,ye,qe,"”","''",!0);U(Tt,ye,qe,"”","\\textquotedblright");U(re,ye,qe,"°","\\degree",!0);U(Tt,ye,qe,"°","\\degree");U(Tt,ye,qe,"°","\\textdegree",!0);U(re,ye,qe,"£","\\pounds");U(re,ye,qe,"£","\\mathsterling",!0);U(Tt,ye,qe,"£","\\pounds");U(Tt,ye,qe,"£","\\textsterling",!0);U(re,ze,qe,"✠","\\maltese");U(Tt,ze,qe,"✠","\\maltese");var pZ='0123456789/@."';for(var iI=0;iI<pZ.length;iI++){var gZ=pZ.charAt(iI);U(re,ye,qe,gZ,gZ)}var mZ='0123456789!@*()-=+";:?/.,';for(var aI=0;aI<mZ.length;aI++){var yZ=mZ.charAt(aI);U(Tt,ye,qe,yZ,yZ)}var UA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var sI=0;sI<UA.length;sI++){var NE=UA.charAt(sI);U(re,ye,hr,NE,NE),U(Tt,ye,qe,NE,NE)}U(re,ze,qe,"C","ℂ");U(Tt,ze,qe,"C","ℂ");U(re,ze,qe,"H","ℍ");U(Tt,ze,qe,"H","ℍ");U(re,ze,qe,"N","ℕ");U(Tt,ze,qe,"N","ℕ");U(re,ze,qe,"P","ℙ");U(Tt,ze,qe,"P","ℙ");U(re,ze,qe,"Q","ℚ");U(Tt,ze,qe,"Q","ℚ");U(re,ze,qe,"R","ℝ");U(Tt,ze,qe,"R","ℝ");U(re,ze,qe,"Z","ℤ");U(Tt,ze,qe,"Z","ℤ");U(re,ye,hr,"h","ℎ");U(Tt,ye,hr,"h","ℎ");var Er;for(var Es=0;Es<UA.length;Es++){var bi=UA.charAt(Es);Er=String.fromCharCode(55349,56320+Es),U(re,ye,hr,bi,Er),U(Tt,ye,qe,bi,Er),Er=String.fromCharCode(55349,56372+Es),U(re,ye,hr,bi,Er),U(Tt,ye,qe,bi,Er),Er=String.fromCharCode(55349,56424+Es),U(re,ye,hr,bi,Er),U(Tt,ye,qe,bi,Er),Er=String.fromCharCode(55349,56580+Es),U(re,ye,hr,bi,Er),U(Tt,ye,qe,bi,Er),Er=String.fromCharCode(55349,56684+Es),U(re,ye,hr,bi,Er),U(Tt,ye,qe,bi,Er),Er=String.fromCharCode(55349,56736+Es),U(re,ye,hr,bi,Er),U(Tt,ye,qe,bi,Er),Er=String.fromCharCode(55349,56788+Es),U(re,ye,hr,bi,Er),U(Tt,ye,qe,bi,Er),Er=String.fromCharCode(55349,56840+Es),U(re,ye,hr,bi,Er),U(Tt,ye,qe,bi,Er),Er=String.fromCharCode(55349,56944+Es),U(re,ye,hr,bi,Er),U(Tt,ye,qe,bi,Er),Es<26&&(Er=String.fromCharCode(55349,56632+Es),U(re,ye,hr,bi,Er),U(Tt,ye,qe,bi,Er),Er=String.fromCharCode(55349,56476+Es),U(re,ye,hr,bi,Er),U(Tt,ye,qe,bi,Er))}Er="𝕜";U(re,ye,hr,"k",Er);U(Tt,ye,qe,"k",Er);for(var Uf=0;Uf<10;Uf++){var nd=Uf.toString();Er=String.fromCharCode(55349,57294+Uf),U(re,ye,hr,nd,Er),U(Tt,ye,qe,nd,Er),Er=String.fromCharCode(55349,57314+Uf),U(re,ye,hr,nd,Er),U(Tt,ye,qe,nd,Er),Er=String.fromCharCode(55349,57324+Uf),U(re,ye,hr,nd,Er),U(Tt,ye,qe,nd,Er),Er=String.fromCharCode(55349,57334+Uf),U(re,ye,hr,nd,Er),U(Tt,ye,qe,nd,Er)}var ZO="ÐÞþ";for(var oI=0;oI<ZO.length;oI++){var DE=ZO.charAt(oI);U(re,ye,hr,DE,DE),U(Tt,ye,qe,DE,DE)}var QO={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},vZ={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},bZ={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},htt={mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},Sp={mathClass:"",textClass:"",font:""},xZ={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},TZ={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},wZ={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},JO={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},e$={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},CZ={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},t$={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},kZ=[QO,QO,vZ,vZ,bZ,bZ,htt,Sp,Sp,Sp,xZ,xZ,TZ,TZ,wZ,wZ,JO,JO,e$,e$,CZ,CZ,Sp,Sp,t$,t$],dtt=[QO,Sp,JO,e$,t$],ftt=t=>{var e=t.charCodeAt(0),r=t.charCodeAt(1),n=(e-55296)*1024+(r-56320)+65536;if(119808<=n&&n<120484){var i=Math.floor((n-119808)/26);return kZ[i]}else if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return dtt[a]}else{if(n===120485||n===120486)return kZ[0];if(120486<n&&n<120782)return Sp;throw new _t("Unsupported character: "+t)}},ER=function(e,r,n){if(li[n][e]){var i=li[n][e].replace;i&&(e=i)}return{value:e,metrics:zV(e,r,n)}},Ls=function(e,r,n,i,a){var s=ER(e,r,n),o=s.metrics;e=s.value;var l;if(o){var u=o.italic;(n==="text"||i&&i.font==="mathit")&&(u=0),l=new zo(e,o.height,o.depth,u,o.skew,o.width,a)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+e+"' in style '"+r+"' and mode '"+n+"'")),l=new zo(e,0,0,0,0,0,a);if(i){l.maxFontSize=i.sizeMultiplier,i.style.isTight()&&l.classes.push("mtight");var h=i.getColor();h&&(l.style.color=h)}return l},VV=function(e,r,n,i){return i===void 0&&(i=[]),n.font==="boldsymbol"&&ER(e,"Main-Bold",r).metrics?Ls(e,"Main-Bold",r,n,i.concat(["mathbf"])):e==="\\"||li[r][e].font==="main"?Ls(e,"Main-Regular",r,n,i):Ls(e,"AMS-Regular",r,n,i.concat(["amsrm"]))},ptt=function(e,r,n){return n!=="textord"&&ER(e,"Math-BoldItalic",r).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},AR=function(e,r,n){var i=e.mode,a=e.text,s=["mord"],{font:o,fontFamily:l,fontWeight:u,fontShape:h}=r,d=i==="math"||i==="text"&&!!o,f=d?o:l,p="",g="";if(a.charCodeAt(0)===55349){var m=ftt(a);p=m.font,g=m[i+"Class"]}if(p)return Ls(a,p,i,r,s.concat(g));if(f){var y,v;if(f==="boldsymbol"){var T=ptt(a,i,n);y=T.fontName,v=[T.fontClass]}else d?(y=r$[o].fontName,v=[o]):(y=OE(l,u,h),v=[l,u,h]);if(ER(a,y,i).metrics)return Ls(a,y,i,r,s.concat(v));if(sge.hasOwnProperty(a)&&y.slice(0,10)==="Typewriter"){for(var b=[],w=0;w<a.length;w++)b.push(Ls(a[w],y,i,r,s.concat(v)));return Fh(b)}}if(n==="mathord")return Ls(a,"Math-Italic",i,r,s.concat(["mathnormal"]));if(n==="textord"){var C=li[i][a]&&li[i][a].font;if(C==="ams"){var S=OE("amsrm",u,h);return Ls(a,S,i,r,s.concat("amsrm",u,h))}else if(C==="main"||!C){var k=OE("textrm",u,h);return Ls(a,k,i,r,s.concat(u,h))}else{var E=OE(C,u,h);return Ls(a,E,i,r,s.concat(E,u,h))}}else throw new Error("unexpected type: "+n+" in makeOrd")},gtt=(t,e)=>{if(nf(t.classes)!==nf(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize||t.italic!==0&&t.hasClass("mathnormal"))return!1;if(t.classes.length===1){var r=t.classes[0];if(r==="mbin"||r==="mord")return!1}for(var n of Object.keys(t.style))if(t.style[n]!==e.style[n])return!1;for(var i of Object.keys(e.style))if(t.style[i]!==e.style[i])return!1;return!0},oge=t=>{for(var e=0;e<t.length-1;e++){var r=t[e],n=t[e+1];r instanceof zo&&n instanceof zo&&gtt(r,n)&&(r.text+=n.text,r.height=Math.max(r.height,n.height),r.depth=Math.max(r.depth,n.depth),r.italic=n.italic,t.splice(e+1,1),e--)}return t},GV=function(e){for(var r=0,n=0,i=0,a=0;a<e.children.length;a++){var s=e.children[a];s.height>r&&(r=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>i&&(i=s.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},St=function(e,r,n,i){var a=new Cx(e,r,n,i);return GV(a),a},sf=(t,e,r,n)=>new Cx(t,e,r,n),Db=function(e,r,n){var i=St([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=Mt(i.height),i.maxFontSize=1,i},mtt=function(e,r,n,i){var a=new SR(e,r,n,i);return GV(a),a},Fh=function(e){var r=new wx(e);return GV(r),r},Ob=function(e,r){return e instanceof wx?St([],[e],r):e},ytt=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,a=i,s=1;s<r.length;s++){var o=-r[s].shift-a-r[s].elem.depth,l=o-(r[s-1].elem.height+r[s-1].elem.depth);a=a+o,n.push({type:"kern",size:l}),n.push(r[s])}return{children:n,depth:i}}var u;if(e.positionType==="top"){for(var h=e.positionData,d=0;d<e.children.length;d++){var f=e.children[d];h-=f.type==="kern"?f.size:f.elem.height+f.elem.depth}u=h}else if(e.positionType==="bottom")u=-e.positionData;else{var p=e.children[0];if(p.type!=="elem")throw new Error('First child must have type "elem".');if(e.positionType==="shift")u=-p.elem.depth-e.positionData;else if(e.positionType==="firstBaseline")u=-p.elem.depth;else throw new Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:u}},yn=function(e,r){for(var{children:n,depth:i}=ytt(e),a=0,s=0;s<n.length;s++){var o=n[s];if(o.type==="elem"){var l=o.elem;a=Math.max(a,l.maxFontSize,l.height)}}a+=2;var u=St(["pstrut"],[]);u.style.height=Mt(a);for(var h=[],d=i,f=i,p=i,g=0;g<n.length;g++){var m=n[g];if(m.type==="kern")p+=m.size;else{var y=m.elem,v=m.wrapperClasses||[],T=m.wrapperStyle||{},b=St(v,[u,y],void 0,T);b.style.top=Mt(-a-p-y.depth),m.marginLeft&&(b.style.marginLeft=m.marginLeft),m.marginRight&&(b.style.marginRight=m.marginRight),h.push(b),p+=y.height+y.depth}d=Math.min(d,p),f=Math.max(f,p)}var w=St(["vlist"],h);w.style.height=Mt(f);var C;if(d<0){var S=St([],[]),k=St(["vlist"],[S]);k.style.height=Mt(-d);var E=St(["vlist-s"],[new zo("​")]);C=[St(["vlist-r"],[w,E]),St(["vlist-r"],[k])]}else C=[St(["vlist-r"],[w])];var _=St(["vlist-t"],C);return C.length===2&&_.classes.push("vlist-t2"),_.height=f,_.depth=-d,_},lge=(t,e)=>{var r=St(["mspace"],[],e),n=fi(t,e);return r.style.marginRight=Mt(n),r},OE=(t,e,r)=>{var n,i;switch(t){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=t}return e==="textbf"&&r==="textit"?i="BoldItalic":e==="textbf"?i="Bold":r==="textit"?i="Italic":i="Regular",n+"-"+i},r$={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},cge={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},uge=function(e,r){var[n,i,a]=cge[e],s=new af(n),o=new xh([s],{width:Mt(i),height:Mt(a),style:"width:"+Mt(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=sf(["overlay"],[o],r);return l.height=a,l.style.height=Mt(a),l.style.width=Mt(i),l},di={number:3,unit:"mu"},Yf={number:4,unit:"mu"},Ru={number:5,unit:"mu"},vtt={mord:{mop:di,mbin:Yf,mrel:Ru,minner:di},mop:{mord:di,mop:di,mrel:Ru,minner:di},mbin:{mord:Yf,mop:Yf,mopen:Yf,minner:Yf},mrel:{mord:Ru,mop:Ru,mopen:Ru,minner:Ru},mopen:{},mclose:{mop:di,mbin:Yf,mrel:Ru,minner:di},mpunct:{mord:di,mop:di,mrel:Ru,mopen:di,mclose:di,mpunct:di,minner:di},minner:{mord:di,mop:di,mbin:Yf,mrel:Ru,mopen:di,mpunct:di,minner:di}},btt={mord:{mop:di},mop:{mord:di,mop:di},mbin:{},mrel:{},mopen:{},mclose:{mop:di},mpunct:{},minner:{mop:di}},hge={},YA={},XA={};function Pt(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l<r.length;++l)hge[r[l]]=o;e&&(a&&(YA[e]=a),s&&(XA[e]=s))}function og(t){var{type:e,htmlBuilder:r,mathmlBuilder:n}=t;Pt({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:r,mathmlBuilder:n})}var jA=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},Ui=function(e){return e.type==="ordgroup"?e.body:[e]},xtt=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),Ttt=new Set(["rightmost","mrel","mclose","mpunct"]),wtt={display:Ir.DISPLAY,text:Ir.TEXT,script:Ir.SCRIPT,scriptscript:Ir.SCRIPTSCRIPT},Ctt={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},la=function(e,r,n,i){i===void 0&&(i=[null,null]);for(var a=[],s=0;s<e.length;s++){var o=vn(e[s],r);if(o instanceof wx){var l=o.children;a.push(...l)}else a.push(o)}if(oge(a),!n)return a;var u=r;if(e.length===1){var h=e[0];h.type==="sizing"?u=r.havingSize(h.size):h.type==="styling"&&(u=r.havingStyle(wtt[h.style]))}var d=St([i[0]||"leftmost"],[],r),f=St([i[1]||"rightmost"],[],r),p=n==="root";return n$(a,(g,m)=>{var y=m.classes[0],v=g.classes[0];y==="mbin"&&Ttt.has(v)?m.classes[0]="mord":v==="mbin"&&xtt.has(y)&&(g.classes[0]="mord")},{node:d},f,p),n$(a,(g,m)=>{var y,v,T=a$(m),b=a$(g),w=T&&b?g.hasClass("mtight")?(y=btt[T])==null?void 0:y[b]:(v=vtt[T])==null?void 0:v[b]:null;if(w)return lge(w,u)},{node:d},f,p),a},n$=function(e,r,n,i,a){i&&e.push(i);for(var s=0;s<e.length;s++){var o=e[s],l=dge(o);if(l){n$(l.children,r,n,null,a);continue}var u=!o.hasClass("mspace");if(u){var h=r(o,n.node);h&&(n.insertAfter?n.insertAfter(h):(e.unshift(h),s++))}u?n.node=o:a&&o.hasClass("newline")&&(n.node=St(["leftmost"])),n.insertAfter=(d=>f=>{e.splice(d+1,0,f),s++})(s)}i&&e.pop()},dge=function(e){return e instanceof wx||e instanceof SR||e instanceof Cx&&e.hasClass("enclosing")?e:null},i$=function(e,r){var n=dge(e);if(n){var i=n.children;if(i.length){if(r==="right")return i$(i[i.length-1],"right");if(r==="left")return i$(i[0],"left")}}return e},a$=function(e,r){if(!e)return null;r&&(e=i$(e,r));var n=e.classes[0];return Ctt[n]||null},HC=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return St(r.concat(n))},vn=function(e,r,n){if(!e)return St();if(YA[e.type]){var i=YA[e.type](e,r);if(n&&r.size!==n.size){i=St(r.sizingClasses(n),[i],r);var a=r.sizeMultiplier/n.sizeMultiplier;i.height*=a,i.depth*=a}return i}else throw new _t("Got group of unknown type: '"+e.type+"'")};function $E(t,e){var r=St(["base"],t,e),n=St(["strut"]);return n.style.height=Mt(r.height+r.depth),r.depth&&(n.style.verticalAlign=Mt(-r.depth)),r.children.unshift(n),r}function s$(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=la(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],s=[],o=0;o<n.length;o++)if(s.push(n[o]),n[o].hasClass("mbin")||n[o].hasClass("mrel")||n[o].hasClass("allowbreak")){for(var l=!1;o<n.length-1&&n[o+1].hasClass("mspace")&&!n[o+1].hasClass("newline");)o++,s.push(n[o]),n[o].hasClass("nobreak")&&(l=!0);l||(a.push($E(s,e)),s=[])}else n[o].hasClass("newline")&&(s.pop(),s.length>0&&(a.push($E(s,e)),s=[]),a.push(n[o]));s.length>0&&a.push($E(s,e));var u;r?(u=$E(la(r,e,!0),e),u.classes=["tag"],a.push(u)):i&&a.push(i);var h=St(["katex-html"],a);if(h.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=Mt(h.height+h.depth),h.depth&&(d.style.verticalAlign=Mt(-h.depth))}return h}function fge(t){return new wx(t)}class Lt{constructor(e,r,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=r||[],this.classes=n||[]}setAttribute(e,r){this.attributes[e]=r}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&e.setAttribute(r,this.attributes[r]);this.classes.length>0&&(e.className=nf(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof Yi&&this.children[n+1]instanceof Yi){for(var i=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof Yi;)i+=this.children[++n].toText();e.appendChild(new Yi(i).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&(e+=" "+r+'="',e+=fs(this.attributes[r]),e+='"');this.classes.length>0&&(e+=' class ="'+fs(nf(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Yi{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return fs(this.toText())}toText(){return this.text}}class pge{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Mt(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Mt(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var ktt=new Set(["\\imath","\\jmath"]),Stt=new Set(["mrow","mtable"]),xl=function(e,r,n){return li[r][e]&&li[r][e].replace&&e.charCodeAt(0)!==55349&&!(sge.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=li[r][e].replace),new Yi(e)},WV=function(e){return e.length===1?e[0]:new Lt("mrow",e)},Ett={mathit:"italic",boldsymbol:t=>t.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},HV=(t,e)=>{if(t.mode==="text"){if(e.fontFamily==="texttt")return"monospace";if(e.fontFamily==="textsf")return e.fontShape==="textit"&&e.fontWeight==="textbf"?"sans-serif-bold-italic":e.fontShape==="textit"?"sans-serif-italic":e.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(e.fontShape==="textit"&&e.fontWeight==="textbf")return"bold-italic";if(e.fontShape==="textit")return"italic";if(e.fontWeight==="textbf")return"bold"}var r=e.font;if(!r||r==="mathnormal")return null;var n=t.mode,i=Ett[r];if(i)return typeof i=="function"?i(t):i;var a=t.text;if(ktt.has(a))return null;if(li[n][a]){var s=li[n][a].replace;s&&(a=s)}var o=r$[r].fontName;return zV(a,o,n)?r$[r].variant:null};function lI(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Yi&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var r=t.children[0];return r instanceof Yi&&r.text===","}else return!1}var Uo=function(e,r,n){if(e.length===1){var i=Dn(e[0],r);return n&&i instanceof Lt&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],s,o=0;o<e.length;o++){var l=Dn(e[o],r);if(l instanceof Lt&&s instanceof Lt){if(l.type==="mtext"&&s.type==="mtext"&&l.getAttribute("mathvariant")===s.getAttribute("mathvariant")){s.children.push(...l.children);continue}else if(l.type==="mn"&&s.type==="mn"){s.children.push(...l.children);continue}else if(lI(l)&&s.type==="mn"){s.children.push(...l.children);continue}else if(l.type==="mn"&&lI(s))l.children=[...s.children,...l.children],a.pop();else if((l.type==="msup"||l.type==="msub")&&l.children.length>=1&&(s.type==="mn"||lI(s))){var u=l.children[0];u instanceof Lt&&u.type==="mn"&&(u.children=[...s.children,...u.children],a.pop())}else if(s.type==="mi"&&s.children.length===1){var h=s.children[0];if(h instanceof Yi&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof Yi&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),s=l}return a},of=function(e,r,n){return WV(Uo(e,r,n))},Dn=function(e,r){if(!e)return new Lt("mrow");if(XA[e.type])return XA[e.type](e,r);throw new _t("Got group of unknown type: '"+e.type+"'")};function SZ(t,e,r,n,i){var a=Uo(t,r),s;a.length===1&&a[0]instanceof Lt&&Stt.has(a[0].type)?s=a[0]:s=new Lt("mrow",a);var o=new Lt("annotation",[new Yi(e)]);o.setAttribute("encoding","application/x-tex");var l=new Lt("semantics",[s,o]),u=new Lt("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var h=i?"katex":"katex-mathml";return St([h],[u])}var Att=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],EZ=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],AZ=function(e,r){return r.size<2?e:Att[e-1][r.size-1]};class Hu{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Hu.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=EZ[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(r,e),new Hu(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:AZ(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:EZ[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=AZ(Hu.BASESIZE,e);return this.size===r&&this.textSize===Hu.BASESIZE&&this.style===e?this:this.extend({style:e,size:r})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Hu.BASESIZE?["sizing","reset-size"+this.size,"size"+Hu.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=utt(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Hu.BASESIZE=6;var gge=function(e){return new Hu({style:e.displayMode?Ir.DISPLAY:Ir.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},mge=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=St(n,[e])}return e},_tt=function(e,r,n){var i=gge(n),a;if(n.output==="mathml")return SZ(e,r,i,n.displayMode,!0);if(n.output==="html"){var s=s$(e,i);a=St(["katex"],[s])}else{var o=SZ(e,r,i,n.displayMode,!1),l=s$(e,i);a=St(["katex"],[o,l])}return mge(a,n)},Rtt=function(e,r,n){var i=gge(n),a=s$(e,i),s=St(["katex"],[a]);return mge(s,n)},Ltt={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},_R=function(e){var r=new Lt("mo",[new Yi(Ltt[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},Mtt={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Itt=new Set(["widehat","widecheck","widetilde","utilde"]),RR=function(e,r){function n(){var o=4e5,l=e.label.slice(1);if(Itt.has(l)&&"base"in e){var u=e.base.type==="ordgroup"?e.base.body.length:1,h,d,f;if(u>5)l==="widehat"||l==="widecheck"?(h=420,o=2364,f=.42,d=l+"4"):(h=312,o=2340,f=.34,d="tilde4");else{var p=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][p],h=[0,239,300,360,420][p],f=[0,.24,.3,.3,.36,.42][p],d=l+p):(o=[0,600,1033,2339,2340][p],h=[0,260,286,306,312][p],f=[0,.26,.286,.3,.306,.34][p],d="tilde"+p)}var g=new af(d),m=new xh([g],{width:"100%",height:Mt(f),viewBox:"0 0 "+o+" "+h,preserveAspectRatio:"none"});return{span:sf([],[m],r),minWidth:0,height:f}}else{var y=[],v=Mtt[l];if(!v)throw new Error('No SVG data for "'+l+'".');var[T,b,w]=v,C=w/1e3,S=T.length,k,E;if(S===1){if(v.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');k=["hide-tail"],E=[v[3]]}else if(S===2)k=["halfarrow-left","halfarrow-right"],E=["xMinYMin","xMaxYMin"];else if(S===3)k=["brace-left","brace-center","brace-right"],E=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
`+S+" children.");for(var _=0;_<S;_++){var M=new af(T[_]),L=new xh([M],{width:"400em",height:Mt(C),viewBox:"0 0 "+o+" "+w,preserveAspectRatio:E[_]+" slice"}),P=sf([k[_]],[L],r);if(S===1)return{span:P,minWidth:b,height:C};P.style.height=Mt(C),y.push(P)}return{span:St(["stretchy"],y,r),minWidth:b,height:C}}}var{span:i,minWidth:a,height:s}=n();return i.height=s,i.style.height=Mt(s),a>0&&(i.style.minWidth=Mt(a)),i},Ntt=function(e,r,n,i,a){var s,o=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(s=St(["stretchy",r],[],a),r==="fbox"){var l=a.color&&a.getColor();l&&(s.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new KO({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new KO({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new xh(u,{width:"100%",height:Mt(o)});s=sf([],[h],a)}return s.height=o,s.style.height=Mt(o),s},Dtt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Ott={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function $tt(t){return t in Dtt}function Pr(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function LR(t){var e=MR(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function MR(t){return t&&(t.type==="atom"||Ott.hasOwnProperty(t.type))?t:null}var yge=t=>{if(t instanceof zo)return t;if(ctt(t)&&t.children.length===1)return yge(t.children[0])},qV=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=Pr(t.base,"accent"),r=n.base,t.base=r,i=ltt(vn(t,e)),t.base=n):(n=Pr(t,"accent"),r=n.base);var a=vn(r,e.havingCrampedStyle()),s=n.isShifty&&Ph(r),o=0;if(s){var l,u;o=(l=(u=yge(a))==null?void 0:u.skew)!=null?l:0}var h=n.label==="\\c",d=h?a.height+a.depth:Math.min(a.height,e.fontMetrics().xHeight),f;if(n.isStretchy)f=RR(n,e),f=yn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Mt(2*o)+")",marginLeft:Mt(2*o)}:void 0}]});else{var p,g;n.label==="\\vec"?(p=uge("vec",e),g=cge.vec[1]):(p=AR({mode:n.mode,text:n.label},e,"textord"),p=ott(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=St(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=a.height);var y=o;m||(y-=g/2),f.style.left=Mt(y),n.label==="\\textcircled"&&(f.style.top=".2em"),f=yn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]})}var v=St(["mord","accent"],[f],e);return i?(i.children[0]=v,i.height=Math.max(v.height,i.height),i.classes[0]="mord",i):v},vge=(t,e)=>{var r=t.isStretchy?_R(t.label):new Lt("mo",[xl(t.label,t.mode)]),n=new Lt("mover",[Dn(t.base,e),r]);return n.setAttribute("accent","true"),n},Ptt=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));Pt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var r=jA(e[0]),n=!Ptt.test(t.funcName),i=!n||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:n,isShifty:i,base:r}},htmlBuilder:qV,mathmlBuilder:vge});Pt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var r=e[0],n=t.parser.mode;return n==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:t.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:qV,mathmlBuilder:vge});Pt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"accentUnder",mode:r.mode,label:n,base:i}},htmlBuilder:(t,e)=>{var r=vn(t.base,e),n=RR(t,e),i=t.label==="\\utilde"?.12:0,a=yn({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return St(["mord","accentunder"],[a],e)},mathmlBuilder:(t,e)=>{var r=_R(t.label),n=new Lt("munder",[Dn(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var PE=t=>{var e=new Lt("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};Pt({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n,funcName:i}=t;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:r[0]}},htmlBuilder(t,e){var r=e.style,n=e.havingStyle(r.sup()),i=Ob(vn(t.body,n,e),e),a=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var s;t.below&&(n=e.havingStyle(r.sub()),s=Ob(vn(t.below,n,e),e),s.classes.push(a+"-arrow-pad"));var o=RR(t,e),l=-e.fontMetrics().axisHeight+.5*o.height,u=-e.fontMetrics().axisHeight-.5*o.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(u-=i.depth);var h;if(s){var d=-e.fontMetrics().axisHeight+s.height+.5*o.height+.111;h=yn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:s,shift:d}]})}else h=yn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return St(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=_R(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=PE(Dn(t.body,e));if(t.below){var a=PE(Dn(t.below,e));n=new Lt("munderover",[r,a,i])}else n=new Lt("mover",[r,i])}else if(t.below){var s=PE(Dn(t.below,e));n=new Lt("munder",[r,s])}else n=PE(),n=new Lt("mover",[r,n]);return n}});function bge(t,e){var r=la(t.body,e,!0);return St([t.mclass],r,e)}function xge(t,e){var r,n=Uo(t.body,e);return t.mclass==="minner"?r=new Lt("mpadded",n):t.mclass==="mord"?t.isCharacterBox?(r=n[0],r.type="mi"):r=new Lt("mi",n):(t.isCharacterBox?(r=n[0],r.type="mo"):r=new Lt("mo",n),t.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):t.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):t.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}Pt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:Ui(i),isCharacterBox:Ph(i)}},htmlBuilder:bge,mathmlBuilder:xge});var IR=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};Pt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:r}=t;return{type:"mclass",mode:r.mode,mclass:IR(e[0]),body:Ui(e[1]),isCharacterBox:Ph(e[1])}}});Pt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:r,funcName:n}=t,i=e[1],a=e[0],s;n!=="\\stackrel"?s=IR(i):s="mrel";var o={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Ui(i)},l={type:"supsub",mode:a.mode,base:o,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:r.mode,mclass:s,body:[l],isCharacterBox:Ph(l)}},htmlBuilder:bge,mathmlBuilder:xge});Pt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:IR(e[0]),body:Ui(e[0])}},htmlBuilder(t,e){var r=la(t.body,e,!0),n=St([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=Uo(t.body,e),n=new Lt("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var Btt={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},_Z=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),RZ=t=>t.type==="textord"&&t.text==="@",Ftt=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function ztt(t,e,r){var n=Btt[t];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=r.callFunction("\\\\cdleft",[e[0]],[]),a={type:"atom",text:n,mode:"math",family:"rel"},s=r.callFunction("\\Big",[a],[]),o=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,s,o]};return r.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function Vtt(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var r=t.fetch().text;if(r==="&"||r==="\\\\")t.consume();else if(r==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new _t("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var n=[],i=[n],a=0;a<e.length;a++){for(var s=e[a],o=_Z(),l=0;l<s.length;l++)if(!RZ(s[l]))o.body.push(s[l]);else{n.push(o),l+=1;var u=LR(s[l]).text,h=new Array(2);if(h[0]={type:"ordgroup",mode:"math",body:[]},h[1]={type:"ordgroup",mode:"math",body:[]},!"=|.".includes(u))if("<>AV".includes(u))for(var d=0;d<2;d++){for(var f=!0,p=l+1;p<s.length;p++){if(Ftt(s[p],u)){f=!1,l=p;break}if(RZ(s[p]))throw new _t("Missing a "+u+" character to complete a CD arrow.",s[p]);h[d].body.push(s[p])}if(f)throw new _t("Missing a "+u+" character to complete a CD arrow.",s[l])}else throw new _t('Expected one of "<>AV=|." after @',s[l]);var g=ztt(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),o=_Z()}a%2===0?n.push(o):n.shift(),n=[],i.push(n)}t.gullet.endGroup(),t.gullet.endGroup();var y=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Pt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:e[0]}},htmlBuilder(t,e){var r=e.havingStyle(e.style.sup()),n=Ob(vn(t.label,r,e),e);return n.classes.push("cd-label-"+t.side),n.style.bottom=Mt(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(t,e){var r=new Lt("mrow",[Dn(t.label,e)]);return r=new Lt("mpadded",[r]),r.setAttribute("width","0"),t.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new Lt("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});Pt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:r}=t;return{type:"cdlabelparent",mode:r.mode,fragment:e[0]}},htmlBuilder(t,e){var r=Ob(vn(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new Lt("mrow",[Dn(t.fragment,e)])}});Pt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=Pr(e[0],"ordgroup"),i=n.body,a="",s=0;s<i.length;s++){var o=Pr(i[s],"textord");a+=o.text}var l=parseInt(a),u;if(isNaN(l))throw new _t("\\@char has non-numeric argument "+a);if(l<0||l>=1114111)throw new _t("\\@char with invalid code point "+a);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:r.mode,text:u}}});var Tge=(t,e)=>{var r=la(t.body,e.withColor(t.color),!1);return Fh(r)},wge=(t,e)=>{var r=Uo(t.body,e.withColor(t.color)),n=new Lt("mstyle",r);return n.setAttribute("mathcolor",t.color),n};Pt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:r}=t,n=Pr(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:Ui(i)}},htmlBuilder:Tge,mathmlBuilder:wge});Pt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=Pr(e[0],"color-token").color;r.gullet.macros.set("\\current@color",i);var a=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:i,body:a}},htmlBuilder:Tge,mathmlBuilder:wge});Pt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,r){var{parser:n}=t,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,a=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:a,size:i&&Pr(i,"size").value}},htmlBuilder(t,e){var r=St(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=Mt(fi(t.size,e)))),r},mathmlBuilder(t,e){var r=new Lt("mspace");return t.newLine&&(r.setAttribute("linebreak","newline"),t.size&&r.setAttribute("height",Mt(fi(t.size,e)))),r}});var o$={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Cge=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new _t("Expected a control sequence",t);return e},Gtt=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},kge=(t,e,r,n)=>{var i=t.gullet.macros.get(r.text);i==null&&(r.noexpand=!0,i={tokens:[r],numArgs:0,unexpandable:!t.gullet.isExpandable(r.text)}),t.gullet.macros.set(e,i,n)};Pt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:r}=t;e.consumeSpaces();var n=e.fetch();if(o$[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=o$[n.text]),Pr(e.parseFunction(),"internal");throw new _t("Invalid token after macro prefix",n)}});Pt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new _t("Expected a control sequence",n);for(var a=0,s,o=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){s=e.gullet.future(),o[a].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new _t('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==a+1)throw new _t('Argument number "'+n.text+'" out of order');a++,o.push([])}else{if(n.text==="EOF")throw new _t("Expected a macro definition");o[a].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return s&&l.unshift(s),(r==="\\edef"||r==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:o},r===o$[r]),{type:"internal",mode:e.mode}}});Pt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=Cge(e.gullet.popToken());e.gullet.consumeSpaces();var i=Gtt(e);return kge(e,n,i,r==="\\\\globallet"),{type:"internal",mode:e.mode}}});Pt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:r}=t,n=Cge(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return kge(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var ZT=function(e,r,n){var i=li.math[e]&&li.math[e].replace,a=zV(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},UV=function(e,r,n,i){var a=n.havingBaseStyle(r),s=St(i.concat(a.sizingClasses(n)),[e],n),o=a.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=a.sizeMultiplier,s},Sge=function(e,r,n){var i=r.havingBaseStyle(n),a=(1-r.sizeMultiplier/i.sizeMultiplier)*r.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Mt(a),e.height-=a,e.depth+=a},Wtt=function(e,r,n,i,a,s){var o=Ls(e,"Main-Regular",a,i),l=UV(o,r,i,s);return Sge(l,i,r),l},Htt=function(e,r,n,i){return Ls(e,"Size"+r+"-Regular",n,i)},Ege=function(e,r,n,i,a,s){var o=Htt(e,r,a,i),l=UV(St(["delimsizing","size"+r],[o],i),Ir.TEXT,i,s);return n&&Sge(l,i,Ir.TEXT),l},cI=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=St(["delimsizinginner",i],[St([],[Ls(e,r,n)])]);return{type:"elem",elem:a}},uI=function(e,r,n){var i=Bc["Size4-Regular"][e.charCodeAt(0)]?Bc["Size4-Regular"][e.charCodeAt(0)][4]:Bc["Size1-Regular"][e.charCodeAt(0)][4],a=new af("inner",ett(e,Math.round(1e3*r))),s=new xh([a],{width:Mt(i),height:Mt(r),style:"width:"+Mt(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),o=sf([],[s],n);return o.height=r,o.style.height=Mt(r),o.style.width=Mt(i),{type:"elem",elem:o}},l$=.008,BE={type:"kern",size:-1*l$},qtt=new Set(["|","\\lvert","\\rvert","\\vert"]),Utt=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),Age=function(e,r,n,i,a,s){var o,l,u,h,d="",f=0;o=u=h=e,l=null;var p="Size1-Regular";e==="\\uparrow"?u=h="⏐":e==="\\Uparrow"?u=h="‖":e==="\\downarrow"?o=u="⏐":e==="\\Downarrow"?o=u="‖":e==="\\updownarrow"?(o="\\uparrow",u="⏐",h="\\downarrow"):e==="\\Updownarrow"?(o="\\Uparrow",u="‖",h="\\Downarrow"):qtt.has(e)?(u="∣",d="vert",f=333):Utt.has(e)?(u="∥",d="doublevert",f=556):e==="["||e==="\\lbrack"?(o="⎡",u="⎢",h="⎣",p="Size4-Regular",d="lbrack",f=667):e==="]"||e==="\\rbrack"?(o="⎤",u="⎥",h="⎦",p="Size4-Regular",d="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(u=o="⎢",h="⎣",p="Size4-Regular",d="lfloor",f=667):e==="\\lceil"||e==="⌈"?(o="⎡",u=h="⎢",p="Size4-Regular",d="lceil",f=667):e==="\\rfloor"||e==="⌋"?(u=o="⎥",h="⎦",p="Size4-Regular",d="rfloor",f=667):e==="\\rceil"||e==="⌉"?(o="⎤",u=h="⎥",p="Size4-Regular",d="rceil",f=667):e==="("||e==="\\lparen"?(o="⎛",u="⎜",h="⎝",p="Size4-Regular",d="lparen",f=875):e===")"||e==="\\rparen"?(o="⎞",u="⎟",h="⎠",p="Size4-Regular",d="rparen",f=875):e==="\\{"||e==="\\lbrace"?(o="⎧",l="⎨",h="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(o="⎫",l="⎬",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(o="⎧",h="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(o="⎫",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(o="⎧",h="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(o="⎫",h="⎩",u="⎪",p="Size4-Regular");var g=ZT(o,p,a),m=g.height+g.depth,y=ZT(u,p,a),v=y.height+y.depth,T=ZT(h,p,a),b=T.height+T.depth,w=0,C=1;if(l!==null){var S=ZT(l,p,a);w=S.height+S.depth,C=2}var k=m+b+w,E=Math.max(0,Math.ceil((r-k)/(C*v))),_=k+E*C*v,M=i.fontMetrics().axisHeight;n&&(M*=i.sizeMultiplier);var L=_/2-M,P=[];if(d.length>0){var D=_-m-b,R=Math.round(_*1e3),I=ttt(d,Math.round(D*1e3)),$=new af(d,I),O=Mt(f/1e3),N=Mt(R/1e3),F=new xh([$],{width:O,height:N,viewBox:"0 0 "+f+" "+R}),z=sf([],[F],i);z.height=R/1e3,z.style.width=O,z.style.height=N,P.push({type:"elem",elem:z})}else{if(P.push(cI(h,p,a)),P.push(BE),l===null){var V=_-m-b+2*l$;P.push(uI(u,V,i))}else{var B=(_-m-b-w)/2+2*l$;P.push(uI(u,B,i)),P.push(BE),P.push(cI(l,p,a)),P.push(BE),P.push(uI(u,B,i))}P.push(BE),P.push(cI(o,p,a))}var G=i.havingBaseStyle(Ir.TEXT),H=yn({positionType:"bottom",positionData:L,children:P});return UV(St(["delimsizing","mult"],[H],G),Ir.TEXT,i,s)},hI=80,dI=.08,fI=function(e,r,n,i,a){var s=Jet(e,i,n),o=new af(e,s),l=new xh([o],{width:"400em",height:Mt(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return sf(["hide-tail"],[l],a)},Ytt=function(e,r){var n=r.havingBaseSizing(),i=Ige("\\surd",e*n.sizeMultiplier,Mge,n),a=n.sizeMultiplier,s=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),o,l,u,h,d;return i.type==="small"?(h=1e3+1e3*s+hI,e<1?a=1:e<1.4&&(a=.7),l=(1+s+dI)/a,u=(1+s)/a,o=fI("sqrtMain",l,h,s,r),o.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+hI)*Gw[i.size],u=(Gw[i.size]+s)/a,l=(Gw[i.size]+s+dI)/a,o=fI("sqrtSize"+i.size,l,h,s,r),o.style.minWidth="1.02em",d=1/a):(l=e+s+dI,u=e+s,h=Math.floor(1e3*e+s)+hI,o=fI("sqrtTall",l,h,s,r),o.style.minWidth="0.742em",d=1.056),o.height=u,o.style.height=Mt(l),{span:o,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+s)*a}},_ge=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),Xtt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),Rge=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Gw=[0,1.2,1.8,2.4,3],Lge=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),_ge.has(e)||Rge.has(e))return Ege(e,r,!1,n,i,a);if(Xtt.has(e))return Age(e,Gw[r],!1,n,i,a);throw new _t("Illegal delimiter: '"+e+"'")},jtt=[{type:"small",style:Ir.SCRIPTSCRIPT},{type:"small",style:Ir.SCRIPT},{type:"small",style:Ir.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Ktt=[{type:"small",style:Ir.SCRIPTSCRIPT},{type:"small",style:Ir.SCRIPT},{type:"small",style:Ir.TEXT},{type:"stack"}],Mge=[{type:"small",style:Ir.SCRIPTSCRIPT},{type:"small",style:Ir.SCRIPT},{type:"small",style:Ir.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Ztt=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";var r=e.type;throw new Error("Add support for delim type '"+r+"' here.")},Ige=function(e,r,n,i){for(var a=Math.min(2,3-i.style.size),s=a;s<n.length;s++){var o=n[s];if(o.type==="stack")break;var l=ZT(e,Ztt(o),"math"),u=l.height+l.depth;if(o.type==="small"){var h=i.havingBaseStyle(o.style);u*=h.sizeMultiplier}if(u>r)return o}return n[n.length-1]},c$=function(e,r,n,i,a,s){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;Rge.has(e)?o=jtt:_ge.has(e)?o=Mge:o=Ktt;var l=Ige(e,r,o,i);return l.type==="small"?Wtt(e,l.style,n,i,a,s):l.type==="large"?Ege(e,l.size,n,i,a,s):Age(e,r,n,i,a,s)},pI=function(e,r,n,i,a,s){var o=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,h=Math.max(r-o,n+o),d=Math.max(h/500*l,2*h-u);return c$(e,d,!0,i,a,s)},LZ={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Qtt=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function MZ(t){return"isMiddle"in t}function NR(t,e){var r=MR(t);if(r&&Qtt.has(r.text))return r;throw r?new _t("Invalid delimiter '"+r.text+"' after '"+e.funcName+"'",t):new _t("Invalid delimiter type '"+t.type+"'",t)}Pt({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var r=NR(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:LZ[t.funcName].size,mclass:LZ[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?St([t.mclass]):Lge(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(xl(t.delim,t.mode));var r=new Lt("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=Mt(Gw[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function IZ(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Pt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=t.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new _t("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:NR(e[0],t).text,color:r}}});Pt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=NR(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=Pr(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(t,e)=>{IZ(t);for(var r=la(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,s=0;s<r.length;s++){var o=r[s];MZ(o)?a=!0:(n=Math.max(r[s].height,n),i=Math.max(r[s].depth,i))}n*=e.sizeMultiplier,i*=e.sizeMultiplier;var l;if(t.left==="."?l=HC(e,["mopen"]):l=pI(t.left,n,i,e,t.mode,["mopen"]),r.unshift(l),a)for(var u=1;u<r.length;u++){var h=r[u];if(MZ(h)){var d=h.isMiddle;r[u]=pI(d.delim,n,i,d.options,t.mode,[])}}var f;if(t.right===".")f=HC(e,["mclose"]);else{var p=t.rightColor?e.withColor(t.rightColor):e;f=pI(t.right,n,i,p,t.mode,["mclose"])}return r.push(f),St(["minner"],r,e)},mathmlBuilder:(t,e)=>{IZ(t);var r=Uo(t.body,e);if(t.left!=="."){var n=new Lt("mo",[xl(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new Lt("mo",[xl(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return WV(r)}});Pt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=NR(e[0],t);if(!t.parser.leftrightDepth)throw new _t("\\middle without preceding \\left",r);return{type:"middle",mode:t.parser.mode,delim:r.text}},htmlBuilder:(t,e)=>{var r;return t.delim==="."?r=HC(e,[]):(r=Lge(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?xl("|","text"):xl(t.delim,t.mode),n=new Lt("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var DR=(t,e)=>{var r=Ob(vn(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,s,o=Ph(t.body);if(n==="sout")a=St(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,s=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=fi({number:.6,unit:"pt"},e),u=fi({number:.35,unit:"ex"},e),h=e.havingBaseSizing();i=i/h.sizeMultiplier;var d=r.height+r.depth+l+u;r.style.paddingLeft=Mt(d/2+l);var f=Math.floor(1e3*d*i),p=Zet(f),g=new xh([new af("phase",p)],{width:"400em",height:Mt(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=sf(["hide-tail"],[g],e),a.style.height=Mt(d),s=r.depth+l+u}else{/cancel/.test(n)?o||r.classes.push("cancel-pad"):n==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var m,y,v=0;/box/.test(n)?(v=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(n==="colorbox"?0:v),y=m):n==="angl"?(v=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*v,y=Math.max(0,.25-r.depth)):(m=o?.2:0,y=m),a=Ntt(r,n,m,y,e),/fbox|boxed|fcolorbox/.test(n)?(a.style.borderStyle="solid",a.style.borderWidth=Mt(v)):n==="angl"&&v!==.049&&(a.style.borderTopWidth=Mt(v),a.style.borderRightWidth=Mt(v)),s=r.depth+y,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var T;if(t.backgroundColor)T=yn({positionType:"individualShift",children:[{type:"elem",elem:a,shift:s},{type:"elem",elem:r,shift:0}]});else{var b=/cancel|phase/.test(n)?["svg-align"]:[];T=yn({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:s,wrapperClasses:b}]})}return/cancel/.test(n)&&(T.height=r.height,T.depth=r.depth),/cancel/.test(n)&&!o?St(["mord","cancel-lap"],[T],e):St(["mord"],[T],e)},OR=(t,e)=>{var r,n=new Lt(t.label.includes("colorbox")?"mpadded":"menclose",[Dn(t.body,e)]);switch(t.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+Mt(i)+" solid "+t.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&n.setAttribute("mathbackground",t.backgroundColor),n};Pt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Pr(e[0],"color-token").color,s=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:s}},htmlBuilder:DR,mathmlBuilder:OR});Pt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(t,e,r){var{parser:n,funcName:i}=t,a=Pr(e[0],"color-token").color,s=Pr(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,borderColor:a,body:o}},htmlBuilder:DR,mathmlBuilder:OR});Pt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\fbox",body:e[0]}}});Pt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:DR,mathmlBuilder:OR});Pt({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t;r.mode==="math"&&r.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=e[0];return{type:"enclose",mode:r.mode,label:n,body:i}},htmlBuilder:DR,mathmlBuilder:OR});Pt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"enclose",mode:r.mode,label:"\\angl",body:e[0]}}});var Nge={};function lu(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:s}=t,o={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<r.length;++l)Nge[r[l]]=o;a&&(YA[e]=a),s&&(XA[e]=s)}var Dge={};function we(t,e){Dge[t]=e}class co{constructor(e,r,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=r,this.end=n}static range(e,r){return r?!e||!e.loc||!r.loc||e.loc.lexer!==r.loc.lexer?null:new co(e.loc.lexer,e.loc.start,r.loc.end):e&&e.loc}}class $o{constructor(e,r){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=r}range(e,r){return new $o(r,co.range(this,e))}}function NZ(t){var e=[];t.consumeSpaces();var r=t.fetch().text;for(r==="\\relax"&&(t.consume(),t.consumeSpaces(),r=t.fetch().text);r==="\\hline"||r==="\\hdashline";)t.consume(),e.push(r==="\\hdashline"),t.consumeSpaces(),r=t.fetch().text;return e}var $R=t=>{var e=t.parser.settings;if(!e.displayMode)throw new _t("{"+t.envName+"} can be used only in display mode.")},Jtt=new Set(["gather","gather*"]);function YV(t){if(!t.includes("ed"))return!t.includes("*")}function Cf(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:s,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:h,maxNumCols:d,leqno:f}=e;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!s){var p=t.gullet.expandMacroAsText("\\arraystretch");if(p==null)s=1;else if(s=parseFloat(p),!s||s<0)throw new _t("Invalid \\arraystretch: "+p)}t.gullet.beginGroup();var g=[],m=[g],y=[],v=[],T=l!=null?[]:void 0;function b(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function w(){T&&(t.gullet.macros.get("\\df@tag")?(T.push(t.subparse([new $o("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):T.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(b(),v.push(NZ(t));;){var C=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup();var S={type:"ordgroup",mode:t.mode,body:C};r&&(S={type:"styling",mode:t.mode,style:r,resetFont:!0,body:[S]}),g.push(S);var k=t.fetch().text;if(k==="&"){if(d&&g.length===d){if(u||o)throw new _t("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(k==="\\end"){w(),g.length===1&&S.type==="styling"&&S.body.length===1&&S.body[0].type==="ordgroup"&&S.body[0].body.length===0&&(m.length>1||!h)&&m.pop(),v.length<m.length+1&&v.push([]);break}else if(k==="\\\\"){t.consume();var E=void 0;t.gullet.future().text!==" "&&(E=t.parseSizeGroup(!0)),y.push(E?E.value:null),w(),v.push(NZ(t)),g=[],m.push(g),b()}else throw new _t("Expected & or \\\\ or \\cr or \\end",t.nextToken)}return t.gullet.endGroup(),t.gullet.endGroup(),{type:"array",mode:t.mode,addJot:i,arraystretch:s,body:m,cols:a,rowGaps:y,hskipBeforeAndAfter:n,hLinesBeforeRow:v,colSeparationType:o,tags:T,leqno:f}}function XV(t){return t.slice(0,1)==="d"?"display":"text"}var cu=function(e,r){var n,i,a=e.body.length,s=e.hLinesBeforeRow,o=0,l=new Array(a),u=[],h=Math.max(r.fontMetrics().arrayRuleWidth,r.minRuleThickness),d=1/r.fontMetrics().ptPerEm,f=5*d;if(e.colSeparationType&&e.colSeparationType==="small"){var p=r.havingStyle(Ir.SCRIPT).sizeMultiplier;f=.2778*(p/r.sizeMultiplier)}var g=e.colSeparationType==="CD"?fi({number:3,unit:"ex"},r):12*d,m=3*d,y=e.arraystretch*g,v=.7*y,T=.3*y,b=0;function w(Te){for(var ae=0;ae<Te.length;++ae)ae>0&&(b+=.25),u.push({pos:b,isDashed:Te[ae]})}for(w(s[0]),n=0;n<e.body.length;++n){var C=e.body[n],S=v,k=T;o<C.length&&(o=C.length);var E={cells:new Array(C.length),height:0,depth:0,pos:0};for(i=0;i<C.length;++i){var _=vn(C[i],r);k<_.depth&&(k=_.depth),S<_.height&&(S=_.height),E.cells[i]=_}var M=e.rowGaps[n],L=0;M&&(L=fi(M,r),L>0&&(L+=T,k<L&&(k=L),L=0)),e.addJot&&n<e.body.length-1&&(k+=m),E.height=S,E.depth=k,b+=S,E.pos=b,b+=k+L,l[n]=E,w(s[n+1])}var P=b/2+r.fontMetrics().axisHeight,D=e.cols||[],R=[],I,$,O=[];if(e.tags&&e.tags.some(Te=>Te))for(n=0;n<a;++n){var N=l[n],F=N.pos-P,z=e.tags[n],V=void 0;z===!0?V=St(["eqn-num"],[],r):z===!1?V=St([],[],r):V=St([],la(z,r,!0),r),V.depth=N.depth,V.height=N.height,O.push({type:"elem",elem:V,shift:F})}for(i=0,$=0;i<o||$<D.length;++i,++$){for(var B,G=D[$],H=!0;((q=G)==null?void 0:q.type)==="separator";){var q;if(H||(I=St(["arraycolsep"],[]),I.style.width=Mt(r.fontMetrics().doubleRuleSep),R.push(I)),G.separator==="|"||G.separator===":"){var Z=G.separator==="|"?"solid":"dashed",Y=St(["vertical-separator"],[],r);Y.style.height=Mt(b),Y.style.borderRightWidth=Mt(h),Y.style.borderRightStyle=Z,Y.style.margin="0 "+Mt(-h/2);var ie=b-P;ie&&(Y.style.verticalAlign=Mt(-ie)),R.push(Y)}else throw new _t("Invalid separator type: "+G.separator);$++,G=D[$],H=!1}if(!(i>=o)){var K=void 0;if(i>0||e.hskipBeforeAndAfter){var Q,te;K=(Q=(te=G)==null?void 0:te.pregap)!=null?Q:f,K!==0&&(I=St(["arraycolsep"],[]),I.style.width=Mt(K),R.push(I))}var J=[];for(n=0;n<a;++n){var ge=l[n],ee=ge.cells[i];if(ee){var Re=ge.pos-P;ee.depth=ge.depth,ee.height=ge.height,J.push({type:"elem",elem:ee,shift:Re})}}var Ie=yn({positionType:"individualShift",children:J}),Be=St(["col-align-"+(((B=G)==null?void 0:B.align)||"c")],[Ie]);if(R.push(Be),i<o-1||e.hskipBeforeAndAfter){var ce,oe;K=(ce=(oe=G)==null?void 0:oe.postgap)!=null?ce:f,K!==0&&(I=St(["arraycolsep"],[]),I.style.width=Mt(K),R.push(I))}}}var be=St(["mtable"],R);if(u.length>0){for(var fe=Db("hline",r,h),Pe=Db("hdashline",r,h),ve=[{type:"elem",elem:be,shift:0}];u.length>0;){var Ce=u.pop(),Ve=Ce.pos-P;Ce.isDashed?ve.push({type:"elem",elem:Pe,shift:Ve}):ve.push({type:"elem",elem:fe,shift:Ve})}be=yn({positionType:"individualShift",children:ve})}if(O.length===0)return St(["mord"],[be],r);var se=yn({positionType:"individualShift",children:O}),de=St(["tag"],[se],r);return Fh([be,de])},ert={c:"center ",l:"left ",r:"right "},uu=function(e,r){for(var n=[],i=new Lt("mtd",[],["mtr-glue"]),a=new Lt("mtd",[],["mml-eqn-num"]),s=0;s<e.body.length;s++){for(var o=e.body[s],l=[],u=0;u<o.length;u++)l.push(new Lt("mtd",[Dn(o[u],r)]));e.tags&&e.tags[s]&&(l.unshift(i),l.push(i),e.leqno?l.unshift(a):l.push(a)),n.push(new Lt("mtr",l))}var h=new Lt("mtable",n),d=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);h.setAttribute("rowspacing",Mt(d));var f="",p="";if(e.cols&&e.cols.length>0){var g=e.cols,m="",y=!1,v=0,T=g.length;g[0].type==="separator"&&(f+="top ",v=1),g[g.length-1].type==="separator"&&(f+="bottom ",T-=1);for(var b=v;b<T;b++){var w=g[b];w.type==="align"?(p+=ert[w.align],y&&(m+="none "),y=!0):w.type==="separator"&&y&&(m+=w.separator==="|"?"solid ":"dashed ",y=!1)}h.setAttribute("columnalign",p.trim()),/[sd]/.test(m)&&h.setAttribute("columnlines",m.trim())}if(e.colSeparationType==="align"){for(var C=e.cols||[],S="",k=1;k<C.length;k++)S+=k%2?"0em ":"1em ";h.setAttribute("columnspacing",S.trim())}else e.colSeparationType==="alignat"||e.colSeparationType==="gather"?h.setAttribute("columnspacing","0em"):e.colSeparationType==="small"?h.setAttribute("columnspacing","0.2778em"):e.colSeparationType==="CD"?h.setAttribute("columnspacing","0.5em"):h.setAttribute("columnspacing","1em");var E="",_=e.hLinesBeforeRow;f+=_[0].length>0?"left ":"",f+=_[_.length-1].length>0?"right ":"";for(var M=1;M<_.length-1;M++)E+=_[M].length===0?"none ":_[M][0]?"dashed ":"solid ";return/[sd]/.test(E)&&h.setAttribute("rowlines",E.trim()),f!==""&&(h=new Lt("menclose",[h]),h.setAttribute("notation",f.trim())),e.arraystretch&&e.arraystretch<1&&(h=new Lt("mstyle",[h]),h.setAttribute("scriptlevel","1")),h},Oge=function(e,r){e.envName.includes("ed")||$R(e);var n=[],i=e.envName.includes("at")?"alignat":"align",a=e.envName==="split",s=Cf(e.parser,{cols:n,addJot:!0,autoTag:a?void 0:YV(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:a?2:void 0,leqno:e.parser.settings.leqno},"display"),o=0,l=0,u={type:"ordgroup",mode:e.mode,body:[]};if(r[0]&&r[0].type==="ordgroup"){for(var h="",d=0;d<r[0].body.length;d++){var f=Pr(r[0].body[d],"textord");h+=f.text}o=Number(h),l=o*2}var p=!l;s.body.forEach(function(v){for(var T=1;T<v.length;T+=2){var b=Pr(v[T],"styling"),w=Pr(b.body[0],"ordgroup");w.body.unshift(u)}if(p)l<v.length&&(l=v.length);else{var C=v.length/2;if(o<C)throw new _t("Too many math in a row: "+("expected "+o+", but got "+C),v[0])}});for(var g=0;g<l;++g){var m="r",y=0;g%2===1?m="l":g>0&&p&&(y=1),n[g]={type:"align",align:m,pregap:y,postgap:0}}return s.colSeparationType=p?"align":"alignat",s};lu({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=MR(e[0]),n=r?[e[0]]:Pr(e[0],"ordgroup").body,i=n.map(function(s){var o=LR(s),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new _t("Unknown column alignment: "+l,s)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Cf(t.parser,a,XV(t.envName))},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],r="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,!"lcr".includes(r))throw new _t("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:r}]}}var a=Cf(t.parser,n,XV(t.envName)),s=Math.max(0,...a.body.map(o=>o.length));return a.cols=new Array(s).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=Cf(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=MR(e[0]),n=r?[e[0]]:Pr(e[0],"ordgroup").body,i=n.map(function(o){var l=LR(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new _t("Unknown column alignment: "+u,o)});if(i.length>1)throw new _t("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},s=Cf(t.parser,a,"script");if(s.body.length>0&&s.body[0].length>1)throw new _t("{subarray} can contain only one column");return s},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=Cf(t.parser,e,XV(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Oge,htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){Jtt.has(t.envName)&&$R(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:YV(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return Cf(t.parser,e,"display")},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Oge,htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){$R(t);var e={autoTag:YV(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return Cf(t.parser,e,"display")},htmlBuilder:cu,mathmlBuilder:uu});lu({type:"array",names:["CD"],props:{numArgs:0},handler(t){return $R(t),Vtt(t.parser)},htmlBuilder:cu,mathmlBuilder:uu});we("\\nonumber","\\gdef\\@eqnsw{0}");we("\\notag","\\nonumber");Pt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new _t(t.funcName+" valid only within array environment")}});var DZ=Nge;Pt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];if(i.type!=="ordgroup")throw new _t("Invalid environment name",i);for(var a="",s=0;s<i.body.length;++s)a+=Pr(i.body[s],"textord").text;if(n==="\\begin"){if(!DZ.hasOwnProperty(a))throw new _t("No such environment: "+a,i);var o=DZ[a],{args:l,optArgs:u}=r.parseArguments("\\begin{"+a+"}",o),h={mode:r.mode,envName:a,parser:r},d=o.handler(h,l,u);r.expect("\\end",!1);var f=r.nextToken,p=Pr(r.parseFunction(),"environment");if(p.name!==a)throw new _t("Mismatch: \\begin{"+a+"} matched by \\end{"+p.name+"}",f);return d}return{type:"environment",mode:r.mode,name:a,nameGroup:i}}});var $ge=(t,e)=>{var r=t.font,n=e.withFont(r);return vn(t.body,n)},Pge=(t,e)=>{var r=t.font,n=e.withFont(r);return Dn(t.body,n)},OZ={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Pt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=jA(e[0]),a=n;return a in OZ&&(a=OZ[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:$ge,mathmlBuilder:Pge});Pt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"mclass",mode:r.mode,mclass:IR(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:Ph(n)}}});Pt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,breakOnTokenText:i}=t,{mode:a}=r,s=r.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:s}}},htmlBuilder:$ge,mathmlBuilder:Pge});var trt=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var s=vn(t.numer,a,e);if(t.continued){var o=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;s.height=s.height<o?o:s.height,s.depth=s.depth<l?l:s.depth}a=e.havingStyle(i);var u=vn(t.denom,a,e),h,d,f;t.hasBarLine?(t.barSize?(d=fi(t.barSize,e),h=Db("frac-line",e,d)):h=Db("frac-line",e),d=h.height,f=h.height):(h=null,d=0,f=e.fontMetrics().defaultRuleThickness);var p,g,m;r.size===Ir.DISPLAY.size?(p=e.fontMetrics().num1,d>0?g=3*f:g=7*f,m=e.fontMetrics().denom1):(d>0?(p=e.fontMetrics().num2,g=f):(p=e.fontMetrics().num3,g=3*f),m=e.fontMetrics().denom2);var y;if(h){var T=e.fontMetrics().axisHeight;p-s.depth-(T+.5*d)<g&&(p+=g-(p-s.depth-(T+.5*d))),T-.5*d-(u.height-m)<g&&(m+=g-(T-.5*d-(u.height-m)));var b=-(T-.5*d);y=yn({positionType:"individualShift",children:[{type:"elem",elem:u,shift:m},{type:"elem",elem:h,shift:b},{type:"elem",elem:s,shift:-p}]})}else{var v=p-s.depth-(u.height-m);v<g&&(p+=.5*(g-v),m+=.5*(g-v)),y=yn({positionType:"individualShift",children:[{type:"elem",elem:u,shift:m},{type:"elem",elem:s,shift:-p}]})}a=e.havingStyle(r),y.height*=a.sizeMultiplier/e.sizeMultiplier,y.depth*=a.sizeMultiplier/e.sizeMultiplier;var w;r.size===Ir.DISPLAY.size?w=e.fontMetrics().delim1:r.size===Ir.SCRIPTSCRIPT.size?w=e.havingStyle(Ir.SCRIPT).fontMetrics().delim2:w=e.fontMetrics().delim2;var C,S;return t.leftDelim==null?C=HC(e,["mopen"]):C=c$(t.leftDelim,w,!0,e.havingStyle(r),t.mode,["mopen"]),t.continued?S=St([]):t.rightDelim==null?S=HC(e,["mclose"]):S=c$(t.rightDelim,w,!0,e.havingStyle(r),t.mode,["mclose"]),St(["mord"].concat(a.sizingClasses(e)),[C,St(["mfrac"],[y]),S],e)},rrt=(t,e)=>{var r=new Lt("mfrac",[Dn(t.numer,e),Dn(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=fi(t.barSize,e);r.setAttribute("linethickness",Mt(n))}if(t.leftDelim!=null||t.rightDelim!=null){var i=[];if(t.leftDelim!=null){var a=new Lt("mo",[new Yi(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(r),t.rightDelim!=null){var s=new Lt("mo",[new Yi(t.rightDelim.replace("\\",""))]);s.setAttribute("fence","true"),i.push(s)}return WV(i)}return r},Bge=(t,e)=>{if(!e)return t;var r={type:"styling",mode:t.mode,style:e,body:[t]};return r};Pt({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=e[1],s,o=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,o="(",l=")";break;case"\\\\bracefrac":s=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":s=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=n==="\\cfrac",h=null;return u||n.startsWith("\\d")?h="display":n.startsWith("\\t")&&(h="text"),Bge({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:u,hasBarLine:s,leftDelim:o,rightDelim:l,barSize:null},h)},htmlBuilder:trt,mathmlBuilder:rrt});Pt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:r,token:n}=t,i;switch(r){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var $Z=["display","text","script","scriptscript"],PZ=function(e){var r=null;return e.length>0&&(r=e,r=r==="."?null:r),r};Pt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:r}=t,n=e[4],i=e[5],a=jA(e[0]),s=a.type==="atom"&&a.family==="open"?PZ(a.text):null,o=jA(e[1]),l=o.type==="atom"&&o.family==="close"?PZ(o.text):null,u=Pr(e[2],"size"),h,d=null;u.isBlank?h=!0:(d=u.value,h=d.number>0);var f=null,p=e[3];if(p.type==="ordgroup"){if(p.body.length>0){var g=Pr(p.body[0],"textord");f=$Z[Number(g.text)]}}else p=Pr(p,"textord"),f=$Z[Number(p.text)];return Bge({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:s,rightDelim:l},f)}});Pt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:r,funcName:n,token:i}=t;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:Pr(e[0],"size").value,token:i}}});Pt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0],a=Pr(e[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var s=e[2],o=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null}}});var Fge=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?vn(t.sup,e.havingStyle(r.sup()),e):vn(t.sub,e.havingStyle(r.sub()),e),i=Pr(t.base,"horizBrace")):i=Pr(t,"horizBrace");var a=vn(i.base,e.havingBaseStyle(Ir.DISPLAY)),s=RR(i,e),o;if(i.isOver?o=yn({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):o=yn({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),n){var l=St(["minner",i.isOver?"mover":"munder"],[o],e);i.isOver?o=yn({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):o=yn({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return St(["minner",i.isOver?"mover":"munder"],[o],e)},nrt=(t,e)=>{var r=_R(t.label);return new Lt(t.isOver?"mover":"munder",[Dn(t.base,e),r])};Pt({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(t,e){var{parser:r,funcName:n}=t;return{type:"horizBrace",mode:r.mode,label:n,isOver:n.includes("\\over"),base:e[0]}},htmlBuilder:Fge,mathmlBuilder:nrt});Pt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=Pr(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:Ui(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=la(t.body,e,!1);return mtt(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=of(t.body,e);return r instanceof Lt||(r=new Lt("mrow",[r])),r.setAttribute("href",t.href),r}});Pt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=Pr(e[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var i=[],a=0;a<n.length;a++){var s=n[a];s==="~"&&(s="\\textasciitilde"),i.push({type:"textord",mode:"text",text:s})}var o={type:"text",mode:r.mode,font:"\\texttt",body:i};return{type:"href",mode:r.mode,href:n,body:Ui(o)}}});Pt({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(t,e){var{parser:r}=t;return{type:"hbox",mode:r.mode,body:Ui(e[0])}},htmlBuilder(t,e){var r=la(t.body,e.withFont(""),!1);return Fh(r)},mathmlBuilder(t,e){return new Lt("mrow",Uo(t.body,e.withFont("")))}});Pt({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n,token:i}=t,a=Pr(e[0],"raw").string,s=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(n){case"\\htmlClass":l.class=a,o={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,o={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,o={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var u=a.split(","),h=0;h<u.length;h++){var d=u[h],f=d.indexOf("=");if(f<0)throw new _t("\\htmlData key/value '"+d+"' missing equals sign");var p=d.slice(0,f),g=d.slice(f+1);l["data-"+p.trim()]=g}o={command:"\\htmlData",attributes:l};break}default:throw new Error("Unrecognized html command")}return r.settings.isTrusted(o)?{type:"html",mode:r.mode,attributes:l,body:Ui(s)}:r.formatUnsupportedCmd(n)},htmlBuilder:(t,e)=>{var r=la(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=St(n,r,e);for(var a in t.attributes)a!=="class"&&t.attributes.hasOwnProperty(a)&&i.setAttribute(a,t.attributes[a]);return i},mathmlBuilder:(t,e)=>of(t.body,e)});Pt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"htmlmathml",mode:r.mode,html:Ui(e[0]),mathml:Ui(e[1])}},htmlBuilder:(t,e)=>{var r=la(t.html,e,!1);return Fh(r)},mathmlBuilder:(t,e)=>of(t.mathml,e)});var gI=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!r)throw new _t("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(r[1]+r[2]),unit:r[3]};if(!tge(n))throw new _t("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Pt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,r)=>{var{parser:n}=t,i={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(r[0])for(var l=Pr(r[0],"raw").string,u=l.split(","),h=0;h<u.length;h++){var d=u[h].split("=");if(d.length===2){var f=d[1].trim();switch(d[0].trim()){case"alt":o=f;break;case"width":i=gI(f);break;case"height":a=gI(f);break;case"totalheight":s=gI(f);break;default:throw new _t("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var p=Pr(e[0],"url").url;return o===""&&(o=p,o=o.replace(/^.*[\\/]/,""),o=o.substring(0,o.lastIndexOf("."))),n.settings.isTrusted({command:"\\includegraphics",url:p})?{type:"includegraphics",mode:n.mode,alt:o,width:i,height:a,totalheight:s,src:p}:n.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(t,e)=>{var r=fi(t.height,e),n=0;t.totalheight.number>0&&(n=fi(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=fi(t.width,e));var a={height:Mt(r+n)};i>0&&(a.width=Mt(i)),n>0&&(a.verticalAlign=Mt(-n));var s=new att(t.src,t.alt,a);return s.height=r,s.depth=n,s},mathmlBuilder:(t,e)=>{var r=new Lt("mglyph",[]);r.setAttribute("alt",t.alt);var n=fi(t.height,e),i=0;if(t.totalheight.number>0&&(i=fi(t.totalheight,e)-n,r.setAttribute("valign",Mt(-i))),r.setAttribute("height",Mt(n+i)),t.width.number>0){var a=fi(t.width,e);r.setAttribute("width",Mt(a))}return r.setAttribute("src",t.src),r}});Pt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=Pr(e[0],"size");if(r.settings.strict){var a=n[1]==="m",s=i.value.unit==="mu";a?(s||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):s&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:i.value}},htmlBuilder(t,e){return lge(t.dimension,e)},mathmlBuilder(t,e){var r=fi(t.dimension,e);return new pge(r)}});Pt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:i}},htmlBuilder:(t,e)=>{var r;t.alignment==="clap"?(r=St([],[vn(t.body,e)]),r=St(["inner"],[r],e)):r=St(["inner"],[vn(t.body,e)]);var n=St(["fix"],[]),i=St([t.alignment],[r,n],e),a=St(["strut"]);return a.style.height=Mt(i.height+i.depth),i.depth&&(a.style.verticalAlign=Mt(-i.depth)),i.children.unshift(a),i=St(["thinbox"],[i],e),St(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new Lt("mpadded",[Dn(t.body,e)]);if(t.alignment!=="rlap"){var n=t.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}});Pt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:r,parser:n}=t,i=n.mode;n.switchMode("math");var a=r==="\\("?"\\)":"$",s=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",resetFont:!0,body:s}}});Pt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new _t("Mismatched "+t.funcName)}});var BZ=(t,e)=>{switch(e.style.size){case Ir.DISPLAY.size:return t.display;case Ir.TEXT.size:return t.text;case Ir.SCRIPT.size:return t.script;case Ir.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};Pt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:r}=t;return{type:"mathchoice",mode:r.mode,display:Ui(e[0]),text:Ui(e[1]),script:Ui(e[2]),scriptscript:Ui(e[3])}},htmlBuilder:(t,e)=>{var r=BZ(t,e),n=la(r,e,!1);return Fh(n)},mathmlBuilder:(t,e)=>{var r=BZ(t,e);return of(r,e)}});var zge=(t,e,r,n,i,a,s)=>{t=St([],[t]);var o=r&&Ph(r),l,u;if(e){var h=vn(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=vn(r,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var f;if(u&&l){var p=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+s;f=yn({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Mt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Mt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(l){var g=t.height-s;f=yn({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Mt(-a)},{type:"kern",size:l.kern},{type:"elem",elem:t}]})}else if(u){var m=t.depth+s;f=yn({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Mt(a)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else return t;var y=[f];if(l&&a!==0&&!o){var v=St(["mspace"],[],n);v.style.marginRight=Mt(a),y.unshift(v)}return St(["mop","op-limits"],y,n)},Vge=new Set(["\\smallint"]),Sx=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Pr(t.base,"op"),i=!0):a=Pr(t,"op");var s=e.style,o=!1;s.size===Ir.DISPLAY.size&&a.symbol&&!Vge.has(a.name)&&(o=!0);var l,u;if(a.symbol){var h=o?"Size2-Regular":"Size1-Regular",d="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(d=a.name.slice(1),a.name=d==="oiint"?"\\iint":"\\iiint"),l=Ls(a.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,d.length>0){var f=uge(d+"Size"+(o?"2":"1"),e);l=yn({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:o?.08:0}]}),a.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(a.body){var p=la(a.body,e,!0);p.length===1&&p[0]instanceof zo?(l=p[0],l.classes[0]="mop"):l=St(["mop"],p,e)}else{for(var g=[],m=1;m<a.name.length;m++)g.push(VV(a.name[m],a.mode,e));l=St(["mop"],g,e)}var y=0,v=0;if((l instanceof zo||a.name==="\\oiint"||a.name==="\\oiiint")&&!a.suppressBaseShift){var T;y=(l.height-l.depth)/2-e.fontMetrics().axisHeight,v=(T=l.italic)!=null?T:0}return i?zge(l,r,n,e,s,v,y):(y&&(l.style.position="relative",l.style.top=Mt(y)),l)},aS=(t,e)=>{var r;if(t.symbol)r=new Lt("mo",[xl(t.name,t.mode)]),Vge.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new Lt("mo",Uo(t.body,e));else{r=new Lt("mi",[new Yi(t.name.slice(1))]);var n=new Lt("mo",[xl("⁡","text")]);t.parentIsSupSub?r=new Lt("mrow",[r,n]):r=fge([r,n])}return r},irt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Pt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=n;return i.length===1&&(i=irt[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:Sx,mathmlBuilder:aS});Pt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Ui(n)}},htmlBuilder:Sx,mathmlBuilder:aS});var art={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Pt({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:Sx,mathmlBuilder:aS});Pt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:r}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:Sx,mathmlBuilder:aS});Pt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(t){var{parser:e,funcName:r}=t,n=r;return n.length===1&&(n=art[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:Sx,mathmlBuilder:aS});var Gge=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=Pr(t.base,"operatorname"),i=!0):a=Pr(t,"operatorname");var s;if(a.body.length>0){for(var o=a.body.map(d=>{var f="text"in d?d.text:void 0;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=la(o,e.withFont("mathrm"),!0),u=0;u<l.length;u++){var h=l[u];h instanceof zo&&(h.text=h.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}s=St(["mop"],l,e)}else s=St(["mop"],[],e);return i?zge(s,r,n,e,e.style,0,0):s},srt=(t,e)=>{for(var r=Uo(t.body,e.withFont("mathrm")),n=!0,i=0;i<r.length;i++){var a=r[i];if(!(a instanceof pge))if(a instanceof Lt)switch(a.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":{var s=a.children[0];a.children.length===1&&s instanceof Yi?s.text=s.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):n=!1;break}default:n=!1}else n=!1}if(n){var o=r.map(h=>h.toText()).join("");r=[new Yi(o)]}var l=new Lt("mi",r);l.setAttribute("mathvariant","normal");var u=new Lt("mo",[xl("⁡","text")]);return t.parentIsSupSub?new Lt("mrow",[l,u]):fge([l,u])};Pt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:r,funcName:n}=t,i=e[0];return{type:"operatorname",mode:r.mode,body:Ui(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Gge,mathmlBuilder:srt});we("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");og({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?Fh(la(t.body,e,!1)):St(["mord"],la(t.body,e,!0),e)},mathmlBuilder(t,e){return of(t.body,e,!0)}});Pt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:r}=t,n=e[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(t,e){var r=vn(t.body,e.havingCrampedStyle()),n=Db("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=yn({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return St(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new Lt("mo",[new Yi("‾")]);r.setAttribute("stretchy","true");var n=new Lt("mover",[Dn(t.body,e),r]);return n.setAttribute("accent","true"),n}});Pt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"phantom",mode:r.mode,body:Ui(n)}},htmlBuilder:(t,e)=>{var r=la(t.body,e.withPhantom(),!1);return Fh(r)},mathmlBuilder:(t,e)=>{var r=Uo(t.body,e);return new Lt("mphantom",r)}});we("\\hphantom","\\smash{\\phantom{#1}}");Pt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(t,e)=>{var r=St(["inner"],[vn(t.body,e.withPhantom())]),n=St(["fix"],[]);return St(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=Uo(Ui(t.body),e),n=new Lt("mphantom",r),i=new Lt("mpadded",[n]);return i.setAttribute("width","0px"),i}});Pt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:r}=t,n=Pr(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=vn(t.body,e),n=fi(t.dy,e);return yn({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new Lt("mpadded",[Dn(t.body,e)]),n=t.dy.number+t.dy.unit;return r.setAttribute("voffset",n),r}});Pt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});Pt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,r){var{parser:n}=t,i=r[0],a=Pr(e[0],"size"),s=Pr(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&Pr(i,"size").value,width:a.value,height:s.value}},htmlBuilder(t,e){var r=St(["mord","rule"],[],e),n=fi(t.width,e),i=fi(t.height,e),a=t.shift?fi(t.shift,e):0;return r.style.borderRightWidth=Mt(n),r.style.borderTopWidth=Mt(i),r.style.bottom=Mt(a),r.width=n,r.height=i+a,r.depth=-a,r.maxFontSize=i*1.125*e.sizeMultiplier,r},mathmlBuilder(t,e){var r=fi(t.width,e),n=fi(t.height,e),i=t.shift?fi(t.shift,e):0,a=e.color&&e.getColor()||"black",s=new Lt("mspace");s.setAttribute("mathbackground",a),s.setAttribute("width",Mt(r)),s.setAttribute("height",Mt(n));var o=new Lt("mpadded",[s]);return i>=0?o.setAttribute("height",Mt(i)):(o.setAttribute("height",Mt(i)),o.setAttribute("depth",Mt(-i))),o.setAttribute("voffset",Mt(i)),o}});function Wge(t,e,r){for(var n=la(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a<n.length;a++){var s=n[a].classes.indexOf("sizing");s<0?Array.prototype.push.apply(n[a].classes,e.sizingClasses(r)):n[a].classes[s+1]==="reset-size"+e.size&&(n[a].classes[s+1]="reset-size"+r.size),n[a].height*=i,n[a].depth*=i}return Fh(n)}var FZ=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],ort=(t,e)=>{var r=e.havingSize(t.size);return Wge(t.body,r,e)};Pt({type:"sizing",names:FZ,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!1,r);return{type:"sizing",mode:i.mode,size:FZ.indexOf(n)+1,body:a}},htmlBuilder:ort,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=Uo(t.body,r),i=new Lt("mstyle",n);return i.setAttribute("mathsize",Mt(r.sizeMultiplier)),i}});Pt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,r)=>{var{parser:n}=t,i=!1,a=!1,s=r[0]&&Pr(r[0],"ordgroup");if(s)for(var o,l=0;l<s.body.length;++l){var u=s.body[l];if(o=LR(u).text,o==="t")i=!0;else if(o==="b")a=!0;else{i=!1,a=!1;break}}else i=!0,a=!0;var h=e[0];return{type:"smash",mode:n.mode,body:h,smashHeight:i,smashDepth:a}},htmlBuilder:(t,e)=>{var r=St([],[vn(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return r;if(t.smashHeight&&(r.height=0),t.smashDepth&&(r.depth=0),t.smashHeight&&t.smashDepth)return St(["mord","smash"],[r],e);if(r.children)for(var n=0;n<r.children.length;n++)t.smashHeight&&(r.children[n].height=0),t.smashDepth&&(r.children[n].depth=0);var i=yn({positionType:"firstBaseline",children:[{type:"elem",elem:r}]});return St(["mord"],[i],e)},mathmlBuilder:(t,e)=>{var r=new Lt("mpadded",[Dn(t.body,e)]);return t.smashHeight&&r.setAttribute("height","0px"),t.smashDepth&&r.setAttribute("depth","0px"),r}});Pt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,r){var{parser:n}=t,i=r[0],a=e[0];return{type:"sqrt",mode:n.mode,body:a,index:i}},htmlBuilder(t,e){var r=vn(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=Ob(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.id<Ir.TEXT.id&&(a=e.fontMetrics().xHeight);var s=i+a/4,o=r.height+r.depth+s+i,{span:l,ruleWidth:u,advanceWidth:h}=Ytt(o,e),d=l.height-u;d>r.height+r.depth+s&&(s=(s+d-r.height-r.depth)/2);var f=l.height-r.height-s-u;r.style.paddingLeft=Mt(h);var p=yn({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+f)},{type:"elem",elem:l},{type:"kern",size:u}]});if(t.index){var g=e.havingStyle(Ir.SCRIPTSCRIPT),m=vn(t.index,g,e),y=.6*(p.height-p.depth),v=yn({positionType:"shift",positionData:-y,children:[{type:"elem",elem:m}]}),T=St(["root"],[v]);return St(["mord","sqrt"],[T,p],e)}else return St(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new Lt("mroot",[Dn(r,e),Dn(n,e)]):new Lt("msqrt",[Dn(r,e)])}});var u$={display:Ir.DISPLAY,text:Ir.TEXT,script:Ir.SCRIPT,scriptscript:Ir.SCRIPTSCRIPT};function lrt(t){return t in u$}Pt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:r,funcName:n,parser:i}=t,a=i.parseExpression(!0,r),s=n.slice(1,n.length-5);if(!lrt(s))throw new Error("Unknown style: "+s);return{type:"styling",mode:i.mode,style:s,body:a}},htmlBuilder(t,e){var r=u$[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),Wge(t.body,n,e)},mathmlBuilder(t,e){var r=u$[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=Uo(t.body,n),a=new Lt("mstyle",i),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=s[t.style];return a.setAttribute("scriptlevel",o[0]),a.setAttribute("displaystyle",o[1]),a}});var crt=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===Ir.DISPLAY.size||n.alwaysHandleSupSub);return i?Sx:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===Ir.DISPLAY.size||n.limits);return a?Gge:null}else{if(n.type==="accent")return Ph(n.base)?qV:null;if(n.type==="horizBrace"){var s=!e.sub;return s===n.isOver?Fge:null}else return null}else return null};og({type:"supsub",htmlBuilder(t,e){var r=crt(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,s=vn(n,e),o,l,u=e.fontMetrics(),h=0,d=0,f=n&&Ph(n);if(i){var p=e.havingStyle(e.style.sup());o=vn(i,p,e),f||(h=s.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=vn(a,g,e),f||(d=s.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===Ir.DISPLAY?m=u.sup1:e.style.cramped?m=u.sup3:m=u.sup2;var y=e.sizeMultiplier,v=Mt(.5/u.ptPerEm/y),T=null;if(l){var b=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");if(s instanceof zo||b){var w;T=Mt(-((w=s.italic)!=null?w:0))}}var C;if(o&&l){h=Math.max(h,m,o.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var S=u.defaultRuleThickness,k=4*S;if(h-o.depth-(l.height-d)<k){d=k-(h-o.depth)+l.height;var E=.8*u.xHeight-(h-o.depth);E>0&&(h+=E,d-=E)}var _=[{type:"elem",elem:l,shift:d,marginRight:v,marginLeft:T},{type:"elem",elem:o,shift:-h,marginRight:v}];C=yn({positionType:"individualShift",children:_})}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var M=[{type:"elem",elem:l,marginLeft:T,marginRight:v}];C=yn({positionType:"shift",positionData:d,children:M})}else if(o)h=Math.max(h,m,o.depth+.25*u.xHeight),C=yn({positionType:"shift",positionData:-h,children:[{type:"elem",elem:o,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var L=a$(s,"right")||"mord";return St([L],[s,St(["msupsub"],[C])],e)},mathmlBuilder(t,e){var r=!1,n,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(r=!0,n=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var a=[Dn(t.base,e)];t.sub&&a.push(Dn(t.sub,e)),t.sup&&a.push(Dn(t.sup,e));var s;if(r)s=n?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===Ir.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===Ir.DISPLAY||u.limits)?s="munderover":s="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===Ir.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Ir.DISPLAY)?s="munder":s="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===Ir.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===Ir.DISPLAY)?s="mover":s="msup"}return new Lt(s,a)}});og({type:"atom",htmlBuilder(t,e){return VV(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new Lt("mo",[xl(t.text,t.mode)]);if(t.family==="bin"){var n=HV(t,e);n==="bold-italic"&&r.setAttribute("mathvariant",n)}else t.family==="punct"?r.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&r.setAttribute("stretchy","false");return r}});var Hge={mi:"italic",mn:"normal",mtext:"normal"};og({type:"mathord",htmlBuilder(t,e){return AR(t,e,"mathord")},mathmlBuilder(t,e){var r=new Lt("mi",[xl(t.text,t.mode,e)]),n=HV(t,e)||"italic";return n!==Hge[r.type]&&r.setAttribute("mathvariant",n),r}});og({type:"textord",htmlBuilder(t,e){return AR(t,e,"textord")},mathmlBuilder(t,e){var r=xl(t.text,t.mode,e),n=HV(t,e)||"normal",i;return t.mode==="text"?i=new Lt("mtext",[r]):/[0-9]/.test(t.text)?i=new Lt("mn",[r]):t.text==="\\prime"?i=new Lt("mo",[r]):i=new Lt("mi",[r]),n!==Hge[i.type]&&i.setAttribute("mathvariant",n),i}});var mI={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},yI={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};og({type:"spacing",htmlBuilder(t,e){if(yI.hasOwnProperty(t.text)){var r=yI[t.text].className||"";if(t.mode==="text"){var n=AR(t,e,"textord");return n.classes.push(r),n}else return St(["mspace",r],[VV(t.text,t.mode,e)],e)}else{if(mI.hasOwnProperty(t.text))return St(["mspace",mI[t.text]],[],e);throw new _t('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(yI.hasOwnProperty(t.text))r=new Lt("mtext",[new Yi(" ")]);else{if(mI.hasOwnProperty(t.text))return new Lt("mspace");throw new _t('Unknown type of space "'+t.text+'"')}return r}});var zZ=()=>{var t=new Lt("mtd",[]);return t.setAttribute("width","50%"),t};og({type:"tag",mathmlBuilder(t,e){var r=new Lt("mtable",[new Lt("mtr",[zZ(),new Lt("mtd",[of(t.body,e)]),zZ(),new Lt("mtd",[of(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var VZ={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},GZ={"\\textbf":"textbf","\\textmd":"textmd"},urt={"\\textit":"textit","\\textup":"textup"},WZ=(t,e)=>{var r=t.font;if(r){if(VZ[r])return e.withTextFontFamily(VZ[r]);if(GZ[r])return e.withTextFontWeight(GZ[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(urt[r])};Pt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:r,funcName:n}=t,i=e[0];return{type:"text",mode:r.mode,body:Ui(i),font:n}},htmlBuilder(t,e){var r=WZ(t,e),n=la(t.body,r,!0);return St(["mord","text"],n,r)},mathmlBuilder(t,e){var r=WZ(t,e);return of(t.body,r)}});Pt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"underline",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=vn(t.body,e),n=Db("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=yn({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return St(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new Lt("mo",[new Yi("‾")]);r.setAttribute("stretchy","true");var n=new Lt("munder",[Dn(t.body,e),r]);return n.setAttribute("accentunder","true"),n}});Pt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:r}=t;return{type:"vcenter",mode:r.mode,body:e[0]}},htmlBuilder(t,e){var r=vn(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return yn({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new Lt("mpadded",[Dn(t.body,e)],["vcenter"]);return new Lt("mrow",[r])}});Pt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,r){throw new _t("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var r=HZ(t),n=[],i=e.havingStyle(e.style.text()),a=0;a<r.length;a++){var s=r[a];s==="~"&&(s="\\textasciitilde"),n.push(Ls(s,"Typewriter-Regular",t.mode,i,["mord","texttt"]))}return St(["mord","text"].concat(i.sizingClasses(e)),oge(n),i)},mathmlBuilder(t,e){var r=new Yi(HZ(t)),n=new Lt("mtext",[r]);return n.setAttribute("mathvariant","monospace"),n}});var HZ=t=>t.body.replace(/ /g,t.star?"␣":" "),Md=hge,qge=`[ \r
]`,hrt="\\\\[a-zA-Z@]+",drt="\\\\[^\uD800-\uDFFF]",frt="("+hrt+")"+qge+"*",prt=`\\\\(
|[ \r ]+
?)[ \r ]*`,h$="[̀-ͯ]",grt=new RegExp(h$+"+$"),mrt="("+qge+"+)|"+(prt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(h$+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(h$+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+frt)+("|"+drt+")");let qZ=class{constructor(e,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=r,this.tokenRegex=new RegExp(mrt,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,r){this.catcodes[e]=r}lex(){var e=this.input,r=this.tokenRegex.lastIndex;if(r===e.length)return new $o("EOF",new co(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new _t("Unexpected character: '"+e[r]+"'",new $o(e[r],new co(this,r,r+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=e.indexOf(`
`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new $o(i,new co(this,r,this.tokenRegex.lastIndex))}};class yrt{constructor(e,r){e===void 0&&(e={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new _t("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var r in e)e.hasOwnProperty(r)&&(e[r]==null?delete this.current[r]:this.current[r]=e[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,r,n){if(n===void 0&&(n=!1),n){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=r)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}r==null?delete this.current[e]:this.current[e]=r}}var vrt=Dge;we("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});we("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});we("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});we("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});we("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var r=t.future();return e[0].length===1&&e[0][0].text===r.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});we("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");we("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var UZ={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};we("\\char",function(t){var e=t.popToken(),r,n=0;if(e.text==="'")r=8,e=t.popToken();else if(e.text==='"')r=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new _t("\\char` missing argument");n=e.text.charCodeAt(0)}else r=10;if(r){if(n=UZ[e.text],n==null||n>=r)throw new _t("Invalid base-"+r+" digit "+e.text);for(var i;(i=UZ[t.future().text])!=null&&i<r;)n*=r,n+=i,t.popToken()}return"\\@char{"+n+"}"});var jV=(t,e,r,n)=>{var i=t.consumeArg().tokens;if(i.length!==1)throw new _t("\\newcommand's first argument must be a macro name");var a=i[0].text,s=t.isDefined(a);if(s&&!e)throw new _t("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!s&&!r)throw new _t("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var o=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=t.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new _t("Invalid number of arguments: "+l);o=parseInt(l),i=t.consumeArg().tokens}return s&&n||t.macros.set(a,{tokens:i,numArgs:o}),""};we("\\newcommand",t=>jV(t,!1,!0,!1));we("\\renewcommand",t=>jV(t,!0,!1,!1));we("\\providecommand",t=>jV(t,!0,!0,!0));we("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""});we("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""});we("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),Md[r],li.math[r],li.text[r]),""});we("\\bgroup","{");we("\\egroup","}");we("~","\\nobreakspace");we("\\lq","`");we("\\rq","'");we("\\aa","\\r a");we("\\AA","\\r A");we("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");we("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");we("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");we("ℬ","\\mathscr{B}");we("ℰ","\\mathscr{E}");we("ℱ","\\mathscr{F}");we("ℋ","\\mathscr{H}");we("ℐ","\\mathscr{I}");we("ℒ","\\mathscr{L}");we("ℳ","\\mathscr{M}");we("ℛ","\\mathscr{R}");we("ℭ","\\mathfrak{C}");we("ℌ","\\mathfrak{H}");we("ℨ","\\mathfrak{Z}");we("\\Bbbk","\\Bbb{k}");we("\\llap","\\mathllap{\\textrm{#1}}");we("\\rlap","\\mathrlap{\\textrm{#1}}");we("\\clap","\\mathclap{\\textrm{#1}}");we("\\mathstrut","\\vphantom{(}");we("\\underbar","\\underline{\\text{#1}}");we("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');we("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");we("\\ne","\\neq");we("≠","\\neq");we("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");we("∉","\\notin");we("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");we("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");we("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");we("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");we("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");we("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");we("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");we("⟂","\\perp");we("‼","\\mathclose{!\\mkern-0.8mu!}");we("∌","\\notni");we("⌜","\\ulcorner");we("⌝","\\urcorner");we("⌞","\\llcorner");we("⌟","\\lrcorner");we("©","\\copyright");we("®","\\textregistered");we("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');we("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');we("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');we("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');we("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");we("⋮","\\vdots");we("\\varGamma","\\mathit{\\Gamma}");we("\\varDelta","\\mathit{\\Delta}");we("\\varTheta","\\mathit{\\Theta}");we("\\varLambda","\\mathit{\\Lambda}");we("\\varXi","\\mathit{\\Xi}");we("\\varPi","\\mathit{\\Pi}");we("\\varSigma","\\mathit{\\Sigma}");we("\\varUpsilon","\\mathit{\\Upsilon}");we("\\varPhi","\\mathit{\\Phi}");we("\\varPsi","\\mathit{\\Psi}");we("\\varOmega","\\mathit{\\Omega}");we("\\substack","\\begin{subarray}{c}#1\\end{subarray}");we("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");we("\\boxed","\\fbox{$\\displaystyle{#1}$}");we("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");we("\\implies","\\DOTSB\\;\\Longrightarrow\\;");we("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");we("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");we("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var YZ={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},brt=new Set(["bin","rel"]);we("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in YZ?e=YZ[r]:(r.slice(0,4)==="\\not"||r in li.math&&brt.has(li.math[r].group))&&(e="\\dotsb"),e});var KV={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};we("\\dotso",function(t){var e=t.future().text;return e in KV?"\\ldots\\,":"\\ldots"});we("\\dotsc",function(t){var e=t.future().text;return e in KV&&e!==","?"\\ldots\\,":"\\ldots"});we("\\cdots",function(t){var e=t.future().text;return e in KV?"\\@cdots\\,":"\\@cdots"});we("\\dotsb","\\cdots");we("\\dotsm","\\cdots");we("\\dotsi","\\!\\cdots");we("\\dotsx","\\ldots\\,");we("\\DOTSI","\\relax");we("\\DOTSB","\\relax");we("\\DOTSX","\\relax");we("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");we("\\,","\\tmspace+{3mu}{.1667em}");we("\\thinspace","\\,");we("\\>","\\mskip{4mu}");we("\\:","\\tmspace+{4mu}{.2222em}");we("\\medspace","\\:");we("\\;","\\tmspace+{5mu}{.2777em}");we("\\thickspace","\\;");we("\\!","\\tmspace-{3mu}{.1667em}");we("\\negthinspace","\\!");we("\\negmedspace","\\tmspace-{4mu}{.2222em}");we("\\negthickspace","\\tmspace-{5mu}{.277em}");we("\\enspace","\\kern.5em ");we("\\enskip","\\hskip.5em\\relax");we("\\quad","\\hskip1em\\relax");we("\\qquad","\\hskip2em\\relax");we("\\tag","\\@ifstar\\tag@literal\\tag@paren");we("\\tag@paren","\\tag@literal{({#1})}");we("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new _t("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});we("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");we("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");we("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");we("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");we("\\newline","\\\\\\relax");we("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Uge=Mt(Bc["Main-Regular"][84][1]-.7*Bc["Main-Regular"][65][1]);we("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Uge+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");we("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Uge+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");we("\\hspace","\\@ifstar\\@hspacer\\@hspace");we("\\@hspace","\\hskip #1\\relax");we("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");we("\\ordinarycolon",":");we("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");we("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');we("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');we("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');we("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');we("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');we("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');we("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');we("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');we("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');we("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');we("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');we("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');we("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');we("∷","\\dblcolon");we("∹","\\eqcolon");we("≔","\\coloneqq");we("≕","\\eqqcolon");we("⩴","\\Coloneqq");we("\\ratio","\\vcentcolon");we("\\coloncolon","\\dblcolon");we("\\colonequals","\\coloneqq");we("\\coloncolonequals","\\Coloneqq");we("\\equalscolon","\\eqqcolon");we("\\equalscoloncolon","\\Eqqcolon");we("\\colonminus","\\coloneq");we("\\coloncolonminus","\\Coloneq");we("\\minuscolon","\\eqcolon");we("\\minuscoloncolon","\\Eqcolon");we("\\coloncolonapprox","\\Colonapprox");we("\\coloncolonsim","\\Colonsim");we("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");we("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");we("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");we("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");we("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");we("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");we("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");we("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");we("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");we("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");we("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");we("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");we("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");we("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");we("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");we("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");we("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");we("\\nleqq","\\html@mathml{\\@nleqq}{≰}");we("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");we("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");we("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");we("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");we("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");we("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");we("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");we("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");we("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");we("\\imath","\\html@mathml{\\@imath}{ı}");we("\\jmath","\\html@mathml{\\@jmath}{ȷ}");we("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");we("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");we("⟦","\\llbracket");we("⟧","\\rrbracket");we("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");we("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");we("⦃","\\lBrace");we("⦄","\\rBrace");we("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");we("⦵","\\minuso");we("\\darr","\\downarrow");we("\\dArr","\\Downarrow");we("\\Darr","\\Downarrow");we("\\lang","\\langle");we("\\rang","\\rangle");we("\\uarr","\\uparrow");we("\\uArr","\\Uparrow");we("\\Uarr","\\Uparrow");we("\\N","\\mathbb{N}");we("\\R","\\mathbb{R}");we("\\Z","\\mathbb{Z}");we("\\alef","\\aleph");we("\\alefsym","\\aleph");we("\\Alpha","\\mathrm{A}");we("\\Beta","\\mathrm{B}");we("\\bull","\\bullet");we("\\Chi","\\mathrm{X}");we("\\clubs","\\clubsuit");we("\\cnums","\\mathbb{C}");we("\\Complex","\\mathbb{C}");we("\\Dagger","\\ddagger");we("\\diamonds","\\diamondsuit");we("\\empty","\\emptyset");we("\\Epsilon","\\mathrm{E}");we("\\Eta","\\mathrm{H}");we("\\exist","\\exists");we("\\harr","\\leftrightarrow");we("\\hArr","\\Leftrightarrow");we("\\Harr","\\Leftrightarrow");we("\\hearts","\\heartsuit");we("\\image","\\Im");we("\\infin","\\infty");we("\\Iota","\\mathrm{I}");we("\\isin","\\in");we("\\Kappa","\\mathrm{K}");we("\\larr","\\leftarrow");we("\\lArr","\\Leftarrow");we("\\Larr","\\Leftarrow");we("\\lrarr","\\leftrightarrow");we("\\lrArr","\\Leftrightarrow");we("\\Lrarr","\\Leftrightarrow");we("\\Mu","\\mathrm{M}");we("\\natnums","\\mathbb{N}");we("\\Nu","\\mathrm{N}");we("\\Omicron","\\mathrm{O}");we("\\plusmn","\\pm");we("\\rarr","\\rightarrow");we("\\rArr","\\Rightarrow");we("\\Rarr","\\Rightarrow");we("\\real","\\Re");we("\\reals","\\mathbb{R}");we("\\Reals","\\mathbb{R}");we("\\Rho","\\mathrm{P}");we("\\sdot","\\cdot");we("\\sect","\\S");we("\\spades","\\spadesuit");we("\\sub","\\subset");we("\\sube","\\subseteq");we("\\supe","\\supseteq");we("\\Tau","\\mathrm{T}");we("\\thetasym","\\vartheta");we("\\weierp","\\wp");we("\\Zeta","\\mathrm{Z}");we("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");we("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");we("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");we("\\bra","\\mathinner{\\langle{#1}|}");we("\\ket","\\mathinner{|{#1}\\rangle}");we("\\braket","\\mathinner{\\langle{#1}\\rangle}");we("\\Bra","\\left\\langle#1\\right|");we("\\Ket","\\left|#1\\right\\rangle");var Yge=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,s=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",s),i.length&&f.macros.set("\\|",o));var p=d;if(!d&&i.length){var g=f.future();g.text==="|"&&(f.popToken(),p=!0)}return{tokens:p?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var u=e.consumeArg().tokens,h=e.expandTokens([...a,...u,...r]);return e.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};we("\\bra@ket",Yge(!1));we("\\bra@set",Yge(!0));we("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");we("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");we("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");we("\\angln","{\\angl n}");we("\\blue","\\textcolor{##6495ed}{#1}");we("\\orange","\\textcolor{##ffa500}{#1}");we("\\pink","\\textcolor{##ff00af}{#1}");we("\\red","\\textcolor{##df0030}{#1}");we("\\green","\\textcolor{##28ae7b}{#1}");we("\\gray","\\textcolor{gray}{#1}");we("\\purple","\\textcolor{##9d38bd}{#1}");we("\\blueA","\\textcolor{##ccfaff}{#1}");we("\\blueB","\\textcolor{##80f6ff}{#1}");we("\\blueC","\\textcolor{##63d9ea}{#1}");we("\\blueD","\\textcolor{##11accd}{#1}");we("\\blueE","\\textcolor{##0c7f99}{#1}");we("\\tealA","\\textcolor{##94fff5}{#1}");we("\\tealB","\\textcolor{##26edd5}{#1}");we("\\tealC","\\textcolor{##01d1c1}{#1}");we("\\tealD","\\textcolor{##01a995}{#1}");we("\\tealE","\\textcolor{##208170}{#1}");we("\\greenA","\\textcolor{##b6ffb0}{#1}");we("\\greenB","\\textcolor{##8af281}{#1}");we("\\greenC","\\textcolor{##74cf70}{#1}");we("\\greenD","\\textcolor{##1fab54}{#1}");we("\\greenE","\\textcolor{##0d923f}{#1}");we("\\goldA","\\textcolor{##ffd0a9}{#1}");we("\\goldB","\\textcolor{##ffbb71}{#1}");we("\\goldC","\\textcolor{##ff9c39}{#1}");we("\\goldD","\\textcolor{##e07d10}{#1}");we("\\goldE","\\textcolor{##a75a05}{#1}");we("\\redA","\\textcolor{##fca9a9}{#1}");we("\\redB","\\textcolor{##ff8482}{#1}");we("\\redC","\\textcolor{##f9685d}{#1}");we("\\redD","\\textcolor{##e84d39}{#1}");we("\\redE","\\textcolor{##bc2612}{#1}");we("\\maroonA","\\textcolor{##ffbde0}{#1}");we("\\maroonB","\\textcolor{##ff92c6}{#1}");we("\\maroonC","\\textcolor{##ed5fa6}{#1}");we("\\maroonD","\\textcolor{##ca337c}{#1}");we("\\maroonE","\\textcolor{##9e034e}{#1}");we("\\purpleA","\\textcolor{##ddd7ff}{#1}");we("\\purpleB","\\textcolor{##c6b9fc}{#1}");we("\\purpleC","\\textcolor{##aa87ff}{#1}");we("\\purpleD","\\textcolor{##7854ab}{#1}");we("\\purpleE","\\textcolor{##543b78}{#1}");we("\\mintA","\\textcolor{##f5f9e8}{#1}");we("\\mintB","\\textcolor{##edf2df}{#1}");we("\\mintC","\\textcolor{##e0e5cc}{#1}");we("\\grayA","\\textcolor{##f6f7f7}{#1}");we("\\grayB","\\textcolor{##f0f1f2}{#1}");we("\\grayC","\\textcolor{##e3e5e6}{#1}");we("\\grayD","\\textcolor{##d6d8da}{#1}");we("\\grayE","\\textcolor{##babec2}{#1}");we("\\grayF","\\textcolor{##888d93}{#1}");we("\\grayG","\\textcolor{##626569}{#1}");we("\\grayH","\\textcolor{##3b3e40}{#1}");we("\\grayI","\\textcolor{##21242c}{#1}");we("\\kaBlue","\\textcolor{##314453}{#1}");we("\\kaGreen","\\textcolor{##71B307}{#1}");var Xge={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class xrt{constructor(e,r,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(e),this.macros=new yrt(vrt,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new qZ(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var r,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:r,end:n}=this.consumeArg());return this.pushToken(new $o("EOF",n.loc)),this.pushTokens(i),new $o("",co.range(r,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var r=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),a,s=0,o=0;do{if(a=this.popToken(),r.push(a),a.text==="{")++s;else if(a.text==="}"){if(--s,s===-1)throw new _t("Extra }",a)}else if(a.text==="EOF")throw new _t("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",a);if(e&&n)if((s===0||s===1&&e[o]==="{")&&a.text===e[o]){if(++o,o===e.length){r.splice(-o,o);break}}else o=0}while(s!==0||n);return i.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:i,end:a}}consumeArgs(e,r){if(r){if(r.length!==e+1)throw new _t("The length of delimiters doesn't match the number of args!");for(var n=r[0],i=0;i<n.length;i++){var a=this.popToken();if(n[i]!==a.text)throw new _t("Use of the macro doesn't match its definition",a)}}for(var s=[],o=0;o<e;o++)s.push(this.consumeArg(r&&r[o+1]).tokens);return s}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new _t("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var r=this.popToken(),n=r.text,i=r.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new _t("Undefined control sequence: "+n);return this.pushToken(r),!1}this.countExpansion(1);var a=i.tokens,s=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var o=a.length-1;o>=0;--o){var l=a[o];if(l.text==="#"){if(o===0)throw new _t("Incomplete placeholder at end of macro body",l);if(l=a[--o],l.text==="#")a.splice(o+1,1);else if(/^[1-9]$/.test(l.text))a.splice(o,2,...s[+l.text-1]);else throw new _t("Not a valid argument number",l)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new $o(e)]):void 0}expandTokens(e){var r=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),r.push(i)}return this.countExpansion(r.length),r}expandMacroAsText(e){var r=this.expandMacro(e);return r&&r.map(n=>n.text).join("")}_getExpansion(e){var r=this.macros.get(e);if(r==null)return r;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof r=="function"?r(this):r;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var s=i.replace(/##/g,"");s.includes("#"+(a+1));)++a;for(var o=new qZ(i,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var h={tokens:l,numArgs:a};return h}return i}isDefined(e){return this.macros.has(e)||Md.hasOwnProperty(e)||li.math.hasOwnProperty(e)||li.text.hasOwnProperty(e)||Xge.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:Md.hasOwnProperty(e)&&!Md[e].primitive}}var XZ=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,FE=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),vI={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},jZ={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let jge=class Kge{constructor(e,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new xrt(e,r,this.mode),this.settings=r,this.leftrightDepth=0,this.nextToken=null}expect(e,r){if(r===void 0&&(r=!0),this.fetch().text!==e)throw new _t("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var r=this.nextToken;this.consume(),this.gullet.pushToken(new $o("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,n}parseExpression(e,r){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(Kge.endOfExpression.has(i.text)||r&&i.text===r||e&&Md[i.text]&&Md[i.text].infix)break;var a=this.parseAtom(r);if(a){if(a.type==="internal")continue}else break;n.push(a)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var r=-1,n,i=0;i<e.length;i++){var a=e[i];if(a.type==="infix"){if(r!==-1)throw new _t("only one infix operator per group",a.token);r=i,n=a.replaceWith}}if(r!==-1&&n){var s,o,l=e.slice(0,r),u=e.slice(r+1);l.length===1&&l[0].type==="ordgroup"?s=l[0]:s={type:"ordgroup",mode:this.mode,body:l},u.length===1&&u[0].type==="ordgroup"?o=u[0]:o={type:"ordgroup",mode:this.mode,body:u};var h;return n==="\\\\abovefrac"?h=this.callFunction(n,[s,e[r],o],[]):h=this.callFunction(n,[s,o],[]),[h]}else return e}handleSupSubscript(e){var r=this.fetch(),n=r.text;this.consume(),this.consumeSpaces();var i;do{var a;i=this.parseGroup(e)}while(((a=i)==null?void 0:a.type)==="internal");if(!i)throw new _t("Expected group after '"+n+"'",r);return i}formatUnsupportedCmd(e){for(var r=[],n=0;n<e.length;n++)r.push({type:"textord",mode:"text",text:e[n]});var i={type:"text",mode:this.mode,body:r},a={type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]};return a}parseAtom(e){var r=this.parseGroup("atom",e);if((r==null?void 0:r.type)==="internal"||this.mode==="text")return r;for(var n,i;;){this.consumeSpaces();var a=this.fetch();if(a.text==="\\limits"||a.text==="\\nolimits"){if(r&&r.type==="op"){var s=a.text==="\\limits";r.limits=s,r.alwaysHandleSupSub=!0}else if(r&&r.type==="operatorname")r.alwaysHandleSupSub&&(r.limits=a.text==="\\limits");else throw new _t("Limit controls must follow a math operator",a);this.consume()}else if(a.text==="^"){if(n)throw new _t("Double superscript",a);n=this.handleSupSubscript("superscript")}else if(a.text==="_"){if(i)throw new _t("Double subscript",a);i=this.handleSupSubscript("subscript")}else if(a.text==="'"){if(n)throw new _t("Double superscript",a);var o={type:"textord",mode:this.mode,text:"\\prime"},l=[o];for(this.consume();this.fetch().text==="'";)l.push(o),this.consume();this.fetch().text==="^"&&l.push(this.handleSupSubscript("superscript")),n={type:"ordgroup",mode:this.mode,body:l}}else if(FE[a.text]){var u=XZ.test(a.text),h=[];for(h.push(new $o(FE[a.text])),this.consume();;){var d=this.fetch().text;if(!FE[d]||XZ.test(d)!==u)break;h.unshift(new $o(FE[d])),this.consume()}var f=this.subparse(h);u?i={type:"ordgroup",mode:"math",body:f}:n={type:"ordgroup",mode:"math",body:f}}else break}return n||i?{type:"supsub",mode:this.mode,base:r,sup:n,sub:i}:r}parseFunction(e,r){var n=this.fetch(),i=n.text,a=Md[i];if(!a)return null;if(this.consume(),r&&r!=="atom"&&!a.allowedInArgument)throw new _t("Got function '"+i+"' with no arguments"+(r?" as "+r:""),n);if(this.mode==="text"&&!a.allowedInText)throw new _t("Can't use function '"+i+"' in text mode",n);if(this.mode==="math"&&a.allowedInMath===!1)throw new _t("Can't use function '"+i+"' in math mode",n);var{args:s,optArgs:o}=this.parseArguments(i,a);return this.callFunction(i,s,o,n,e)}callFunction(e,r,n,i,a){var s={funcName:e,parser:this,token:i,breakOnTokenText:a},o=Md[e];if(o&&o.handler)return o.handler(s,r,n);throw new _t("No function handler for "+e)}parseArguments(e,r){var n=r.numArgs+r.numOptionalArgs;if(n===0)return{args:[],optArgs:[]};for(var i=[],a=[],s=0;s<n;s++){var o=r.argTypes&&r.argTypes[s],l=s<r.numOptionalArgs;("primitive"in r&&r.primitive&&o==null||r.type==="sqrt"&&s===1&&a[0]==null)&&(o="primitive");var u=this.parseGroupOfType("argument to '"+e+"'",o,l);if(l)a.push(u);else if(u!=null)i.push(u);else throw new _t("Null argument, please report this as a bug")}return{args:i,optArgs:a}}parseGroupOfType(e,r,n){switch(r){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,r);case"hbox":{var i=this.parseArgumentGroup(n,"text");return i!=null?{type:"styling",mode:i.mode,body:[i],style:"text",resetFont:!0}:null}case"raw":{var a=this.parseStringGroup("raw",n);return a!=null?{type:"raw",mode:"text",string:a.text}:null}case"primitive":{if(n)throw new _t("A primitive argument cannot be optional");var s=this.parseGroup(e);if(s==null)throw new _t("Expected group as "+e,this.fetch());return s}case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new _t("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e,r){var n=this.gullet.scanArgument(r);if(n==null)return null;for(var i="",a;(a=this.fetch()).text!=="EOF";)i+=a.text,this.consume();return this.consume(),n.text=i,n}parseRegexGroup(e,r){for(var n=this.fetch(),i=n,a="",s;(s=this.fetch()).text!=="EOF"&&e.test(a+s.text);)i=s,a+=i.text,this.consume();if(a==="")throw new _t("Invalid "+r+": '"+n.text+"'",n);return n.range(i,a)}parseColorGroup(e){var r=this.parseStringGroup("color",e);if(r==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(r.text);if(!n)throw new _t("Invalid color: '"+r.text+"'",r);var i=n[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(e){var r,n=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{"?r=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):r=this.parseStringGroup("size",e),!r)return null;!e&&r.text.length===0&&(r.text="0pt",n=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(r.text);if(!i)throw new _t("Invalid size: '"+r.text+"'",r);var a={number:+(i[1]+i[2]),unit:i[3]};if(!tge(a))throw new _t("Invalid unit: '"+a.unit+"'",r);return{type:"size",mode:this.mode,value:a,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var r=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),r==null)return null;var n=r.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,r){var n=this.gullet.scanArgument(e);if(n==null)return null;var i=this.mode;r&&this.switchMode(r),this.gullet.beginGroup();var a=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var s={type:"ordgroup",mode:this.mode,loc:n.loc,body:a};return r&&this.switchMode(i),s}parseGroup(e,r){var n=this.fetch(),i=n.text,a;if(i==="{"||i==="\\begingroup"){this.consume();var s=i==="{"?"}":"\\endgroup";this.gullet.beginGroup();var o=this.parseExpression(!1,s),l=this.fetch();this.expect(s),this.gullet.endGroup(),a={type:"ordgroup",mode:this.mode,loc:co.range(n,l),body:o,semisimple:i==="\\begingroup"||void 0}}else if(a=this.parseFunction(r,e)||this.parseSymbol(),a==null&&i[0]==="\\"&&!Xge.hasOwnProperty(i)){if(this.settings.throwOnError)throw new _t("Undefined control sequence: "+i,n);a=this.formatUnsupportedCmd(i),this.consume()}return a}formLigatures(e){for(var r=e.length-1,n=0;n<r;++n){var i=e[n];if(i.type==="textord"){var a=i.text,s=e[n+1];if(!(!s||s.type!=="textord")){if(a==="-"&&s.text==="-"){var o=e[n+2];n+1<r&&o&&o.type==="textord"&&o.text==="-"?(e.splice(n,3,{type:"textord",mode:"text",loc:co.range(i,o),text:"---"}),r-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:co.range(i,s),text:"--"}),r-=1)}(a==="'"||a==="`")&&s.text===a&&(e.splice(n,2,{type:"textord",mode:"text",loc:co.range(i,s),text:a+a}),r-=1)}}}}parseSymbol(){var e=this.fetch(),r=e.text;if(/^\\verb[^a-zA-Z]/.test(r)){this.consume();var n=r.slice(5),i=n.charAt(0)==="*";if(i&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new _t(`\\verb assertion failed --
please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:i}}jZ.hasOwnProperty(r[0])&&!li[this.mode][r[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+r[0]+'" used in math mode',e),r=jZ[r[0]]+r.slice(1));var a=grt.exec(r);a&&(r=r.substring(0,a.index),r==="i"?r="ı":r==="j"&&(r="ȷ"));var s;if(li[this.mode][r]){this.settings.strict&&this.mode==="math"&&ZO.includes(r)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+r[0]+'" used in math mode',e);var o=li[this.mode][r].group,l=co.range(e),u;$tt(o)?u={type:"atom",mode:this.mode,family:o,loc:l,text:r}:u={type:o,mode:this.mode,loc:l,text:r},s=u}else if(r.charCodeAt(0)>=128)this.settings.strict&&(ege(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),e)),s={type:"textord",mode:"text",loc:co.range(e),text:r};else return null;if(this.consume(),a)for(var h=0;h<a[0].length;h++){var d=a[0][h];if(!vI[d])throw new _t("Unknown accent ' "+d+"'",e);var f=vI[d][this.mode]||vI[d].text;if(!f)throw new _t("Accent "+d+" unsupported in "+this.mode+" mode",e);s={type:"accent",mode:this.mode,loc:co.range(e),label:f,isStretchy:!1,isShifty:!0,base:s}}return s}};jge.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var ZV=function(e,r){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new jge(e,r);delete n.gullet.macros.current["\\df@tag"];var i=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!r.displayMode)throw new _t("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:n.subparse([new $o("\\df@tag")])}]}return i},QV=function(e,r,n){r.textContent="";var i=PR(e,n).toNode();r.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),QV=function(){throw new _t("KaTeX doesn't work in quirks mode.")});var Zge=function(e,r){var n=PR(e,r).toMarkup();return n},Qge=function(e,r){var n=new PV(r);return ZV(e,n)},Jge=function(e,r,n){if(n.throwOnError||!(e instanceof _t))throw e;var i=St(["katex-error"],[new zo(r)]);return i.setAttribute("title",e.toString()),i.setAttribute("style","color:"+n.errorColor),i},PR=function(e,r){var n=new PV(r);try{var i=ZV(e,n);return _tt(i,e,n)}catch(a){return Jge(a,e,n)}},eme=function(e,r){var n=new PV(r);try{var i=ZV(e,n);return Rtt(i,e,n)}catch(a){return Jge(a,e,n)}},tme="0.16.47",rme={Span:Cx,Anchor:SR,SymbolNode:zo,SvgNode:xh,PathNode:af,LineNode:KO},Trt={version:tme,render:QV,renderToString:Zge,ParseError:_t,SETTINGS_SCHEMA:HA,__parse:Qge,__renderToDomTree:PR,__renderToHTMLTree:eme,__setFontMetrics:age,__defineSymbol:U,__defineFunction:Pt,__defineMacro:we,__domTree:rme};const wrt=Object.freeze(Object.defineProperty({__proto__:null,ParseError:_t,SETTINGS_SCHEMA:HA,__defineFunction:Pt,__defineMacro:we,__defineSymbol:U,__domTree:rme,__parse:Qge,__renderToDomTree:PR,__renderToHTMLTree:eme,__setFontMetrics:age,default:Trt,get render(){return QV},renderToString:Zge,version:tme},Symbol.toStringTag,{value:"Module"}));var nme=typeof global=="object"&&global&&global.Object===Object&&global,Crt=typeof self=="object"&&self&&self.Object===Object&&self,hu=nme||Crt||Function("return this")(),Tl=hu.Symbol,ime=Object.prototype,krt=ime.hasOwnProperty,Srt=ime.toString,hT=Tl?Tl.toStringTag:void 0;function Ert(t){var e=krt.call(t,hT),r=t[hT];try{t[hT]=void 0;var n=!0}catch{}var i=Srt.call(t);return n&&(e?t[hT]=r:delete t[hT]),i}var Art=Object.prototype,_rt=Art.toString;function Rrt(t){return _rt.call(t)}var Lrt="[object Null]",Mrt="[object Undefined]",KZ=Tl?Tl.toStringTag:void 0;function lg(t){return t==null?t===void 0?Mrt:Lrt:KZ&&KZ in Object(t)?Ert(t):Rrt(t)}function Zc(t){return t!=null&&typeof t=="object"}var Irt="[object Symbol]";function $0(t){return typeof t=="symbol"||Zc(t)&&lg(t)==Irt}function gy(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var Zi=Array.isArray,ZZ=Tl?Tl.prototype:void 0,QZ=ZZ?ZZ.toString:void 0;function ame(t){if(typeof t=="string")return t;if(Zi(t))return gy(t,ame)+"";if($0(t))return QZ?QZ.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var Nrt=/\s/;function Drt(t){for(var e=t.length;e--&&Nrt.test(t.charAt(e)););return e}var Ort=/^\s+/;function $rt(t){return t&&t.slice(0,Drt(t)+1).replace(Ort,"")}function Vo(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var JZ=NaN,Prt=/^[-+]0x[0-9a-f]+$/i,Brt=/^0b[01]+$/i,Frt=/^0o[0-7]+$/i,zrt=parseInt;function Vrt(t){if(typeof t=="number")return t;if($0(t))return JZ;if(Vo(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Vo(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=$rt(t);var r=Brt.test(t);return r||Frt.test(t)?zrt(t.slice(2),r?2:8):Prt.test(t)?JZ:+t}var eQ=1/0,Grt=17976931348623157e292;function n3(t){if(!t)return t===0?t:0;if(t=Vrt(t),t===eQ||t===-eQ){var e=t<0?-1:1;return e*Grt}return t===t?t:0}function Wrt(t){var e=n3(t),r=e%1;return e===e?r?e-r:e:0}function cg(t){return t}var Hrt="[object AsyncFunction]",qrt="[object Function]",Urt="[object GeneratorFunction]",Yrt="[object Proxy]";function qC(t){if(!Vo(t))return!1;var e=lg(t);return e==qrt||e==Urt||e==Hrt||e==Yrt}var bI=hu["__core-js_shared__"],tQ=(function(){var t=/[^.]+$/.exec(bI&&bI.keys&&bI.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function Xrt(t){return!!tQ&&tQ in t}var jrt=Function.prototype,Krt=jrt.toString;function ug(t){if(t!=null){try{return Krt.call(t)}catch{}try{return t+""}catch{}}return""}var Zrt=/[\\^$.*+?()[\]{}|]/g,Qrt=/^\[object .+?Constructor\]$/,Jrt=Function.prototype,ent=Object.prototype,tnt=Jrt.toString,rnt=ent.hasOwnProperty,nnt=RegExp("^"+tnt.call(rnt).replace(Zrt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function int(t){if(!Vo(t)||Xrt(t))return!1;var e=qC(t)?nnt:Qrt;return e.test(ug(t))}function ant(t,e){return t==null?void 0:t[e]}function hg(t,e){var r=ant(t,e);return int(r)?r:void 0}var d$=hg(hu,"WeakMap"),rQ=Object.create,snt=(function(){function t(){}return function(e){if(!Vo(e))return{};if(rQ)return rQ(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})();function ont(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function lnt(){}function sme(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var cnt=800,unt=16,hnt=Date.now;function dnt(t){var e=0,r=0;return function(){var n=hnt(),i=unt-(n-r);if(r=n,i>0){if(++e>=cnt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ym(t){return function(){return t}}var KA=(function(){try{var t=hg(Object,"defineProperty");return t({},"",{}),t}catch{}})(),fnt=KA?function(t,e){return KA(t,"toString",{configurable:!0,enumerable:!1,value:Ym(e),writable:!0})}:cg,ome=dnt(fnt);function lme(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function cme(t,e,r,n){for(var i=t.length,a=r+-1;++a<i;)if(e(t[a],a,t))return a;return-1}function pnt(t){return t!==t}function gnt(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function mnt(t,e,r){return e===e?gnt(t,e,r):cme(t,pnt,r)}function ynt(t,e){var r=t==null?0:t.length;return!!r&&mnt(t,e,0)>-1}var vnt=9007199254740991,bnt=/^(?:0|[1-9]\d*)$/;function BR(t,e){var r=typeof t;return e=e??vnt,!!e&&(r=="number"||r!="symbol"&&bnt.test(t))&&t>-1&&t%1==0&&t<e}function FR(t,e,r){e=="__proto__"&&KA?KA(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Ex(t,e){return t===e||t!==t&&e!==e}var xnt=Object.prototype,Tnt=xnt.hasOwnProperty;function zR(t,e,r){var n=t[e];(!(Tnt.call(t,e)&&Ex(n,r))||r===void 0&&!(e in t))&&FR(t,e,r)}function sS(t,e,r,n){var i=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var o=e[a],l=void 0;l===void 0&&(l=t[o]),i?FR(r,o,l):zR(r,o,l)}return r}var nQ=Math.max;function ume(t,e,r){return e=nQ(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,a=nQ(n.length-e,0),s=Array(a);++i<a;)s[i]=n[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=n[i];return o[e]=r(s),ont(t,this,o)}}function VR(t,e){return ome(ume(t,e,cg),t+"")}var wnt=9007199254740991;function JV(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=wnt}function kf(t){return t!=null&&JV(t.length)&&!qC(t)}function UC(t,e,r){if(!Vo(r))return!1;var n=typeof e;return(n=="number"?kf(r)&&BR(e,r.length):n=="string"&&e in r)?Ex(r[e],t):!1}function Cnt(t){return VR(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&UC(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var o=r[n];o&&t(e,o,n,a)}return e})}var knt=Object.prototype;function GR(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||knt;return t===r}function Snt(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Ent="[object Arguments]";function iQ(t){return Zc(t)&&lg(t)==Ent}var hme=Object.prototype,Ant=hme.hasOwnProperty,_nt=hme.propertyIsEnumerable,$b=iQ((function(){return arguments})())?iQ:function(t){return Zc(t)&&Ant.call(t,"callee")&&!_nt.call(t,"callee")};function Rnt(){return!1}var dme=typeof exports=="object"&&exports&&!exports.nodeType&&exports,aQ=dme&&typeof module=="object"&&module&&!module.nodeType&&module,Lnt=aQ&&aQ.exports===dme,sQ=Lnt?hu.Buffer:void 0,Mnt=sQ?sQ.isBuffer:void 0,Pb=Mnt||Rnt,Int="[object Arguments]",Nnt="[object Array]",Dnt="[object Boolean]",Ont="[object Date]",$nt="[object Error]",Pnt="[object Function]",Bnt="[object Map]",Fnt="[object Number]",znt="[object Object]",Vnt="[object RegExp]",Gnt="[object Set]",Wnt="[object String]",Hnt="[object WeakMap]",qnt="[object ArrayBuffer]",Unt="[object DataView]",Ynt="[object Float32Array]",Xnt="[object Float64Array]",jnt="[object Int8Array]",Knt="[object Int16Array]",Znt="[object Int32Array]",Qnt="[object Uint8Array]",Jnt="[object Uint8ClampedArray]",eit="[object Uint16Array]",tit="[object Uint32Array]",Xn={};Xn[Ynt]=Xn[Xnt]=Xn[jnt]=Xn[Knt]=Xn[Znt]=Xn[Qnt]=Xn[Jnt]=Xn[eit]=Xn[tit]=!0;Xn[Int]=Xn[Nnt]=Xn[qnt]=Xn[Dnt]=Xn[Unt]=Xn[Ont]=Xn[$nt]=Xn[Pnt]=Xn[Bnt]=Xn[Fnt]=Xn[znt]=Xn[Vnt]=Xn[Gnt]=Xn[Wnt]=Xn[Hnt]=!1;function rit(t){return Zc(t)&&JV(t.length)&&!!Xn[lg(t)]}function WR(t){return function(e){return t(e)}}var fme=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ww=fme&&typeof module=="object"&&module&&!module.nodeType&&module,nit=Ww&&Ww.exports===fme,xI=nit&&nme.process,Bb=(function(){try{var t=Ww&&Ww.require&&Ww.require("util").types;return t||xI&&xI.binding&&xI.binding("util")}catch{}})(),oQ=Bb&&Bb.isTypedArray,HR=oQ?WR(oQ):rit,iit=Object.prototype,ait=iit.hasOwnProperty;function pme(t,e){var r=Zi(t),n=!r&&$b(t),i=!r&&!n&&Pb(t),a=!r&&!n&&!i&&HR(t),s=r||n||i||a,o=s?Snt(t.length,String):[],l=o.length;for(var u in t)(e||ait.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||BR(u,l)))&&o.push(u);return o}function gme(t,e){return function(r){return t(e(r))}}var sit=gme(Object.keys,Object),oit=Object.prototype,lit=oit.hasOwnProperty;function mme(t){if(!GR(t))return sit(t);var e=[];for(var r in Object(t))lit.call(t,r)&&r!="constructor"&&e.push(r);return e}function Lo(t){return kf(t)?pme(t):mme(t)}function cit(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var uit=Object.prototype,hit=uit.hasOwnProperty;function dit(t){if(!Vo(t))return cit(t);var e=GR(t),r=[];for(var n in t)n=="constructor"&&(e||!hit.call(t,n))||r.push(n);return r}function dg(t){return kf(t)?pme(t,!0):dit(t)}var fit=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pit=/^\w*$/;function eG(t,e){if(Zi(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||$0(t)?!0:pit.test(t)||!fit.test(t)||e!=null&&t in Object(e)}var YC=hg(Object,"create");function git(){this.__data__=YC?YC(null):{},this.size=0}function mit(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var yit="__lodash_hash_undefined__",vit=Object.prototype,bit=vit.hasOwnProperty;function xit(t){var e=this.__data__;if(YC){var r=e[t];return r===yit?void 0:r}return bit.call(e,t)?e[t]:void 0}var Tit=Object.prototype,wit=Tit.hasOwnProperty;function Cit(t){var e=this.__data__;return YC?e[t]!==void 0:wit.call(e,t)}var kit="__lodash_hash_undefined__";function Sit(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=YC&&e===void 0?kit:e,this}function P0(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}P0.prototype.clear=git;P0.prototype.delete=mit;P0.prototype.get=xit;P0.prototype.has=Cit;P0.prototype.set=Sit;function Eit(){this.__data__=[],this.size=0}function qR(t,e){for(var r=t.length;r--;)if(Ex(t[r][0],e))return r;return-1}var Ait=Array.prototype,_it=Ait.splice;function Rit(t){var e=this.__data__,r=qR(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():_it.call(e,r,1),--this.size,!0}function Lit(t){var e=this.__data__,r=qR(e,t);return r<0?void 0:e[r][1]}function Mit(t){return qR(this.__data__,t)>-1}function Iit(t,e){var r=this.__data__,n=qR(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function zh(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}zh.prototype.clear=Eit;zh.prototype.delete=Rit;zh.prototype.get=Lit;zh.prototype.has=Mit;zh.prototype.set=Iit;var XC=hg(hu,"Map");function Nit(){this.size=0,this.__data__={hash:new P0,map:new(XC||zh),string:new P0}}function Dit(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function UR(t,e){var r=t.__data__;return Dit(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Oit(t){var e=UR(this,t).delete(t);return this.size-=e?1:0,e}function $it(t){return UR(this,t).get(t)}function Pit(t){return UR(this,t).has(t)}function Bit(t,e){var r=UR(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function Vh(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Vh.prototype.clear=Nit;Vh.prototype.delete=Oit;Vh.prototype.get=$it;Vh.prototype.has=Pit;Vh.prototype.set=Bit;var Fit="Expected a function";function tG(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Fit);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(tG.Cache||Vh),r}tG.Cache=Vh;var zit=500;function Vit(t){var e=tG(t,function(n){return r.size===zit&&r.clear(),n}),r=e.cache;return e}var Git=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Wit=/\\(\\)?/g,Hit=Vit(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Git,function(r,n,i,a){e.push(i?a.replace(Wit,"$1"):n||r)}),e});function yme(t){return t==null?"":ame(t)}function YR(t,e){return Zi(t)?t:eG(t,e)?[t]:Hit(yme(t))}function oS(t){if(typeof t=="string"||$0(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function XR(t,e){e=YR(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[oS(e[r++])];return r&&r==n?t:void 0}function qit(t,e,r){var n=t==null?void 0:XR(t,e);return n===void 0?r:n}function rG(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var lQ=Tl?Tl.isConcatSpreadable:void 0;function Uit(t){return Zi(t)||$b(t)||!!(lQ&&t&&t[lQ])}function nG(t,e,r,n,i){var a=-1,s=t.length;for(r||(r=Uit),i||(i=[]);++a<s;){var o=t[a];r(o)?rG(i,o):n||(i[i.length]=o)}return i}function Ax(t){var e=t==null?0:t.length;return e?nG(t):[]}function Yit(t){return ome(ume(t,void 0,Ax),t+"")}var iG=gme(Object.getPrototypeOf,Object),Xit="[object Object]",jit=Function.prototype,Kit=Object.prototype,vme=jit.toString,Zit=Kit.hasOwnProperty,Qit=vme.call(Object);function Jit(t){if(!Zc(t)||lg(t)!=Xit)return!1;var e=iG(t);if(e===null)return!0;var r=Zit.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&vme.call(r)==Qit}function eat(t,e,r,n){var i=-1,a=t==null?0:t.length;for(n&&a&&(r=t[++i]);++i<a;)r=e(r,t[i],i,t);return r}function tat(){this.__data__=new zh,this.size=0}function rat(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function nat(t){return this.__data__.get(t)}function iat(t){return this.__data__.has(t)}var aat=200;function sat(t,e){var r=this.__data__;if(r instanceof zh){var n=r.__data__;if(!XC||n.length<aat-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Vh(n)}return r.set(t,e),this.size=r.size,this}function Ql(t){var e=this.__data__=new zh(t);this.size=e.size}Ql.prototype.clear=tat;Ql.prototype.delete=rat;Ql.prototype.get=nat;Ql.prototype.has=iat;Ql.prototype.set=sat;function oat(t,e){return t&&sS(e,Lo(e),t)}function lat(t,e){return t&&sS(e,dg(e),t)}var bme=typeof exports=="object"&&exports&&!exports.nodeType&&exports,cQ=bme&&typeof module=="object"&&module&&!module.nodeType&&module,cat=cQ&&cQ.exports===bme,uQ=cat?hu.Buffer:void 0,hQ=uQ?uQ.allocUnsafe:void 0;function xme(t,e){if(e)return t.slice();var r=t.length,n=hQ?hQ(r):new t.constructor(r);return t.copy(n),n}function Tme(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[i++]=s)}return a}function wme(){return[]}var uat=Object.prototype,hat=uat.propertyIsEnumerable,dQ=Object.getOwnPropertySymbols,aG=dQ?function(t){return t==null?[]:(t=Object(t),Tme(dQ(t),function(e){return hat.call(t,e)}))}:wme;function dat(t,e){return sS(t,aG(t),e)}var fat=Object.getOwnPropertySymbols,Cme=fat?function(t){for(var e=[];t;)rG(e,aG(t)),t=iG(t);return e}:wme;function pat(t,e){return sS(t,Cme(t),e)}function kme(t,e,r){var n=e(t);return Zi(t)?n:rG(n,r(t))}function f$(t){return kme(t,Lo,aG)}function gat(t){return kme(t,dg,Cme)}var p$=hg(hu,"DataView"),g$=hg(hu,"Promise"),my=hg(hu,"Set"),fQ="[object Map]",mat="[object Object]",pQ="[object Promise]",gQ="[object Set]",mQ="[object WeakMap]",yQ="[object DataView]",yat=ug(p$),vat=ug(XC),bat=ug(g$),xat=ug(my),Tat=ug(d$),ol=lg;(p$&&ol(new p$(new ArrayBuffer(1)))!=yQ||XC&&ol(new XC)!=fQ||g$&&ol(g$.resolve())!=pQ||my&&ol(new my)!=gQ||d$&&ol(new d$)!=mQ)&&(ol=function(t){var e=lg(t),r=e==mat?t.constructor:void 0,n=r?ug(r):"";if(n)switch(n){case yat:return yQ;case vat:return fQ;case bat:return pQ;case xat:return gQ;case Tat:return mQ}return e});var wat=Object.prototype,Cat=wat.hasOwnProperty;function kat(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Cat.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var ZA=hu.Uint8Array;function sG(t){var e=new t.constructor(t.byteLength);return new ZA(e).set(new ZA(t)),e}function Sat(t,e){var r=e?sG(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Eat=/\w*$/;function Aat(t){var e=new t.constructor(t.source,Eat.exec(t));return e.lastIndex=t.lastIndex,e}var vQ=Tl?Tl.prototype:void 0,bQ=vQ?vQ.valueOf:void 0;function _at(t){return bQ?Object(bQ.call(t)):{}}function Sme(t,e){var r=e?sG(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Rat="[object Boolean]",Lat="[object Date]",Mat="[object Map]",Iat="[object Number]",Nat="[object RegExp]",Dat="[object Set]",Oat="[object String]",$at="[object Symbol]",Pat="[object ArrayBuffer]",Bat="[object DataView]",Fat="[object Float32Array]",zat="[object Float64Array]",Vat="[object Int8Array]",Gat="[object Int16Array]",Wat="[object Int32Array]",Hat="[object Uint8Array]",qat="[object Uint8ClampedArray]",Uat="[object Uint16Array]",Yat="[object Uint32Array]";function Xat(t,e,r){var n=t.constructor;switch(e){case Pat:return sG(t);case Rat:case Lat:return new n(+t);case Bat:return Sat(t,r);case Fat:case zat:case Vat:case Gat:case Wat:case Hat:case qat:case Uat:case Yat:return Sme(t,r);case Mat:return new n;case Iat:case Oat:return new n(t);case Nat:return Aat(t);case Dat:return new n;case $at:return _at(t)}}function Eme(t){return typeof t.constructor=="function"&&!GR(t)?snt(iG(t)):{}}var jat="[object Map]";function Kat(t){return Zc(t)&&ol(t)==jat}var xQ=Bb&&Bb.isMap,Zat=xQ?WR(xQ):Kat,Qat="[object Set]";function Jat(t){return Zc(t)&&ol(t)==Qat}var TQ=Bb&&Bb.isSet,est=TQ?WR(TQ):Jat,tst=1,rst=2,nst=4,Ame="[object Arguments]",ist="[object Array]",ast="[object Boolean]",sst="[object Date]",ost="[object Error]",_me="[object Function]",lst="[object GeneratorFunction]",cst="[object Map]",ust="[object Number]",Rme="[object Object]",hst="[object RegExp]",dst="[object Set]",fst="[object String]",pst="[object Symbol]",gst="[object WeakMap]",mst="[object ArrayBuffer]",yst="[object DataView]",vst="[object Float32Array]",bst="[object Float64Array]",xst="[object Int8Array]",Tst="[object Int16Array]",wst="[object Int32Array]",Cst="[object Uint8Array]",kst="[object Uint8ClampedArray]",Sst="[object Uint16Array]",Est="[object Uint32Array]",Pn={};Pn[Ame]=Pn[ist]=Pn[mst]=Pn[yst]=Pn[ast]=Pn[sst]=Pn[vst]=Pn[bst]=Pn[xst]=Pn[Tst]=Pn[wst]=Pn[cst]=Pn[ust]=Pn[Rme]=Pn[hst]=Pn[dst]=Pn[fst]=Pn[pst]=Pn[Cst]=Pn[kst]=Pn[Sst]=Pn[Est]=!0;Pn[ost]=Pn[_me]=Pn[gst]=!1;function Hw(t,e,r,n,i,a){var s,o=e&tst,l=e&rst,u=e&nst;if(s!==void 0)return s;if(!Vo(t))return t;var h=Zi(t);if(h){if(s=kat(t),!o)return sme(t,s)}else{var d=ol(t),f=d==_me||d==lst;if(Pb(t))return xme(t,o);if(d==Rme||d==Ame||f&&!i){if(s=l||f?{}:Eme(t),!o)return l?pat(t,lat(s,t)):dat(t,oat(s,t))}else{if(!Pn[d])return i?t:{};s=Xat(t,d,o)}}a||(a=new Ql);var p=a.get(t);if(p)return p;a.set(t,s),est(t)?t.forEach(function(y){s.add(Hw(y,e,r,y,t,a))}):Zat(t)&&t.forEach(function(y,v){s.set(v,Hw(y,e,r,v,t,a))});var g=u?l?gat:f$:l?dg:Lo,m=h?void 0:g(t);return lme(m||t,function(y,v){m&&(v=y,y=t[v]),zR(s,v,Hw(y,e,r,v,t,a))}),s}var Ast=4;function _st(t){return Hw(t,Ast)}var Rst=1,Lst=4;function Mst(t){return Hw(t,Rst|Lst)}var Ist="__lodash_hash_undefined__";function Nst(t){return this.__data__.set(t,Ist),this}function Dst(t){return this.__data__.has(t)}function jC(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Vh;++e<r;)this.add(t[e])}jC.prototype.add=jC.prototype.push=Nst;jC.prototype.has=Dst;function Ost(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function Lme(t,e){return t.has(e)}var $st=1,Pst=2;function Mme(t,e,r,n,i,a){var s=r&$st,o=t.length,l=e.length;if(o!=l&&!(s&&l>o))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&Pst?new jC:void 0;for(a.set(t,e),a.set(e,t);++d<o;){var g=t[d],m=e[d];if(n)var y=s?n(m,g,d,e,t,a):n(g,m,d,t,e,a);if(y!==void 0){if(y)continue;f=!1;break}if(p){if(!Ost(e,function(v,T){if(!Lme(p,T)&&(g===v||i(g,v,r,n,a)))return p.push(T)})){f=!1;break}}else if(!(g===m||i(g,m,r,n,a))){f=!1;break}}return a.delete(t),a.delete(e),f}function Bst(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function oG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Fst=1,zst=2,Vst="[object Boolean]",Gst="[object Date]",Wst="[object Error]",Hst="[object Map]",qst="[object Number]",Ust="[object RegExp]",Yst="[object Set]",Xst="[object String]",jst="[object Symbol]",Kst="[object ArrayBuffer]",Zst="[object DataView]",wQ=Tl?Tl.prototype:void 0,TI=wQ?wQ.valueOf:void 0;function Qst(t,e,r,n,i,a,s){switch(r){case Zst:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Kst:return!(t.byteLength!=e.byteLength||!a(new ZA(t),new ZA(e)));case Vst:case Gst:case qst:return Ex(+t,+e);case Wst:return t.name==e.name&&t.message==e.message;case Ust:case Xst:return t==e+"";case Hst:var o=Bst;case Yst:var l=n&Fst;if(o||(o=oG),t.size!=e.size&&!l)return!1;var u=s.get(t);if(u)return u==e;n|=zst,s.set(t,e);var h=Mme(o(t),o(e),n,i,a,s);return s.delete(t),h;case jst:if(TI)return TI.call(t)==TI.call(e)}return!1}var Jst=1,eot=Object.prototype,tot=eot.hasOwnProperty;function rot(t,e,r,n,i,a){var s=r&Jst,o=f$(t),l=o.length,u=f$(e),h=u.length;if(l!=h&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in e:tot.call(e,f)))return!1}var p=a.get(t),g=a.get(e);if(p&&g)return p==e&&g==t;var m=!0;a.set(t,e),a.set(e,t);for(var y=s;++d<l;){f=o[d];var v=t[f],T=e[f];if(n)var b=s?n(T,v,f,e,t,a):n(v,T,f,t,e,a);if(!(b===void 0?v===T||i(v,T,r,n,a):b)){m=!1;break}y||(y=f=="constructor")}if(m&&!y){var w=t.constructor,C=e.constructor;w!=C&&"constructor"in t&&"constructor"in e&&!(typeof w=="function"&&w instanceof w&&typeof C=="function"&&C instanceof C)&&(m=!1)}return a.delete(t),a.delete(e),m}var not=1,CQ="[object Arguments]",kQ="[object Array]",zE="[object Object]",iot=Object.prototype,SQ=iot.hasOwnProperty;function aot(t,e,r,n,i,a){var s=Zi(t),o=Zi(e),l=s?kQ:ol(t),u=o?kQ:ol(e);l=l==CQ?zE:l,u=u==CQ?zE:u;var h=l==zE,d=u==zE,f=l==u;if(f&&Pb(t)){if(!Pb(e))return!1;s=!0,h=!1}if(f&&!h)return a||(a=new Ql),s||HR(t)?Mme(t,e,r,n,i,a):Qst(t,e,l,r,n,i,a);if(!(r&not)){var p=h&&SQ.call(t,"__wrapped__"),g=d&&SQ.call(e,"__wrapped__");if(p||g){var m=p?t.value():t,y=g?e.value():e;return a||(a=new Ql),i(m,y,r,n,a)}}return f?(a||(a=new Ql),rot(t,e,r,n,i,a)):!1}function lG(t,e,r,n,i){return t===e?!0:t==null||e==null||!Zc(t)&&!Zc(e)?t!==t&&e!==e:aot(t,e,r,n,lG,i)}var sot=1,oot=2;function lot(t,e,r,n){var i=r.length,a=i;if(t==null)return!a;for(t=Object(t);i--;){var s=r[i];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<a;){s=r[i];var o=s[0],l=t[o],u=s[1];if(s[2]){if(l===void 0&&!(o in t))return!1}else{var h=new Ql,d;if(!(d===void 0?lG(u,l,sot|oot,n,h):d))return!1}}return!0}function Ime(t){return t===t&&!Vo(t)}function cot(t){for(var e=Lo(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,Ime(i)]}return e}function Nme(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function uot(t){var e=cot(t);return e.length==1&&e[0][2]?Nme(e[0][0],e[0][1]):function(r){return r===t||lot(r,t,e)}}function hot(t,e){return t!=null&&e in Object(t)}function Dme(t,e,r){e=YR(e,t);for(var n=-1,i=e.length,a=!1;++n<i;){var s=oS(e[n]);if(!(a=t!=null&&r(t,s)))break;t=t[s]}return a||++n!=i?a:(i=t==null?0:t.length,!!i&&JV(i)&&BR(s,i)&&(Zi(t)||$b(t)))}function Ome(t,e){return t!=null&&Dme(t,e,hot)}var dot=1,fot=2;function pot(t,e){return eG(t)&&Ime(e)?Nme(oS(t),e):function(r){var n=qit(r,t);return n===void 0&&n===e?Ome(r,t):lG(e,n,dot|fot)}}function got(t){return function(e){return e==null?void 0:e[t]}}function mot(t){return function(e){return XR(e,t)}}function yot(t){return eG(t)?got(oS(t)):mot(t)}function Sf(t){return typeof t=="function"?t:t==null?cg:typeof t=="object"?Zi(t)?pot(t[0],t[1]):uot(t):yot(t)}function vot(t){return function(e,r,n){for(var i=-1,a=Object(e),s=n(e),o=s.length;o--;){var l=s[++i];if(r(a[l],l,a)===!1)break}return e}}var cG=vot();function uG(t,e){return t&&cG(t,e,Lo)}function bot(t,e){return function(r,n){if(r==null)return r;if(!kf(r))return t(r,n);for(var i=r.length,a=-1,s=Object(r);++a<i&&n(s[a],a,s)!==!1;);return r}}var jR=bot(uG),$me=Object.prototype,xot=$me.hasOwnProperty,Tot=VR(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&UC(e[0],e[1],i)&&(n=1);++r<n;)for(var a=e[r],s=dg(a),o=-1,l=s.length;++o<l;){var u=s[o],h=t[u];(h===void 0||Ex(h,$me[u])&&!xot.call(t,u))&&(t[u]=a[u])}return t});function m$(t,e,r){(r!==void 0&&!Ex(t[e],r)||r===void 0&&!(e in t))&&FR(t,e,r)}function Pme(t){return Zc(t)&&kf(t)}function y$(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function wot(t){return sS(t,dg(t))}function Cot(t,e,r,n,i,a,s){var o=y$(t,r),l=y$(e,r),u=s.get(l);if(u){m$(t,r,u);return}var h=a?a(o,l,r+"",t,e,s):void 0,d=h===void 0;if(d){var f=Zi(l),p=!f&&Pb(l),g=!f&&!p&&HR(l);h=l,f||p||g?Zi(o)?h=o:Pme(o)?h=sme(o):p?(d=!1,h=xme(l,!0)):g?(d=!1,h=Sme(l,!0)):h=[]:Jit(l)||$b(l)?(h=o,$b(o)?h=wot(o):(!Vo(o)||qC(o))&&(h=Eme(l))):d=!1}d&&(s.set(l,h),i(h,l,n,a,s),s.delete(l)),m$(t,r,h)}function Bme(t,e,r,n,i){t!==e&&cG(e,function(a,s){if(i||(i=new Ql),Vo(a))Cot(t,e,s,r,Bme,n,i);else{var o=n?n(y$(t,s),a,s+"",t,e,i):void 0;o===void 0&&(o=a),m$(t,s,o)}},dg)}function QA(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function hG(t){return typeof t=="function"?t:cg}function ft(t,e){var r=Zi(t)?lme:jR;return r(t,hG(e))}function kot(t,e){var r=[];return jR(t,function(n,i,a){e(n,i,a)&&r.push(n)}),r}function eh(t,e){var r=Zi(t)?Tme:kot;return r(t,Sf(e))}function Sot(t){return function(e,r,n){var i=Object(e);if(!kf(e)){var a=Sf(r);e=Lo(e),r=function(o){return a(i[o],o,i)}}var s=t(e,r,n);return s>-1?i[a?e[s]:s]:void 0}}var Eot=Math.max;function Aot(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Wrt(r);return i<0&&(i=Eot(n+i,0)),cme(t,Sf(e),i)}var dG=Sot(Aot);function Fme(t,e){var r=-1,n=kf(t)?Array(t.length):[];return jR(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function Xi(t,e){var r=Zi(t)?gy:Fme;return r(t,Sf(e))}function _ot(t,e){return t==null?t:cG(t,hG(e),dg)}function Rot(t,e){return t&&uG(t,hG(e))}function Lot(t,e){return t>e}var Mot=Object.prototype,Iot=Mot.hasOwnProperty;function Not(t,e){return t!=null&&Iot.call(t,e)}function zme(t,e){return t!=null&&Dme(t,e,Not)}function Dot(t,e){return gy(e,function(r){return t[r]})}function dh(t){return t==null?[]:Dot(t,Lo(t))}var Oot="[object Map]",$ot="[object Set]",Pot=Object.prototype,Bot=Pot.hasOwnProperty;function EQ(t){if(t==null)return!0;if(kf(t)&&(Zi(t)||typeof t=="string"||typeof t.splice=="function"||Pb(t)||HR(t)||$b(t)))return!t.length;var e=ol(t);if(e==Oot||e==$ot)return!t.size;if(GR(t))return!mme(t).length;for(var r in t)if(Bot.call(t,r))return!1;return!0}function Di(t){return t===void 0}function Vme(t,e){return t<e}function KR(t,e){var r={};return e=Sf(e),uG(t,function(n,i,a){FR(r,i,e(n,i,a))}),r}function fG(t,e,r){for(var n=-1,i=t.length;++n<i;){var a=t[n],s=e(a);if(s!=null&&(o===void 0?s===s&&!$0(s):r(s,o)))var o=s,l=a}return l}function B0(t){return t&&t.length?fG(t,cg,Lot):void 0}var v$=Cnt(function(t,e,r){Bme(t,e,r)});function KC(t){return t&&t.length?fG(t,cg,Vme):void 0}function pG(t,e){return t&&t.length?fG(t,Sf(e),Vme):void 0}function Fot(t,e,r,n){if(!Vo(t))return t;e=YR(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i<a;){var l=oS(e[i]),u=r;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=s){var h=o[l];u=void 0,u===void 0&&(u=Vo(h)?h:BR(e[i+1])?[]:{})}zR(o,l,u),o=o[l]}return t}function zot(t,e,r){for(var n=-1,i=e.length,a={};++n<i;){var s=e[n],o=XR(t,s);r(o,s)&&Fot(a,YR(s,t),o)}return a}function Vot(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}function Got(t,e){if(t!==e){var r=t!==void 0,n=t===null,i=t===t,a=$0(t),s=e!==void 0,o=e===null,l=e===e,u=$0(e);if(!o&&!u&&!a&&t>e||a&&s&&l&&!o&&!u||n&&s&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&t<e||u&&r&&i&&!n&&!a||o&&r&&i||!s&&i||!l)return-1}return 0}function Wot(t,e,r){for(var n=-1,i=t.criteria,a=e.criteria,s=i.length,o=r.length;++n<s;){var l=Got(i[n],a[n]);if(l){if(n>=o)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}function Hot(t,e,r){e.length?e=gy(e,function(a){return Zi(a)?function(s){return XR(s,a.length===1?a[0]:a)}:a}):e=[cg];var n=-1;e=gy(e,WR(Sf));var i=Fme(t,function(a,s,o){var l=gy(e,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return Vot(i,function(a,s){return Wot(a,s,r)})}function qot(t,e){return zot(t,e,function(r,n){return Ome(t,n)})}var JA=Yit(function(t,e){return t==null?{}:qot(t,e)}),Uot=Math.ceil,Yot=Math.max;function Xot(t,e,r,n){for(var i=-1,a=Yot(Uot((e-t)/(r||1)),0),s=Array(a);a--;)s[++i]=t,t+=r;return s}function jot(t){return function(e,r,n){return n&&typeof n!="number"&&UC(e,r,n)&&(r=n=void 0),e=n3(e),r===void 0?(r=e,e=0):r=n3(r),n=n===void 0?e<r?1:-1:n3(n),Xot(e,r,n)}}var Fb=jot();function Kot(t,e,r,n,i){return i(t,function(a,s,o){r=n?(n=!1,a):e(r,a,s,o)}),r}function lS(t,e,r){var n=Zi(t)?eat:Kot,i=arguments.length<3;return n(t,Sf(e),r,i,jR)}var cS=VR(function(t,e){if(t==null)return[];var r=e.length;return r>1&&UC(t,e[0],e[1])?e=[]:r>2&&UC(e[0],e[1],e[2])&&(e=[e[0]]),Hot(t,nG(e),[])}),Zot=1/0,Qot=my&&1/oG(new my([,-0]))[1]==Zot?function(t){return new my(t)}:lnt,Jot=200;function elt(t,e,r){var n=-1,i=ynt,a=t.length,s=!0,o=[],l=o;if(a>=Jot){var u=Qot(t);if(u)return oG(u);s=!1,i=Lme,l=new jC}else l=o;e:for(;++n<a;){var h=t[n],d=h;if(h=h!==0?h:0,s&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;o.push(h)}else i(l,d,r)||(l!==o&&l.push(d),o.push(h))}return o}var tlt=VR(function(t){return elt(nG(t,1,Pme,!0))}),rlt=0;function gG(t){var e=++rlt;return yme(t)+e}function nlt(t,e,r){for(var n=-1,i=t.length,a=e.length,s={};++n<i;){var o=n<a?e[n]:void 0;r(s,t[n],o)}return s}function ilt(t,e){return nlt(t||[],e||[],zR)}var alt="\0",Xf="\0",AQ="";class ms{constructor(e={}){this._isDirected=Object.prototype.hasOwnProperty.call(e,"directed")?e.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(e,"multigraph")?e.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(e,"compound")?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=Ym(void 0),this._defaultEdgeLabelFn=Ym(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[Xf]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return qC(e)||(e=Ym(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return Lo(this._nodes)}sources(){var e=this;return eh(this.nodes(),function(r){return EQ(e._in[r])})}sinks(){var e=this;return eh(this.nodes(),function(r){return EQ(e._out[r])})}setNodes(e,r){var n=arguments,i=this;return ft(e,function(a){n.length>1?i.setNode(a,r):i.setNode(a)}),this}setNode(e,r){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Xf,this._children[e]={},this._children[Xf][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],ft(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),ft(Lo(this._in[e]),r),delete this._in[e],delete this._preds[e],ft(Lo(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Di(r))r=Xf;else{r+="";for(var n=r;!Di(n);n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==Xf)return r}}children(e){if(Di(e)&&(e=Xf),this._isCompound){var r=this._children[e];if(r)return Lo(r)}else{if(e===Xf)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return Lo(r)}successors(e){var r=this._sucs[e];if(r)return Lo(r)}neighbors(e){var r=this.predecessors(e);if(r)return tlt(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;ft(this._nodes,function(s,o){e(o)&&r.setNode(o,s)}),ft(this._edgeObjs,function(s){r.hasNode(s.v)&&r.hasNode(s.w)&&r.setEdge(s,n.edge(s))});var i={};function a(s){var o=n.parent(s);return o===void 0||r.hasNode(o)?(i[s]=o,o):o in i?i[o]:a(o)}return this._isCompound&&ft(r.nodes(),function(s){r.setParent(s,a(s))}),r}setDefaultEdgeLabel(e){return qC(e)||(e=Ym(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return dh(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return lS(e,function(a,s){return i.length>1?n.setEdge(a,s,r):n.setEdge(a,s),s}),this}setEdge(){var e,r,n,i,a=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(e=s.v,r=s.w,n=s.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=s,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,r=""+r,Di(n)||(n=""+n);var o=QT(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return a&&(this._edgeLabels[o]=i),this;if(!Di(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[o]=a?i:this._defaultEdgeLabelFn(e,r,n);var l=slt(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[o]=l,_Q(this._preds[r],e),_Q(this._sucs[e],r),this._in[r][o]=l,this._out[e][o]=l,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?wI(this._isDirected,arguments[0]):QT(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?wI(this._isDirected,arguments[0]):QT(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?wI(this._isDirected,arguments[0]):QT(this._isDirected,e,r,n),a=this._edgeObjs[i];return a&&(e=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],RQ(this._preds[r],e),RQ(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var i=dh(n);return r?eh(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=dh(n);return r?eh(i,function(a){return a.w===r}):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}}ms.prototype._nodeCount=0;ms.prototype._edgeCount=0;function _Q(t,e){t[e]?t[e]++:t[e]=1}function RQ(t,e){--t[e]||delete t[e]}function QT(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}return i+AQ+a+AQ+(Di(n)?alt:n)}function slt(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}var o={v:i,w:a};return n&&(o.name=n),o}function wI(t,e){return QT(t,e.v,e.w,e.name)}function fh(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:olt(t),edges:llt(t)};return Di(t.graph())||(e.value=_st(t.graph())),e}function olt(t){return Xi(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return Di(r)||(i.value=r),Di(n)||(i.parent=n),i})}function llt(t){return Xi(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return Di(e.name)||(n.name=e.name),Di(r)||(n.value=r),n})}var Lr=new Map,Id=new Map,Gme=new Map,Wme=x(()=>{Id.clear(),Gme.clear(),Lr.clear()},"clear"),F0=x((t,e)=>{const r=Id.get(e)||[];return le.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),clt=x((t,e)=>{const r=Id.get(e)||[];return le.info("Descendants of ",e," is ",r),le.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||F0(t.v,e)||F0(t.w,e)||r.includes(t.w):(le.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),b$=x((t,e,r,n)=>{le.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),le.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)b$(a,e,r,n);else{const s=e.node(a);le.info("cp ",a," to ",n," with parent ",t),r.setNode(a,s),n!==e.parent(a)&&(le.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(le.debug("Setting parent",a,t),r.setParent(a,t)):(le.info("In copy ",t,"root",n,"data",e.node(t),n),le.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));const o=e.edges(a);le.debug("Copying Edges",o),o.forEach(l=>{le.info("Edge",l);const u=e.edge(l.v,l.w,l.name);le.info("Edge data",u,n);try{if(clt(l,n)){const h=Id.get(n)||[],d=h.includes(l.v)||F0(l.v,n)||l.v===n,f=h.includes(l.w)||F0(l.w,n)||l.w===n;if(d&&f)le.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),le.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]));else{const p=d?n:l.v,g=f?n:l.w;le.info("Rebinding cross-boundary edge as ",p,g,u,l.name),e.setEdge(p,g,u,l.name)}}else le.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){le.error(h)}})}le.debug("Removing node",a),e.removeNode(a)})},"copy"),Hme=x((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)Gme.set(i,t),n=[...n,...Hme(i,e)];return n},"extractDescendants"),ult=x((t,e,r)=>{const n=t.edges().filter(l=>l.v===e||l.w===e),i=t.edges().filter(l=>l.v===r||l.w===r),a=n.map(l=>({v:l.v===e?r:l.v,w:l.w===e?e:l.w})),s=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>s.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),zb=x((t,e,r)=>{const n=e.children(t);if(le.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const a of n){const s=zb(a,e,r),o=ult(e,r,s);if(s)if(o.length>0)i=s;else return s}return i},"findNonClusterChild"),LQ=x(t=>!Lr.has(t)||!Lr.get(t).externalConnections?t:Lr.has(t)?Lr.get(t).id:t,"getAnchorId"),hlt=x((t,e)=>{var r;if(!t||e>10){le.debug("Opting out, no graph ");return}else le.debug("Opting in, graph ");t.nodes().forEach(function(n){t.children(n).length>0&&(le.warn("Cluster identified",n," Replacement id in edges: ",zb(n,t,n)),Id.set(n,Hme(n,t)),Lr.set(n,{id:zb(n,t,n),clusterData:t.node(n)}))}),t.nodes().forEach(function(n){const i=t.children(n),a=t.edges();i.length>0?(le.debug("Cluster identified",n,Id),a.forEach(s=>{const o=F0(s.v,n),l=F0(s.w,n);o^l&&(le.warn("Edge: ",s," leaves cluster ",n),le.warn("Descendants of XXX ",n,": ",Id.get(n)),Lr.get(n).externalConnections=!0)})):le.debug("Not a cluster ",n,Id)});for(let n of Lr.keys()){const i=Lr.get(n).id,a=t.parent(i);a!==n&&Lr.has(a)&&!Lr.get(a).externalConnections&&(Lr.get(n).id=a);const s=t.edges().some(o=>o.v===n);if(i&&((r=Lr.get(n))!=null&&r.externalConnections)&&s&&Yme(t,i,n)){const o=flt(t,n,t.parent(i));o&&(Lr.get(n).id=o)}}t.edges().forEach(function(n){const i=t.edge(n);le.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),le.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(t.edge(n)));let a=n.v,s=n.w;if(le.warn("Fix XXX",Lr,"ids:",n.v,n.w,"Translating: ",Lr.get(n.v)," --- ",Lr.get(n.w)),Lr.get(n.v)||Lr.get(n.w)){if(le.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),a=LQ(n.v),s=LQ(n.w),t.removeEdge(n.v,n.w,n.name),a!==n.v){const o=t.parent(a);Lr.get(o).externalConnections=!0,i.fromCluster=n.v}if(s!==n.w){const o=t.parent(s);Lr.get(o).externalConnections=!0,i.toCluster=n.w}le.warn("Fix Replacing with XXX",a,s,n.name),t.setEdge(a,s,i,n.name)}}),le.warn("Adjusted Graph",fh(t)),qme(t,0),le.trace(Lr)},"adjustClustersAndEdges"),qme=x((t,e)=>{var i,a,s,o;if(le.warn("extractor - ",e,fh(t),t.children("D")),e>10){le.error("Bailing out");return}let r=t.nodes(),n=!1;for(const l of r){const u=t.children(l);n=n||u.length>0}if(!n){le.debug("Done, no node has children",t.nodes());return}le.debug("Nodes = ",r,e);for(const l of r)if(le.debug("Extracting node",l,Lr,Lr.has(l)&&!Lr.get(l).externalConnections,!t.parent(l),t.node(l),t.children("D")," Depth ",e),!Lr.has(l))le.debug("Not a cluster",l,e);else if((a=(i=Lr.get(l))==null?void 0:i.clusterData)!=null&&a.explicitDir&&t.children(l)&&t.children(l).length>0){le.warn("Cluster with explicit dir, creating subgraph for children",l,e);const u=Lr.get(l).clusterData.dir,h=new ms({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b$(l,t,h,l);const d=t.node(l)||{};t.setNode(l,{...d,clusterNode:!0,id:l,clusterData:Lr.get(l).clusterData,label:Lr.get(l).label,graph:h}),le.warn("Subgraph for cluster with explicit dir created:",l,fh(h))}else if(!Lr.get(l).externalConnections&&t.children(l)&&t.children(l).length>0){le.warn("Cluster without external connections, without a parent and with children",l,e);let h=t.graph().rankdir==="TB"?"LR":"TB";(o=(s=Lr.get(l))==null?void 0:s.clusterData)!=null&&o.dir&&(h=Lr.get(l).clusterData.dir,le.warn("Fixing dir",Lr.get(l).clusterData.dir,h));const d=new ms({multigraph:!0,compound:!0}).setGraph({rankdir:h,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b$(l,t,d,l);const f=t.node(l)||{};t.setNode(l,{...f,clusterNode:!0,id:l,clusterData:Lr.get(l).clusterData,label:Lr.get(l).label,graph:d}),le.debug("Old graph after copy",fh(t))}else le.warn("Cluster ** ",l," **not meeting the criteria !externalConnections:",!Lr.get(l).externalConnections," no parent: ",!t.parent(l)," children ",t.children(l)&&t.children(l).length>0,t.children("D"),e),le.debug(Lr);r=t.nodes(),le.warn("New list of nodes",r);for(const l of r){const u=t.node(l);le.warn(" Now next level",l,u),u!=null&&u.clusterNode&&qme(u.graph,e+1)}},"extractor"),Ume=x((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=Ume(t,i);r=[...r,...a]}),r},"sorter"),dlt=x(t=>Ume(t,t.children()),"sortNodesByHierarchy"),Yme=x((t,e,r)=>{let n=t.parent(e);for(;n&&n!==r;){const i=Lr.get(n);if(i&&!i.externalConnections)return!0;n=t.parent(n)}return!1},"isNodeInExtractableCluster"),flt=x((t,e,r)=>{const n=t.children(e)??[];for(const i of n){if(i===r||F0(i,r))continue;const a=zb(i,t,e);if(a&&!Yme(t,a,e))return a}return null},"findSafeAnchorNode");class plt{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return MQ(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&MQ(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,n=r._prev;n!==r;)e.push(JSON.stringify(n,glt)),n=n._prev;return"["+e.join(", ")+"]"}}function MQ(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function glt(t,e){if(t!=="_next"&&t!=="_prev")return e}var mlt=Ym(1);function ylt(t,e){if(t.nodeCount()<=1)return[];var r=blt(t,e||mlt),n=vlt(r.graph,r.buckets,r.zeroIdx);return Ax(Xi(n,function(i){return t.outEdges(i.v,i.w)}))}function vlt(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],s;t.nodeCount();){for(;s=a.dequeue();)CI(t,e,r,s);for(;s=i.dequeue();)CI(t,e,r,s);if(t.nodeCount()){for(var o=e.length-2;o>0;--o)if(s=e[o].dequeue(),s){n=n.concat(CI(t,e,r,s,!0));break}}}return n}function CI(t,e,r,n,i){var a=i?[]:void 0;return ft(t.inEdges(n.v),function(s){var o=t.edge(s),l=t.node(s.v);i&&a.push({v:s.v,w:s.w}),l.out-=o,x$(e,r,l)}),ft(t.outEdges(n.v),function(s){var o=t.edge(s),l=s.w,u=t.node(l);u.in-=o,x$(e,r,u)}),t.removeNode(n.v),a}function blt(t,e){var r=new ms,n=0,i=0;ft(t.nodes(),function(o){r.setNode(o,{v:o,in:0,out:0})}),ft(t.edges(),function(o){var l=r.edge(o.v,o.w)||0,u=e(o),h=l+u;r.setEdge(o.v,o.w,h),i=Math.max(i,r.node(o.v).out+=u),n=Math.max(n,r.node(o.w).in+=u)});var a=Fb(i+n+3).map(function(){return new plt}),s=n+1;return ft(r.nodes(),function(o){x$(a,s,r.node(o))}),{graph:r,buckets:a,zeroIdx:s}}function x$(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function xlt(t){var e=t.graph().acyclicer==="greedy"?ylt(t,r(t)):Tlt(t);ft(e,function(n){var i=t.edge(n);t.removeEdge(n),i.forwardName=n.name,i.reversed=!0,t.setEdge(n.w,n.v,i,gG("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function Tlt(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,ft(t.outEdges(a),function(s){Object.prototype.hasOwnProperty.call(r,s.w)?e.push(s):i(s.w)}),delete r[a])}return ft(t.nodes(),i),e}function wlt(t){ft(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}function _x(t,e,r,n){var i;do i=gG(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function Clt(t){var e=new ms().setGraph(t.graph());return ft(t.nodes(),function(r){e.setNode(r,t.node(r))}),ft(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e}function Xme(t){var e=new ms({multigraph:t.isMultigraph()}).setGraph(t.graph());return ft(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),ft(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function IQ(t,e){var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=o*i/a,u=o):(i<0&&(s=-s),l=s,u=s*a/i),{x:r+l,y:n+u}}function ZR(t){var e=Xi(Fb(jme(t)+1),function(){return[]});return ft(t.nodes(),function(r){var n=t.node(r),i=n.rank;Di(i)||(e[i][n.order]=r)}),e}function klt(t){var e=KC(Xi(t.nodes(),function(r){return t.node(r).rank}));ft(t.nodes(),function(r){var n=t.node(r);zme(n,"rank")&&(n.rank-=e)})}function Slt(t){var e=KC(Xi(t.nodes(),function(a){return t.node(a).rank})),r=[];ft(t.nodes(),function(a){var s=t.node(a).rank-e;r[s]||(r[s]=[]),r[s].push(a)});var n=0,i=t.graph().nodeRankFactor;ft(r,function(a,s){Di(a)&&s%i!==0?--n:n&&ft(a,function(o){t.node(o).rank+=n})})}function NQ(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),_x(t,"border",i,e)}function jme(t){return B0(Xi(t.nodes(),function(e){var r=t.node(e).rank;if(!Di(r))return r}))}function Elt(t,e){var r={lhs:[],rhs:[]};return ft(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function Alt(t,e){return e()}function _lt(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&&ft(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,s=i.maxRank+1;a<s;++a)DQ(t,"borderLeft","_bl",r,i,a),DQ(t,"borderRight","_br",r,i,a)}}ft(t.children(),e)}function DQ(t,e,r,n,i,a){var s={width:0,height:0,rank:a,borderType:e},o=i[e][a-1],l=_x(t,"border",s,r);i[e][a]=l,t.setParent(l,n),o&&t.setEdge(o,l,{weight:1})}function Rlt(t){var e=t.graph().rankdir.toLowerCase();(e==="lr"||e==="rl")&&Kme(t)}function Llt(t){var e=t.graph().rankdir.toLowerCase();(e==="bt"||e==="rl")&&Mlt(t),(e==="lr"||e==="rl")&&(Ilt(t),Kme(t))}function Kme(t){ft(t.nodes(),function(e){OQ(t.node(e))}),ft(t.edges(),function(e){OQ(t.edge(e))})}function OQ(t){var e=t.width;t.width=t.height,t.height=e}function Mlt(t){ft(t.nodes(),function(e){kI(t.node(e))}),ft(t.edges(),function(e){var r=t.edge(e);ft(r.points,kI),Object.prototype.hasOwnProperty.call(r,"y")&&kI(r)})}function kI(t){t.y=-t.y}function Ilt(t){ft(t.nodes(),function(e){SI(t.node(e))}),ft(t.edges(),function(e){var r=t.edge(e);ft(r.points,SI),Object.prototype.hasOwnProperty.call(r,"x")&&SI(r)})}function SI(t){var e=t.x;t.x=t.y,t.y=e}function Nlt(t){t.graph().dummyChains=[],ft(t.edges(),function(e){Dlt(t,e)})}function Dlt(t,e){var r=e.v,n=t.node(r).rank,i=e.w,a=t.node(i).rank,s=e.name,o=t.edge(e),l=o.labelRank;if(a!==n+1){t.removeEdge(e);var u=void 0,h,d;for(d=0,++n;n<a;++d,++n)o.points=[],u={width:0,height:0,edgeLabel:o,edgeObj:e,rank:n},h=_x(t,"edge",u,"_d"),n===l&&(u.width=o.width,u.height=o.height,u.dummy="edge-label",u.labelpos=o.labelpos),t.setEdge(r,h,{weight:o.weight},s),d===0&&t.graph().dummyChains.push(h),r=h;t.setEdge(r,i,{weight:o.weight},s)}}function Olt(t){ft(t.graph().dummyChains,function(e){var r=t.node(e),n=r.edgeLabel,i;for(t.setEdge(r.edgeObj,n);r.dummy;)i=t.successors(e)[0],t.removeNode(e),n.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),e=i,r=t.node(e)})}function mG(t){var e={};function r(n){var i=t.node(n);if(Object.prototype.hasOwnProperty.call(e,n))return i.rank;e[n]=!0;var a=KC(Xi(t.outEdges(n),function(s){return r(s.w)-t.edge(s).minlen}));return(a===Number.POSITIVE_INFINITY||a===void 0||a===null)&&(a=0),i.rank=a}ft(t.sources(),r)}function ZC(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}function Zme(t){var e=new ms({directed:!1}),r=t.nodes()[0],n=t.nodeCount();e.setNode(r,{});for(var i,a;$lt(e,t)<n;)i=Plt(e,t),a=e.hasNode(i.v)?ZC(t,i):-ZC(t,i),Blt(e,t,a);return e}function $lt(t,e){function r(n){ft(e.nodeEdges(n),function(i){var a=i.v,s=n===a?i.w:a;!t.hasNode(s)&&!ZC(e,i)&&(t.setNode(s,{}),t.setEdge(n,s,{}),r(s))})}return ft(t.nodes(),r),t.nodeCount()}function Plt(t,e){return pG(e.edges(),function(r){if(t.hasNode(r.v)!==t.hasNode(r.w))return ZC(e,r)})}function Blt(t,e,r){ft(t.nodes(),function(n){e.node(n).rank+=r})}function Flt(){}Flt.prototype=new Error;function Qme(t,e,r){Zi(e)||(e=[e]);var n=(t.isDirected()?t.successors:t.neighbors).bind(t),i=[],a={};return ft(e,function(s){if(!t.hasNode(s))throw new Error("Graph does not have node: "+s);Jme(t,s,r==="post",a,n,i)}),i}function Jme(t,e,r,n,i,a){Object.prototype.hasOwnProperty.call(n,e)||(n[e]=!0,r||a.push(e),ft(i(e),function(s){Jme(t,s,r,n,i,a)}),r&&a.push(e))}function zlt(t,e){return Qme(t,e,"post")}function Vlt(t,e){return Qme(t,e,"pre")}fg.initLowLimValues=vG;fg.initCutValues=yG;fg.calcCutValue=eye;fg.leaveEdge=rye;fg.enterEdge=nye;fg.exchangeEdges=iye;function fg(t){t=Clt(t),mG(t);var e=Zme(t);vG(e),yG(e,t);for(var r,n;r=rye(e);)n=nye(e,t,r),iye(e,t,r,n)}function yG(t,e){var r=zlt(t,t.nodes());r=r.slice(0,r.length-1),ft(r,function(n){Glt(t,e,n)})}function Glt(t,e,r){var n=t.node(r),i=n.parent;t.edge(r,i).cutvalue=eye(t,e,r)}function eye(t,e,r){var n=t.node(r),i=n.parent,a=!0,s=e.edge(r,i),o=0;return s||(a=!1,s=e.edge(i,r)),o=s.weight,ft(e.nodeEdges(r),function(l){var u=l.v===r,h=u?l.w:l.v;if(h!==i){var d=u===a,f=e.edge(l).weight;if(o+=d?f:-f,Hlt(t,r,h)){var p=t.edge(r,h).cutvalue;o+=d?-p:p}}}),o}function vG(t,e){arguments.length<2&&(e=t.nodes()[0]),tye(t,{},1,e)}function tye(t,e,r,n,i){var a=r,s=t.node(n);return e[n]=!0,ft(t.neighbors(n),function(o){Object.prototype.hasOwnProperty.call(e,o)||(r=tye(t,e,r,o,n))}),s.low=a,s.lim=r++,i?s.parent=i:delete s.parent,r}function rye(t){return dG(t.edges(),function(e){return t.edge(e).cutvalue<0})}function nye(t,e,r){var n=r.v,i=r.w;e.hasEdge(n,i)||(n=r.w,i=r.v);var a=t.node(n),s=t.node(i),o=a,l=!1;a.lim>s.lim&&(o=s,l=!0);var u=eh(e.edges(),function(h){return l===$Q(t,t.node(h.v),o)&&l!==$Q(t,t.node(h.w),o)});return pG(u,function(h){return ZC(e,h)})}function iye(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),vG(t),yG(t,e),Wlt(t,e)}function Wlt(t,e){var r=dG(t.nodes(),function(i){return!e.node(i).parent}),n=Vlt(t,r);n=n.slice(1),ft(n,function(i){var a=t.node(i).parent,s=e.edge(i,a),o=!1;s||(s=e.edge(a,i),o=!0),e.node(i).rank=e.node(a).rank+(o?s.minlen:-s.minlen)})}function Hlt(t,e,r){return t.hasEdge(e,r)}function $Q(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function qlt(t){switch(t.graph().ranker){case"network-simplex":PQ(t);break;case"tight-tree":Ylt(t);break;case"longest-path":Ult(t);break;default:PQ(t)}}var Ult=mG;function Ylt(t){mG(t),Zme(t)}function PQ(t){fg(t)}function Xlt(t){var e=_x(t,"root",{},"_root"),r=jlt(t),n=B0(dh(r))-1,i=2*n+1;t.graph().nestingRoot=e,ft(t.edges(),function(s){t.edge(s).minlen*=i});var a=Klt(t)+1;ft(t.children(),function(s){aye(t,e,i,a,n,r,s)}),t.graph().nodeRankFactor=i}function aye(t,e,r,n,i,a,s){var o=t.children(s);if(!o.length){s!==e&&t.setEdge(e,s,{weight:0,minlen:r});return}var l=NQ(t,"_bt"),u=NQ(t,"_bb"),h=t.node(s);t.setParent(l,s),h.borderTop=l,t.setParent(u,s),h.borderBottom=u,ft(o,function(d){aye(t,e,r,n,i,a,d);var f=t.node(d),p=f.borderTop?f.borderTop:d,g=f.borderBottom?f.borderBottom:d,m=f.borderTop?n:2*n,y=p!==g?1:i-a[s]+1;t.setEdge(l,p,{weight:m,minlen:y,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:y,nestingEdge:!0})}),t.parent(s)||t.setEdge(e,l,{weight:0,minlen:i+a[s]})}function jlt(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&&ft(a,function(s){r(s,i+1)}),e[n]=i}return ft(t.children(),function(n){r(n,1)}),e}function Klt(t){return lS(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function Zlt(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,ft(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function Qlt(t,e,r){var n={},i;ft(r,function(a){for(var s=t.parent(a),o,l;s;){if(o=t.parent(s),o?(l=n[o],n[o]=s):(l=i,i=s),l&&l!==s){e.setEdge(l,s);return}s=o}})}function Jlt(t,e,r){var n=ect(t),i=new ms({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return ft(t.nodes(),function(a){var s=t.node(a),o=t.parent(a);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(i.setNode(a),i.setParent(a,o||n),ft(t[r](a),function(l){var u=l.v===a?l.w:l.v,h=i.edge(u,a),d=Di(h)?0:h.weight;i.setEdge(u,a,{weight:t.edge(l).weight+d})}),Object.prototype.hasOwnProperty.call(s,"minRank")&&i.setNode(a,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),i}function ect(t){for(var e;t.hasNode(e=gG("_root")););return e}function tct(t,e){for(var r=0,n=1;n<e.length;++n)r+=rct(t,e[n-1],e[n]);return r}function rct(t,e,r){for(var n=ilt(r,Xi(r,function(u,h){return h})),i=Ax(Xi(e,function(u){return cS(Xi(t.outEdges(u),function(h){return{pos:n[h.w],weight:t.edge(h).weight}}),"pos")})),a=1;a<r.length;)a<<=1;var s=2*a-1;a-=1;var o=Xi(new Array(s),function(){return 0}),l=0;return ft(i.forEach(function(u){var h=u.pos+a;o[h]+=u.weight;for(var d=0;h>0;)h%2&&(d+=o[h+1]),h=h-1>>1,o[h]+=u.weight;l+=u.weight*d})),l}function nct(t){var e={},r=eh(t.nodes(),function(o){return!t.children(o).length}),n=B0(Xi(r,function(o){return t.node(o).rank})),i=Xi(Fb(n+1),function(){return[]});function a(o){if(!zme(e,o)){e[o]=!0;var l=t.node(o);i[l.rank].push(o),ft(t.successors(o),a)}}var s=cS(r,function(o){return t.node(o).rank});return ft(s,a),i}function ict(t,e){return Xi(e,function(r){var n=t.inEdges(r);if(n.length){var i=lS(n,function(a,s){var o=t.edge(s),l=t.node(s.v);return{sum:a.sum+o.weight*l.order,weight:a.weight+o.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function act(t,e){var r={};ft(t,function(i,a){var s=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};Di(i.barycenter)||(s.barycenter=i.barycenter,s.weight=i.weight)}),ft(e.edges(),function(i){var a=r[i.v],s=r[i.w];!Di(a)&&!Di(s)&&(s.indegree++,a.out.push(r[i.w]))});var n=eh(r,function(i){return!i.indegree});return sct(n)}function sct(t){var e=[];function r(a){return function(s){s.merged||(Di(s.barycenter)||Di(a.barycenter)||s.barycenter>=a.barycenter)&&oct(a,s)}}function n(a){return function(s){s.in.push(a),--s.indegree===0&&t.push(s)}}for(;t.length;){var i=t.pop();e.push(i),ft(i.in.reverse(),r(i)),ft(i.out,n(i))}return Xi(eh(e,function(a){return!a.merged}),function(a){return JA(a,["vs","i","barycenter","weight"])})}function oct(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}function lct(t,e){var r=Elt(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=cS(r.rhs,function(h){return-h.i}),a=[],s=0,o=0,l=0;n.sort(cct(!!e)),l=BQ(a,i,l),ft(n,function(h){l+=h.vs.length,a.push(h.vs),s+=h.barycenter*h.weight,o+=h.weight,l=BQ(a,i,l)});var u={vs:Ax(a)};return o&&(u.barycenter=s/o,u.weight=o),u}function BQ(t,e,r){for(var n;e.length&&(n=QA(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function cct(t){return function(e,r){return e.barycenter<r.barycenter?-1:e.barycenter>r.barycenter?1:t?r.i-e.i:e.i-r.i}}function sye(t,e,r,n){var i=t.children(e),a=t.node(e),s=a?a.borderLeft:void 0,o=a?a.borderRight:void 0,l={};s&&(i=eh(i,function(g){return g!==s&&g!==o}));var u=ict(t,i);ft(u,function(g){if(t.children(g.v).length){var m=sye(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&hct(g,m)}});var h=act(u,r);uct(h,l);var d=lct(h,n);if(s&&(d.vs=Ax([s,d.vs,o]),t.predecessors(s).length)){var f=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(o)[0]);Object.prototype.hasOwnProperty.call(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function uct(t,e){ft(t,function(r){r.vs=Ax(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function hct(t,e){Di(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}function dct(t){var e=jme(t),r=FQ(t,Fb(1,e+1),"inEdges"),n=FQ(t,Fb(e-1,-1,-1),"outEdges"),i=nct(t);zQ(t,i);for(var a=Number.POSITIVE_INFINITY,s,o=0,l=0;l<4;++o,++l){fct(o%2?r:n,o%4>=2),i=ZR(t);var u=tct(t,i);u<a&&(l=0,s=Mst(i),a=u)}zQ(t,s)}function FQ(t,e,r){return Xi(e,function(n){return Jlt(t,n,r)})}function fct(t,e){var r=new ms;ft(t,function(n){var i=n.graph().root,a=sye(n,i,r,e);ft(a.vs,function(s,o){n.node(s).order=o}),Qlt(n,r,a.vs)})}function zQ(t,e){ft(e,function(r){ft(r,function(n,i){t.node(n).order=i})})}function pct(t){var e=mct(t);ft(t.graph().dummyChains,function(r){for(var n=t.node(r),i=n.edgeObj,a=gct(t,e,i.v,i.w),s=a.path,o=a.lca,l=0,u=s[l],h=!0;r!==i.w;){if(n=t.node(r),h){for(;(u=s[l])!==o&&t.node(u).maxRank<n.rank;)l++;u===o&&(h=!1)}if(!h){for(;l<s.length-1&&t.node(u=s[l+1]).minRank<=n.rank;)l++;u=s[l]}t.setParent(r,u),r=t.successors(r)[0]}})}function gct(t,e,r,n){var i=[],a=[],s=Math.min(e[r].low,e[n].low),o=Math.max(e[r].lim,e[n].lim),l,u;l=r;do l=t.parent(l),i.push(l);while(l&&(e[l].low>s||o>e[l].lim));for(u=l,l=n;(l=t.parent(l))!==u;)a.push(l);return{path:i.concat(a.reverse()),lca:u}}function mct(t){var e={},r=0;function n(i){var a=r;ft(t.children(i),n),e[i]={low:a,lim:r++}}return ft(t.children(),n),e}function yct(t,e){var r={};function n(i,a){var s=0,o=0,l=i.length,u=QA(a);return ft(a,function(h,d){var f=bct(t,h),p=f?t.node(f).order:l;(f||h===u)&&(ft(a.slice(o,d+1),function(g){ft(t.predecessors(g),function(m){var y=t.node(m),v=y.order;(v<s||p<v)&&!(y.dummy&&t.node(g).dummy)&&oye(r,m,g)})}),o=d+1,s=p)}),a}return lS(e,n),r}function vct(t,e){var r={};function n(a,s,o,l,u){var h;ft(Fb(s,o),function(d){h=a[d],t.node(h).dummy&&ft(t.predecessors(h),function(f){var p=t.node(f);p.dummy&&(p.order<l||p.order>u)&&oye(r,f,h)})})}function i(a,s){var o=-1,l,u=0;return ft(s,function(h,d){if(t.node(h).dummy==="border"){var f=t.predecessors(h);f.length&&(l=t.node(f[0]).order,n(s,u,d,o,l),u=d,o=l)}n(s,u,s.length,l,a.length)}),s}return lS(e,i),r}function bct(t,e){if(t.node(e).dummy)return dG(t.predecessors(e),function(r){return t.node(r).dummy})}function oye(t,e,r){if(e>r){var n=e;e=r,r=n}Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=t[e];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function xct(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function Tct(t,e,r,n){var i={},a={},s={};return ft(e,function(o){ft(o,function(l,u){i[l]=l,a[l]=l,s[l]=u})}),ft(e,function(o){var l=-1;ft(o,function(u){var h=n(u);if(h.length){h=cS(h,function(m){return s[m]});for(var d=(h.length-1)/2,f=Math.floor(d),p=Math.ceil(d);f<=p;++f){var g=h[f];a[u]===u&&l<s[g]&&!xct(r,u,g)&&(a[g]=u,a[u]=i[u]=i[g],l=s[g])}}})}),{root:i,align:a}}function wct(t,e,r,n,i){var a={},s=Cct(t,e,r,i),o=i?"borderLeft":"borderRight";function l(d,f){for(var p=s.nodes(),g=p.pop(),m={};g;)m[g]?d(g):(m[g]=!0,p.push(g),p=p.concat(f(g))),g=p.pop()}function u(d){a[d]=s.inEdges(d).reduce(function(f,p){return Math.max(f,a[p.v]+s.edge(p))},0)}function h(d){var f=s.outEdges(d).reduce(function(g,m){return Math.min(g,a[m.w]-s.edge(m))},Number.POSITIVE_INFINITY),p=t.node(d);f!==Number.POSITIVE_INFINITY&&p.borderType!==o&&(a[d]=Math.max(a[d],f))}return l(u,s.predecessors.bind(s)),l(h,s.successors.bind(s)),ft(n,function(d){a[d]=a[r[d]]}),a}function Cct(t,e,r,n){var i=new ms,a=t.graph(),s=_ct(a.nodesep,a.edgesep,n);return ft(e,function(o){var l;ft(o,function(u){var h=r[u];if(i.setNode(h),l){var d=r[l],f=i.edge(d,h);i.setEdge(d,h,Math.max(s(t,u,l),f||0))}l=u})}),i}function kct(t,e){return pG(dh(e),function(r){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return _ot(r,function(a,s){var o=Rct(t,s)/2;n=Math.max(a+o,n),i=Math.min(a-o,i)}),n-i})}function Sct(t,e){var r=dh(e),n=KC(r),i=B0(r);ft(["u","d"],function(a){ft(["l","r"],function(s){var o=a+s,l=t[o],u;if(l!==e){var h=dh(l);u=s==="l"?n-KC(h):i-B0(h),u&&(t[o]=KR(l,function(d){return d+u}))}})})}function Ect(t,e){return KR(t.ul,function(r,n){if(e)return t[e.toLowerCase()][n];var i=cS(Xi(t,n));return(i[1]+i[2])/2})}function Act(t){var e=ZR(t),r=v$(yct(t,e),vct(t,e)),n={},i;ft(["u","d"],function(s){i=s==="u"?e:dh(e).reverse(),ft(["l","r"],function(o){o==="r"&&(i=Xi(i,function(d){return dh(d).reverse()}));var l=(s==="u"?t.predecessors:t.successors).bind(t),u=Tct(t,i,r,l),h=wct(t,i,u.root,u.align,o==="r");o==="r"&&(h=KR(h,function(d){return-d})),n[s+o]=h})});var a=kct(t,n);return Sct(n,a),Ect(n,t.graph().align)}function _ct(t,e,r){return function(n,i,a){var s=n.node(i),o=n.node(a),l=0,u;if(l+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":u=-s.width/2;break;case"r":u=s.width/2;break}if(u&&(l+=r?u:-u),u=0,l+=(s.dummy?e:t)/2,l+=(o.dummy?e:t)/2,l+=o.width/2,Object.prototype.hasOwnProperty.call(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":u=o.width/2;break;case"r":u=-o.width/2;break}return u&&(l+=r?u:-u),u=0,l}}function Rct(t,e){return t.node(e).width}function Lct(t){t=Xme(t),Mct(t),Rot(Act(t),function(e,r){t.node(r).x=e})}function Mct(t){var e=ZR(t),r=t.graph().ranksep,n=0;ft(e,function(i){var a=B0(Xi(i,function(s){return t.node(s).height}));ft(i,function(s){t.node(s).y=n+a/2}),n+=a+r})}function lye(t,e){var r=Alt;r("layout",()=>{var n=r(" buildLayoutGraph",()=>Gct(t));r(" runLayout",()=>Ict(n,r)),r(" updateInputGraph",()=>Nct(t,n))})}function Ict(t,e){e(" makeSpaceForEdgeLabels",()=>Wct(t)),e(" removeSelfEdges",()=>Qct(t)),e(" acyclic",()=>xlt(t)),e(" nestingGraph.run",()=>Xlt(t)),e(" rank",()=>qlt(Xme(t))),e(" injectEdgeLabelProxies",()=>Hct(t)),e(" removeEmptyRanks",()=>Slt(t)),e(" nestingGraph.cleanup",()=>Zlt(t)),e(" normalizeRanks",()=>klt(t)),e(" assignRankMinMax",()=>qct(t)),e(" removeEdgeLabelProxies",()=>Uct(t)),e(" normalize.run",()=>Nlt(t)),e(" parentDummyChains",()=>pct(t)),e(" addBorderSegments",()=>_lt(t)),e(" order",()=>dct(t)),e(" insertSelfEdges",()=>Jct(t)),e(" adjustCoordinateSystem",()=>Rlt(t)),e(" position",()=>Lct(t)),e(" positionSelfEdges",()=>eut(t)),e(" removeBorderNodes",()=>Zct(t)),e(" normalize.undo",()=>Olt(t)),e(" fixupEdgeLabelCoords",()=>jct(t)),e(" undoCoordinateSystem",()=>Llt(t)),e(" translateGraph",()=>Yct(t)),e(" assignNodeIntersects",()=>Xct(t)),e(" reversePoints",()=>Kct(t)),e(" acyclic.undo",()=>wlt(t))}function Nct(t,e){ft(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),ft(t.edges(),function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var Dct=["nodesep","edgesep","ranksep","marginx","marginy"],Oct={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},$ct=["acyclicer","ranker","rankdir","align"],Pct=["width","height"],Bct={width:0,height:0},Fct=["minlen","weight","width","height","labeloffset"],zct={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Vct=["labelpos"];function Gct(t){var e=new ms({multigraph:!0,compound:!0}),r=AI(t.graph());return e.setGraph(v$({},Oct,EI(r,Dct),JA(r,$ct))),ft(t.nodes(),function(n){var i=AI(t.node(n));e.setNode(n,Tot(EI(i,Pct),Bct)),e.setParent(n,t.parent(n))}),ft(t.edges(),function(n){var i=AI(t.edge(n));e.setEdge(n,v$({},zct,EI(i,Fct),JA(i,Vct)))}),e}function Wct(t){var e=t.graph();e.ranksep/=2,ft(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function Hct(t){ft(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-n.rank)/2+n.rank,e};_x(t,"edge-proxy",a,"_ep")}})}function qct(t){var e=0;ft(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=B0(e,n.maxRank))}),t.graph().maxRank=e}function Uct(t){ft(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function Yct(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=t.graph(),s=a.marginx||0,o=a.marginy||0;function l(u){var h=u.x,d=u.y,f=u.width,p=u.height;e=Math.min(e,h-f/2),r=Math.max(r,h+f/2),n=Math.min(n,d-p/2),i=Math.max(i,d+p/2)}ft(t.nodes(),function(u){l(t.node(u))}),ft(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=s,n-=o,ft(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),ft(t.edges(),function(u){var h=t.edge(u);ft(h.points,function(d){d.x-=e,d.y-=n}),Object.prototype.hasOwnProperty.call(h,"x")&&(h.x-=e),Object.prototype.hasOwnProperty.call(h,"y")&&(h.y-=n)}),a.width=r-e+s,a.height=i-n+o}function Xct(t){ft(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=i,s=n),r.points.unshift(IQ(n,a)),r.points.push(IQ(i,s))})}function jct(t){ft(t.edges(),function(e){var r=t.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function Kct(t){ft(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function Zct(t){ft(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),a=t.node(QA(r.borderLeft)),s=t.node(QA(r.borderRight));r.width=Math.abs(s.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),ft(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function Qct(t){ft(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function Jct(t){var e=ZR(t);ft(e,function(r){var n=0;ft(r,function(i,a){var s=t.node(i);s.order=a+n,ft(s.selfEdges,function(o){_x(t,"selfedge",{width:o.label.width,height:o.label.height,rank:s.rank,order:a+ ++n,e:o.e,label:o.label},"_se")}),delete s.selfEdges})})}function eut(t){ft(t.nodes(),function(e){var r=t.node(e);if(r.dummy==="selfedge"){var n=t.node(r.e.v),i=n.x+n.width/2,a=n.y,s=r.x-i,o=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{x:i+s,y:a},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],r.label.x=r.x,r.label.y=r.y}})}function EI(t,e){return KR(JA(t,e),Number)}function AI(t){var e={};return ft(t,function(r,n){e[n.toLowerCase()]=r}),e}var VQ=x((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),GQ=x((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),tut=x(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram","shouldMergeSelfLoopSegments"),rut=x((t,e,r,n,i)=>{const a=[],s=new Set;if(r.forEach(({start:h,end:d})=>{h!==n&&s.add(h),d!==n&&s.add(d)}),s.forEach(h=>{const d=t.node(h);typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&a.push(d)}),a.length===0&&r.forEach(({edge:h})=>{(h.points??[]).forEach(d=>{typeof(d==null?void 0:d.x)=="number"&&typeof(d==null?void 0:d.y)=="number"&&a.push(d)})}),a.length===0)return GQ(i);const o=a.reduce((h,d)=>({x:h.x+d.x/a.length,y:h.y+d.y/a.length}),{x:0,y:0}),l=o.x-e.x,u=o.y-e.y;return Math.abs(l)>Math.abs(u)?l>0?"right":"left":Math.abs(u)>0?u>0?"bottom":"top":GQ(i)},"getSelfLoopSide"),nut=x((t,e="top",r=0,n=0)=>{const i=t.x,a=t.y-r,s=t.width/2,o=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),u=VQ(Math.max(n,t.width*.35),36,l),h=VQ(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const d=a+o;return[{x:i-u/2,y:d},{x:i-u/2,y:d+h},{x:i+u/2,y:d+h},{x:i+u/2,y:d}]}case"right":{const d=i+s;return[{x:d,y:a-u/2},{x:d+h,y:a-u/2},{x:d+h,y:a+u/2},{x:d,y:a+u/2}]}case"left":{const d=i-s;return[{x:d,y:a-u/2},{x:d-h,y:a-u/2},{x:d-h,y:a+u/2},{x:d,y:a+u/2}]}case"top":default:{const d=a-o;return[{x:i-u/2,y:d},{x:i-u/2,y:d-h},{x:i+u/2,y:d-h},{x:i+u/2,y:d}]}}},"getSelfLoopPoints"),iut=x((t,e,r="top",n=0,i={})=>{const s=t.x,o=t.y-n,l=i.width??0,u=i.height??0;switch(r){case"bottom":return{x:s,y:Math.max(...e.map(h=>h.y))+u/2+4};case"right":return{x:Math.max(...e.map(h=>h.x))+l/2+4,y:o};case"left":return{x:Math.min(...e.map(h=>h.x))-l/2-4,y:o};case"top":default:return{x:s,y:Math.min(...e.map(h=>h.y))-u/2-4}}},"getSelfLoopLabelPosition"),cye=x((t,e=0,{mergeSelfLoops:r=!0}={})=>{var s;const n=new Map,i=[],a=(s=t.graph())==null?void 0:s.rankdir;return t.edges().forEach(o=>{const l=t.edge(o);if(r&&l.selfLoop){const u=l.selfLoop.id;n.has(u)||n.set(u,[]),n.get(u).push({edge:l,start:o.v,end:o.w})}else i.push({edge:l,start:o.v,end:o.w})}),n.forEach(o=>{if(o.length!==3){o.forEach(T=>i.push(T));return}o.sort((T,b)=>T.edge.selfLoop.order-b.edge.selfLoop.order);const[l,u,h]=o,d=l.edge.originalEdge??u.edge.originalEdge??h.edge.originalEdge??u.edge,f=t.node(d.start);if(!f){o.forEach(T=>i.push(T));return}const p={width:u.edge.width,height:u.edge.height},g=rut(t,f,o,d.start,a),m=nut(f,g,e,p.width??0),y=iut(f,m,g,e,p),v={...u.edge,...d,id:d.id,points:m,start:d.start,end:d.end,x:y.x,y:y.y,width:p.width,height:p.height,labelStyle:u.edge.labelStyle,fromCluster:l.edge.fromCluster??u.edge.fromCluster??h.edge.fromCluster,toCluster:l.edge.toCluster??u.edge.toCluster??h.edge.toCluster};delete v.selfLoop,delete v.originalEdge,i.push({edge:v,start:v.start,end:v.end})}),i},"getEdgesToRender"),uye=x(async(t,e,r,n,i,a)=>{le.warn("Graph in recursive render:XAX",fh(e),i);const s=e.graph().rankdir;le.trace("Dir in recursive render - dir:",s);const o=t.insert("g").attr("class","root");e.nodes()?le.info("Recursive render XXX",e.nodes()):le.info("No nodes found for",e),e.edges().length>0&&le.info("Recursive edges",e.edge(e.edges()[0]));const l=o.insert("g").attr("class","clusters"),u=o.insert("g").attr("class","edgePaths"),h=o.insert("g").attr("class","edgeLabels"),d=o.insert("g").attr("class","nodes"),f=tut(r);await Promise.all(e.nodes().map(async function(T){const b=e.node(T);if(i!==void 0){const w=JSON.parse(JSON.stringify(i.clusterData));le.trace(`Setting data for parent cluster XXX
Node.id = `,T,`
data=`,w.height,`
Parent cluster`,i.height),e.setNode(i.id,w),e.parent(T)||(le.trace("Setting parent",T,i.id),e.setParent(T,i.id,w))}if(le.info("(Insert) Node XXX"+T+": "+JSON.stringify(e.node(T))),b!=null&&b.clusterNode){le.info("Cluster identified XBX",T,b.width,e.node(T));const{ranksep:w,nodesep:C}=e.graph();b.graph.setGraph({...b.graph.graph(),ranksep:w+25,nodesep:C});const S=await uye(d,b.graph,r,n,e.node(T),a),k=S.elem;Kt(b,k),b.diff=S.diff||0,le.info("New compound node after recursive render XAX",T,"width",b.width,"height",b.height),eKe(k,b)}else e.children(T).length>0?(le.trace("Cluster - the non recursive path XBX",T,b.id,b,b.width,"Graph:",e),le.trace(zb(b.id,e)),Lr.set(b.id,{id:zb(b.id,e),node:b})):(le.trace("Node - the non recursive path XAX",T,d,e.node(T),s),await rS(d,e.node(T),{config:a,dir:s}))})),await x(async()=>{const T=e.edges().map(async function(b){const w=e.edge(b.v,b.w,b.name);if(le.info("Edge "+b.v+" -> "+b.w+": "+JSON.stringify(b)),le.info("Edge "+b.v+" -> "+b.w+": ",b," ",JSON.stringify(e.edge(b))),le.info("Fix",Lr,"ids:",b.v,b.w,"Translating: ",Lr.get(b.v),Lr.get(b.w)),f&&w.selfLoop){if(w.selfLoop.order!==1)return;const C=w.id;w.id=w.selfLoop.id,await zA(h,w),w.id=C;return}await zA(h,w)});await Promise.all(T)},"processEdges")(),le.info("Graph before layout:",JSON.stringify(fh(e))),le.info("############################################# XXX"),le.info("### Layout ### XXX"),le.info("############################################# XXX"),lye(e),le.info("Graph after layout:",JSON.stringify(fh(e)));let g=0,{subGraphTitleTotalMargin:m}=vx(a);await Promise.all(dlt(e).map(async function(T){var w;const b=e.node(T);if(le.info("Position XBX => "+T+": ("+b.x,","+b.y,") width: ",b.width," height: ",b.height),b!=null&&b.clusterNode)b.y+=m,le.info("A tainted cluster node XBX1",T,b.id,b.width,b.height,b.x,b.y,e.parent(T)),Lr.get(b.id).node=b,FA(b);else if(e.children(T).length>0){le.info("A pure cluster node XBX1",T,b.id,b.x,b.y,b.width,b.height,e.parent(T)),b.height+=m,e.node(b.parentId);const C=(b==null?void 0:b.padding)/2||0,S=((w=b==null?void 0:b.labelBBox)==null?void 0:w.height)||0,k=S-C||0;le.debug("OffsetY",k,"labelHeight",S,"halfPadding",C),await xR(l,b),Lr.get(b.id).node=b}else{const C=e.node(b.parentId);b.y+=m/2,le.info("A regular node XBX1 - using the padding",b.id,"parent",b.parentId,b.width,b.height,b.x,b.y,"offsetY",b.offsetY,"parent",C,C==null?void 0:C.offsetY,b),FA(b)}}));const y=m/2;return cye(e,y,{mergeSelfLoops:f}).forEach(function({edge:T,start:b,end:w}){le.info("Edge "+b+" -> "+w+": "+JSON.stringify(T),T),T.points.forEach(E=>E.y+=y);const C=e.node(b),S=e.node(w),k=RV(u,T,Lr,r,C,S,n);Vpe(T,k)}),e.nodes().forEach(function(T){const b=e.node(T);le.info(T,b.type,b.diff),b.isGroup&&(g=b.diff)}),le.warn("Returning from recursive render XAX",o,g),{elem:o,diff:g}},"recursiveRender"),aut=x(async(t,e)=>{var a,s,o,l,u,h;const r=new ms({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:((a=t.config)==null?void 0:a.nodeSpacing)||((o=(s=t.config)==null?void 0:s.flowchart)==null?void 0:o.nodeSpacing)||t.nodeSpacing,ranksep:((l=t.config)==null?void 0:l.rankSpacing)||((h=(u=t.config)==null?void 0:u.flowchart)==null?void 0:h.rankSpacing)||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=e.select("g");LV(n,t.markers,t.type,t.diagramId),Bpe(),zpe(),yfe(),Wme(),t.nodes.forEach(d=>{r.setNode(d.id,{...d}),d.parentId&&r.setParent(d.id,d.parentId)}),le.debug("Edges:",t.edges),t.edges.forEach(d=>{if(d.start===d.end){const f=d.start,p=f+"---"+f+"---1",g=f+"---"+f+"---2",m=r.node(f);r.setNode(p,{domId:p,id:p,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(p,m.parentId),r.setNode(g,{domId:g,id:g,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(g,m.parentId);const y=structuredClone(d),v=structuredClone(d),T=structuredClone(d),b=structuredClone(d);v.originalEdge=y,v.selfLoop={id:y.id,order:0},T.originalEdge=y,T.selfLoop={id:y.id,order:1},b.originalEdge=y,b.selfLoop={id:y.id,order:2},v.label="",v.arrowTypeEnd="none",v.endLabelLeft="",v.endLabelRight="",v.startLabelLeft="",v.id=f+"-cyclic-special-1",T.startLabelRight="",T.startLabelLeft="",T.endLabelLeft="",T.endLabelRight="",T.arrowTypeStart="none",T.arrowTypeEnd="none",T.id=f+"-cyclic-special-mid",b.label="",b.startLabelRight="",b.startLabelLeft="",b.arrowTypeStart="none",m.isGroup&&(v.fromCluster=f,b.toCluster=f),b.id=f+"-cyclic-special-2",b.arrowTypeStart="none",r.setEdge(f,p,v,f+"-cyclic-special-0"),r.setEdge(p,g,T,f+"-cyclic-special-1"),r.setEdge(g,f,b,f+"-cyclic-special-2")}else r.setEdge(d.start,d.end,{...d},d.id)}),le.warn("Graph at first:",JSON.stringify(fh(r))),hlt(r),le.warn("Graph after XAX:",JSON.stringify(fh(r)));const i=Fe();await uye(n,r,t.type,t.diagramId,void 0,i)},"render");const sut=Object.freeze(Object.defineProperty({__proto__:null,getEdgesToRender:cye,render:aut},Symbol.toStringTag,{value:"Module"}));async function hye(t,e){const r=new ms({multigraph:!0,compound:!0}),n=[...e.edges],i=Fe(),a=t.insert("g").attr("class","root"),s=a.insert("g").attr("class","clusters"),o=a.insert("g").attr("class","edges edgePath"),l=a.insert("g").attr("class","edgeLabels"),u=a.insert("g").attr("class","nodes"),h=new Map,d=t.node()!=null;await Promise.all(e.nodes.map(async f=>{var p;if(f.isGroup)r.setNode(f.id,{...f});else{if(d){const g=await rS(u,f,{config:i,dir:f.dir}),m=((p=g.node())==null?void 0:p.getBBox())??{width:0,height:0};h.set(f.id,g),f.width=m.width,f.height=m.height}r.setNode(f.id,{...f})}}));for(const f of n)r.setEdge(f.start,f.end,{...f},f.id),e.edges.some(g=>g.id===f.id)||e.edges.push(f);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:f}=await tr(async()=>{const{captureNodeSizes:p}=await Promise.resolve().then(()=>sPt);return{captureNodeSizes:p}},void 0,import.meta.url);f(t,e)}return{graph:r,groups:{clusters:s,edgePaths:o,edgeLabels:l,nodes:u,rootGroups:a},nodeElements:h}}x(hye,"createGraphWithElements");var WQ=5,VE=1e-5,GE=1e-6;function e_(t){const e=[];for(let r=0;r<t.length-1;r++)e.push({a:t[r],b:t[r+1]});return e}x(e_,"buildSegmentList");function dye(t,e,r,n){const i=e.x-t.x,a=e.y-t.y,s=n.x-r.x,o=n.y-r.y,l=i*o-a*s;if(l===0)return null;const u=r.x-t.x,h=r.y-t.y,d=(u*o-h*s)/l,f=(u*a-h*i)/l;return d<=GE||d>=1-GE||f<=GE||f>=1-GE?null:{point:{x:t.x+d*i,y:t.y+d*a},tA:d,tB:f}}x(dye,"segmentIntersection");function T$(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}x(T$,"isHorizontalSeg");function fye(t){const e=[];for(let r=0;r<t.length;r++){const n=t[r],i=e_(n.points);for(let a=r+1;a<t.length;a++){const s=t[a],o=e_(s.points);for(const[l,u]of i.entries())for(const[h,d]of o.entries()){const f=dye(u.a,u.b,d.a,d.b);if(!f)continue;const p=T$(u),g=T$(d);(p!==g?p:!1)?e.push({jumpEdgeId:n.id,otherEdgeId:s.id,segIndex:l,t:f.tA,point:f.point}):e.push({jumpEdgeId:s.id,otherEdgeId:n.id,segIndex:h,t:f.tB,point:f.point})}}}return e}x(fye,"findEdgeIntersections");function Vl(t){const e=Math.round(t*1e3)/1e3;return Number.isInteger(e)?`${e}`:`${e}`}x(Vl,"fmt");function yy(t){return`${Vl(t.x)},${Vl(t.y)}`}x(yy,"pointToString");function pye(t){const e=t.b.x-t.a.x,r=t.b.y-t.a.y;return Math.abs(e)>=Math.abs(r)?e>=0?1:0:r>=0?1:0}x(pye,"getArcSweepFlag");var out=.001;function gye(t,e){if(t.length<2)return t.map(a=>({...a}));const r=t.map(a=>({...a})),n=e.arrowTypeStart&&ma[e.arrowTypeStart];if(n){const a=t[0],s=t[1],o=Math.atan2(s.y-a.y,s.x-a.x);r[0].x=a.x+n*Math.cos(o),r[0].y=a.y+n*Math.sin(o)}const i=e.arrowTypeEnd&&ma[e.arrowTypeEnd];if(i){const a=t.length,s=t[a-2],o=t[a-1],l=Math.atan2(o.y-s.y,o.x-s.x);r[a-1].x=o.x-i*Math.cos(l),r[a-1].y=o.y-i*Math.sin(l)}return r}x(gye,"applyMarkerOffsets");function mye(t,e,r,n,i){const a=t.point.x,s=t.point.y,o={x:a-e*t.r,y:s-r*t.r},l={x:a+e*t.r,y:s+r*t.r},u=[`L${yy(o)}`];return i==="arc"?u.push(`A${Vl(t.r)},${Vl(t.r)} 0 0 ${n} ${yy(l)}`):u.push(`M${yy(l)}`),u}x(mye,"emitJump");function w$(t,e,r,n){const i=e.x-t.x,a=e.y-t.y,s=r.x-e.x,o=r.y-e.y,l=Math.hypot(i,a),u=Math.hypot(s,o);if(l<VE||u<VE)return null;const h=i/l,d=a/l,f=s/u,p=o/u,g=h*f+d*p,m=Math.max(-1,Math.min(1,g)),y=Math.acos(m);if(y<VE||Math.abs(Math.PI-y)<VE)return null;const v=Math.min(n/Math.sin(y/2),l/2,u/2);return{startX:e.x-h*v,startY:e.y-d*v,endX:e.x+f*v,endY:e.y+p*v,ctrlX:e.x,ctrlY:e.y,cutLen:v}}x(w$,"computeRoundedCorner");function yye(t,e,r){const n=t.points;if(n.length<2)return"";const i=gye(n,t),a=t.curve==="rounded",s=e_(i),o=new Map;for(const u of e){const h=s[u.segIndex];if(!h)continue;const d=Math.hypot(h.b.x-h.a.x,h.b.y-h.a.y),f=o.get(u.segIndex)??[];f.push({t:u.t,point:u.point,d:u.t*d,r:r.jumpRadius}),o.set(u.segIndex,f)}const l=[`M${yy(i[0])}`];for(let u=0;u<s.length;u++){const h=s[u],d=Math.hypot(h.b.x-h.a.x,h.b.y-h.a.y),f=d===0?0:(h.b.x-h.a.x)/d,p=d===0?0:(h.b.y-h.a.y)/d,g=pye(h);let m=0;if(a&&u>0){const b=w$(i[u-1],i[u],i[u+1]??i[u],WQ);b&&(m=b.cutLen)}let y=d,v=null;a&&u<s.length-1&&(v=w$(i[u],i[u+1],i[u+2]??i[u+1],WQ),v&&(y=d-v.cutLen));const T=[...o.get(u)??[]].sort((b,w)=>b.t-w.t);for(const b of T)b.r=Math.min(b.r,b.d-m,y-b.d);for(let b=0;b<T.length-1;b++){const w=T[b+1].d-T[b].d;if(T[b].r+T[b+1].r>w){const C=w/2;T[b].r=Math.min(T[b].r,C),T[b+1].r=Math.min(T[b+1].r,C)}}for(const b of T)b.r<out||l.push(...mye(b,f,p,g,r.jumpStyle));a&&v?(l.push(`L${Vl(v.startX)},${Vl(v.startY)}`),l.push(`Q${Vl(v.ctrlX)},${Vl(v.ctrlY)} ${Vl(v.endX)},${Vl(v.endY)}`)):l.push(`L${yy(h.b)}`)}return l.join(" ")}x(yye,"rewriteEdgePath");function vye(t){return/^[\d\s+,.LMelm-]*$/.test(t)}x(vye,"isStraightPath");function bye(t){return t?t==="linear"||t==="rounded"||t==="step"||t==="stepBefore"||t==="stepAfter":!0}x(bye,"curveSupportsLineHops");function xye(t){if(!t)return null;try{const e=typeof atob=="function"?atob(t):Buffer.from(t,"base64").toString(),r=JSON.parse(e);if(!Array.isArray(r))return null;const n=[];for(const i of r)i&&typeof i.x=="number"&&typeof i.y=="number"&&n.push({x:i.x,y:i.y});return n.length>=2?n:null}catch{return null}}x(xye,"decodeDataPoints");function Tye(t,e,r){if(!r.enabled)return;const n=t.node();if(!n)return;const i=new Map;for(const u of e)i.set(u.id,u);const a=[],s=new Map;for(const u of e){const h=typeof CSS<"u"&&CSS.escape?CSS.escape(u.id):u.id,d=n.querySelector(`path[data-id="${h}"]`);if(!d)continue;s.set(u.id,d);const p=xye(d.getAttribute("data-points"))??u.points;a.push({...u,points:p})}const o=fye(a);if(o.length===0)return;const l=new Map;for(const u of o){const h=l.get(u.jumpEdgeId)??[];h.push(u),l.set(u.jumpEdgeId,h)}for(const u of a){const h=l.get(u.id);if(!h||h.length===0)continue;const d=i.get(u.id),f=d==null?void 0:d.curve;if(f!==void 0&&!bye(f))continue;const p=s.get(u.id);if(!p)continue;if(f===void 0){const b=p.getAttribute("d")??"";if(!vye(b))continue}const g=p.getAttribute("style")??"",m=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(g),y=m?Number.parseFloat(m[1]):null,v=m?Number.parseFloat(m[2]):null,T=yye(u,h,r);if(p.setAttribute("d",T),y!==null&&v!==null&&typeof p.getTotalLength=="function"){const b=p.getTotalLength(),w=Math.max(0,b-y-v),C=`0 ${y} ${w} ${v}`,S=g.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${C};`).replace(/;\s*;+/g,";");p.setAttribute("style",S)}}}x(Tye,"applyLineJumpsToSvg");async function wye(t,e){var i,a;for(const s of t.nodes)s.isGroup?await xR(e.clusters,s):FA(s);const r=new Map;for(const s of t.nodes)s!=null&&s.id&&r.set(s.id,s);for(const s of t.edges){const o=s.start?r.get(s.start)??{}:{},l=s.end?r.get(s.end)??{}:{},u=RV(e.edgePaths,{...s},{},t.type,o,l,t.diagramId);s.label&&await zA(e.rootGroups,s),s.label&&Cye(s,u)}const n=(a=(i=t.config)==null?void 0:i.swimlane)==null?void 0:a.lineHops;if(n!==!1){const s=n==="gap"?"gap":"arc",o=t.edges.filter(l=>Array.isArray(l.points)&&l.points.length>=2).map(l=>({id:l.id,points:l.points,curve:l.curve,arrowTypeStart:l.arrowTypeStart,arrowTypeEnd:l.arrowTypeEnd}));Tye(e.edgePaths,o,{enabled:!0,jumpRadius:6,jumpStyle:s})}}x(wye,"adjustLayout");function Cye(t,e){const r=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),n=Xt(),{subGraphTitleTotalMargin:i}=vx({flowchart:n.flowchart??{}});if(t.label){const a=zC.get(t.id);let s=t.x,o=t.y;if(r){const l=yr.calcLabelPosition(r);le.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t!=null&&t.startLabelLeft){const a=Li.get(t.id).startLeft;let s=t==null?void 0:t.x,o=t==null?void 0:t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=Li.get(t.id).startRight;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=Li.get(t.id).endLeft;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=Li.get(t.id).endRight;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}}x(Cye,"positionEdgeLabel");var _I="__swimlane_default__",lut=21,HQ=20;function C$(t){return Math.max(t.padding??HQ,HQ)}x(C$,"topLaneHorizontalPadding");function kye(t){const{x:e,y:r,width:n,height:i}=t,a=t.swimlaneContentTop;if(typeof e!="number"||typeof r!="number"||typeof n!="number"||typeof i!="number"||typeof a!="number"||!Number.isFinite(e)||!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(i)||!Number.isFinite(a)||n<=0||i<=0){delete t.groupTitleRect;return}const s=r-i/2,o=Math.min(a,r+i/2),l=Math.min(lut,Math.max(0,o-s)),u=s+l;if(u<=s){delete t.groupTitleRect;return}t.groupTitleRect={left:e-n/2,right:e+n/2,top:s,bottom:u}}x(kye,"assignTopLaneTitleRect");function Sye(t){const e=t.direction,r=t.nodes??(t.nodes=[]);for(const a of t.nodes??[])a.isGroup&&!a.parentId&&(a.shape="swimlane",e&&(a.direction=e));const n=r.filter(a=>!a.isGroup&&!a.parentId);if(n.length===0)return;let i=r.find(a=>a.id===_I);i?i.isGroup&&(i.shape="swimlane",e&&(i.direction=e)):(i={id:_I,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},r.push(i));for(const a of n)a.parentId=_I}x(Sye,"prepareLayoutForSwimlanes");function Eye(t){const e=new Map;for(const l of t.nodes??[])e.set(l.id,l);const r=[];for(const l of t.edges??[]){const u=typeof l.start=="string"?l.start:void 0,h=typeof l.end=="string"?l.end:void 0;!u||!h||l.labelNodeId||r.push({id:l.id,src:u,dst:h,ref:l})}const n=t.nodes??[],i=n.filter(l=>l.isGroup),a=n.filter(l=>!l.isGroup);return{nodes:[...[...i].reverse(),...a].map(l=>l.id),edges:r,layout:t,nodeById:e}}x(Eye,"toGraphView");function Aye(t,e,r,n){const{layout:i}=t,a=t.nodeById,s=(n==null?void 0:n.layerGap)??100,o=(n==null?void 0:n.nodeGap)??40;let l=0;for(const f of e.layers){let p=0;for(const g of f){const m=a.get(g);if(!m){p++;continue}m.layer=l,m.order=p;const y=r.x[g]??p*o,v=r.y[g]??l*s;m.x=y,m.y=v,p++}l++}const u=i.nodes??[],h=new Map,d=[];for(const f of u){if(!(f!=null&&f.isGroup))continue;f.parentId||d.push(f);const p=u.filter(T=>T.parentId===f.id);let g=1/0,m=-1/0,y=1/0,v=-1/0;for(const T of p){const b=T.x??r.x[T.id],w=T.y??r.y[T.id],C=T.width??0,S=T.height??0;b!=null&&w!=null&&(g=Math.min(g,b-C/2),m=Math.max(m,b+C/2),y=Math.min(y,w-S/2),v=Math.max(v,w+S/2))}if(g===1/0||y===1/0)f.x=f.x??0,f.y=f.y??0,f.width=f.width??0,f.height=f.height??0;else{const T=f.padding??20,b=f.parentId?T:2*C$(f),w=T,C=Math.max(0,m-g)+b,S=Math.max(0,v-y)+w,k=(g+m)/2,E=(y+v)/2;f.x=k,f.y=E,f.width=C,f.height=S,h.set(f.id,{minX:g,maxX:m,minY:y,maxY:v})}}if(d.length>0&&h.size>0){let f=1/0,p=-1/0,g=0;for(const m of d){const y=m.padding??20;y>g&&(g=y);const v=h.get(m.id);v&&(f=Math.min(f,v.minY),p=Math.max(p,v.maxY))}if(f!==1/0&&p!==-1/0){const m=Math.max(0,p-f),v=Math.max(g,36),T=m+2*v,b=(f+p)/2;for(const _ of d)_.y=b,_.height=T,_.swimlaneContentTop=f;const w=[...d].sort((_,M)=>{const L=_.x??0,P=M.x??0;return L-P}),C=[],S=[],k=[];for(const _ of w){const M=h.get(_.id);if(!M)continue;const L=Math.max(0,M.maxX-M.minX)+2*C$(_),P=(M.minX+M.maxX)/2;C.push(_.id),S.push(P),k.push(L)}const E=C.length;if(E>0){const _=new Map;if(E===1)_.set(C[0],k[0]);else{const M=[];for(let I=0;I<E-1;I++)M.push(S[I+1]-S[I]);const L=new Array(E);L[0]=0;for(let I=0;I<E-1;I++)L[I+1]=2*M[I]-L[I];let P=0,D=Number.POSITIVE_INFINITY;for(let I=0;I<E;I++){const $=k[I];I%2===0?P=Math.max(P,$-L[I]):D=Math.min(D,L[I]-$)}let R=P;P<=D?R=(P+D)/2:R=P;for(let I=0;I<E;I++){const $=L[I]+(I%2===0?R:-R),O=Math.max(k[I],$);_.set(C[I],O)}}for(const M of d){const L=_.get(M.id);L!=null&&(M.width=L),kye(M)}}}}}x(Aye,"writeBackToLayoutData");var cut="[EdgeLabelNodes]";function _ye(t){const e=[],r=[],n=new Map;for(const s of t.nodes)n.set(s.id,s);for(const s of t.edges){if(!s.label||s.label.length===0||s.isLayoutOnly||s.labelNodeId)continue;const o=s.start?n.get(s.start):void 0,l=s.end?n.get(s.end):void 0;if(!o||!l){le.warn(cut,`Edge ${s.id} has missing source or target node`);continue}const u=`edge-label-${s.start}-${s.end}-${s.id}`,d=o.parentId!==l.parentId?l.parentId:o.parentId,f={id:u,label:s.label,edgeStart:s.start??"",edgeEnd:s.end??"",shape:"labelRect",width:0,height:0,isEdgeLabel:!0,isDummy:!0,parentId:d,isGroup:!1,labelStyle:Array.isArray(s.labelStyle)?s.labelStyle[0]:s.labelStyle??"",...o.dir?{dir:o.dir}:{}};e.push(f),s.labelNodeId=u,s.label=void 0,s.text=void 0;const p={id:`${s.id}-to-label`,start:s.start,end:u,type:"normal",isLayoutOnly:!0},g={id:`${s.id}-from-label`,start:u,end:s.end,type:"normal",isLayoutOnly:!0};r.push(p,g)}const i=[...t.nodes,...e],a=[...t.edges,...r];return{...t,nodes:i,edges:a}}x(_ye,"createEdgeLabelNodes");var Ea=.001;function bG(t){const e=t.x??0,r=t.y??0,n=t.width??0,i=t.height??0;return n>0&&i>0?{cx:e,cy:r,rect:vy(e,r,n,i)}:void 0}x(bG,"measuredNodeRect");function xG(t){if(t.isGroup)return;const e=bG(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}x(xG,"nodeBoundsInfoFor");function wl(t,e,r=Ea){return Math.abs(t.x-e.x)<r&&Math.abs(t.y-e.y)<r}x(wl,"samePoint");function qr(t,e,r=Ea){return Math.abs(t.x-e.x)<r}x(qr,"sameX");function Kr(t,e,r=Ea){return Math.abs(t.y-e.y)<r}x(Kr,"sameY");function xi(t,e,r=Ea){return Kr(t,e,r)&&Math.abs(t.x-e.x)>r}x(xi,"isHorizontalSegment");function Ti(t,e,r=Ea){return qr(t,e,r)&&Math.abs(t.y-e.y)>r}x(Ti,"isVerticalSegment");function qs(t,e,r,n){return Math.max(0,Math.min(Math.max(t,e),Math.max(r,n))-Math.max(Math.min(t,e),Math.min(r,n)))}x(qs,"overlapLength");function Uc(t,e,r=Ea){return t.horizontal&&e.horizontal&&Kr(t.a,e.a,r)?qs(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&qr(t.a,e.a,r)?qs(t.a.y,t.b.y,e.a.y,e.b.y):0}x(Uc,"sameAxisSegmentOverlapLength");function Vb(t,e=Ea){const r=[];for(let n=0;n<t.length-1;n++){const i=t[n],a=t[n+1],s=xi(i,a,e),o=Ti(i,a,e);(s||o)&&r.push({index:n,a:i,b:a,horizontal:s,vertical:o})}return r}x(Vb,"orthogonalSegmentsForPoints");function Mo(t,e=Ea){const r=Vb(t,e);let n=0;for(let i=1;i<r.length;i++)r[i-1].horizontal!==r[i].horizontal&&n++;return n}x(Mo,"countOrthogonalBends");function on(t,e=Ea){const r=[];for(const n of t){const i=r.length>0?r[r.length-1]:void 0;(!i||!wl(i,n,e))&&r.push({x:n.x,y:n.y})}return r}x(on,"dedupeConsecutivePoints");function TG(t,e=Ea){if(!t||t.length!==4)return;const[r,n,i,a]=t;return xi(r,n,e)&&Ti(n,i,e)&&xi(i,a,e)?{kind:"HVH",p0:r,p1:n,p2:i,p3:a}:Ti(r,n,e)&&xi(n,i,e)&&Ti(i,a,e)?{kind:"VHV",p0:r,p1:n,p2:i,p3:a}:void 0}x(TG,"classifyThreeSegmentRoute");function QR(t,e,r,n=0){const i=Math.min(t.x,e.x),a=Math.max(t.x,e.x),s=Math.min(t.y,e.y),o=Math.max(t.y,e.y);return a>r.left-n&&i<r.right+n&&o>r.top-n&&s<r.bottom+n}x(QR,"segmentBoundsOverlapRect");function wG(t,e,r=0){return t.x>e.left+r&&t.x<e.right-r&&t.y>e.top+r&&t.y<e.bottom-r}x(wG,"pointInsideRect");function Rye(t,e){return t.left<=e.left&&t.right>=e.right&&t.top<=e.top&&t.bottom>=e.bottom}x(Rye,"rectContainsRect");function t_(t,e){return t.left<e.right&&t.right>e.left&&t.top<e.bottom&&t.bottom>e.top}x(t_,"rectsOverlap");function k$(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}x(k$,"inflateRect");function vy(t,e,r,n){return{left:t-r/2,right:t+r/2,top:e-n/2,bottom:e+n/2}}x(vy,"rectFromCenterSize");function To(t){var e;return(e=bG(t))==null?void 0:e.rect}x(To,"rectOfNodeBounds");function Qp(t,e){switch(e){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}x(Qp,"portForRectSide");function CG(t,e,r,n,i,a=Ea){const s=e==="left"||e==="right",o=n==="left"||n==="right";if(s&&o){if(e==="right"&&n==="left"&&t.x<r.x||e==="left"&&n==="right"&&t.x>r.x){if(Kr(t,r,a))return[t,r];const d=(t.x+r.x)/2;return[t,{x:d,y:t.y},{x:d,y:r.y},r]}if(e===n){if(Kr(t,r,a))return;const d=e==="left"?Math.min(t.x,r.x)-i:Math.max(t.x,r.x)+i;return[t,{x:d,y:t.y},{x:d,y:r.y},r]}return}if(!s&&!o){if(e===n){if(qr(t,r,a))return;const f=e==="top"?Math.min(t.y,r.y)-i:Math.max(t.y,r.y)+i;return[t,{x:t.x,y:f},{x:r.x,y:f},r]}if(!(e==="bottom"&&n==="top"&&t.y<r.y||e==="top"&&n==="bottom"&&t.y>r.y))return;if(qr(t,r,a))return[t,r];const d=(t.y+r.y)/2;return[t,{x:t.x,y:d},{x:r.x,y:d},r]}if(s&&!o){const h=e==="right"&&r.x>t.x||e==="left"&&r.x<t.x,d=n==="top"&&t.y<r.y||n==="bottom"&&t.y>r.y;return h&&d?[t,{x:r.x,y:t.y},r]:void 0}const l=e==="bottom"&&r.y>t.y||e==="top"&&r.y<t.y,u=n==="left"&&t.x<r.x||n==="right"&&t.x>r.x;return l&&u?[t,{x:t.x,y:r.y},r]:void 0}x(CG,"buildOrthogonalPortPath");function kG(t,e,r,n){return e==="left"||e==="right"?[t,{x:n,y:t.y},{x:n,y:r.y},r]:[t,{x:t.x,y:n},{x:r.x,y:n},r]}x(kG,"buildSameSideTrackPath");function JR(t){const e=new Map,r=[];for(const n of t){if(n.isEdgeLabel)continue;const i=xG(n);i&&(e.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:e,realNodeRects:r}}x(JR,"collectRealNodeBounds");function Ef(t){const e=[],r=[];for(const n of t){const i=xG(n);if(!i)continue;const a={id:i.id,rect:i.rect};n.isEdgeLabel?r.push(a):e.push(a)}return{realNodeRects:e,labelNodeRects:r}}x(Ef,"collectNodeRectEntries");function Lye(t,{includeEdgeLabels:e=!0}={}){const r=[];for(const n of t){if(n.isGroup||!e&&n.isEdgeLabel)continue;const i=n.x??0,a=n.y??0,s=n.width??0,o=n.height??0;r.push({nodeId:n.id,...vy(i,a,s,o)})}return r}x(Lye,"collectLayoutNodeRects");function SG(t,e,r=Ea){const n=t.start,i=t.end;if(!n||!i)return;const a=e.get(n),s=e.get(i);if(!(!a||!s))return{srcId:n,dstId:i,srcInfo:a,dstInfo:s,collinearX:Math.abs(a.cx-s.cx)<r,collinearY:Math.abs(a.cy-s.cy)<r}}x(SG,"getNodePairGeometry");function Oi(t,e,r,n=[],i=0){for(const a of r)if(!n.includes(a.id)&&QR(t,e,a.rect,-i))return!0;return!1}x(Oi,"segmentHitsAnyRect");function EG(t,e,r,n,i=Ea,a=1e-6){const s=Kr(t,e,i),o=qr(t,e,i),l=Kr(r,n,i),u=qr(r,n,i);if(s&&l||o&&u||!(s||o)||!(l||u))return!1;const h=s?{a:t,b:e}:{a:r,b:n},d=o?{a:t,b:e}:{a:r,b:n},f=h.a.y,p=Math.min(h.a.x,h.b.x),g=Math.max(h.a.x,h.b.x),m=d.a.x,y=Math.min(d.a.y,d.b.y),v=Math.max(d.a.y,d.b.y);if(m<p||m>g||f<y||f>v)return!1;const T=Math.abs(m-h.a.x)<a&&Math.abs(f-h.a.y)<a||Math.abs(m-h.b.x)<a&&Math.abs(f-h.b.y)<a,b=Math.abs(m-d.a.x)<a&&Math.abs(f-d.a.y)<a||Math.abs(m-d.b.x)<a&&Math.abs(f-d.b.y)<a;return!(T&&b)}x(EG,"orthogonalSegmentsCross");function Mye(t,e,r,n,i=Ea){const a=Kr(t,e,i),s=qr(t,e,i),o=Kr(r,n,i),l=qr(r,n,i);return s&&l&&qr(t,r,i)?qs(t.y,e.y,r.y,n.y)>i:a&&o&&Kr(t,r,i)?qs(t.x,e.x,r.x,n.x)>i:!1}x(Mye,"sameAxisSegmentsOverlap");function r_(t,e,r,n,{epsilon:i=Ea,skipDegenerateOther:a=!1}={}){for(const s of r){if(s===n||s.isLayoutOnly)continue;const o=s.points;if(!(!o||o.length<2))for(let l=0;l<o.length-1;l++){const u=o[l],h=o[l+1];if(!(a&&wl(u,h,i))&&(EG(t,e,u,h,i)||Mye(t,e,u,h,i)))return!0}}return!1}x(r_,"segmentConflictsWithAnyEdge");function Gh(t,e,r,n,i=Ea){const a=Kr(t,e,i),s=qr(t,e,i),o=Kr(r,n,i),l=qr(r,n,i);if(!(a&&l||s&&o))return!1;const u=a?{a:t,b:e}:{a:r,b:n},h=a?{a:r,b:n}:{a:t,b:e},d=u.a.y,f=Math.min(u.a.x,u.b.x),p=Math.max(u.a.x,u.b.x),g=h.a.x,m=Math.min(h.a.y,h.b.y),y=Math.max(h.a.y,h.b.y);return g>f+i&&g<p-i&&d>m+i&&d<y-i}x(Gh,"orthogonalSegmentsStrictlyCross");function S$(t,e,r){const n=Math.min(e,r),i=Math.max(e,r);return t>n+Ea&&t<i-Ea}x(S$,"strictlyBetween");function Iye(t,e,r){return qr(t,e)&&qr(e,r)?S$(e.y,t.y,r.y):Kr(t,e)&&Kr(e,r)?S$(e.x,t.x,r.x):!1}x(Iye,"isCollinearIntermediate");function Nye(t){let e=!1;const r=[];for(let n=0;n<t.length;n++){const i=r[r.length-1],a=t[n],s=n+1<t.length?t[n+1]:void 0;if(i&&s){if(wl(i,s)){n++,e=!0;continue}if(Iye(i,a,s)){e=!0;continue}}r.push(a)}return{points:r,changed:e}}x(Nye,"simplifyPolylineOnce");function n_(t){const e=[t[0]];for(let n=1;n<t.length;n++){const i=e[e.length-1],a=t[n];if(!qr(i,a)&&!Kr(i,a)){const s=e.length>=2?e[e.length-2]:void 0,l=(s?qr(s,i):!1)?{x:i.x,y:a.y}:{x:a.x,y:i.y};e.push(l)}e.push(a)}const r=[];for(const n of e){const i=r[r.length-1];(!i||!wl(i,n))&&r.push(n)}return r}x(n_,"orthogonalizePolyline");function Qc(t){if(t.length<3)return t;let e=[...t];for(let r=0;r<32;r++){const n=Nye(e);if(e=n.points,!n.changed)break}return e}x(Qc,"simplifyPolyline");var br=.001,uut=.5,qQ=4;function AG(t,e,r){const n=t;if(n.isLayoutOnly||!n.points||n.points.length<r)return;const i=n.start?e.get(n.start):void 0,a=n.end?e.get(n.end):void 0;return{edge:n,points:n.points,srcRect:i?To(i):void 0,dstRect:a?To(a):void 0}}x(AG,"endpointContextFor");function Dye(t,e,r){if(Kr(t,e,br))return{x:t.x<r.left?r.left:r.right,y:t.y};if(qr(t,e,br)){const n=t.y<r.top?r.top:r.bottom;return{x:t.x,y:n}}return{x:Math.min(r.right,Math.max(r.left,t.x)),y:Math.min(r.bottom,Math.max(r.top,t.y))}}x(Dye,"segmentEnterPoint");function E$(t,e,r){const n=r?1:-1;let i=r?0:t.length-1;for(;i>=0&&i<t.length&&wG(t[i],e,uut);)i+=n;if(i<0||i>=t.length)return t;const a=i-n;if(a<0||a>=t.length)return t;const s=Dye(t[i],t[a],e);return r?[s,...t.slice(i)]:[...t.slice(0,i+1),s]}x(E$,"clipEndpoint");function Oye(t,e){for(const r of t){const n=AG(r,e,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=E$(i,n.srcRect,!0)),n.dstRect&&(i=E$(i,n.dstRect,!1)),i=Qc(n_(i)),i=_G(i,n.srcRect,n.dstRect),n.edge.points=Qc(n_(i))}}x(Oye,"clipEdgeEndpointsToNodeBoundaries");function A$(t,e,r,n=!1){if(Kr(t,e,br)){if(e.y<r.top-br||e.y>r.bottom+br)return e;if(n){if(t.x<r.left-br)return{x:r.left,y:t.y};if(t.x>r.right+br)return{x:r.right,y:t.y}}return{x:Math.abs(e.x-r.left)<=Math.abs(e.x-r.right)?r.left:r.right,y:t.y}}if(qr(t,e,br)){if(e.x<r.left-br||e.x>r.right+br)return e;if(n){if(t.y<r.top-br)return{x:t.x,y:r.top};if(t.y>r.bottom+br)return{x:t.x,y:r.bottom}}const i=Math.abs(e.y-r.top)<=Math.abs(e.y-r.bottom);return{x:t.x,y:i?r.top:r.bottom}}return e}x(A$,"snapEndpointToBoundary");function i_(t,e,r){const n=t[e];for(let i=e+r;i>=0&&i<t.length;i+=r){const a=t[i];if(!wl(a,n,br))return a}return t[e+r]}x(i_,"firstDistinctAdjacent");function a_(t,e){const r=t+qQ,n=e-qQ;return r<=n?{lo:r,hi:n}:{lo:(t+e)/2,hi:(t+e)/2}}x(a_,"cornerClearanceRange");function _$(t,e,r){const{lo:n,hi:i}=a_(e,r);return Math.min(i,Math.max(n,t))}x(_$,"clampToCornerClearance");function $ye(t){const e=Math.max(...t.map(n=>n.lo)),r=Math.min(...t.map(n=>n.hi));if(!(e>r))return{lo:e,hi:r}}x($ye,"intersectRanges");function R$(t,e){return e==="left"||e==="right"?a_(t.top,t.bottom):a_(t.left,t.right)}x(R$,"clearanceRangeForSide");function s_(t,e,r){const n=t.y>=r.top-br&&t.y<=r.bottom+br,i=t.x>=r.left-br&&t.x<=r.right+br;if(Kr(t,e,br)&&n){if(Math.abs(t.x-r.left)<br)return"left";if(Math.abs(t.x-r.right)<br)return"right"}if(qr(t,e,br)&&i){if(Math.abs(t.y-r.top)<br)return"top";if(Math.abs(t.y-r.bottom)<br)return"bottom"}}x(s_,"terminalSideForSegment");function QC(t){return t==="left"||t==="right"}x(QC,"isHorizontalSide");function Pye(t,e,r,n,i){const a=[],s=r?s_(t,e,r):void 0,o=n?s_(e,t,n):void 0;return r&&s&&QC(s)===i&&a.push(R$(r,s)),n&&o&&QC(o)===i&&a.push(R$(n,o)),a.length>0?$ye(a):void 0}x(Pye,"straightClearanceRange");function L$(t,e,r,n,i){const a=Pye(t,e,r,n,i);if(!a)return;const s=i?t.y:t.x,o=Math.min(a.hi,Math.max(a.lo,s));if(!(Math.abs(o-s)<br))return i?[{x:t.x,y:o},{x:e.x,y:o}]:[{x:o,y:t.y},{x:o,y:e.y}]}x(L$,"clearStraightEndpointCornerAxis");function _G(t,e,r){if(t.length!==2)return t;const[n,i]=t;return Kr(n,i,br)?L$(n,i,e,r,!0)??t:qr(n,i,br)?L$(n,i,e,r,!1)??t:t}x(_G,"clearStraightEndpointCornerConnections");function Bye(t,e,r){return QC(r)?{x:t.x,y:_$(t.y,e.top,e.bottom)}:{x:_$(t.x,e.left,e.right),y:t.y}}x(Bye,"cornerClearedEndpoint");function Fye(t,e,r,n,i,a){const s=t.map(o=>({...o}));for(let o=e;o>=0&&o<t.length;o+=r){const l=t[o];if(a&&!Kr(l,n,br)||!a&&!qr(l,n,br))break;a?s[o].y=i.y:s[o].x=i.x}return s}x(Fye,"moveCollinearEndpointRun");function M$(t,e,r){if(t.length<2)return t;const n=r?0:t.length-1,i=r?1:-1,a=t[n],s=i_(t,n,i);if(!s)return t;const o=s_(a,s,e);if(!o)return t;const l=QC(o),u=Bye(a,e,o);return wl(a,u,br)?t:Fye(t,n,i,a,u,l)}x(M$,"clearEndpointCornerConnection");function I$(t,e,r){const n=Math.min(t.x,e.x)>=r.left-br&&Math.max(t.x,e.x)<=r.right+br,i=Math.min(t.y,e.y)>=r.top-br&&Math.max(t.y,e.y)<=r.bottom+br;if(Math.abs(t.y-r.top)<br&&Math.abs(e.y-r.top)<br&&n)return"top";if(Math.abs(t.y-r.bottom)<br&&Math.abs(e.y-r.bottom)<br&&n)return"bottom";if(Math.abs(t.x-r.left)<br&&Math.abs(e.x-r.left)<br&&i)return"left";if(Math.abs(t.x-r.right)<br&&Math.abs(e.x-r.right)<br&&i)return"right"}x(I$,"borderSideForSegment");function N$(t,e,r,n){switch(t){case"top":return qr(e,r,br)&&r.y<n.top-br;case"bottom":return qr(e,r,br)&&r.y>n.bottom+br;case"left":return Kr(e,r,br)&&r.x<n.left-br;case"right":return Kr(e,r,br)&&r.x>n.right+br}}x(N$,"leavesOutward");function D$(t,e,r){if(t.length<3)return t;if(r){const a=I$(t[0],t[1],e);return a&&N$(a,t[1],t[2],e)?t.slice(1):t}const n=t.length-1,i=I$(t[n-1],t[n],e);return i&&N$(i,t[n-1],t[n-2],e)?t.slice(0,n):t}x(D$,"collapseOwnBorderStub");function zye(t,e,r){let n=t;if(e){const a=i_(n,0,1);if(a){const s=A$(a,n[0],e);s!==n[0]&&(n=[s,...n.slice(1)])}n=D$(n,e,!0)}if(r){const a=n.length-1,s=i_(n,a,-1);if(s){const o=A$(s,n[a],r,!0);o!==n[a]&&(n=[...n.slice(0,a),o])}n=D$(n,r,!1)}const i=_G(n,e,r);return i!==n||n.length===2?i:(e&&(n=M$(n,e,!0)),r&&(n=M$(n,r,!1)),n)}x(zye,"snapAndCollapseEndpoints");function O$(t,e){for(const r of t){const n=AG(r,e,2);if(!n)continue;const i=on(n.points,br),a=zye(i,n.srcRect,n.dstRect);if(a.length<3){n.edge.points=a;continue}const s=[a[0],{...a[0]},...a.slice(1,-1),a[a.length-1],{...a[a.length-1]}];n.edge.points=s}}x(O$,"prepareEdgeEndpointsForRenderer");function RG(t){return new Map(t.map(e=>[e.id,e]))}x(RG,"buildNodeMap");function Vye(t,e){let r=t.parentId,n=null;for(;r;){const i=e.get(r);if(!(i!=null&&i.isGroup))break;n=i.id,r=i.parentId}return n}x(Vye,"resolveTopLevelGroupId");function $$(t,e){let r=0,n=t.parentId;for(;n;){const i=e.get(n);if(!(i!=null&&i.isGroup))break;r++,n=i.parentId}return r}x($$,"groupDepth");function LG(t){let e=1/0,r=-1/0,n=1/0,i=-1/0;for(const a of t){const s=a.x,o=a.y;if(typeof s!="number"||typeof o!="number")continue;const l=a.width??0,u=a.height??0;e=Math.min(e,s-l/2),r=Math.max(r,s+l/2),n=Math.min(n,o-u/2),i=Math.max(i,o+u/2)}return e===1/0||n===1/0?null:{minX:e,maxX:r,minY:n,maxY:i}}x(LG,"boundsForChildren");function Gye(t,e){const r=t.padding??20;t.x=(e.minX+e.maxX)/2,t.y=(e.minY+e.maxY)/2,t.width=Math.max(0,e.maxX-e.minX)+r,t.height=Math.max(0,e.maxY-e.minY)+r}x(Gye,"applyGroupBounds");function Wye(t){const e=RG(t),r=t.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>$$(i,e)-$$(n,e));for(const n of r){const i=t.filter(s=>s.parentId===n.id),a=LG(i);a&&Gye(n,a)}}x(Wye,"recomputeNestedGroupBounds");function o_(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(l=>!l.isGroup);let a=1/0,s=-1/0;for(const l of i){const u=l[e];typeof u=="number"&&(a=Math.min(a,u),s=Math.max(s,u))}if(!Number.isFinite(a)||!Number.isFinite(s))return!1;const o=x(l=>a+s-l,"mirror");for(const l of r){const u=l[e];typeof u=="number"&&(l[e]=o(u));const h=l.groupTitleRect;h&&(l.groupTitleRect=e==="x"?{...h,left:o(h.right),right:o(h.left)}:{...h,top:o(h.bottom),bottom:o(h.top)})}for(const l of n)for(const u of l.points??[])u[e]=o(u[e]);return!0}x(o_,"mirrorAxis");function Hye(t){return(t.nodes??[]).some(r=>!r.isGroup)?o_(t,"y"):!0}x(Hye,"applyBtDirectionTransform");function qye(t,e="LR"){const r=t.nodes??[],n=t.edges??[],i=r.filter(D=>!D.isGroup);let a=1/0,s=1/0;for(const D of i){const R=D.x??0,I=D.y??0;R<a&&(a=R),I<s&&(s=I)}if(!Number.isFinite(a)||!Number.isFinite(s))return!1;const o=36;let l=0,u=0;for(const D of i)l+=D.width??0,u+=D.height??0;const h=l/i.length,d=u/i.length,f=d>0?Math.max(1,h/d):1;for(const D of i){const R=D.x??0,$=((D.y??0)-s)*f+o,O=R-a;D.x=$,D.y=O}for(const D of n)if(D.points)for(const R of D.points){const I=R.x,O=(R.y-s)*f+o,N=I-a;R.x=O,R.y=N}Wye(r);const p=r.filter(D=>D.isGroup&&!D.parentId);if(p.length===0)return e==="RL"&&o_(t,"x"),!0;const g=RG(r),m=new Map;for(const D of r){if(D.isGroup)continue;const R=Vye(D,g);if(!R)continue;const I=m.get(R)??[];I.push(D),m.set(R,I)}let y=0;for(const D of p){const R=D.padding??0;R>y&&(y=R)}const v=[];let T=1/0,b=-1/0;for(const D of p){const R=m.get(D.id)??[],I=LG(R);I&&(T=Math.min(T,I.minX),b=Math.max(b,I.maxX),v.push({lane:D,contentTop:I.minY,contentBottom:I.maxY,centerY:(I.minY+I.maxY)/2}))}if(T===1/0||b===-1/0)return!0;const w=Math.max(0,b-T),C=Math.max(y,10),S=w+2*C,k=o+S,M=(T+b)/2-S/2-o,L=M+k/2,P=Math.max(y,o);v.sort((D,R)=>D.centerY-R.centerY);for(let D=0;D<v.length;D++){const R=v[D];let I,$;if(D===0?I=R.contentTop-P:I=(v[D-1].contentBottom+R.contentTop)/2,D===v.length-1)$=R.contentBottom+P;else{const F=v[D+1];$=(R.contentBottom+F.contentTop)/2}const O=Math.max(0,$-I),N=(I+$)/2;R.lane.x=L,R.lane.y=N,R.lane.width=k,R.lane.height=O,R.lane.swimlaneContentTop=R.contentTop,R.lane.groupTitleRect={left:M,right:M+o,top:I,bottom:$}}return e==="RL"&&o_(t,"x"),!0}x(qye,"applyLrDirectionTransform");var _l=1e-6,hut=8,WE=hut,dut=[0,WE,-WE,2*WE,-2*WE];function Uye(t,e){const{nodeInfoById:r,realNodeRects:n}=JR(e);for(const i of t){if(i.isLayoutOnly)continue;const a=i.points;if(!a||a.length<4)continue;const s=TG(on(a,_l),_l);if(!s)continue;const{p3:o}=s,l=s.kind==="HVH",u=SG(i,r,_l);if(!u)continue;const{srcId:h,dstId:d,srcInfo:f,dstInfo:p,collinearX:g,collinearY:m}=u;if(g||m)continue;let y;const v=f.rect;for(const T of dut){let b,w,C;if(l){const L=p.cy>f.cy?v.bottom:v.top,P=f.cx+T;if(P<=v.left+_l||P>=v.right-_l)continue;b={x:P,y:L},w={x:P,y:o.y},C={x:o.x,y:o.y}}else{const L=p.cx>f.cx?v.right:v.left,P=f.cy+T;if(P<=v.top+_l||P>=v.bottom-_l)continue;b={x:L,y:P},w={x:o.x,y:P},C={x:o.x,y:o.y}}const S=wl(b,w,_l),k=wl(w,C,_l);if(S&&k||!S&&Oi(b,w,n,[h],1)||!k&&Oi(w,C,n,[d],1))continue;const E=!S&&r_(b,w,t,i,{epsilon:_l,skipDegenerateOther:!0}),_=!k&&r_(w,C,t,i,{epsilon:_l,skipDegenerateOther:!0});if(!(E||_)){S?y=[w,C]:k?y=[b,w]:y=[b,w,C];break}}y&&(i.points=y)}}x(Uye,"portSwapToLShape");function Yye(t,e){const{realNodeRects:a,labelNodeRects:s}=Ef(e.values());for(const o of t){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<4)continue;const u=on(l,.001);if(u.length<4)continue;const h=u.length-1,d=u[h],f=u[h-1],p=u[h-2],g=d.x-f.x,m=d.y-f.y,y=Math.hypot(g,m);if(y>=10||y<.001)continue;const v=f.x-p.x,T=f.y-p.y;if(Math.hypot(v,T)<.001)continue;const w=xi(f,d,.001),C=Ti(f,d,.001),S=xi(p,f,.001),k=Ti(p,f,.001);if(!(w&&k||C&&S))continue;const E=o.end,_=o.start,M=E?e.get(E):void 0;if(!M)continue;const L=M.x??0,P=M.y??0,D=To(M);if(!D)continue;let R,I;if(k){const B=T<0;R={x:L,y:p.y},I={x:L,y:B?D.bottom:D.top}}else{const B=v>0;R={x:p.x,y:P},I={x:B?D.right:D.left,y:P}}if(Oi(R,I,a,E?[E]:[],-2)||Oi(R,I,s,[],-2))continue;if(_){const B=e.get(_),G=B?To(B):void 0;if(G&&wG(R,G,2))continue}const $=x((B,G)=>`${B.x.toFixed(3)},${B.y.toFixed(3)}|${G.x.toFixed(3)},${G.y.toFixed(3)}`,"ownSegmentKey"),O=new Set;for(let B=0;B<u.length-1;B++)O.add($(u[B],u[B+1]));const N=x((B,G)=>{for(const H of t){if(H===o||H.isLayoutOnly)continue;const q=H.points;if(!(!q||q.length<2))for(let Z=0;Z<q.length-1;Z++){const Y=q[Z],ie=q[Z+1];if(!O.has($(Y,ie))&&Gh(B,G,Y,ie,.001))return!0}}return!1},"segmentCrossesOtherEdge");if(N(R,I))continue;if(h-3>=0){const B=u[h-3],G=[_,E].filter(H=>!!H);if(Oi(B,R,a,G,-2)||N(B,R))continue}const z=[...u.slice(0,h-2),R,I];o.points=z;const V=o.labelNodeId;if(V){const B=e.get(V);if(B){const G=B.width??0,H=B.height??0;if(G>0&&H>0){let q,Z,Y=-1;for(let ie=0;ie<z.length-1;ie++){const K=z[ie],Q=z[ie+1],te=Math.hypot(Q.x-K.x,Q.y-K.y),J=Kr(K,Q,.001),ge=qr(K,Q,.001);(J&&te>=G+2||ge&&te>=H+2)&&te>Y&&(Y=te,q=(K.x+Q.x)/2,Z=(K.y+Q.y)/2)}q!==void 0&&Z!==void 0&&(B.x=q,B.y=Z)}}}}}x(Yye,"collapseShortTerminalStub");var Yt=.001,ka=8,$r=Vb,RI=x((t,e)=>qr(t,e,Yt)||Kr(t,e,Yt),"orthogonallyAligned");function Xye(t,e){const i=x((p,g)=>{const m=p.x??0,y=p.y??0,v=g.x-m,T=g.y-y;let b=(p.width??0)/2,w=(p.height??0)/2;return Math.abs(T)*b>Math.abs(v)*w?(T<0&&(w=-w),{x:m+(T===0?0:w*v/T),y:y+w}):(v<0&&(b=-b),{x:m+b,y:y+(v===0?0:b*T/v)})},"rectIntersect"),a=x((p,g)=>{const m=on(p.points??[]);if(m.length<2)return;const y=g?p.start:p.end,v=y?e.get(y):void 0,T=v?To(v):void 0;if(!v||!y||!T)return;const b=g?m[0]:m[m.length-1],w=g?m[1]:m[m.length-2],C=i(v,b);let S=b;if(RI(w,C)&&(S=w),qr(C,S,Yt))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:g,orientation:"V",coord:C.x,min:Math.min(C.y,S.y),max:Math.max(C.y,S.y),boundary:C,railEnd:S,rect:T};if(Kr(C,S,Yt))return{edge:p,edgeId:String(p.id??""),nodeId:y,atStart:g,orientation:"H",coord:C.y,min:Math.min(C.x,S.x),max:Math.max(C.x,S.x),boundary:C,railEnd:S,rect:T}},"terminalLaneFor"),s=x((p,g)=>Math.max(0,Math.min(p.max,g.max)-Math.max(p.min,g.min)),"projectedOverlapLength"),o=x((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:p.orientation==="H"?(Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1)&&qr(p.boundary,g.boundary,1):(Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1)&&Kr(p.boundary,g.boundary,1),"sameTerminalFace"),l=x((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:s(p,g)>=ka&&Math.abs(p.coord-g.coord)<.5,"exactTerminalLaneConflict"),u=x((p,g)=>{if(p.nodeId!==g.nodeId||p.orientation!==g.orientation||p.orientation!=="H"||p.atStart===g.atStart)return!1;const m=s(p,g);if(m<ka)return!1;const y=p.rect.bottom-p.rect.top;return m<y||m>2*y?!1:o(p,g)&&Math.abs(p.coord-g.coord)<16},"nearTerminalLaneConflict"),h=x((p,g)=>{const m=on(p.edge.points??[]);if(m.length<2)return;const y=p.orientation==="V"?{x:p.boundary.x+g,y:p.boundary.y}:{x:p.boundary.x,y:p.boundary.y+g},v=p.orientation==="V"?{x:p.railEnd.x+g,y:p.railEnd.y}:{x:p.railEnd.x,y:p.railEnd.y+g};if(!x(()=>Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1?Kr(y,p.boundary,Yt)&&y.x>=p.rect.left+1&&y.x<=p.rect.right-1:Math.abs(p.boundary.x-p.rect.left)<1||Math.abs(p.boundary.x-p.rect.right)<1?qr(y,p.boundary,Yt)&&y.y>=p.rect.top+1&&y.y<=p.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(p.atStart){const S=m.length>1&&wl(m[1],p.railEnd,Yt),k=m.slice(S?2:1),E=k[0];return E&&!RI(E,v)?void 0:[y,v,...k]}const b=m.length>1&&wl(m[m.length-2],p.railEnd,Yt),w=m.slice(0,b?-2:-1),C=w[w.length-1];if(!(C&&!RI(C,v)))return[...w,v,y]},"shiftedCandidate"),d=x(p=>{const g=p.edge,m=on(g.points??[]);if(m.length!==2)return!1;const y=g.start,v=g.end,T=y?e.get(y):void 0,b=v?e.get(v):void 0;if(!T||!b)return!1;const w=T.x??0,C=T.y??0,S=b.x??0,k=b.y??0,[E,_]=m;return Kr(E,_,Yt)&&Math.abs(C-k)<1&&Math.abs(w-S)>1||qr(E,_,Yt)&&Math.abs(w-S)<1&&Math.abs(C-k)>1},"laneIsStraightCollinearConnector"),f=[-7,7,-14,14,-21,21];for(let p=0;p<8;p++){const g=t.filter(y=>!y.isLayoutOnly).flatMap(y=>[a(y,!0),a(y,!1)]).filter(y=>!!y);let m=!1;for(let y=0;y<g.length&&!m;y++)for(let v=y+1;v<g.length&&!m;v++){const T=g[y],b=g[v];if(T.edge===b.edge||!(l(T,b)||u(T,b)))continue;const w=!l(T,b),C=[T,b].sort((S,k)=>{const E=d(S),_=d(k);return E!==_?Number(E)-Number(_):+!k.atStart-+!S.atStart});for(const S of C){for(const k of f){const E=h(S,k);if(!E)continue;const _=a({...S.edge,points:E},S.atStart);if(!(!_||g.some(M=>M.edge!==S.edge&&(l(_,M)||w&&u(_,M))))){S.edge.points=E,m=!0;break}}if(m)break}}if(!m)return}}x(Xye,"separateSharedRenderedTerminalLanes");function jye(t,e){const{realNodeRects:n,labelNodeRects:i}=Ef(e.values()),a=x((o,l)=>{const u=o.start,h=o.end,d=$r(l);if(d.length!==l.length-1)return!1;const f=[u,h].filter(p=>!!p);for(const p of d)if(Oi(p.a,p.b,n,f,-2)||Oi(p.a,p.b,i,[],-2))return!1;for(const p of t){if(p===o||p.isLayoutOnly)continue;const g=p.points;if(!(!g||g.length<2)){for(const m of d)for(const y of $r(on(g)))if(Uc(m,y,.5)>=ka||Gh(m.a,m.b,y.a,y.b,Yt))return!1}}return!0},"candidateIsSafe"),s=x((o,l)=>{if(l+4>=o.length)return;const u=o[l],h=o[l+1],d=o[l+2],f=o[l+3],p=o[l+4],g=xi(u,h)&&Ti(h,d)&&xi(d,f)&&Ti(f,p)&&qr(u,f,Yt)&&qr(u,p,Yt)&&qr(h,d,Yt)&&(h.x-u.x)*(f.x-d.x)<0,m=Ti(u,h)&&xi(h,d)&&Ti(d,f)&&xi(f,p)&&Kr(u,f,Yt)&&Kr(u,p,Yt)&&Kr(h,d,Yt)&&(h.y-u.y)*(f.y-d.y)<0;if(g||m)return on([...o.slice(0,l+1),p,...o.slice(l+5)]);if(l+5>=o.length)return;const y=o[l+5],v=Ti(u,h)&&xi(h,d)&&Ti(d,f)&&xi(f,p)&&Ti(p,y)&&qr(u,p,Yt)&&qr(u,y,Yt)&&qr(d,f,Yt)&&(d.x-h.x)*(p.x-f.x)<0,T=xi(u,h)&&Ti(h,d)&&xi(d,f)&&Ti(f,p)&&xi(p,y)&&Kr(u,p,Yt)&&Kr(u,y,Yt)&&Kr(d,f,Yt)&&(d.y-h.y)*(p.y-f.y)<0;if(!(!v&&!T))return on([...o.slice(0,l+1),y,...o.slice(l+6)])},"withoutDogleg");for(let o=0;o<8;o++){let l=!1;for(const u of t){if(u.isLayoutOnly)continue;const h=on(u.points??[]);for(let d=0;d<=h.length-5;d++){const f=s(h,d);if(!(!f||!a(u,f))){u.points=f,l=!0;break}}if(l)break}if(!l)return}}x(jye,"collapseRedundantRectangularDoglegs");function P$(t,e){const{realNodeRects:a,labelNodeRects:s}=Ef(e.values()),o=t.filter(g=>!g.isLayoutOnly),l=x((g,m,y)=>on(g===m?y??[]:g.points??[]),"pointsFor"),u=x((g,m)=>{let y=0;for(let v=0;v<o.length;v++){const T=$r(l(o[v],g,m));for(let b=v+1;b<o.length;b++){const w=$r(l(o[b],g,m));for(const C of T)for(const S of w)Gh(C.a,C.b,S.a,S.b,Yt)&&y++}}return y},"strictCrossingCount"),h=x(g=>{const m=$r(g);if(m.length!==3)return;const y=m[1];if(!(m[0].horizontal===y.horizontal||m[2].horizontal===y.horizontal))return{index:y.index,horizontal:y.horizontal,vertical:y.vertical,segment:y}},"middleRail"),d=x((g,m)=>{const y=[g.start,g.end].filter(v=>!!v);return a.filter(v=>{if(y.includes(v.id))return!1;const T=v.rect;return m.horizontal?qs(m.a.x,m.b.x,T.left,T.right)>=ka&&m.a.y>=T.top-2&&m.a.y<=T.bottom+2:qs(m.a.y,m.b.y,T.top,T.bottom)>=ka&&m.a.x>=T.left-2&&m.a.x<=T.right+2})},"blockingRectsFor"),f=x((g,m,y)=>{const v=g.map(b=>({...b}));if(m.horizontal)v[m.index].y=y,v[m.index+1].y=y;else if(m.vertical)v[m.index].x=y,v[m.index+1].x=y;else return;const T=Qc(on(v));return $r(T).length===T.length-1?T:void 0},"candidateByMovingRail"),p=x((g,m,y)=>{const v=[g.start,g.end].filter(b=>!!b),T=$r(m);if(T.length!==m.length-1)return!1;for(const b of T)if(Oi(b.a,b.b,a,v,-2)||Oi(b.a,b.b,s,[],-2))return!1;for(const b of o)if(b!==g){for(const w of T)for(const C of $r(l(b)))if(Uc(w,C,.5)>=ka)return!1}return u(g,m)<=y},"candidateIsSafe");for(let g=0;g<8;g++){const m=u();let y=!1;for(const v of o){const T=l(v),b=h(T);if(!b)continue;const w=d(v,b.segment);if(w.length===0)continue;const C=b.horizontal?[Math.min(...w.map(S=>S.rect.top))-20,Math.max(...w.map(S=>S.rect.bottom))+20]:[Math.min(...w.map(S=>S.rect.left))-20,Math.max(...w.map(S=>S.rect.right))+20];for(const S of C){const k=f(T,b.segment,S);if(!(!k||!p(v,k,m))){v.points=k,y=!0;break}}if(y)break}if(!y)return}}x(P$,"liftObstacleHuggingSameSideRails");function B$(t,e){const n=x(l=>{const u=l.groupTitleRect;if(!(!u||typeof u.left!="number"||typeof u.right!="number"||typeof u.top!="number"||typeof u.bottom!="number"||!Number.isFinite(u.left)||!Number.isFinite(u.right)||!Number.isFinite(u.top)||!Number.isFinite(u.bottom)||u.right<=u.left||u.bottom<=u.top))return{left:u.left,right:u.right,top:u.top,bottom:u.bottom}},"validTitleRect"),i=x(l=>{if(!l.isGroup||l.parentId)return;const u=l.direction,h=typeof u=="string"?u.toUpperCase():"";if(h==="LR"||h==="RL"||h==="BT")return;const d=n(l),f=l.y,p=l.height;if(!d||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=d.right-d.left,m=d.bottom-d.top;if(!(m<=0||g<m))return{node:l,rect:d}},"topLaneTitleFor"),a=x((l,u)=>{if(!l.horizontal)return!1;const h=l.a.y;return h<=u.top+Yt||h>=u.bottom-Yt?!1:qs(l.a.x,l.b.x,u.left,u.right)>=ka},"horizontalSegmentIntersectsTitle"),s=[...e.values()].map(i).filter(l=>!!l);if(s.length===0)return;let o=0;for(const l of t){if(l.isLayoutOnly)continue;const u=on(l.points??[]);for(const h of $r(u))for(const d of s)a(h,d.rect)&&(o=Math.max(o,d.rect.bottom-h.a.y+4))}if(!(o<=Yt))for(const l of s){const u=l.node.y,h=l.node.height;typeof u!="number"||typeof h!="number"||!Number.isFinite(u)||!Number.isFinite(h)||h<=0||(l.node.y=u-o/2,l.node.height=h+o,l.node.groupTitleRect={...l.rect,top:l.rect.top-o,bottom:l.rect.bottom-o})}}x(B$,"liftTopLaneTitleBandsAboveRails");function F$(t,e){const n=x(u=>{const h=u.groupTitleRect;if(!(!h||typeof h.left!="number"||typeof h.right!="number"||typeof h.top!="number"||typeof h.bottom!="number"||!Number.isFinite(h.left)||!Number.isFinite(h.right)||!Number.isFinite(h.top)||!Number.isFinite(h.bottom)||h.right<=h.left||h.bottom<=h.top))return{left:h.left,right:h.right,top:h.top,bottom:h.bottom}},"validTitleRect"),i=x(u=>{if(!u.isGroup||u.parentId||u.direction!=="LR")return;const d=n(u),f=u.x,p=u.width;if(!d||typeof f!="number"||typeof p!="number"||!Number.isFinite(f)||!Number.isFinite(p)||p<=0)return;const g=d.right-d.left,m=d.bottom-d.top;if(!(g<=0||m<g))return{node:u,rect:d}},"leftLaneTitleFor"),a=x((u,h)=>{if(!u.vertical)return!1;const d=u.a.x;return d<=h.left+Yt||d>=h.right-Yt?!1:qs(u.a.y,u.b.y,h.top,h.bottom)>=ka},"verticalSegmentIntersectsTitle"),s=x((u,h)=>{if(!u.horizontal)return!1;const d=u.a.y;return d<=h.top+Yt||d>=h.bottom-Yt?!1:qs(u.a.x,u.b.x,h.left,h.right)>=ka},"horizontalSegmentIntersectsTitle"),o=[...e.values()].map(i).filter(u=>!!u);if(o.length===0)return;let l=0;for(const u of t){if(u.isLayoutOnly)continue;const h=on(u.points??[]);for(const d of $r(h))for(const f of o)if(a(d,f.rect))l=Math.max(l,f.rect.right-d.a.x+4);else if(s(d,f.rect)){const p=Math.min(d.a.x,d.b.x);l=Math.max(l,f.rect.right-p+4)}}if(!(l<=Yt))for(const u of o){const h=u.node.x,d=u.node.width;typeof h!="number"||typeof d!="number"||!Number.isFinite(h)||!Number.isFinite(d)||d<=0||(u.node.x=h-l/2,u.node.width=d+l,u.node.groupTitleRect={...u.rect,left:u.rect.left-l,right:u.rect.right-l})}}x(F$,"shiftLeftLaneTitleBandsLeftOfRails");function Kye(t,e){const{realNodeRects:n}=Ef(e.values()),i=t.filter(g=>!g.isLayoutOnly),a=x((g,m=new Map)=>on(m.get(g)??g.points??[]),"replacementPointsFor"),s=x((g=new Map)=>{let m=0;for(let y=0;y<i.length;y++){const v=$r(a(i[y],g));for(let T=y+1;T<i.length;T++){const b=$r(a(i[T],g));for(const w of v)for(const C of b)Gh(w.a,w.b,C.a,C.b,Yt)&&m++}}return m},"crossingCount"),o=x((g=new Map)=>i.reduce((m,y)=>m+Mo(a(y,g)),0),"totalBends"),l=x(g=>{const m=a(g);if(m.length<4)return;const y=m[m.length-2],v=m[m.length-1];if(!(!xi(y,v,Yt)&&!Ti(y,v,Yt)))return{tailStart:y,terminal:v}},"terminalTailFor"),u=x((g,m)=>{const y=a(g);if(y.length<3)return;const v=y[0],T=y[1];let b;if(xi(v,T,Yt))b={x:T.x,y:m.tailStart.y};else if(Ti(v,T,Yt))b={x:m.tailStart.x,y:T.y};else return;const w=Qc(on([v,T,b,m.tailStart,m.terminal]));return $r(w).length===w.length-1?w:void 0},"candidateWithDestinationTail"),h=x((g,m)=>{const y=[g.start,g.end].filter(v=>!!v);for(const v of $r(m))if(Oi(v.a,v.b,n,y,-2))return!0;return!1},"pathHasNodeHit"),d=x((g,m,y)=>{for(const v of i)if(v!==g){for(const T of $r(m))for(const b of $r(a(v,y)))if(Uc(T,b,.5)>=ka)return!0}return!1},"pathHasSharedTrack"),f=x((g,m,y)=>!h(g,m)&&!d(g,m,y),"candidateIsSafe"),p=x(()=>{const g=new Map;for(const m of i){const y=m.end;if(!y||!e.has(y)||a(m).length<4)continue;const T=g.get(y)??[];T.push(m),g.set(y,T)}return g},"edgesByDestination");for(let g=0;g<4;g++){const m=s();if(m===0)return;const y=o();let v,T=m,b=y;for(const w of p().values())for(let C=0;C<w.length;C++)for(let S=C+1;S<w.length;S++){const k=w[C],E=w[S],_=l(k),M=l(E);if(!_||!M)continue;const L=u(k,M),P=u(E,_);if(!L||!P)continue;const D=new Map([[k,L],[E,P]]);if(!f(k,L,D)||!f(E,P,D))continue;const R=s(D),I=o(D);R>=m||R>T||R===T&&I>=b||(v=D,T=R,b=I)}if(!v)return;for(const[w,C]of v)w.points=C}}x(Kye,"swapDestinationTerminalTailsToReduceCrossings");function Zye(t,e){const{realNodeRects:a,labelNodeRects:s}=Ef(e.values()),o=t.filter(w=>!w.isLayoutOnly),l=x((w,C=new Map)=>on(C.get(w)??w.points??[]),"replacementPointsFor"),u=x((w=new Map)=>{let C=0;for(let S=0;S<o.length;S++){const k=$r(l(o[S],w));for(let E=S+1;E<o.length;E++){const _=$r(l(o[E],w));for(const M of k)for(const L of _)Gh(M.a,M.b,L.a,L.b,Yt)&&C++}}return C},"strictCrossingCount"),h=x((w=new Map)=>o.reduce((C,S)=>C+Mo(l(S,w)),0),"totalBends"),d=x(w=>{const C=w.start,S=w.end,k=C?e.get(C):void 0,E=S?e.get(S):void 0,_=k?To(k):void 0,M=E?To(E):void 0;return _&&M?{src:_,dst:M}:void 0},"endpointRectsFor"),f=x((w,C,S)=>{if(S.index<=0||S.index+1>=C.length-1)return;const k=d(w);if(k){if(S.vertical){const E=S.a.x,_=Math.min(k.src.left,k.dst.left),M=Math.max(k.src.right,k.dst.right),L=E<_-Yt?"left":E>M+Yt?"right":void 0;return L?{edge:w,points:C,segmentIndex:S.index,axis:"vertical",side:L,coord:E,min:Math.min(S.a.y,S.b.y),max:Math.max(S.a.y,S.b.y)}:void 0}if(S.horizontal){const E=S.a.y,_=Math.min(k.src.top,k.dst.top),M=Math.max(k.src.bottom,k.dst.bottom),L=E<_-Yt?"top":E>M+Yt?"bottom":void 0;return L?{edge:w,points:C,segmentIndex:S.index,axis:"horizontal",side:L,coord:E,min:Math.min(S.a.x,S.b.x),max:Math.max(S.a.x,S.b.x)}:void 0}}},"externalRailForSegment"),p=x(()=>{const w=[];for(const C of o){const S=l(C);for(const k of $r(S)){const E=f(C,S,k);E&&w.push(E)}}return w},"collectExternalRails"),g=x((w,C)=>w.edge!==C.edge&&w.axis===C.axis&&w.side===C.side&&qs(w.min,w.max,C.min,C.max)>=ka,"railsInteract"),m=x(w=>{const C=[],S=new Set;for(const k of w){if(S.has(k))continue;const E=[k],_=[];for(S.add(k);E.length>0;){const M=E.pop();_.push(M);for(const L of w)!S.has(L)&&g(M,L)&&(S.add(L),E.push(L))}_.length>1&&C.push(_)}return C},"connectedComponents"),y=x(w=>{const C=[];for(const S of w)C.some(k=>Math.abs(k-S.coord)<Yt)||C.push(S.coord);for(;C.length<w.length;){const S=Math.min(...C),k=Math.max(...C),E=w[0].side;C.push(E==="left"||E==="top"?S-12*(w.length-C.length):k+12*(w.length-C.length))}return C},"uniqueCoordsFor"),v=x(w=>{const C=w.map(E=>E.coord),S=y(w),k=[];if(w.length<=6){const E=new Array(S.length).fill(!1),_=[],M=x(()=>{if(_.length===w.length){_.some((L,P)=>Math.abs(L-C[P])>=Yt)&&k.push([..._]);return}for(const[L,P]of S.entries())E[L]||(E[L]=!0,_.push(P),M(),_.pop(),E[L]=!1)},"visit");return M(),k}for(let E=0;E<C.length;E++)for(let _=E+1;_<C.length;_++){const M=[...C];[M[E],M[_]]=[M[_],M[E]],k.push(M)}return k},"coordinateAssignmentsFor"),T=x((w,C)=>{const S=new Map;for(const[E,_]of w.entries()){const M=C[E],L=S.get(_.edge)??_.points.map(P=>({x:P.x,y:P.y}));_.axis==="vertical"?(L[_.segmentIndex].x=M,L[_.segmentIndex+1].x=M):(L[_.segmentIndex].y=M,L[_.segmentIndex+1].y=M),S.set(_.edge,L)}const k=new Map;for(const[E,_]of S){const M=Qc(on(_));if($r(M).length!==M.length-1)return;k.set(E,M)}return k},"replacementsForAssignment"),b=x(w=>{for(const[C,S]of w){const k=[C.start,C.end].filter(E=>!!E);for(const E of $r(S))if(Oi(E.a,E.b,a,k,-2)||Oi(E.a,E.b,s,[],-2))return!1}for(let C=0;C<o.length;C++){const S=o[C],k=w.has(S),E=$r(l(S,w));for(let _=C+1;_<o.length;_++){const M=o[_];if(!k&&!w.has(M))continue;const L=$r(l(M,w));for(const P of E)for(const D of L)if(Uc(P,D,.5)>=ka)return!1}}return!0},"candidateIsSafe");for(let w=0;w<4;w++){const C=u();if(C===0)return;let S,k=C,E=h(),_=Number.POSITIVE_INFINITY;for(const M of m(p()))for(const L of v(M)){const P=T(M,L);if(!P||!b(P))continue;const D=u(P);if(D>=C)continue;const R=h(P),I=M.reduce(($,O,N)=>$+Math.abs(L[N]-O.coord),0);D>k||D===k&&(R>E||R===E&&I>=_)||(S=P,k=D,E=R,_=I)}if(!S)return;for(const[M,L]of S)M.points=L}}x(Zye,"reassignCrossingExternalRailChannels");function Qye(t,e){const{realNodeRects:n,labelNodeRects:i}=Ef(e.values()),a=t.filter(p=>!p.isLayoutOnly),s=x((p,g,m)=>on(p===g?m??[]:p.points??[]),"pointsFor"),o=x(p=>$r(p).reduce((g,m)=>{const y=m.a.x-m.b.x,v=m.a.y-m.b.y;return g+Math.hypot(y,v)},0),"pathLength"),l=x((p,g)=>{let m=0;for(let y=0;y<a.length;y++){const v=$r(s(a[y],p,g));for(let T=y+1;T<a.length;T++){const b=$r(s(a[T],p,g));for(const w of v)for(const C of b)Gh(w.a,w.b,C.a,C.b,Yt)&&m++}}return m},"strictCrossingCount"),u=x((p,g)=>{if(p.horizontal){const m=p.a.y;return(Math.abs(m-g.top)<1||Math.abs(m-g.bottom)<1)&&qs(p.a.x,p.b.x,g.left,g.right)>=ka}if(p.vertical){const m=p.a.x;return(Math.abs(m-g.left)<1||Math.abs(m-g.right)<1)&&qs(p.a.y,p.b.y,g.top,g.bottom)>=ka}return!1},"segmentRunsAlongRectBorder"),h=x(p=>{const g=[p.start,p.end].filter(y=>!!y),m=[];for(const y of g){const v=e.get(y),T=v?To(v):void 0;T&&m.push(T)}return m},"endpointRectsFor"),d=x((p,g)=>{if(g+3>=p.length)return[];const m=p[g],y=p[g+1],v=p[g+2],T=p[g+3],b=xi(m,y,Yt)&&Ti(y,v,Yt)&&xi(v,T,Yt),w=Ti(m,y,Yt)&&xi(y,v,Yt)&&Ti(v,T,Yt);if(!b&&!w)return[];if(!(b?Math.sign(y.x-m.x)!==Math.sign(T.x-v.x):Math.sign(y.y-m.y)!==Math.sign(T.y-v.y)))return[];const S=qr(m,T,Yt)||Kr(m,T,Yt)?[]:[{x:m.x,y:T.y},{x:T.x,y:m.y}],k=S.length===0?[[...p.slice(0,g+1),...p.slice(g+3)]]:S.map(_=>[...p.slice(0,g+1),_,...p.slice(g+3)]),E=new Set;return k.map(_=>Qc(on(_))).filter(_=>{if($r(_).length!==_.length-1||!_.some(L=>wl(L,T,Yt)))return!1;const M=_.map(L=>`${L.x.toFixed(3)},${L.y.toFixed(3)}`).join("|");return E.has(M)?!1:(E.add(M),!0)})},"shortcutCandidatesAt"),f=x((p,g,m)=>{const y=[p.start,p.end].filter(T=>!!T),v=h(p);for(const T of $r(g))if(Oi(T.a,T.b,n,y,-2)||Oi(T.a,T.b,i,[],-2)||v.some(b=>u(T,b)))return!1;for(const T of a)if(T!==p){for(const b of $r(g))for(const w of $r(s(T)))if(Uc(b,w,.5)>=ka)return!1}return l(p,g)<=m},"candidateIsSafe");for(let p=0;p<8;p++){const g=l();let m,y,v=g,T=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY;for(const w of a){const C=s(w),S=Mo(C,Yt),k=o(C);for(let E=0;E<=C.length-4;E++)for(const _ of d(C,E)){const M=Mo(_,Yt),L=o(_);if(!(M<S||M===S&&L<k-Yt)||!f(w,_,g))continue;const D=l(w,_);D>v||D===v&&(M>T||M===T&&L>=b)||(m=w,y=_,v=D,T=M,b=L)}}if(!m||!y)return;m.points=y}}x(Qye,"shortcutRedundantOrthogonalJogs");function Jye(t,e){const s=[];for(const ce of e.values()){if(ce.isGroup||ce.isEdgeLabel)continue;const oe=ce.x??0,be=ce.y??0,fe=To(ce);fe&&s.push({id:String(ce.id??""),cx:oe,cy:be,rect:fe})}if(s.length===0)return;const o=new Map(s.map(ce=>[ce.id,ce])),l=s.map(ce=>({id:ce.id,rect:ce.rect})),u=["top","bottom","left","right"],h={top:Math.min(...s.map(ce=>ce.rect.top))-20,bottom:Math.max(...s.map(ce=>ce.rect.bottom))+20,left:Math.min(...s.map(ce=>ce.rect.left))-20,right:Math.max(...s.map(ce=>ce.rect.right))+20},d=t.filter(ce=>!ce.isLayoutOnly),f=new Map(d.map((ce,oe)=>[ce,oe])),p=x(ce=>{const oe=ce==="left"||ce==="top"?-1:1,be=[];for(let fe=0;fe<=2;fe++)be.push(h[ce]+oe*20*fe);return be},"outwardTracksForSide"),g=x((ce,oe=new Map)=>on(oe.get(ce)??ce.points??[]),"replacementPointsFor"),m=x((ce,oe)=>{let be=0;for(const fe of ce)for(const Pe of oe)Gh(fe.a,fe.b,Pe.a,Pe.b,Yt)&&be++;return be},"crossingCountBetweenSegments"),y=x((ce,oe)=>m($r(ce),$r(oe)),"crossingCountBetweenPaths"),v=x((ce=new Map)=>{let oe=0;const be=[],fe=new Set,Pe=[],ve=x(Ce=>{fe.has(Ce)||(fe.add(Ce),Pe.push(Ce))},"addEdge");for(let Ce=0;Ce<d.length;Ce++){const Ve=d[Ce],se=g(Ve,ce);for(let de=Ce+1;de<d.length;de++){const Te=d[de],ae=y(se,g(Te,ce));ae>0&&(oe+=ae,be.push({first:Ve,second:Te,count:ae}),ve(Ve),ve(Te))}}return Pe.sort((Ce,Ve)=>(f.get(Ce)??0)-(f.get(Ve)??0)),{count:oe,pairs:be,edgeSet:fe,edges:Pe}},"crossingSnapshot"),T=x((ce,oe)=>{const be=new Set(oe.keys());if(be.size===0)return ce.count;let fe=0;for(const ve of ce.pairs)(be.has(ve.first)||be.has(ve.second))&&(fe+=ve.count);let Pe=0;for(let ve=0;ve<d.length;ve++){const Ce=d[ve],Ve=be.has(Ce),se=g(Ce,oe);for(let de=ve+1;de<d.length;de++){const Te=d[de];!Ve&&!be.has(Te)||(Pe+=y(se,g(Te,oe)))}}return ce.count-fe+Pe},"crossingCountWithReplacements"),b=x(ce=>{const oe=new Map;for(const Pe of ce.pairs){const ve=oe.get(Pe.first)??new Set;ve.add(Pe.second),oe.set(Pe.first,ve);const Ce=oe.get(Pe.second)??new Set;Ce.add(Pe.first),oe.set(Pe.second,Ce)}const be=[],fe=new Set;for(const Pe of ce.edges){if(fe.has(Pe))continue;const ve=[Pe],Ce=[];for(fe.add(Pe);ve.length>0;){const Ve=ve.pop();Ce.push(Ve);for(const se of oe.get(Ve)??[])fe.has(se)||(fe.add(se),ve.push(se))}Ce.sort((Ve,se)=>(f.get(Ve)??0)-(f.get(se)??0)),Ce.length>1&&be.push(Ce)}return be},"crossingComponents"),w=x(ce=>[ce.start,ce.end].filter(oe=>!!oe),"endpointIdsFor"),C=x(ce=>{const oe=[];for(const be of b(ce)){const fe=new Set(be),Pe=new Set(be.flatMap(Ce=>w(Ce))),ve=[...be];for(const Ce of d)fe.has(Ce)||w(Ce).some(Ve=>Pe.has(Ve))&&ve.push(Ce);ve.sort((Ce,Ve)=>(f.get(Ce)??0)-(f.get(Ve)??0)),oe.push(ve)}return oe},"pairSearchGroups"),S=x((ce,oe,be)=>T(ce,new Map([[oe,be]])),"crossingCountWithSingleReplacement"),k=x(ce=>{const oe=new Map;for(const be of ce.pairs)oe.set(be.first,(oe.get(be.first)??0)+be.count),oe.set(be.second,(oe.get(be.second)??0)+be.count);return oe},"currentCrossingsByEdge"),E=x(ce=>ce.slice(1).reduce((oe,be,fe)=>{const Pe=ce[fe];return oe+Math.abs(be.x-Pe.x)+Math.abs(be.y-Pe.y)},0),"pathLength"),_=x((ce=new Map)=>d.reduce((oe,be)=>oe+Mo(g(be,ce)),0),"totalBends"),M=x((ce=new Map)=>d.reduce((oe,be)=>oe+E(g(be,ce)),0),"totalLength"),L=x((ce,oe,be=new Map)=>{const fe=$r(oe);for(const Pe of d)if(Pe!==ce){for(const ve of fe)for(const Ce of $r(g(Pe,be)))if(Uc(ve,Ce,.5)>=ka)return!0}return!1},"pathHasSegmentConflict"),P=x((ce,oe)=>{const be=[ce.start,ce.end].filter(fe=>!!fe);for(const fe of $r(oe))if(Oi(fe.a,fe.b,l,be,-2))return!0;return!1},"pathHitsNode"),D=x((ce,oe)=>{const be=Qc(on(oe));$r(be).length===be.length-1&&ce.push(be)},"pushOrthogonalCandidate"),R=x(ce=>ce==="left"||ce==="right","sideIsHorizontal"),I=x((ce,oe,be)=>{switch(oe){case"left":return Math.min(ce.x,be.x)-20;case"right":return Math.max(ce.x,be.x)+20;case"top":return Math.min(ce.y,be.y)-20;case"bottom":return Math.max(ce.y,be.y)+20}},"localTrackForSameSide"),$=x((ce,oe,be,fe)=>{const Pe=be==="left"||be==="top"?-1:1,ve=[I(oe,be,fe),h[be]];for(const Ce of ve)for(let Ve=0;Ve<=2;Ve++)D(ce,kG(oe,be,fe,Ce+Pe*20*Ve))},"addSameSideCandidates"),O=x((ce,oe,be,fe,Pe)=>{for(const ve of p(be))for(const Ce of p(Pe))D(ce,[oe,{x:ve,y:oe.y},{x:ve,y:Ce},{x:fe.x,y:Ce},fe])},"addHorizontalToVerticalCandidates"),N=x((ce,oe,be,fe,Pe)=>{for(const ve of p(be))for(const Ce of p(Pe))D(ce,[oe,{x:oe.x,y:ve},{x:Ce,y:ve},{x:Ce,y:fe.y},fe])},"addVerticalToHorizontalCandidates"),F=x((ce,oe,be,fe,Pe)=>{const ve=[...p("top"),...p("bottom")];for(const Ce of p(be))for(const Ve of p(Pe))for(const se of ve)D(ce,[oe,{x:Ce,y:oe.y},{x:Ce,y:se},{x:Ve,y:se},{x:Ve,y:fe.y},fe])},"addHorizontalPairCandidates"),z=x((ce,oe,be,fe,Pe)=>{const ve=[...p("left"),...p("right")];for(const Ce of p(be))for(const Ve of p(Pe))for(const se of ve)D(ce,[oe,{x:oe.x,y:Ce},{x:se,y:Ce},{x:se,y:Ve},{x:fe.x,y:Ve},fe])},"addVerticalPairCandidates"),V=x(ce=>{const oe=new Set;return ce.map(be=>on(be)).filter(be=>{const fe=be.map(Pe=>`${Pe.x.toFixed(3)},${Pe.y.toFixed(3)}`).join("|");return oe.has(fe)||be.length<2?!1:(oe.add(fe),!0)})},"dedupeCandidatePaths"),B=x((ce,oe,be,fe)=>{const Pe=[],ve=CG(ce,oe,be,fe,20,Yt);ve&&D(Pe,ve),oe===fe&&$(Pe,ce,oe,be);const Ce=R(oe),Ve=R(fe);return Ce&&!Ve?O(Pe,ce,oe,be,fe):!Ce&&Ve?N(Pe,ce,oe,be,fe):Ce?F(Pe,ce,oe,be,fe):z(Pe,ce,oe,be,fe),V(Pe)},"buildCandidatesForSides"),G=x((ce,oe,be,fe)=>{const Pe=[...p("left"),...p("right")],ve=[...p("top"),...p("bottom")];for(const Ce of u){const Ve=Qp(fe,Ce),se=Ce==="top"||Ce==="bottom"?p(Ce):ve;for(const de of Pe){D(ce,[oe,be,{x:de,y:be.y},{x:de,y:Ve.y},Ve]);for(const Te of se)D(ce,[oe,be,{x:de,y:be.y},{x:de,y:Te},{x:Ve.x,y:Te},Ve])}}},"addVerticalDepartureOuterTrackCandidates"),H=x((ce,oe,be,fe)=>{const Pe=[...p("left"),...p("right")],ve=[...p("top"),...p("bottom")];for(const Ce of u){const Ve=Qp(fe,Ce),se=Ce==="left"||Ce==="right"?p(Ce):Pe;for(const de of ve){D(ce,[oe,be,{x:be.x,y:de},{x:Ve.x,y:de},Ve]);for(const Te of se)D(ce,[oe,be,{x:be.x,y:de},{x:Te,y:de},{x:Te,y:Ve.y},Ve])}}},"addHorizontalDepartureOuterTrackCandidates"),q=x(ce=>{const oe=ce.start,be=ce.end,fe=be?o.get(be):void 0;if(!oe||!fe)return[];const Pe=on(ce.points??[]);if(Pe.length<4)return[];const ve=Pe[0],Ce=Pe[1],Ve=[];return Ti(ve,Ce,Yt)?G(Ve,ve,Ce,fe):xi(ve,Ce,Yt)&&H(Ve,ve,Ce,fe),Ve},"terminalPreservingOuterTrackCandidates"),Z=x(ce=>{const oe=ce.start,be=ce.end,fe=oe?o.get(oe):void 0,Pe=be?o.get(be):void 0;if(!fe||!Pe)return[];const ve=[];for(const Ce of u){const Ve=Qp(fe,Ce);for(const se of u)ve.push(...B(Ve,Ce,Qp(Pe,se),se))}return ve.push(...q(ce)),ve},"candidatePathsFor"),Y=x(()=>new Map(d.map(ce=>[ce,$r(g(ce))])),"currentSegmentsByEdge"),ie=x((ce,oe,be)=>{const fe=new Set;for(const Pe of d){if(Pe===ce)continue;const ve=be.get(Pe)??$r(g(Pe));oe.some(Ce=>ve.some(Ve=>Uc(Ce,Ve,.5)>=ka))&&fe.add(Pe)}return fe},"sharedTrackConflictsFor"),K=x((ce,oe,be,fe)=>{const Pe=new Set;return Z(ce).map(Ce=>Qc(on(Ce))).filter(Ce=>{if(P(ce,Ce))return!1;const Ve=Ce.map(se=>`${se.x.toFixed(3)},${se.y.toFixed(3)}`).join("|");return Pe.has(Ve)||Ce.length<2?!1:(Pe.add(Ve),!0)}).map(Ce=>{const Ve=$r(Ce);let se=0;for(const de of d)de!==ce&&(se+=m(Ve,be.get(de)??$r(g(de))));return{candidate:Ce,candidateSegments:Ve,crossings:oe.count-(fe.get(ce)??0)+se,bends:Mo(Ce,Yt),totalBends:Mo(Ce),length:E(Ce)}}).filter(({crossings:Ce})=>Ce<=oe.count).sort((Ce,Ve)=>Ce.crossings-Ve.crossings||Ce.bends-Ve.bends||Ce.length-Ve.length).slice(0,48).map(Ce=>({path:Ce.candidate,segments:Ce.candidateSegments,sharedTrackConflicts:ie(ce,Ce.candidateSegments,be),totalBends:Ce.totalBends,length:Ce.length}))},"pairCandidatesFor"),Q=x((ce,oe,be,fe,Pe,ve)=>{let Ce=0;for(const se of ce.pairs)(se.first===oe||se.second===oe||se.first===fe||se.second===fe)&&(Ce+=se.count);let Ve=m(be.segments,Pe.segments);for(const se of d){if(se===oe||se===fe)continue;const de=ve.get(se)??$r(g(se));Ve+=m(be.segments,de)+m(Pe.segments,de)}return ce.count-Ce+Ve},"pairCrossingCount"),te=x((ce,oe)=>{for(const be of ce.sharedTrackConflicts)if(be!==oe)return!1;return!0},"conflictsOnlyWith"),J=x((ce,oe)=>ce.segments.some(be=>oe.segments.some(fe=>Uc(be,fe,.5)>=ka)),"candidatesShareTrack"),ge=x((ce,oe,be,fe)=>te(oe,be.edge)&&te(fe,ce.edge)&&!J(oe,fe),"pairCandidatesAreCompatible"),ee=x((ce,oe,be,fe,Pe)=>{const ve=Q(ce.current,oe.edge,be,fe.edge,Pe,ce.baseSegments);if(!(ve>=ce.current.count))return{replacements:new Map([[oe.edge,be.path],[fe.edge,Pe.path]]),crossings:ve,bends:ce.currentBends-(ce.baseBendsByEdge.get(oe.edge)??0)-(ce.baseBendsByEdge.get(fe.edge)??0)+be.totalBends+Pe.totalBends,length:ce.currentLength-(ce.baseLengthByEdge.get(oe.edge)??0)-(ce.baseLengthByEdge.get(fe.edge)??0)+be.length+Pe.length}},"scorePairReplacement"),Re=x((ce,oe)=>ce.crossings<oe.crossings||ce.crossings===oe.crossings&&(ce.bends<oe.bends||ce.bends===oe.bends&&ce.length<oe.length),"pairScoreIsBetter"),Ie=x((ce,oe,be,fe)=>{let Pe=fe;for(const ve of oe.candidates)for(const Ce of be.candidates){if(!ge(oe,ve,be,Ce))continue;const Ve=ee(ce,oe,ve,be,Ce);Ve&&Re(Ve,Pe)&&(Pe=Ve)}return Pe},"bestScoreForOptionPair"),Be=x(ce=>{const oe=_(),be=M(),fe=Y(),Pe=k(ce),ve=new Map(d.map(ae=>[ae,Mo(g(ae))])),Ce=new Map(d.map(ae=>[ae,E(g(ae))])),Ve=new Map,se=C(ce);for(const ae of se)for(const he of ae){if(Ve.has(he))continue;const W=K(he,ce,fe,Pe);W.length>0&&Ve.set(he,{edge:he,candidates:W})}let de={replacements:new Map,crossings:ce.count,bends:oe,length:be};const Te={current:ce,currentBends:oe,currentLength:be,baseBendsByEdge:ve,baseLengthByEdge:Ce,baseSegments:fe};for(const ae of se){const he=new Set(ae.filter(ne=>ce.edgeSet.has(ne))),W=ae.map(ne=>Ve.get(ne)).filter(ne=>!!ne);for(let ne=0;ne<W.length;ne++){const j=W[ne];for(let ue=ne+1;ue<W.length;ue++){const X=W[ue];!he.has(j.edge)&&!he.has(X.edge)||(de=Ie(Te,j,X,de))}}}return de.replacements.size>0?de.replacements:void 0},"bestPairedReplacement");for(let ce=0;ce<4;ce++){const oe=v(),be=oe.count;if(be===0)return;let fe,Pe,ve=be,Ce=Number.POSITIVE_INFINITY;for(const se of oe.edges){const de=Mo(g(se),Yt);for(const Te of Z(se)){const ae=P(se,Te),he=!ae&&L(se,Te),W=S(oe,se,Te),ne=Mo(Te,Yt);ae||he||!(W<be||W===be&&ne<de)||W>ve||W===ve&&ne>=Ce||(fe=se,Pe=Te,ve=W,Ce=ne)}}if(fe&&Pe){fe.points=Pe;continue}const Ve=Be(oe);if(!Ve)return;for(const[se,de]of Ve)se.points=de}}x(Jye,"resolveRenderedOrthogonalCrossings");var id=.001,fut=8;function e1e(t,e){const{nodeInfoById:r,realNodeRects:n}=JR(e),i=["top","bottom","left","right"],a=20,s={top:Math.min(...n.map(m=>m.rect.top))-a,bottom:Math.max(...n.map(m=>m.rect.bottom))+a,left:Math.min(...n.map(m=>m.rect.left))-a,right:Math.max(...n.map(m=>m.rect.right))+a},o=x((m,y,v,T)=>{const b=[],w=CG(m,y,v,T,a,id);return w&&b.push(w),y===T&&b.push(kG(m,y,v,s[y])),b},"buildOrthogonalPathCandidates"),l=x((m,y)=>{for(let v=0;v<m.length-1;v++){const T=m[v],b=m[v+1];if(Oi(T,b,n,y,1))return!0}return!1},"pathHitsNode"),u=x((m,y,v=!1)=>{let T=0;const b=Vb(m,id),w=y.start,C=y.end;for(const S of t){if(S===y||S.isLayoutOnly)continue;const k=S.start,E=S.end;if(!v&&w&&C&&(k===w||k===C||E===w||E===C))continue;const _=S.points;if(!(!_||_.length<2))for(const M of b)for(const L of Vb(_,id)){if(EG(M.a,M.b,L.a,L.b,id,id)){T++;continue}Uc(M,L,id)>=fut&&T++}}return T},"pathConflictCount"),h=4,d=x((m,y)=>{const v=Math.abs(m.y-y.rect.top),T=Math.abs(m.y-y.rect.bottom),b=Math.abs(m.x-y.rect.left),w=Math.abs(m.x-y.rect.right);let C="top",S=v;return T<S&&(C="bottom",S=T),b<S&&(C="left",S=b),w<S&&(C="right",S=w),C},"nearestSideOfRect"),f=new Map,p=x((m,y,v)=>{const T=f.get(m)??[];T.push({side:y,edgeId:v}),f.set(m,T)},"addFaceClaim");for(const m of t){if(m.isLayoutOnly)continue;const y=m.points??[];if(y.length<1)continue;const v=m.id??"",T=m.start,b=m.end;if(T){const w=r.get(T);w&&p(T,d(y[0],w),v)}if(b){const w=r.get(b);w&&p(b,d(y[y.length-1],w),v)}}const g=x((m,y,v)=>{var T;return((T=f.get(m))==null?void 0:T.some(b=>b.edgeId!==v&&b.side===y))??!1},"faceIsClaimed");for(const m of t){if(m.isLayoutOnly)continue;const y=m.points;if(!y||y.length<2)continue;const v=Mo(y,id);if(v<h)continue;const T=m.start,b=m.end;if(!T||!b)continue;const w=r.get(T),C=r.get(b);if(!w||!C)continue;const S=m.id??"",k=u(y,m,!0),E=u(y,m);let _,M=k,L=v;for(const P of i){if(g(T,P,S))continue;const D=Qp(w,P);for(const R of i){if(g(b,R,S))continue;const I=Qp(C,R);for(const $ of o(D,P,I,R)){if(l($,[T,b]))continue;const O=Mo($,id);if(k>0){const N=u($,m,!0);if(N>M||N===M&&O>=L)continue;M=N,L=O,_=$;continue}u($,m)>E||O<L&&(L=O,_=$)}}}if(_){m.points=_;const P=f.get(T);P&&f.set(T,P.filter(R=>R.edgeId!==S));const D=f.get(b);D&&f.set(b,D.filter(R=>R.edgeId!==S)),p(T,d(_[0],w),S),p(b,d(_[_.length-1],C),S)}}}x(e1e,"simplifyDetouredEdges");var oo=.001,UQ=10,HE=7;function z$(t,e){const r=e?0:t.length-1,n=e?1:-1,i=t[r],a=t[r+n];if(!i||!a)return;const s=a.x-i.x,o=a.y-i.y;if(!(Math.abs(s)+Math.abs(o)<oo)){if(Math.abs(o)<=oo){const u=i.x+Math.sign(s)*UQ;return{left:Math.min(i.x,u),right:Math.max(i.x,u),top:i.y-HE,bottom:i.y+HE}}if(Math.abs(s)<=oo){const u=i.y+Math.sign(o)*UQ;return{left:i.x-HE,right:i.x+HE,top:Math.min(i.y,u),bottom:Math.max(i.y,u)}}return{left:Math.min(i.x,a.x),right:Math.max(i.x,a.x),top:Math.min(i.y,a.y),bottom:Math.max(i.y,a.y)}}}x(z$,"markerClearanceRectFor");function t1e(t){return{left:Math.min(t.left,t.right),right:Math.max(t.left,t.right),top:Math.min(t.top,t.bottom),bottom:Math.max(t.top,t.bottom)}}x(t1e,"normalizeRect");function V$(t,e){const r=on(e),n=z$(r,!0),i=z$(r,!1);return[n,i].some(a=>a&&t_(t,t1e(a)))}x(V$,"labelOverlapsOwnMarker");function i3(t,e){const r=[];for(const g of t){if(g.isLayoutOnly)continue;const m=g.points;if(!(!m||m.length<2))for(let y=0;y<m.length-1;y++)r.push({edgeId:g.id,p1:m[y],p2:m[y+1]})}const n=[],i=[];for(const g of e.values()){const m=g.isGroup,y=g.parentId;if(m&&!y){const T=To(g);T&&i.push({id:g.id,rect:T});continue}if(m||g.isEdgeLabel)continue;const v=To(g);v&&n.push({nodeId:g.id,rect:v})}const a=3,s=1,o=12,l=x((g,m)=>{const y=k$(m,a);for(const{nodeId:v,rect:T}of n)if(v!==g&&t_(y,T))return!0;return!1},"labelOverlapsForeignNode"),u=x((g,m)=>{const y=k$(m,a);for(const v of r)if(v.edgeId!==g&&QR(v.p1,v.p2,y))return!0;return!1},"labelOverlapsForeignEdge"),h=x((g,m,y)=>l(g,y)||u(m,y),"labelOverlapsAnything"),d=[],f=x(g=>{for(const{id:m,rect:y}of i)if(Rye(y,g))return m},"findContainingLane"),p=x((g,m)=>d.some(y=>y.labelId!==g&&t_(m,y.rect)),"overlapsPlacedLabel");for(const g of t){if(g.isLayoutOnly)continue;const m=g.labelNodeId;if(!m)continue;const y=e.get(m);if(!y)continue;const v=g.points;if(!v||v.length<2)continue;const T=y.width??0,b=y.height??0;if(T<=0||b<=0)continue;const w=[];for(let V=0;V<v.length-1;V++){const B=v[V],G=v[V+1],H=Math.abs(B.x-G.x),q=Math.abs(B.y-G.y);H<oo&&q<oo||H>=oo&&q>=oo||w.push({idx:V,length:H+q,orientation:H>=oo?"horizontal":"vertical",midX:(B.x+G.x)/2,midY:(B.y+G.y)/2})}if(w.length===0)continue;const C=w.length>=3?w.filter(V=>V.idx>0&&V.idx<w.length-1):w,S=C.length>0?C:w,k=T>=b?"horizontal":"vertical",E=x(V=>[...V].sort((B,G)=>{const H=B.orientation===k,q=G.orientation===k;if(H!==q)return H?-1:1;const Z=B.length>=(B.orientation==="horizontal"?T:b)+2,Y=G.length>=(G.orientation==="horizontal"?T:b)+2;return Z!==Y?Z?-1:1:G.length-B.length}),"rankSegments"),_=w[0],M=w[w.length-1],L=[.5,.25,.75,.05,.95,.15,.85,.1,.9],P=x((V,B)=>{const G=v[V.idx],H=v[V.idx+1];return{midX:G.x+(H.x-G.x)*B,midY:G.y+(H.y-G.y)*B}},"anchorAtT"),D=x((V,B,G)=>Math.min(G,Math.max(B,V)),"clamp"),R=x((V,B)=>V.midX>=B.left-oo&&V.midX<=B.right+oo&&V.midY>=B.top-oo&&V.midY<=B.bottom+oo,"pointInsideRectInclusive"),I=x(V=>{const B=vy(V.midX,V.midY,T,b),G=f(B);if(G)return{laneId:G,anchor:V,rect:B};const H=i.find(({rect:te})=>R(V,te));if(!H)return;const q=H.rect.left+T/2+s,Z=H.rect.right-T/2-s,Y=H.rect.top+b/2+s,ie=H.rect.bottom-b/2-s;if(q>Z||Y>ie)return;const K={midX:D(V.midX,q,Z),midY:D(V.midY,Y,ie)},Q=vy(K.midX,K.midY,T,b);return R(V,Q)?{laneId:H.id,anchor:K,rect:Q}:void 0},"placementForAnchor"),$=x((V,B,G)=>V.orientation==="horizontal"?Math.abs(B.midX-G.x):Math.abs(B.midY-G.y),"distanceAlongSegment"),O=x((V,B)=>{const H=(V.orientation==="horizontal"?T/2:b/2)+o;if(V===_){const q=v[V.idx];if($(V,B,q)+oo<H)return!1}if(V===M){const q=v[V.idx+1];if($(V,B,q)+oo<H)return!1}return!0},"labelClearsTerminalEndpoints"),N=x(V=>{const B=E(V);for(const G of B)for(const H of L){const q=P(G,H);if(!O(G,q))continue;const Z=I(q);if(Z&&!V$(Z.rect,v)&&!p(m,Z.rect)&&!h(m,g.id,Z.rect))return{laneId:Z.laneId,anchor:Z.anchor}}},"tryPool"),F=x((V,B,G=!1)=>{const H=E(V);for(const q of H){const Z={midX:q.midX,midY:q.midY};if(B&&!O(q,Z))continue;const Y=I(Z);if(Y&&!V$(Y.rect,v)&&!p(m,Y.rect)&&!l(m,Y.rect)&&(G||!u(g.id,Y.rect)))return{laneId:Y.laneId,anchor:Y.anchor}}},"findLaneContainingFallback"),z=N(S)??(S.length<w.length?N(w):void 0)??F(w,!0)??F(w,!1)??F(w,!1,!0);if(z){y.x=z.anchor.midX,y.y=z.anchor.midY,y.parentId=z.laneId;const V=vy(z.anchor.midX,z.anchor.midY,T,b),B=d.findIndex(G=>G.labelId===m);B>=0?d[B]={labelId:m,rect:V}:d.push({labelId:m,rect:V})}}}x(i3,"anchorLabelsToPolyline");var LI=1e-6,put=8,YQ=put/2,gut=3;function G$(t,e){return t<e?`${t}::${e}`:`${e}::${t}`}x(G$,"pairKey");function r1e(t,e){const{nodeInfoById:r,realNodeRects:n}=JR(e),i=new Map;for(const s of e){const o=s.id;if(!s.isGroup&&s.isEdgeLabel){i.set(o,{w:s.width??0,h:s.height??0});continue}}const a=x((s,o,l,u)=>{const h=G$(o,l);let d=0;const f=x(p=>{if(!p)return;const g=i.get(p);if(!g)return;const m=u==="x"?g.w/2:g.h/2;m>d&&(d=m)},"consider");f(s.labelNodeId);for(const p of t){if(p===s||p.isLayoutOnly)continue;const g=p.start,m=p.end;!g||!m||G$(g,m)===h&&f(p.labelNodeId)}return d>0?d+gut:0},"labelClearanceFor");for(const s of t){if(s.isLayoutOnly)continue;const o=s.points;if(!TG(o,LI))continue;const l=SG(s,r,LI);if(!l)continue;const{srcId:u,dstId:h,srcInfo:d,dstInfo:f,collinearX:p,collinearY:g}=l;if(p===g)continue;let m,y;if(p){const C=f.cy>d.cy;m={x:d.cx,y:C?d.rect.bottom:d.rect.top},y={x:f.cx,y:C?f.rect.top:f.rect.bottom}}else{const C=f.cx>d.cx;m={x:C?d.rect.right:d.rect.left,y:d.cy},y={x:C?f.rect.left:f.rect.right,y:f.cy}}if(Oi(m,y,n,[u,h],1))continue;const T=a(s,u,h,p?"x":"y"),b=T>YQ?T:YQ,w=[0,b,-b];for(const C of w){const S={...m},k={...y};if(p){if(S.x+=C,k.x+=C,S.x<=d.rect.left||S.x>=d.rect.right||k.x<=f.rect.left||k.x>=f.rect.right)continue}else if(S.y+=C,k.y+=C,S.y<=d.rect.top||S.y>=d.rect.bottom||k.y<=f.rect.top||k.y>=f.rect.bottom)continue;if(!Oi(S,k,n,[u,h],1)&&!r_(S,k,t,s,{epsilon:LI})){s.points=[S,k];break}}}}x(r1e,"straightenCollinearSiblingDetours");function W$(t,e){const{realNodeRects:l,labelNodeRects:u}=Ef(e.values()),h=x((C,S)=>Vb(S,.001).map(k=>({...k,edge:C,interior:k.index>=1&&k.index<=S.length-3})),"segmentsFor"),d=x(()=>{const C=[];for(const S of t){if(S.isLayoutOnly)continue;const k=S.points;!k||k.length<2||C.push(...h(S,on(k)))}return C},"allSegments"),f=x((C,S)=>C.horizontal&&S.horizontal?qs(C.a.x,C.b.x,S.a.x,S.b.x)>=8&&Math.abs(C.a.y-S.a.y)<7:C.vertical&&S.vertical?qs(C.a.y,C.b.y,S.a.y,S.b.y)>=8&&Math.abs(C.a.x-S.a.x)<7:!1,"hasCrowdedParallelTrack"),p=x((C,S)=>{const k=C.start,E=C.end,_=h(C,S);if(_.length!==S.length-1)return!1;const M=[k,E].filter(P=>!!P),L=C.labelNodeId?[C.labelNodeId]:[];for(const P of _)if(Oi(P.a,P.b,l,M,-2)||Oi(P.a,P.b,u,L,-2))return!1;for(const P of t){if(P===C||P.isLayoutOnly)continue;const D=P.points;if(!(!D||D.length<2)){for(const R of _)for(const I of h(P,on(D)))if(f(R,I)||Gh(R.a,R.b,I.a,I.b,.001))return!1}}return!0},"candidateIsSafe"),g=x((C,S)=>{const k=on(C.edge.points??[]);if(k.length<4||C.index>=k.length-1)return;const E=k.map(_=>({..._}));if(C.horizontal)E[C.index].y+=S,E[C.index+1].y+=S;else if(C.vertical)E[C.index].x+=S,E[C.index+1].x+=S;else return;return h(C.edge,E).length===E.length-1?E:void 0},"shiftedCandidate"),m=x((C,S)=>({x:C.x??(S.left+S.right)/2,y:C.y??(S.top+S.bottom)/2}),"nodeCenter"),y=x(C=>{const S=C.edge,k=on(S.points??[]);if(k.length!==4||C.index!==1)return;const E=S.start?e.get(S.start):void 0,_=S.end?e.get(S.end):void 0,M=E?To(E):void 0,L=_?To(_):void 0,P=k.slice(C.index+2);if(!(!E||!_||!M||!L||P.length===0))return{sourceCenter:m(E,M),targetCenter:m(_,L),sourceRect:M,tail:P}},"sourceDetourContextFor"),v=x((C,S,k,E,_,M)=>{const L=E.y>=k.y,P=L?_.bottom:_.top,D=P+(L?20:-20);if(L&&C.b.y<=D+.001||!L&&C.b.y>=D-.001)return;const R=C.a.x+S;return on([{x:k.x,y:P},{x:k.x,y:D},{x:R,y:D},{x:R,y:C.b.y},...M],.001)},"verticalSourceDetour"),T=x((C,S,k,E,_,M)=>{const L=E.x>=k.x,P=L?_.right:_.left,D=P+(L?20:-20);if(L&&C.b.x<=D+.001||!L&&C.b.x>=D-.001)return;const R=C.a.y+S;return on([{x:P,y:k.y},{x:D,y:k.y},{x:D,y:R},{x:C.b.x,y:R},...M],.001)},"horizontalSourceDetour"),b=x((C,S)=>{const k=y(C);if(k){if(C.vertical)return v(C,S,k.sourceCenter,k.targetCenter,k.sourceRect,k.tail);if(C.horizontal)return T(C,S,k.sourceCenter,k.targetCenter,k.sourceRect,k.tail)}},"sourceDetourCandidate"),w=[-7,7,-14,14,-21,21];for(let C=0;C<12;C++){const S=d();let k=!1;for(let E=0;E<S.length&&!k;E++)for(let _=E+1;_<S.length&&!k;_++){const M=S[E],L=S[_];if(M.edge===L.edge||!f(M,L))continue;const P=[M,L].filter(D=>D.interior);for(const D of P){for(const R of w){const I=g(D,R);if(I&&p(D.edge,I)){D.edge.points=I,k=!0;break}const $=b(D,R);if($&&p(D.edge,$)){D.edge.points=$,k=!0;break}}if(k)break}}if(!k)return}}x(W$,"nudgeSharedInteriorSubpaths");function n1e(t,e,r,n){const i=e.x-t.x,a=e.y-t.y,s=n.x-r.x,o=n.y-r.y,l=i*o-a*s;if(Math.abs(l)<1e-10)return!1;const u=r.x-t.x,h=r.y-t.y,d=(u*o-h*s)/l,f=(u*a-h*i)/l,p=.01;return d>p&&d<1-p&&f>p&&f<1-p}x(n1e,"segmentsIntersect");function i1e(t){const e=t.nodes??[],r=t.edges??[],n=[];if(!r.length||!e.length)return n;const i=Lye(e),a=[];for(const o of r){if(o.isLayoutOnly)continue;const l=o.points;if(!l||l.length<2)continue;const u=o.start,h=o.end,d=o.labelNodeId,f=o.id??`${u}->${h}`;for(const p of i)if(!(p.nodeId===u||p.nodeId===h)&&!(d&&p.nodeId===d)){for(let g=0;g<l.length-1;g++)if(QR(l[g],l[g+1],p,-1)){n.push({type:"edge-node-overlap",edgeId:f,targetId:p.nodeId,detail:`segment ${g} passes through node "${p.nodeId}"`});break}}for(let p=0;p<l.length-1;p++)a.push({edgeId:f,start:u,end:h,p1:l[p],p2:l[p+1]})}const s=new Set;for(let o=0;o<a.length;o++)for(let l=o+1;l<a.length;l++){const u=a[o],h=a[l];if(u.edgeId!==h.edgeId&&!(u.start===h.start||u.start===h.end||u.end===h.start||u.end===h.end)&&n1e(u.p1,u.p2,h.p1,h.p2)){const d=u.edgeId<h.edgeId?`${u.edgeId}|${h.edgeId}`:`${h.edgeId}|${u.edgeId}`;s.has(d)||(s.add(d),n.push({type:"edge-edge-crossing",edgeId:u.edgeId,targetId:h.edgeId,detail:`edges "${u.edgeId}" and "${h.edgeId}" cross`}))}}if(n.length>0){const o=n.filter(u=>u.type==="edge-node-overlap").length,l=n.filter(u=>u.type==="edge-edge-crossing").length;le.warn(`[SWIMLANE_VALIDATE] ${n.length} issue(s) detected: ${o} edge-node overlap(s), ${l} edge crossing(s)`);for(const u of n)le.warn(`[SWIMLANE_VALIDATE] ${u.type}: ${u.detail}`)}return n}x(i1e,"validateSwimlanesLayout");function a1e(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(o=>!o.isGroup);if((e==="LR"||e==="RL")&&i.length>0&&!qye(t,e)||e==="BT"&&i.length>0&&!Hye(t))return;for(const o of n){if(o.isLayoutOnly)continue;const l=o.points;!l||l.length<2||(o.points=Qc(n_(l)))}e1e(n,r),r1e(n,r),Uye(n,r);const a=new Map;for(const o of r)a.set(String(o.id),o);i3(n,a),Oye(n,a),Yye(n,a),W$(n,a),Xye(n,a),jye(n,a),P$(n,a),Kye(n,a);const s=x(()=>{Jye(n,a),Zye(n,a),Qye(n,a),i3(n,a),O$(n,a),P$(n,a),i3(n,a),O$(n,a)},"finalizeRenderedEdges");s(),W$(n,a),s(),B$(n,a),F$(n,a),B$(n,a),F$(n,a)}x(a1e,"postProcessSwimlaneLayout");function Af(t){const e=new Map(t.nodeById),r=new Set,n=[];for(const a of t.edges){if(!e.has(a.src)||!e.has(a.dst))continue;const s=`${a.id}:${a.src}->${a.dst}`;r.has(s)||(r.add(s),n.push(a))}return{nodes:[...e.keys()],edges:n,layout:t.layout,nodeById:e}}x(Af,"normalizeGraph");function MG(t,e){return t.edges.filter(r=>r.dst===e)}x(MG,"incoming");function s1e(t){const e=new Map;for(const r of t.nodes)e.set(r,[]);for(const r of t.edges)e.get(r.src).push(r.dst);return e}x(s1e,"buildSuccessorMap");function IG(t){const e=s1e(t);for(const r of e.values())r.sort((n,i)=>n.localeCompare(i));return e}x(IG,"buildSortedSuccessorMap");function NG(t){const e=new Map;for(const r of t.nodes)e.set(r,0);for(const r of t.edges)e.set(r.dst,(e.get(r.dst)??0)+1);return e}x(NG,"buildInDegreeMap");function DG(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,r)=>e.localeCompare(r))}x(DG,"sortedZeroInDegreeNodes");function eL(t,e=()=>!0){const r=new Map,n=new Map;for(const i of t.nodes)r.set(i,[]),n.set(i,[]);for(const i of t.edges)e(i)&&(n.get(i.src).push(i.dst),r.get(i.dst).push(i.src));return{preds:r,succs:n}}x(eL,"buildPredecessorSuccessorMaps");function OG(t,e,r,n){var s,o;let i=0;for(const l of t.nodes)n!=null&&n.skipGroups&&((s=t.nodeById.get(l))!=null&&s.isGroup)||(i=Math.max(i,r[l]??0));const a=Array.from({length:i+1},()=>[]);for(const l of e)n!=null&&n.skipGroups&&((o=t.nodeById.get(l))!=null&&o.isGroup)||a[Math.max(0,r[l]??0)].push(l);return a}x(OG,"buildLayersFromRanks");function uS(t){const e=NG(t),r=DG(e),n=[],i=IG(t);for(;r.length;){const a=r.shift();n.push(a);for(const s of i.get(a)??[])if(e.set(s,(e.get(s)??0)-1),(e.get(s)??0)===0){let o=0;for(;o<r.length&&r[o]<s;)o++;r.splice(o,0,s)}}return n.length===t.nodes.length?n:null}x(uS,"topoSortIfAcyclic");function Gb(t){const e=new Map;let r=0;for(const n of t)e.set(n,r),r++;return e}x(Gb,"buildLayerIndex");function $G(t){const e=new Array(t.length),r=x((n,i)=>{if(i-n<=1)return 0;const a=n+i>>1;let s=r(n,a)+r(a,i),o=n,l=a,u=n;for(;o<a||l<i;)l>=i||o<a&&t[o]<=t[l]?e[u++]=t[o++]:(e[u++]=t[l++],s+=a-o);for(let h=n;h<i;h++)t[h]=e[h];return s},"count");return r(0,t.length)}x($G,"countInversions");function o1e(t){const e=Af(t),r=new Map;for(const h of e.nodes)r.set(h,[]);for(const h of e.edges)r.get(h.src).push(h);for(const h of r.values())h.sort((d,f)=>d.dst===f.dst?d.id.localeCompare(f.id):d.dst.localeCompare(f.dst));const n=Object.create(null);for(const h of e.nodes)n[h]=0;const i=[],a=x(h=>{n[h]=1;for(const d of r.get(h)??[]){const f=d.dst;n[f]===0?a(f):n[f]===1&&i.push(d)}n[h]=2},"dfs"),s=[...e.nodes].sort((h,d)=>h.localeCompare(d));for(const h of s)n[h]===0&&a(h);const o=new Set(i.map(h=>`${h.id}:${h.src}->${h.dst}`)),l=e.edges.map(h=>o.has(`${h.id}:${h.src}->${h.dst}`)?{id:h.id,src:h.dst,dst:h.src,weight:h.weight,ref:h.ref}:h);return{acyclic:{nodes:[...e.nodes],edges:l,layout:e.layout,nodeById:new Map(e.nodeById)},reversed:i}}x(o1e,"removeCycles_DFS");function l1e(t){const e=new Map,r=x(n=>{if(e.has(n))return e.get(n);const i=t.nodeById.get(n);if(!i)return e.set(n,null),null;const a=i.parentId;if(!a)return e.set(n,null),null;const o=r(a)??a;return e.set(n,o),o},"resolve");for(const n of t.nodes)r(n);return e}x(l1e,"buildTopLaneMap");function Wh(t){const e=l1e(t);return r=>e.get(r)??null}x(Wh,"createTopLaneResolver");function tL(t){const e=[];for(const r of t.layout.nodes??[])r.isGroup&&!r.parentId&&e.push(r.id);return[...new Set(e)].reverse()}x(tL,"buildTopLaneOrder");function PG(t,e){const r=tL(t);if(!e||e.length===0)return r;const n=new Set(r),i=new Set,a=[];for(const s of e)!n.has(s)||i.has(s)||(i.add(s),a.push(s));for(const s of r)i.has(s)||a.push(s);return a}x(PG,"resolveTopLaneOrder");var mut={EPSILON:1e-6},l_={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},XQ={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function c1e(t,e){const r=Af(t),n=(e==null?void 0:e.laneOf)??(()=>null),i=e==null?void 0:e.rankHint,{preds:a}=eL(r);for(const C of a.values())C.sort((S,k)=>S.localeCompare(k));const s=uS(r)??[...r.nodes].sort((C,S)=>C.localeCompare(S)),o=new Map;for(const[C,S]of s.entries())o.set(S,C);const l=new Map,u=new Map;for(const C of r.nodes)u.set(C,[]);for(const C of s){const S=(a.get(C)??[]).filter(k=>l.has(k));if(S.length>0){const k=u1e(C,S,{laneOf:n,rankHint:i,topoIndex:o});l.set(C,k),u.get(k).push(C)}else l.has(C)||l.set(C,null)}for(const C of r.nodes)l.has(C)||l.set(C,null);const h=new Set;for(const C of r.nodes)(l.get(C)??null)===null&&h.add(C);const d=[...h].sort((C,S)=>{const k=o.get(C)??0,E=o.get(S)??0;return k===E?C.localeCompare(S):k-E}),f=h1e(r),p=new Map;for(const[C,S]of f.entries())p.set(C,[...S].sort((k,E)=>k.localeCompare(E)));const g=d1e(p),m=f1e(p),y=new Map;for(const C of r.nodes)y.set(C,[]);for(const C of m)for(const S of C.nodes){const k=y.get(S);k?k.push(C.id):y.set(S,[C.id])}const v=[],T=[],b=new Set,w=x(C=>{if(!b.has(C)){b.add(C),v.push(C);for(const S of u.get(C)??[])w(S);T.push(C)}},"walk");for(const C of d)w(C);for(const C of s)w(C);return{parent:l,children:u,roots:d,componentOf:g,blocks:m,nodeBlocks:y,adjacency:p,preorder:v,postorder:T,topologicalOrder:s}}x(c1e,"buildDrivingTree");function u1e(t,e,r){const n=r.laneOf(t);return[...e].sort((a,s)=>{var m,y;const o=r.laneOf(a),l=r.laneOf(s),u=o!=null&&o===n,h=l!=null&&l===n;if(u!==h)return u?-1:1;const d=(m=r.rankHint)==null?void 0:m[a],f=(y=r.rankHint)==null?void 0:y[s];if(d!=null&&f!=null&&d!==f)return f-d;const p=r.topoIndex.get(a)??0,g=r.topoIndex.get(s)??0;return p!==g?p-g:a.localeCompare(s)})[0]}x(u1e,"chooseParent");function h1e(t){const e=new Map;for(const r of t.nodes)e.set(r,new Set);for(const r of t.edges)e.get(r.src).add(r.dst),e.get(r.dst).add(r.src);return e}x(h1e,"buildAdjacency");function d1e(t){const e=new Map;let r=0;for(const n of t.keys()){if(e.has(n))continue;const i=[n];for(;i.length>0;){const a=i.pop();if(!e.has(a)){e.set(a,r);for(const s of t.get(a)??[])e.has(s)||i.push(s)}}r++}return e}x(d1e,"assignComponents");function f1e(t){const e=new Map,r=new Map,n=[],i=[];let a=0;const s=x((o,l)=>{e.set(o,++a),r.set(o,a);for(const u of t.get(o)??[])u!==l&&(e.has(u)?(e.get(u)??0)<(e.get(o)??0)&&(n.push([o,u]),r.set(o,Math.min(r.get(o)??a,e.get(u)??a))):(n.push([o,u]),s(u,o),r.set(o,Math.min(r.get(o)??a,r.get(u)??a)),(r.get(u)??0)>=(e.get(o)??0)&&i.push(p1e(o,u,n,i.length))))},"visit");for(const o of t.keys())e.has(o)||s(o,null);return i}x(f1e,"computeBlocks");function p1e(t,e,r,n){const i=[],a=new Set;for(;r.length>0;){const s=r.pop();if(i.push(s),a.add(s[0]),a.add(s[1]),s[0]===t&&s[1]===e||s[0]===e&&s[1]===t)break}return{id:n,edges:i,nodes:[...a]}}x(p1e,"popBlock");function g1e(t,e,r){const n=[...t.nodes],i=new Map;for(const[T,b]of n.entries())i.set(b,T);const a=n.length,s=new Array(a).fill(-1),o=new Array(a).fill(0),l=[],u=new Set;for(const T of n){const b=r.parent.get(T)??null,w=i.get(T);w!=null&&b==null&&(s[w]=-1,o[w]=0,u.has(T)||(u.add(T),l.push(T)))}for(;l.length>0;){const T=l.shift(),b=i.get(T);if(b==null)continue;const w=r.children.get(T)??[];for(const C of w){if(u.has(C))continue;const S=i.get(C);S!=null&&(s[S]=b,o[S]=o[b]+1,u.add(C),l.push(C))}}for(const T of n){if(u.has(T))continue;const b=i.get(T);b!=null&&(s[b]=-1,o[b]=0,u.add(T))}const h=Math.max(1,Math.ceil(Math.log2(Math.max(1,a)))+1),d=Array.from({length:h},()=>new Array(a).fill(-1));for(let T=0;T<a;T++)d[0][T]=s[T];for(let T=1;T<h;T++)for(let b=0;b<a;b++){const w=d[T-1][b];d[T][b]=w===-1?-1:d[T-1][w]}const f=x((T,b)=>{if(T===-1||b===-1)return-1;o[T]<o[b]&&([T,b]=[b,T]);const w=o[T]-o[b];for(let C=0;C<h;C++)if(w>>C&1&&(T=d[C][T],T===-1))return-1;if(T===b)return T;for(let C=h-1;C>=0;C--){const S=d[C][T],k=d[C][b];S===-1||k===-1||S!==k&&(T=S,b=k)}return d[0][T]},"lcaIndex"),p=Array.from({length:a},()=>new Map);for(const T of t.edges){let b=T.src,w=T.dst,C=e[b],S=e[w];if(C==null||S==null||(C>S&&([b,w]=[w,b],[C,S]=[S,C]),C==null||S==null||C===S))continue;const k=i.get(b),E=i.get(w);if(k==null||E==null)continue;const _=f(k,E);if(_===-1)continue;const M=p[_];for(let L=C;L<S;L++)M.set(L,(M.get(L)??0)+1)}const g=new Map,m=x((T,b)=>{if(b.size!==0)for(const[w,C]of b)T.set(w,(T.get(w)??0)+C)},"mergeInto"),y=new Set,v=x(T=>{const b=i.get(T);y.add(T);const w=b==null?void 0:p[b],C=w?new Map(w):new Map,S=r.children.get(T)??[];for(const k of S){const E=v(k),_=e[T];if(_!=null){let M=g.get(T);M||(M=new Map,g.set(T,M));let L=E.get(_)??0;const P=e[k];P!=null&&P>_&&(L+=1),M.set(k,L)}m(C,E)}return C},"dfs");for(const T of r.roots)y.has(T)||v(T);for(const T of n)y.has(T)||v(T);return g}x(g1e,"computeSubtreeCrossCounts");function m1e(t,e,r){const n=new Map,i=x(a=>{let s=r[a]??0;const o=[...e.get(a)??[]];o.sort(BG(r));for(const l of o){i(l);const u=n.get(l);u!=null&&(s=Math.min(s,u))}n.set(a,s)},"annotate");for(const a of t)i(a);return n}x(m1e,"annotateMinimumLayers");function BG(t){return(e,r)=>{const n=t[e]??0,i=t[r]??0;return n===i?e.localeCompare(r):n-i}}x(BG,"compareByRankThenId");function y1e(t,e,r,n){let i=0;for(const l of e){const u=r[l]??0;u>i&&(i=u)}const a=Array.from({length:i+1},()=>[]),s=new Set,o=x(l=>{if(s.has(l))return;s.add(l);const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l);for(const h of n(l))o(h)},"emit");for(const l of t)o(l);for(const l of e)if(!s.has(l)){const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l),s.add(l)}return a}x(y1e,"emitNodesInTreeOrder");function v1e(t){const e=[];for(const r of t){const n=new Set,i=[];for(const a of r)n.has(a)||(n.add(a),i.push(a));e.push(i)}return e}x(v1e,"deduplicateLayers");function b1e(t,e,r,n){return i=>{const a=t.get(i)??[];if(a.length===0)return[];const s=e[i]??0,o=[],l=[],u=r.get(i);for(const h of a){const d=n.get(h)??s;d>s?o.push({child:h,min:d}):l.push(h)}return o.sort((h,d)=>h.min===d.min?h.child.localeCompare(d.child):h.min-d.min),l.sort((h,d)=>{const f=(u==null?void 0:u.get(h))??0,p=(u==null?void 0:u.get(d))??0;if(f!==p)return f-p;const g=n.get(h)??s,m=n.get(d)??s;return g!==m?g-m:h.localeCompare(d)}),[...o.map(h=>h.child),...l]}}x(b1e,"createChildOrderer");function c_(t,e,r){const n=c1e(t,{rankHint:e,laneOf:r}),{children:i,roots:a}=n;for(const d of t.nodes)i.has(d)||i.set(d,[]);const s=g1e(t,e,n),o=[...a].sort(BG(e)),l=m1e(o,i,e),u=b1e(i,e,s,l);let h=y1e(o,t.nodes,e,u);return h=v1e(h),h}x(c_,"buildMultitreeLayerOrder");function x1e(t,e,r){const n=new Set(t),i=new Set(e),a=Gb(e),s=[];for(const o of r)n.has(o.src)&&i.has(o.dst)&&s.push(a.get(o.dst));return $G(s)}x(x1e,"countCrossingsBetweenAdjacent");function H$(t,e,r){const n=[];for(const a of e){const s=r[a.src],o=r[a.dst];if(s==null||o==null||s===o)continue;let l=a.src,u=a.dst,h=s,d=o;s>o&&(l=a.dst,u=a.src,h=o,d=s);for(let f=h;f<d;f++)n.push({id:`${a.id}@${f}`,src:l,dst:u,ref:a.ref})}let i=0;for(let a=0;a+1<t.length;a++)i+=x1e(t[a],t[a+1],n);return i}x(H$,"totalCrossings");function T1e(t,e){const r={...e},{preds:n}=eL(t),i=Wh(t),a=c_(t,r,i);let s=H$(a,t.edges,r);const o=l_.MAX_CROSSING_OPTIMIZATION_PASSES;for(let l=0;l<o;l++){let u=!1;const h=[...t.nodes].sort((d,f)=>(r[f]??0)-(r[d]??0));for(const d of h){const f=r[d]??0;if(f===0)continue;let p=0;for(const v of n.get(d)??[])p=Math.max(p,(r[v]??0)+1);if(p>=f)continue;const g=f;r[d]=p;const m=c_(t,r,i),y=H$(m,t.edges,r);y<s?(s=y,u=!0):r[d]=g}if(!u)break}return r}x(T1e,"optimizeRanksByCrossings");function w1e(t,e){const r=Wh(t),n=[...t.nodes].sort((i,a)=>(e[i]??0)-(e[a]??0)||i.localeCompare(a));for(const i of n){const a=r(i);if(!a)continue;const s=t.edges.filter(m=>m.src===i);if(s.length===0)continue;let o=!1,l=0;for(const m of s){const y=r(m.dst);y==null||y===a?o=!0:l++}if(l===0||o)continue;let u=0,h=!1;for(const m of t.edges){if(m.dst!==i)continue;const y=r(m.src);y&&(y===a?h=!0:u++)}if(u>0||!h)continue;const d=e[i]??0,f=d+l;let p=0;for(const m of t.edges)m.dst===i&&(p=Math.max(p,(e[m.src]??0)+1));const g=Math.max(d,p,f);g!==d&&(e[i]=g)}}x(w1e,"adjustCrossLaneSources");function C1e(t,e){const r=Af(t),n=uS(r)??[...r.nodes].sort(),i=(e==null?void 0:e.compactSingleInput)??!1,a=Wh(r);let s=Object.create(null);for(const l of n){const u=MG(r,l),h=e!=null&&e.ignoreCrossLaneEdges?u.filter(d=>{const f=a(d.src),p=a(l);return!f||!p?!0:f===p}):u;if(h.length===0)s[l]=0;else if(i&&h.length===1){const d=h[0].src,f=a(d),p=a(l);f!==p?s[l]=s[d]??0:s[l]=(s[d]??0)+1}else{let d=-1/0;for(const f of h)d=Math.max(d,(s[f.src]??0)+1);s[l]=d===-1/0?0:d}}return((e==null?void 0:e.optimizeRanksByCrossings)??!1)&&(s=T1e(r,s)),e!=null&&e.ignoreCrossLaneEdges&&w1e(r,s),{layers:c_(r,s,a),rankOf:s,dummy:new Set}}x(C1e,"assignLayers_LongestPath");function k1e(t,e){const r=Af(t),i={...C1e(r,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},a=Wh(r),{preds:s,succs:o}=eL(r,g=>{if(e!=null&&e.ignoreCrossLaneEdges){const m=a(g.src),y=a(g.dst);if(m&&y&&m!==y)return!1}return!0}),l=uS(r)??[...r.nodes],u=[...l].reverse(),h=x((g,m)=>{let y=0;for(const b of s.get(g)??[])y=Math.max(y,(i[b]??0)+1);let v=Number.POSITIVE_INFINITY;const T=o.get(g)??[];return T.length>0&&(v=Math.min(...T.map(b=>(i[b]??0)-1))),Number.isFinite(v)||(v=Math.max(y,m)),Math.min(Math.max(m,y),v)},"clampFeasible"),d=l_.GRAVITY_ITERATIONS,f=x(g=>{let m=!1;for(const y of g){const v=s.get(y)??[],T=o.get(y)??[];if(v.length===0&&T.length===0)continue;const b=v.length>0?v.reduce((k,E)=>k+(i[E]??0)+1,0)/v.length:i[y]??0,w=T.length>0?T.reduce((k,E)=>k+(i[E]??0)-1,0)/T.length:i[y]??0,C=Math.round((b+w)/2),S=h(y,C);S!==i[y]&&(i[y]=S,m=!0)}return m},"relaxOrder");for(let g=0;g<d;g++){const m=f(l),y=f(u);if(!m&&!y)break}for(const g of l){let m=0;for(const y of s.get(g)??[])m=Math.max(m,(i[y]??0)+1);(i[g]??0)<m&&(i[g]=m)}for(const g of u){const m=o.get(g)??[];if(m.length>0){const y=Math.min(...m.map(v=>(i[v]??0)-1));(i[g]??0)>y&&(i[g]=y)}}return{layers:OG(r,l,i),rankOf:i,dummy:new Set}}x(k1e,"assignLayers_Gravity");function S1e(t){const e=NG(t),r=IG(t);let n=DG(e);const i=[];for(;n.length>0;){const a=[];for(const s of n){i.push(s);for(const o of r.get(s)??[])e.set(o,(e.get(o)??0)-1),(e.get(o)??0)===0&&a.push(o)}n=a.sort((s,o)=>s.localeCompare(o))}return i.length===t.nodes.length?i:null}x(S1e,"topoSortByGenerationIfAcyclic");function E1e(t,e){const r=Af(t),n=(e==null?void 0:e.direction)==="LR"?S1e(r)??[...r.nodes].sort():uS(r)??[...r.nodes].sort(),i=Wh(r),a=x(h=>i(h)??h,"laneOf"),s=Object.create(null),o=new Map,l=x((h,d)=>(e==null?void 0:e.ignoreCrossLaneEdges)??!0?a(h)===a(d)?1:0:1,"edgeWeight");for(const h of n){const d=r.nodeById.get(h);if(d!=null&&d.isGroup)continue;const f=MG(r,h);let p=0;if(f.length>0)for(const v of f){const T=v.src,b=s[T]??0;p=Math.max(p,b+l(T,h))}const g=a(h),m=o.get(g)??0,y=Math.max(p,m);s[h]=y,o.set(g,y+1)}return{layers:OG(r,n,s,{skipGroups:!0}),rankOf:s,dummy:new Set}}x(E1e,"assignLayers_LaneAwareCompact");function A1e(t,e){const r=Af(e),{rankOf:n}=t,i=t.layers.map(p=>[...p]),a=new Set(t.dummy?[...t.dummy]:[]);let s=0;const o=new Map(r.nodeById),l=x(p=>{const g=`placeholder-${s++}`,m={id:g,isGroup:!1,isDummy:!0,width:0,height:0};for(o.set(g,m),a.add(g);i.length<=p;)i.push([]);return i[p].push(g),n[g]=p,g},"addDummyAt"),u=[...r.edges].sort((p,g)=>p.id===g.id?p.src===g.src?p.dst.localeCompare(g.dst):p.src.localeCompare(g.src):p.id.localeCompare(g.id)),h=[];for(const p of u){const g=n[p.src]??0,m=n[p.dst]??0;if(m-g<=1){h.push(p);continue}let y=p.src;for(let T=g+1,b=0;T<m;T++,b++){const w=l(T);h.push({id:`${p.id}#${b}`,src:y,dst:w,weight:p.weight,ref:p.ref}),y=w}const v=m-g-2;h.push({id:`${p.id}#${Math.max(v+1,0)}`,src:y,dst:p.dst,weight:p.weight,ref:p.ref})}const f={nodes:[...r.nodes,...[...a].filter(p=>!r.nodes.includes(p))],edges:h,layout:r.layout,nodeById:o};return{layering:{layers:i,rankOf:n,dummy:a},graphWithDummies:f}}x(A1e,"makeProperLayering");function q$(t){const e=t.length;if(e===0)return Number.POSITIVE_INFINITY;const r=[...t].sort((n,i)=>n-i);return e%2===1?r[(e-1)/2]:.5*(r[e/2-1]+r[e/2])}x(q$,"median");function U$(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((r,n)=>r+n,0)/t.length}x(U$,"barycenter");function _1e(t,e,r,n){const i=new Map;for(const a of t)i.set(a,[]);for(const a of r)n==="down"?e.has(a.src)&&i.has(a.dst)&&i.get(a.dst).push(e.get(a.src)):e.has(a.dst)&&i.has(a.src)&&i.get(a.src).push(e.get(a.dst));return i}x(_1e,"neighborPositionsFor");function R1e(t,e,r){const n=r.get(t)??0,i=r.get(e)??0;return n!==i?n-i:t.localeCompare(e)}x(R1e,"currentOrderTieBreak");function Y$(t,e,r){const n=new Set(t),i=new Set(e),a=Gb(t),s=Gb(e),o=[];for(const u of r)n.has(u.src)&&i.has(u.dst)&&o.push({u:a.get(u.src),v:s.get(u.dst)});o.sort((u,h)=>u.u===h.u?u.v-h.v:u.u-h.u);const l=o.map(u=>u.v);return $G(l)}x(Y$,"countCrossingsBetweenAdjacent");function a3(t,e,r){return[...t].sort((n,i)=>{const a=q$(e.get(n)??[]),s=q$(e.get(i)??[]);return a===s?R1e(n,i,r):isFinite(a)?isFinite(s)?a-s:-1:1})}x(a3,"sortByHeuristic");function X$(t,e,r,n,i,a){const s=Gb(t),o=Gb(e),l=_1e(e,s,r,n);if(!i||!a||a.length===0)return a3(e,l,o);const u=new Map;for(const f of e){const p=i(f),g=u.get(p)??[];g.push(f),u.set(p,g)}const h=[];for(const f of a){const p=u.get(f);if(!p||p.length===0)continue;const g=a3(p,l,o);h.push(...g)}const d=u.get(null);if(d&&d.length>0){const f=a3(d,l,o);for(const p of f){const g=U$(l.get(p)??[]);let m=h.length;if(isFinite(g))for(const[y,v]of h.entries()){const T=U$(l.get(v)??[]);if(g<T){m=y;break}}h.splice(m,0,p)}}return h}x(X$,"reorderLayer");function j$(t,e,r,n,i){const a=[...e],s=new Set(t),o=new Set(e),l=n?new Set(n):null,u=r.filter(m=>s.has(m.src)&&o.has(m.dst)),h=l?r.filter(m=>o.has(m.src)&&l.has(m.dst)):void 0,d=x(m=>{let y=Y$(t,m,u);return h&&n&&(y+=Y$(m,n,h)),y},"crossingScore"),f=i?new Map:null;if(i&&f)for(const m of e)f.set(m,i(m));let p=!0,g=d(a);for(;p;){p=!1;for(let m=0;m+1<a.length;m++){if(f){const T=f.get(a[m]),b=f.get(a[m+1]);if(T!==b)continue}const y=g;[a[m],a[m+1]]=[a[m+1],a[m]];const v=d(a);v<y?(g=v,p=!0):[a[m],a[m+1]]=[a[m+1],a[m]]}}return a}x(j$,"transposeImprove");function L1e(t,e,r){const n=t.layers.map(o=>[...o]),i=e.edges,a=Wh(e),s=PG(e,r==null?void 0:r.laneOrder);for(let o=0;o<3;o++){for(let l=1;l<n.length;l++)n[l]=X$(n[l-1],n[l],i,"down",a,s),n[l]=j$(n[l-1],n[l],i,n[l+1],a);for(let l=n.length-2;l>=0;l--)n[l]=X$(n[l+1],n[l],i,"up",a,s),n[l]=j$(n[l+1],n[l],i,n[l-1],a)}return{layers:n}}x(L1e,"orderLayers");function M1e(t,e,r){const n=(r==null?void 0:r.layerGap)??XQ.DEFAULT_LAYER_GAP,i=(r==null?void 0:r.nodeGap)??XQ.DEFAULT_NODE_GAP,a=(r==null?void 0:r.laneGap)??i*2,s=(r==null?void 0:r.direction)??"TB",o=s==="LR"||s==="RL",l=t.layers,u=Object.create(null),h=Object.create(null),d=x(M=>e.nodeById.get(M),"getNode"),f=x(M=>{var L;return((L=d(M))==null?void 0:L.width)??0},"getWidth"),p=x(M=>{var L;return((L=d(M))==null?void 0:L.height)??0},"getHeight"),g=Wh(e),m=PG(e,r==null?void 0:r.laneOrder),y=l.map(M=>M.reduce((L,P)=>Math.max(L,p(P)),0)),v=[];if(o)for(let M=0;M+1<l.length;M++){const L=l[M].reduce((N,F)=>Math.max(N,f(F)),0),P=l[M+1].reduce((N,F)=>Math.max(N,f(F)),0),D=y[M],R=y[M+1],I=D/2+R/2,$=(L+P)/2,O=Math.max(0,$-I-n);v.push(O)}const T=new Set;for(const M of l)for(const L of M)T.add(g(L));const b=T.has(null),w=m.filter(M=>T.has(M)),C=[...b?[null]:[],...w],S=Object.create(null);for(const M of w)S[M]=0;b&&(S.null=0);for(const M of l){const L=Object.create(null),P=[];for(const D of M){const R=g(D);R===null?P.push(D):(L[R]||(L[R]=[])).push(D)}for(const[D,R]of Object.entries(L)){const I=R.reduce(($,O)=>$+f(O),0)+i*Math.max(0,R.length-1);S[D]=Math.max(S[D]??0,I)}if(b&&P.length){const D=P.reduce((R,I)=>R+f(I),0)+i*Math.max(0,P.length-1);S.null=Math.max(S.null??0,D)}}const k=new Map;{const M=C.map(D=>(D===null?S.null:S[D])??0);let P=-(M.reduce((D,R)=>D+R,0)+a*Math.max(0,C.length-1))/2;for(let D=0;D<C.length;D++){const R=C[D],I=M[D]??0,$=P+I/2;k.set(R,$),P+=I,D<C.length-1&&(P+=a)}}let E=0;for(const[M,L]of l.entries()){const P=y[M]??0,D=new Map;for(const I of L){const $=g(I),O=D.get($)??[];O.push(I),D.set($,O)}for(const I of C){const $=D.get(I)??[];if($.length===0)continue;const O=k.get(I);if($.length===1){const N=$[0];u[N]=O,h[N]=E+P/2}else{const N=$.map(V=>f(V)),F=N.reduce((V,B)=>V+B,0)+i*($.length-1);let z=O-F/2;for(const[V,B]of $.entries()){const G=N[V];u[B]=z+G/2,h[B]=E+P/2,z+=G+i}}}const R=v[M]??0;E+=P+n+R}const _=new Map;for(const M of e.edges){const L=M.ref.id;_.has(L)||_.set(L,[]),_.get(L).push(M)}for(const[,M]of _){if(M.length===0)continue;const L=M[0].ref,P=L.start,D=L.end;if(P==null||D==null)continue;const R=Math.round(((u[P]??0)+(u[D]??0))/2),I=new Set;for(const $ of M)I.add($.src),I.add($.dst);for(const $ of I){if($===P||$===D)continue;const O=e.nodeById.get($);O!=null&&O.isDummy&&(u[$]=R)}}return{x:u,y:h}}x(M1e,"assignCoordinates");var I1e=8;function N1e(t){let e=2166136261;for(let r=0;r<t.length;r++)e^=t.charCodeAt(r),e=Math.imul(e,16777619);return e>>>0}x(N1e,"hashString");function D1e(t){let e=t>>>0;return()=>{e+=1831565813;let r=e;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}x(D1e,"mulberry32");function O1e(t,e){const r=[...t],n=D1e(e);for(let i=r.length-1;i>0;i--){const a=Math.floor(n()*(i+1));[r[i],r[a]]=[r[a],r[i]]}return r}x(O1e,"deterministicShuffle");function $1e(t,e){let r=0;for(const[n,i]of t.entries())r+=Math.abs(n-(e.get(i)??n));return r}x($1e,"sourceDistance");function K$(t,e){const r=new Map;for(const[i,a]of t.entries())r.set(a,i);let n=0;for(const{a:i,b:a,weight:s}of e){const o=r.get(i),l=r.get(a);o==null||l==null||(n+=s*Math.abs(o-l))}return n}x(K$,"laneArrangementCost");function P1e(t){const e=tL(t);if(e.length<2)return[];const r=new Map(e.map((a,s)=>[a,s])),n=Wh(t),i=new Map;for(const a of t.layout.edges??[]){if(a.isLayoutOnly)continue;const s=typeof a.start=="string"?a.start:void 0,o=typeof a.end=="string"?a.end:void 0;if(!s||!o||!t.nodeById.has(s)||!t.nodeById.has(o))continue;const l=n(s),u=n(o);if(!l||!u||l===u)continue;const h=r.get(l),d=r.get(u);if(h==null||d==null)continue;const[f,p]=h<=d?[l,u]:[u,l],g=`${f}\0${p}`,m=i.get(g);m?m.weight++:i.set(g,{a:f,b:p,weight:1})}return[...i.values()]}x(P1e,"buildWeightedLaneEdges");function Z$(t,e,r){const n=[...t];let i=K$(n,e),a=!0,s=0;const o=Math.max(1,n.length);for(;a&&s<o;){a=!1,s++;for(let l=0;l+1<n.length;l++){[n[l],n[l+1]]=[n[l+1],n[l]];const u=K$(n,e);u<i?(i=u,a=!0):[n[l],n[l+1]]=[n[l+1],n[l]]}}return{order:n,cost:i,sourceDistance:$1e(n,r)}}x(Z$,"greedySwitch");function B1e(t,e){return t.cost!==e.cost?t.cost<e.cost:t.sourceDistance<e.sourceDistance}x(B1e,"isBetterCandidate");function F1e(t,e,r){const n=[...e].sort((i,a)=>i.a===a.a?i.b.localeCompare(a.b):i.a.localeCompare(a.a)).map(({a:i,b:a,weight:s})=>`${i}:${a}:${s}`).join("|");return N1e(`${t.join("|")}#${n}#${r}`)}x(F1e,"seedForRestart");function z1e(t,e={}){const r=tL(t);if(r.length<2)return r;const n=P1e(t);if(n.length===0)return r;const i=new Map(r.map((o,l)=>[o,l]));let a=Z$(r,n,i);const s=Math.max(0,e.restarts??I1e);for(let o=0;o<s;o++){const l=F1e(r,n,o),u=O1e(r,l),h=Z$(u,n,i);B1e(h,a)&&(a=h)}return a.order}x(z1e,"optimizeTopLaneOrder");function V1e(t,e){const r=(e==null?void 0:e.ignoreCrossLaneEdges)??!0,n=(e==null?void 0:e.optimizeRanksByCrossings)??!0,i=Af(t),a=e!=null&&e.automaticLaneOrdering?z1e(i,{restarts:I1e}):void 0,s=o1e(i),o=s.acyclic,l=r?E1e(o,{compactSingleInput:(e==null?void 0:e.compactSingleInput)??l_.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!0,direction:e==null?void 0:e.direction}):k1e(o,{compactSingleInput:(e==null?void 0:e.compactSingleInput)??l_.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!1,optimizeRanksByCrossings:n}),{layering:u,graphWithDummies:h}=A1e(l,o),d=L1e(u,h,{laneOrder:a}),f=M1e(d,h,{layerGap:e==null?void 0:e.layerGap,nodeGap:e==null?void 0:e.nodeGap,direction:e==null?void 0:e.direction,laneOrder:a});return{acyclic:o,reversed:s.reversed,layering:u,ordered:d,coordinates:f}}x(V1e,"sugiyamaLayout");var Fr=mut.EPSILON,yut=8,jf=15,Xg=15,qE=25,Jo=20,MI=10;function Q$(t,e,r){const n=t.x??0,i=t.y??0,a=e.x-n,s=e.y-i,o=Math.abs(a),l=Math.abs(s);return o<Fr&&l<Fr?r:l>Fr&&l*3>=o?s>0?"bottom":"top":o>Fr?a>0?"right":"left":r}x(Q$,"chooseOrthogonalSide");function J$(t,e){return Math.abs(t.to-e.from)<Fr||Math.abs(t.to-e.to)<Fr?t.to:t.from}x(J$,"sharedLineEndpointCoord");function lp(t,e){return t.orient==="vertical"?{x:t.coord,y:e}:{x:e,y:t.coord}}x(lp,"pointOnLine");function G1e(t,e){var Pe,ve,Ce,Ve;const r=t.nodes??[],n=t.edges??[],i=[];for(const se of n)se.isLayoutOnly||i.push({...se,__originalEdge:se});const a=new Map,s=new Map,o=[],l=e==="LR";for(const se of r)a.set(se.id,se);const u=r.filter(se=>se.isGroup&&!se.parentId);for(const se of u){const de={id:se.id},Te=x(ae=>{s.set(ae.id,de),r.filter(he=>he.parentId===ae.id).forEach(Te)},"assignLane");Te(se)}const h=r.filter(se=>!se.isGroup&&!se.isEdgeLabel).map(se=>{const de=se.width??10,Te=se.height??10,ae=se.x??0,he=se.y??0,W=yut;return{nodeId:se.id,minX:ae-de/2-W,maxX:ae+de/2+W,minY:he-Te/2-W,maxY:he+Te/2+W,visualXHalfExtent:l?Te/2+W:de/2+W}}),d=x((se,de,Te,ae)=>{let he=o.find(W=>W.orientation===se&&Math.abs(W.coord-de)<1);return he||(he={id:`pipe-${se}-${de.toFixed(0)}`,orientation:se,coord:de,spanMin:Te,spanMax:ae,tracks:[]},o.push(he)),he.spanMin=Math.min(he.spanMin,Te),he.spanMax=Math.max(he.spanMax,ae),he},"getOrAddPipe"),f=x((se,de)=>{const Te=se.width??10,ae=se.height??10,he=se.x??0,W=se.y??0;switch(de){case"top":return{x:he,y:W-ae/2};case"bottom":return{x:he,y:W+ae/2};case"left":return{x:he-Te/2,y:W};case"right":return{x:he+Te/2,y:W}}},"portForSide"),p=x((se,de,Te)=>f(se,Q$(se,de,Te?"bottom":"top")),"getOrthogonalPort"),g=[],m=[],y=new Set,v=1e3,T=x((se,de,Te)=>{if(g.length===0)return 0;const ae=Math.abs(de.y-Te.y)<Fr,he=Math.abs(de.x-Te.x)<Fr;if(!ae&&!he)return 0;let W=0;if(ae){const ne=de.y,j=Math.min(de.x,Te.x)-Fr,ue=Math.max(de.x,Te.x)+Fr;if(ue<=j)return 0;for(const X of g)X.edgeIndex===se||X.orientation!=="vertical"||X.pipe.coord<j||X.pipe.coord>ue||X.from-Fr<=ne&&X.to+Fr>=ne&&(W+=v)}else if(he){const ne=de.x,j=Math.min(de.y,Te.y)-Fr,ue=Math.max(de.y,Te.y)+Fr;if(ue<=j)return 0;for(const X of g)X.edgeIndex===se||X.orientation!=="horizontal"||X.pipe.coord<j||X.pipe.coord>ue||X.from-Fr<=ne&&X.to+Fr>=ne&&(W+=v)}return W},"crossingPenalty"),b=i.map((se,de)=>{if(!se.start||!se.end)return{idx:de,crossLane:0,dx:0,dy:0};const Te=a.get(se.start),ae=a.get(se.end),he=s.get(se.start),W=s.get(se.end),ne=he&&W&&he.id!==W.id?1:0,j=Te&&ae?Math.abs((ae.x??0)-(Te.x??0)):0,ue=Te&&ae?Math.abs((ae.y??0)-(Te.y??0)):0;return{idx:de,crossLane:ne,dx:j,dy:ue}}).sort((se,de)=>{if(se.crossLane!==de.crossLane)return de.crossLane-se.crossLane;const Te=se.dx+se.dy,ae=de.dx+de.dy;return Math.abs(Te-ae)>1?Te-ae:se.idx-de.idx}).map(se=>se.idx),w=x((se,de,Te,ae)=>{const he=Math.min(se.x,de.x),W=Math.max(se.x,de.x),ne=Math.min(se.y,de.y),j=Math.max(se.y,de.y);return!!h.find(X=>Te&&X.nodeId===Te||ae&&X.nodeId===ae?!1:Math.abs(se.x-de.x)>Fr?X.minY<se.y&&X.maxY>se.y&&X.maxX>he&&X.minX<W:X.minX<se.x&&X.maxX>se.x&&X.maxY>ne&&X.minY<j)},"isSegmentBlocked"),C=new Map,S=new Map;for(const se of i)!se.start||!se.end||se.start===se.end||(S.set(se.start,(S.get(se.start)??0)+1),S.set(se.end,(S.get(se.end)??0)+1));const k=x((se,de)=>Q$(se,de,"bottom"),"determineSide"),E=new Map;for(const[se,de]of i.entries()){if(!de.start||!de.end||de.start===de.end||de.points&&de.points.length>0)continue;const Te=a.get(de.start),ae=a.get(de.end);if(!Te||!ae)continue;const he=(ae.x??0)-(Te.x??0),W=(ae.y??0)-(Te.y??0);E.set(se,{edgeIdx:se,srcId:de.start,dstId:de.end,srcSide:k(Te,{x:ae.x??0,y:ae.y??0}),dstSide:k(ae,{x:Te.x??0,y:Te.y??0}),absDx:Math.abs(he),absDy:Math.abs(W),dxSign:Math.sign(he),dySign:Math.sign(W)})}const _=x(se=>se.srcSide==="top"||se.srcSide==="bottom"?se.absDx===0?1/0:se.absDy/se.absDx:se.absDy===0?1/0:se.absDx/se.absDy,"preferenceStrength"),M=x(se=>se.srcSide==="top"||se.srcSide==="bottom"?se.dxSign>=0?"right":"left":se.dySign>=0?"bottom":"top","secondarySide"),L=new Map;for(const se of E.values()){const de=`${se.srcId}:${se.srcSide}`;L.has(de)||L.set(de,[]),L.get(de).push(se)}const P=new Map,D=x((se,de)=>`${se}:${de}`,"loadKey");for(const se of E.values())P.set(D(se.srcId,se.srcSide),(P.get(D(se.srcId,se.srcSide))??0)+1),P.set(D(se.dstId,se.dstSide),(P.get(D(se.dstId,se.dstSide))??0)+1);for(const se of L.values())if(!(se.length<2)){se.sort((de,Te)=>{const ae=_(de),he=_(Te);return Math.abs(ae-he)>1e-9?he-ae:de.edgeIdx-Te.edgeIdx});for(let de=1;de<se.length;de++){const Te=se[de],ae=M(Te),he=P.get(D(Te.srcId,Te.srcSide))??0,W=P.get(D(Te.srcId,ae))??0;W>=he||(P.set(D(Te.srcId,Te.srcSide),he-1),P.set(D(Te.srcId,ae),W+1),Te.srcSide=ae)}}const R=x(se=>{const de=se==null?void 0:se.shape;return de==="question"||de==="diamond"},"isDiamondNode"),I=new Map;for(const se of E.values())I.has(se.dstId)||I.set(se.dstId,new Set),I.get(se.dstId).add(se.dstSide);for(const se of E.values()){if(!R(a.get(se.srcId)))continue;const de=I.get(se.srcId);if(!(de!=null&&de.has(se.srcSide)))continue;const Te=M(se);if(de.has(Te)||(P.get(D(se.srcId,Te))??0)>0)continue;const ae=P.get(D(se.srcId,se.srcSide))??0;P.set(D(se.srcId,se.srcSide),Math.max(0,ae-1)),P.set(D(se.srcId,Te),1),se.srcSide=Te}for(const se of E.values()){const{edgeIdx:de,srcId:Te,dstId:ae,srcSide:he,dstSide:W}=se,ne=a.get(Te),j=a.get(ae),ue=`${Te}:${he}:src`,X=he==="top"||he==="bottom"?j.x??0:j.y??0;C.has(ue)||C.set(ue,[]),C.get(ue).push({edgeIdx:de,oppositeCoord:X});const Oe=`${ae}:${W}:dst`,xe=W==="top"||W==="bottom"?ne.x??0:ne.y??0;C.has(Oe)||C.set(Oe,[]),C.get(Oe).push({edgeIdx:de,oppositeCoord:xe})}const $=new Map,O=8;for(const[se,de]of C){if(de.length<2)continue;de.sort((He,De)=>He.oppositeCoord-De.oppositeCoord);const Te=se.split(":"),ae=Te.slice(0,-2).join(":"),he=Te[Te.length-2],W=Te[Te.length-1],ne=a.get(ae);if(!ne)continue;const ue=he==="left"||he==="right"?ne.height??10:ne.width??10,X=ne.shape,xe=X==="question"||X==="diamond"?ue*.3:ue,_e=Math.min(20,Math.max(O,xe/(de.length+1))),Me=-(_e*(de.length-1))/2;for(const[He,De]of de.entries()){const Ke=Me+He*_e,Ae=`${De.edgeIdx}:${W}`;$.set(Ae,Ke)}}const N=x(se=>{var de;return!!((de=i[se])!=null&&de.labelNodeId)},"edgeHasLabelNode"),F=x((se,de)=>se?(C.get(`${se}:${de}:src`)??[]).some(({edgeIdx:Te})=>N(Te))||(C.get(`${se}:${de}:dst`)??[]).some(({edgeIdx:Te})=>N(Te)):!1,"faceHasLabelNode"),z=x((se,de,Te)=>de==="top"||de==="bottom"?{x:se.x+Te,y:se.y}:{x:se.x,y:se.y+Te},"applyPortOffset"),V=x((se,de,Te)=>{const ae=E.get(se),he={x:Te.x??0,y:Te.y??0},W={x:de.x??0,y:de.y??0},ne=(ae==null?void 0:ae.srcSide)??k(de,he),j=(ae==null?void 0:ae.dstSide)??k(Te,W);let ue=ae?f(de,ae.srcSide):p(de,he,!0),X=ae?f(Te,ae.dstSide):p(Te,W,!1);const Oe=$.get(`${se}:src`),xe=$.get(`${se}:dst`);return Oe!==void 0&&(ue=z(ue,ne,Oe)),xe!==void 0&&(X=z(X,j,xe)),{pSrcPort:ue,pDstPort:X,srcSide:ne,dstSide:j}},"portsForEdge");for(const se of b){const de=i[se];if(m[se]=[],!de.start||!de.end||de.points&&de.points.length>0||de.start===de.end)continue;const Te=a.get(de.start),ae=a.get(de.end);if(!Te||!ae)continue;const{pSrcPort:he,pDstPort:W,srcSide:ne,dstSide:j}=V(se,Te,ae),ue={...he},X={...W},Oe=ne==="top"||ne==="bottom",xe=j==="top"||j==="bottom";if(Oe){const Qe=he.y>(Te.y??0);ue.y=Qe?he.y+Jo:he.y-Jo}else{const Qe=he.x>(Te.x??0);ue.x=Qe?he.x+Jo:he.x-Jo}if(xe){const Qe=W.y>(ae.y??0);X.y=Qe?W.y+Jo:W.y-Jo}else{const Qe=W.x>(ae.x??0);X.x=Qe?W.x+Jo:W.x-Jo}const Ge=x((Qe,ct)=>{for(const It of h)if(!ct.includes(It.nodeId)&&Qe.x>It.minX&&Qe.x<It.maxX&&Qe.y>It.minY&&Qe.y<It.maxY)return{inside:!0,obstacle:It};return{inside:!1}},"isPointInObstacle"),_e=x((Qe,ct,It,cr,Or)=>{if(Or){const xt=Qe.y>(ct.y??0);return{x:(It.x??0)>=Qe.x?cr.maxX+jf:cr.minX-jf,y:xt?cr.maxY+Xg:cr.minY-Xg,leavesPositiveSide:xt}}const yt=Qe.x>(ct.x??0),it=(It.y??0)>=Qe.y;return{x:yt?cr.maxX+jf:cr.minX-jf,y:it?cr.maxY+Xg:cr.minY-Xg,leavesPositiveSide:yt}},"obstacleDetour");let $e=[];const Me=[de.start,de.end],He=Ge(ue,Me);if(He.inside&&He.obstacle){const Qe=He.obstacle;if(Oe){const ct=_e(he,Te,ae,Qe,!0);ue.x=ct.x,ue.y=ct.y;const It=ct.leavesPositiveSide?Math.min(Qe.minY-2,he.y+Jo):Math.max(Qe.maxY+2,he.y-Jo);$e=[{x:he.x,y:It},{x:ct.x,y:It},{x:ct.x,y:ct.y}]}else{const ct=_e(he,Te,ae,Qe,!1),It=ct.leavesPositiveSide?Math.min(Qe.minX-2,he.x+Jo):Math.max(Qe.maxX+2,he.x-Jo);ue.x=ct.x,ue.y=ct.y,$e=[{x:It,y:he.y},{x:It,y:ct.y},{x:ct.x,y:ct.y}]}}let De=[];const Ke=Ge(X,Me);if(Ke.inside&&Ke.obstacle){const Qe=Ke.obstacle;if(xe){const ct=_e(W,ae,Te,Qe,!0);X.x=ct.x,X.y=ct.y,De=[{x:ct.x,y:ct.y},{x:W.x,y:ct.y}]}else{const ct=_e(W,ae,Te,Qe,!1);X.x=ct.x,X.y=ct.y,De=[{x:ct.x,y:ct.y},{x:ct.x,y:W.y}]}}if($e.length===0&&De.length===0){const Qe=jf,ct=Math.abs(ue.x-X.x)<Qe,It=Math.abs(ue.y-X.y)<Qe,cr=$.get(`${se}:src`)!==void 0||$.get(`${se}:dst`)!==void 0,Or=(((Pe=C.get(`${de.start??""}:${ne}:src`))==null?void 0:Pe.length)??0)+(((ve=C.get(`${de.start??""}:${ne}:dst`))==null?void 0:ve.length)??0),yt=(((Ce=C.get(`${de.end??""}:${j}:src`))==null?void 0:Ce.length)??0)+(((Ve=C.get(`${de.end??""}:${j}:dst`))==null?void 0:Ve.length)??0),it=Or>1||yt>1,xt=S.get(de.start??"")??0,nt=S.get(de.end??"")??0,Ht=Or>1&&F(de.start,ne)||yt>1&&F(de.end,j),ke=Or<=1||xt<=2,rn=yt<=1||nt<=2;if((ct||It)&&!cr&&(!it||it&&!Ht&&ke&&rn)&&!w(he,W,de.start,de.end)){de.points=[{...he},{...ue},{...X},{...W}],y.add(se);const nn=It?"horizontal":"vertical",Bi=It?he.y:he.x,Qr=It?Math.min(he.x,W.x):Math.min(he.y,W.y),bn=It?Math.max(he.x,W.x):Math.max(he.y,W.y),Yr={id:`fast-path-${nn}-${Bi.toFixed(0)}-${se}`,orientation:nn,coord:Bi,spanMin:Qr,spanMax:bn,tracks:[]};g.push({edgeIndex:se,segmentIndex:0,orientation:nn,pipe:Yr,trackIndex:0,from:Qr,to:bn});continue}}const Ae=d("vertical",ue.x,ue.y,ue.y);ue.x=Ae.coord;const at=d("vertical",X.x,X.y,X.y);X.x=at.coord;let Ee=Math.min(ue.x,X.x)-50,pt=Math.max(ue.x,X.x)+50,ht=Math.min(ue.y,X.y)-50,rt=Math.max(ue.y,X.y)+50;for(const Qe of h){const ct=Math.min(ue.x,X.x),It=Math.max(ue.x,X.x),cr=Math.min(ue.y,X.y),Or=Math.max(ue.y,X.y);Qe.minX<It&&Qe.maxX>ct&&Qe.minY<Or&&Qe.maxY>cr&&(Ee=Math.min(Ee,Qe.minX-qE),pt=Math.max(pt,Qe.maxX+qE),ht=Math.min(ht,Qe.minY-qE),rt=Math.max(rt,Qe.maxY+qE))}for(const Qe of h){if(Qe.maxX<Ee||Qe.minX>pt||Qe.maxY<ht||Qe.minY>rt)continue;const ct=jf;d("horizontal",Qe.minY-ct,Ee,pt),d("horizontal",Qe.maxY+ct,Ee,pt);const It=Xg;d("vertical",Qe.minX-It,ht,rt),d("vertical",Qe.maxX+It,ht,rt)}d("horizontal",ue.y,Ee,pt),d("horizontal",X.y,Ee,pt);const Et=o.filter(Qe=>Qe.orientation==="horizontal"&&Qe.coord>=ht&&Qe.coord<=rt),vt=o.filter(Qe=>Qe.orientation==="vertical"&&Qe.coord>=Ee&&Qe.coord<=pt),ot=x((Qe,ct)=>`${Qe.toFixed(1)},${ct.toFixed(1)}`,"getKey"),pe=ot(ue.x,ue.y),Ct=ot(X.x,X.y),lt=new Map,st=new Map,mt=new Map,_r=new Set,Se=[];lt.set(pe,0),mt.set(pe,"n"),Se.push({key:pe,f:Math.hypot(X.x-ue.x,X.y-ue.y),pt:ue}),_r.add(pe);let Ue=[];const tt=x((Qe,ct)=>w(Qe,ct,de.start,de.end),"checkSegmentBlocked"),kt={x:X.x,y:ue.y},Nt=tt(ue,kt),sr=tt(kt,X),Qt=Nt||sr,vr={x:ue.x,y:X.y},nr=tt(ue,vr),Rr=tt(vr,X);if(Qt?nr||Rr||(Math.abs(ue.x-X.x)<Fr?Ue=[ue,X]:Ue=[ue,vr,X]):Math.abs(ue.y-X.y)<Fr||Math.abs(ue.x-X.x)<Fr?Ue=[ue,X]:Ue=[ue,kt,X],Ue.length===0)for(;Se.length>0;){Se.sort((nt,Ht)=>nt.f-Ht.f);const Qe=Se.shift();if(_r.delete(Qe.key),Qe.key===Ct){let nt=Ct,Ht=X;for(Ue=[Ht];st.has(nt);){const ke=st.get(nt);Ue.unshift(ke),Ht=ke,nt=ot(ke.x,ke.y)}break}const ct=Qe.pt.x,It=Qe.pt.y,cr=vt.sort((nt,Ht)=>nt.coord-Ht.coord),Or=cr.findIndex(nt=>Math.abs(nt.coord-ct)<1),yt=Et.sort((nt,Ht)=>nt.coord-Ht.coord),it=yt.findIndex(nt=>Math.abs(nt.coord-It)<1),xt=[];Or>0&&xt.push({x:cr[Or-1].coord,y:It}),Or>=0&&Or<cr.length-1&&xt.push({x:cr[Or+1].coord,y:It}),it>0&&xt.push({x:ct,y:yt[it-1].coord}),it>=0&&it<yt.length-1&&xt.push({x:ct,y:yt[it+1].coord});for(const nt of xt){const Ht=Math.min(ct,nt.x),ke=Math.max(ct,nt.x),rn=Math.min(It,nt.y),Ne=Math.max(It,nt.y);if(h.some(dt=>dt.nodeId===de.start||dt.nodeId===de.end?!1:Ht!==ke?dt.minY<It&&dt.maxY>It&&dt.maxX>Ht&&dt.minX<ke:dt.minX<ct&&dt.maxX>ct&&dt.maxY>rn&&dt.minY<Ne))continue;const nn=ot(nt.x,nt.y),Bi=Math.abs(nt.x-ct)+Math.abs(nt.y-It),Qr=T(se,Qe.pt,nt);let bn=0;const Yr=X.x-ue.x,Da=X.y-ue.y,gc=nt.x-ct,xu=nt.y-It;(Da>10&&xu<-5||Da<-10&&xu>5)&&(bn=Math.abs(xu)*100),(Yr>10&&gc<-5||Yr<-10&&gc>5)&&(bn+=Math.abs(gc)*50);let Vf=0;const Tu=mt.get(Qe.key)??"n",wu=Math.abs(gc)>Fr?"h":"v";Tu!=="n"&&Tu!==wu&&(Vf=50);const wt=Bi+Qr+bn+Vf,Le=(lt.get(Qe.key)??1/0)+wt,je=Math.abs(X.x-nt.x)+Math.abs(X.y-nt.y);if(Le<(lt.get(nn)??1/0))if(st.set(nn,Qe.pt),lt.set(nn,Le),mt.set(nn,wu),!_r.has(nn))Se.push({key:nn,f:Le+je,pt:nt}),_r.add(nn);else{const dt=Se.findIndex(Ft=>Ft.key===nn);dt!==-1&&(Se[dt].f=Le+je)}}}if(Ue.length===0&&(Ue=[ue,{x:ue.x,y:X.y},X]),Ue.length>4){const Qe=Ue[0],ct=Ue[Ue.length-1];let It=Math.min(Qe.x,ct.x),cr=Math.max(Qe.x,ct.x),Or=Math.min(Qe.y,ct.y),yt=Math.max(Qe.y,ct.y);for(const rn of Ue)It=Math.min(It,rn.x),cr=Math.max(cr,rn.x),Or=Math.min(Or,rn.y),yt=Math.max(yt,rn.y);const it=cr>Math.max(Qe.x,ct.x),xt=It<Math.min(Qe.x,ct.x);if(l){const rn=Xg;if(it){const Ne=Math.max(Qe.x,ct.x),Mr=Math.min(Qe.y,ct.y),nn=Math.max(Qe.y,ct.y),Bi=h.filter(Qr=>Qr.minX<Ne&&Qr.maxX>Ne&&Qr.minY<nn&&Qr.maxY>Mr);if(Bi.length>0){let Qr=Math.max(Qe.x,ct.x);for(const bn of Bi){const Yr=(bn.minX+bn.maxX)/2;if(bn.visualXHalfExtent===void 0||isNaN(bn.visualXHalfExtent))continue;const Da=Yr+bn.visualXHalfExtent+rn;Qr=Math.max(Qr,Da)}isNaN(Qr)||(cr=Qr)}}if(xt){const Ne=h.filter(Mr=>Mr.minX<Math.min(Qe.x,ct.x)+rn&&Mr.minY<Math.max(Qe.y,ct.y)&&Mr.maxY>Math.min(Qe.y,ct.y));if(Ne.length>0){let Mr=Math.min(Qe.x,ct.x);for(const nn of Ne){const Qr=(nn.minX+nn.maxX)/2-nn.visualXHalfExtent-rn;Mr=Math.min(Mr,Qr)}It=Mr}}}const nt=x(rn=>{const Ne=ct.y>Qe.y,Mr=h.filter(Qr=>{const bn=Math.min(Qe.x,ct.x)<Qr.maxX&&Math.max(Qe.x,ct.x)>Qr.minX,Yr=Math.min(Qe.y,ct.y)<Qr.maxY&&Math.max(Qe.y,ct.y)>Qr.minY;return bn&&Yr});let nn=Mr;if(l&&Mr.length>0){const Qr=Mr.filter(bn=>bn.minX<rn&&bn.maxX>rn);Qr.length>0&&(nn=Qr)}if(nn.length===0)return ct.y;const Bi=jf;if(Ne){const bn=Math.max(...nn.map(Yr=>Yr.maxY))+Bi;if(bn<ct.y-Fr)return bn}else{const bn=Math.min(...nn.map(Yr=>Yr.minY))-Bi;if(bn>ct.y+Fr)return bn}return ct.y},"findBestReturnY"),Ht=x(rn=>{const Ne=nt(rn),Mr={x:rn,y:Qe.y},nn={x:rn,y:Ne},Bi={x:ct.x,y:Ne},Qr=tt(Qe,Mr),bn=tt(Mr,nn),Yr=tt(nn,Bi),Da=Ne!==ct.y?tt(Bi,ct):!1;return!Qr&&!bn&&!Yr&&!Da?Math.abs(Ne-ct.y)<Fr?[Qe,Mr,nn,ct]:[Qe,Mr,nn,Bi,ct]:null},"trySimplifyWithDetourX"),ke=it&&!xt?Ht(cr):xt&&!it?Ht(It):null;ke&&(Ue=ke)}const gr=[he,...$e,...Ue,...De.reverse(),W];if(gr.length>=3){const Qe=gr[gr.length-1],ct=gr[gr.length-2],It=gr[gr.length-3],cr=Math.abs(It.y-ct.y)<Fr&&Math.abs(ct.y-Qe.y)<Fr,Or=Math.abs(It.x-ct.x)<Fr&&Math.abs(ct.x-Qe.x)<Fr;if(cr){const yt=Math.sign(ct.x-It.x),it=Math.sign(Qe.x-It.x);yt!==0&&yt===it&&Math.abs(ct.x-It.x)>Math.abs(Qe.x-It.x)&&gr.splice(-2,1)}else if(Or){const yt=Math.sign(ct.y-It.y),it=Math.sign(Qe.y-It.y);yt!==0&&yt===it&&Math.abs(ct.y-It.y)>Math.abs(Qe.y-It.y)&&gr.splice(-2,1)}}const Dr=[gr[0]];for(let Qe=1;Qe<gr.length-1;Qe++){if(Qe===1){Dr.push(gr[Qe]);continue}const ct=Dr[Dr.length-1],It=gr[Qe],cr=gr[Qe+1];if(Math.abs(ct.y-It.y)<Fr&&Math.abs(It.y-cr.y)<Fr){const Or=It.x>ct.x,yt=cr.x>It.x;if(Or!==yt){Dr.push(It);continue}continue}if(Math.abs(ct.x-It.x)<Fr&&Math.abs(It.x-cr.x)<Fr){const Or=It.y>ct.y,yt=cr.y>It.y;if(Or!==yt){Dr.push(It);continue}continue}Dr.push(It)}Dr.push(gr[gr.length-1]);for(let Qe=0;Qe<Dr.length-1;Qe++){const ct=Dr[Qe],It=Dr[Qe+1],cr=Math.abs(ct.x-It.x)<Fr?"vertical":"horizontal",Or=cr==="vertical"?ct.x:ct.y,yt=cr==="vertical"?Math.min(ct.y,It.y):Math.min(ct.x,It.x),it=cr==="vertical"?Math.max(ct.y,It.y):Math.max(ct.x,It.x),xt=d(cr,Or,yt,it),nt={edgeIndex:se,segmentIndex:Qe,orientation:cr,pipe:xt,trackIndex:0,from:yt,to:it};g.push(nt),m[se].push(g.length-1),xt.tracks[0]||(xt.tracks[0]={index:0,coord:xt.coord,segments:[]}),xt.tracks[0].segments.push({edgeIndex:se,segmentIndex:Qe,from:yt,to:it})}}const B=x((se,de)=>se.from<de.to&&de.from<se.to,"segmentsOverlap"),G=x((se,de,Te,ae)=>{const he=!ae.segments.some(ne=>(ne.edgeIndex!==de.edgeIndex||ne.segmentIndex!==de.segmentIndex)&&B(ne,se)),W=!Te.segments.some(ne=>(ne.edgeIndex!==se.edgeIndex||ne.segmentIndex!==se.segmentIndex)&&B(ne,de));return he&&W?(se.trackIndex=ae.index,de.trackIndex=Te.index,Te.segments=[...Te.segments.filter(ne=>ne.edgeIndex!==se.edgeIndex||ne.segmentIndex!==se.segmentIndex),{edgeIndex:de.edgeIndex,segmentIndex:de.segmentIndex,from:de.from,to:de.to}],ae.segments=[...ae.segments.filter(ne=>ne.edgeIndex!==de.edgeIndex||ne.segmentIndex!==de.segmentIndex),{edgeIndex:se.edgeIndex,segmentIndex:se.segmentIndex,from:se.from,to:se.to}],!0):!1},"trySwapSegmentsAcrossTracks"),H=x(se=>{const de=se.tracks.length;return se.tracks[de]={index:de,coord:se.coord,segments:[]},de},"createNewTrack"),q=x((se,de)=>{const Te=se.pipe.tracks[se.trackIndex];Te.segments=Te.segments.filter(he=>he.edgeIndex!==se.edgeIndex||he.segmentIndex!==se.segmentIndex),se.trackIndex=de,se.pipe.tracks[de].segments.push({edgeIndex:se.edgeIndex,segmentIndex:se.segmentIndex,from:se.from,to:se.to})},"moveSegmentToTrack"),Z=x((se,de)=>{const Te=m[se.edgeIndex];for(const ae of Te){const he=g[ae];he.pipe===se.pipe&&q(he,de)}},"moveSegmentChainToTrack"),Y=x(se=>{const de=m[se.edgeIndex],Te=de.indexOf(g.indexOf(se)),ae=[];return Te>0&&ae.push(g[de[Te-1]]),Te<de.length-1&&ae.push(g[de[Te+1]]),ae},"getAdjacentSegmentsAlongEdge"),ie=x((se,de)=>{if(se.orientation===de.orientation)return!1;const Te=se.orientation==="horizontal"?se:de,ae=se.orientation==="horizontal"?de:se;return ae.pipe.coord>Te.from&&ae.pipe.coord<Te.to&&Te.pipe.coord>ae.from&&Te.pipe.coord<ae.to},"haveAnyCrossing"),K=x((se,de)=>{for(const Te of se.tracks)if(!Te.segments.some(he=>(he.edgeIndex!==de.edgeIndex||he.segmentIndex!==de.segmentIndex)&&B(he,de)))return Te.index;return-1},"findAvailableTrack"),Q=x((se,de)=>{if(se.trackIndex===de.trackIndex)return B(se,de);const Te=Y(se),ae=Y(de);return Te.some(he=>ae.some(W=>ie(he,W)))},"segmentsConflict"),te=x((se,de,Te)=>{if(G(se,de,se.pipe.tracks[se.trackIndex],de.pipe.tracks[de.trackIndex]))return;const ae=K(se.pipe,de);Te(de,ae!==-1?ae:H(se.pipe))},"resolveTrackConflict"),J=x(se=>{let de=0;for(let Te=0;Te<se.length;Te++)for(let ae=Te+1;ae<se.length;ae++){const he=se[Te],W=se[ae];he.pipe===W.pipe&&Q(he,W)&&(de++,te(he,W,Z))}return de},"resolveHandleConflicts"),ge=new Map,ee=x(se=>{if(ge.has(se))return ge.get(se);const de=m[se];if(de.length===0){const j={dest:0,deviation:0,base:0,delta:0};return ge.set(se,j),j}const ae=g[de[0]].pipe.coord;let he=ae;for(let j=1;j<de.length;j++){const ue=g[de[j]];if(ue.orientation==="horizontal"){const X=ue.from,Oe=ue.to;he=Math.abs(X-ae)>Math.abs(Oe-ae)?X:Oe;break}}const W=Math.abs(he-ae),ne={dest:he,deviation:W,base:ae,delta:he-ae};return ge.set(se,ne),ne},"getDestInfo"),Re=x(()=>{let se=0;const de=new Map;for(const[ae,he]of i.entries())m[ae].length!==0&&he.start&&(de.has(he.start)||de.set(he.start,[]),de.get(he.start).push(ae));const Te=x(ae=>{const he=i[ae];if(!he.start||!he.end)return 0;const W=a.get(he.start),ne=a.get(he.end);if(!W||!ne)return 0;const j=(ne.x??0)-(W.x??0),ue=(ne.y??0)-(W.y??0);return Math.abs(j)+Math.abs(ue)},"getEdgeDistance");for(const ae of de.values()){ae.sort((W,ne)=>{const j=ee(W),ue=ee(ne);if(Math.abs(j.deviation-ue.deviation)>1)return j.deviation-ue.deviation;if(Math.abs(j.dest-ue.dest)>1)return j.dest-ue.dest;const X=Te(W),Oe=Te(ne);if(Math.abs(X-Oe)>1)return Oe-X;const xe=m[W].length,Ge=m[ne].length;if(xe!==Ge)return xe-Ge;if(xe===1){const _e=m[W][0],$e=m[ne][0];if(g[_e]&&g[$e]){const Me=g[_e],He=g[$e],De=Math.abs(Me.to-Me.from),Ke=Math.abs(He.to-He.from);if(Math.abs(De-Ke)>1)return De-Ke}}return 0});const he=ae.map(W=>g[m[W][0]]);se+=J(he)}return se},"fixSourceHandleCrossings"),Ie=x(()=>{let se=0;const de=new Map;for(const[Te,ae]of i.entries())m[Te].length!==0&&ae.end&&(de.has(ae.end)||de.set(ae.end,[]),de.get(ae.end).push(Te));for(const Te of de.values()){Te.sort((he,W)=>{const ne=x(X=>{const Oe=m[X];if(Oe.length<2)return 0;const xe=g[Oe[Oe.length-2]];return Math.abs(xe.to-xe.from)},"getDist"),j=ne(he),ue=ne(W);return Math.abs(j-ue)>.1?j-ue:he-W});const ae=Te.map(he=>g[m[he][m[he].length-1]]);se+=J(ae)}return se},"fixTargetHandleCrossings"),Be=x(()=>{let se=0;for(const de of o){const Te=[];for(const ae of de.tracks)for(const he of ae.segments){const W=m[he.edgeIndex].find(ne=>g[ne].segmentIndex===he.segmentIndex);W!==void 0&&Te.push(g[W])}Te.sort((ae,he)=>ae.edgeIndex-he.edgeIndex||ae.segmentIndex-he.segmentIndex);for(let ae=0;ae<Te.length;ae++)for(let he=ae+1;he<Te.length;he++){const W=Te[ae],ne=Te[he];Q(W,ne)&&(se++,te(W,ne,q))}}return se},"fixPipeCrossings");let ce=0;const oe=10;for(;ce<oe;){let se=0;if(se+=Re(),se+=Ie(),se+=Be(),se===0)break;ce++}const be=new Map;for(const se of o){const de=[];se.tracks.forEach(ae=>{ae.segments.forEach(he=>{de.push({edgeIndex:he.edgeIndex,segmentIndex:he.segmentIndex,trackIndex:ae.index,from:he.from,to:he.to})})}),de.sort((ae,he)=>ae.from-he.from);const Te=[];if(de.length>0){let ae=[de[0]],he=de[0].to;for(let W=1;W<de.length;W++){const ne=de[W];ne.from<he?(ae.push(ne),he=Math.max(he,ne.to)):(Te.push(ae),ae=[ne],he=ne.to)}Te.push(ae)}for(const ae of Te){const he=new Set;ae.forEach(_e=>he.add(_e.trackIndex));const W=new Map;ae.forEach(_e=>{const $e=ee(_e.edgeIndex);W.set(_e.trackIndex,(W.get(_e.trackIndex)??0)+$e.delta)});const ne=[...he].filter(_e=>(W.get(_e)??0)<-1),j=[...he].filter(_e=>(W.get(_e)??0)>1),ue=[...he].filter(_e=>Math.abs(W.get(_e)??0)<=1);ne.sort((_e,$e)=>(W.get($e)??0)-(W.get(_e)??0)),j.sort((_e,$e)=>(W.get(_e)??0)-(W.get($e)??0));const X=x((_e,$e)=>{ae.filter(Me=>Me.trackIndex===_e).forEach(Me=>{const He=y.has(Me.edgeIndex)?se.coord:$e;be.set(`${Me.edgeIndex}-${Me.segmentIndex}`,He)})},"assignCoord");let Oe=0;for(const _e of ne)Oe++,X(_e,se.coord-Oe*MI);if(ue.length===0&&he.size>0){const _e=[...he].sort((He,De)=>Math.abs(W.get(He)??0)-Math.abs(W.get(De)??0))[0],$e=ne.indexOf(_e);$e!==-1&&ne.splice($e,1);const Me=j.indexOf(_e);Me!==-1&&j.splice(Me,1),ue.push(_e)}let xe=0;for(const _e of ue){if(xe===0)X(_e,se.coord);else{const $e=xe%2===1?1:-1,Me=Math.ceil(xe/2);X(_e,se.coord+$e*Me*MI*.5)}xe++}let Ge=0;for(const _e of j)Ge++,X(_e,se.coord+Ge*MI)}}for(const[se,de]of i.entries()){const Te=m[se]??[];if(Te.length===0)continue;const ae=[],he=a.get(de.start),W=a.get(de.end),{pSrcPort:ne,pDstPort:j}=V(se,he,W),ue=Te.map(xe=>{const Ge=g[xe],_e=be.get(`${Ge.edgeIndex}-${Ge.segmentIndex}`)??Ge.pipe.coord;return{orient:Ge.orientation,coord:_e,from:Ge.from,to:Ge.to}});ae.push(ne);for(let xe=0;xe<ue.length;xe++){const Ge=ue[xe],_e=ae[ae.length-1],$e=Ge.orient==="vertical"?_e.y:_e.x,Me=Ge.orient==="vertical"?_e.x:_e.y,He=ue[xe+1],De=xe<ue.length-1;if(Math.abs(Me-Ge.coord)>Fr&&ae.push(lp(Ge,$e)),De&&He.orient===Ge.orient)if(Math.abs(Ge.coord-He.coord)>Fr){const Ke=Ge.orient==="vertical"?($e+He.from)/2:J$(Ge,He);ae.push(lp(Ge,Ke),lp(He,Ke))}else(xe===0||xe===ue.length-2)&&ae.push(lp(Ge,J$(Ge,He)));else if(De)ae.push(lp(Ge,He.coord));else{const Ke=Math.abs(Ge.from-$e)<Math.abs(Ge.to-$e)?Ge.to:Ge.from;ae.push(lp(Ge,Ke))}}const X=ae[ae.length-1];(Math.abs(X.x-j.x)>Fr||Math.abs(X.y-j.y)>Fr)&&ae.push(j);const Oe=[];ae.length>0&&Oe.push(ae[0]);for(let xe=1;xe<ae.length;xe++){const Ge=ae[xe],_e=Oe[Oe.length-1];(Math.abs(Ge.x-_e.x)>Fr||Math.abs(Ge.y-_e.y)>Fr)&&Oe.push(Ge)}de.points=Oe}for(const se of i){const de=se.__originalEdge;de&&se.points&&(de.points=se.points)}t.edges=(t.edges??[]).filter(se=>!se.isLayoutOnly);const fe=x((se,de)=>{const Te=de.x??0,ae=de.y??0,he=de.width??0,W=de.height??0;if(he<=0||W<=0)return se;const ne=Te-he/2,j=Te+he/2,ue=ae-W/2,X=ae+W/2;if(se.x<ne||se.x>j||se.y<ue||se.y>X)return se;const Oe=se.x-ne,xe=j-se.x,Ge=se.y-ue,_e=X-se.y,$e=Math.min(Oe,xe,Ge,_e);return $e===Oe?{x:ne,y:se.y}:$e===xe?{x:j,y:se.y}:$e===Ge?{x:se.x,y:ue}:{x:se.x,y:X}},"nodeBoundaryClamp");for(const se of t.edges){const de=se.points;if(!de||de.length<2)continue;const Te=se.start,ae=se.end,he=Te?a.get(Te):void 0,W=ae?a.get(ae):void 0;he&&(de[0]=fe(de[0],he)),W&&(de[de.length-1]=fe(de[de.length-1],W))}return t}x(G1e,"routeEdgesOrthogonal");function W1e(t){return t.direction??"TB"}x(W1e,"getSwimlaneDirection");function H1e(t){var h,d,f,p,g;const e=Eye(t),r=((h=t.config.flowchart)==null?void 0:h.nodeSpacing)??40,n=((d=t.config.flowchart)==null?void 0:d.rankSpacing)??100,i=((f=t.config.swimlane)==null?void 0:f.ignoreCrossLaneEdges)??!0,a=((p=t.config.swimlane)==null?void 0:p.optimizeRanksByCrossings)??!0,s=((g=t.config.swimlane)==null?void 0:g.automaticLaneOrdering)??!1,o=W1e(t),{ordered:l,coordinates:u}=V1e(e,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:s,direction:o});Aye(e,l,u,{nodeGap:r,layerGap:n});for(const m of t.edges??[])delete m.points;G1e(t,o);for(const m of t.edges??[])(!m.curve||m.curve==="basis")&&(m.curve="rounded");return a1e(t,o),i1e(t),o}x(H1e,"runSwimlaneLayoutCore");async function q1e(t,e){const r=e.select("g");LV(r,t.markers,t.type,t.diagramId),Bpe(),zpe(),yfe(),Wme(),Sye(t);const n=_ye(t);t.nodes=n.nodes,t.edges=n.edges;const{groups:i}=await hye(r,t);H1e(t),await wye(t,i)}x(q1e,"render");const vut=Object.freeze(Object.defineProperty({__proto__:null,render:q1e},Symbol.toStringTag,{value:"Module"}));function eP(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function but(t){if(Array.isArray(t))return t}function xut(t){if(Array.isArray(t))return eP(t)}function _f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Tut(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Y1e(n.key),n)}}function Rf(t,e,r){return e&&Tut(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function yo(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=FG(t))||e){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return s=l.done,l},e:function(l){o=!0,a=l},f:function(){try{s||r.return==null||r.return()}finally{if(o)throw a}}}}function U1e(t,e,r){return(e=Y1e(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wut(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Cut(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,s,o=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(h){u=!0,i=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function kut(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sut(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zi(t,e){return but(t)||Cut(t,e)||FG(t,e)||kut()}function u_(t){return xut(t)||wut(t)||FG(t)||Sut()}function Eut(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Y1e(t){var e=Eut(t,"string");return typeof e=="symbol"?e:e+""}function ca(t){"@babel/helpers - typeof";return ca=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},ca(t)}function FG(t,e){if(t){if(typeof t=="string")return eP(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?eP(t,e):void 0}}var ra=typeof window>"u"?null:window,jQ=ra?ra.navigator:null;ra&&ra.document;var Aut=ca(""),X1e=ca({}),_ut=ca(function(){}),Rut=typeof HTMLElement>"u"?"undefined":ca(HTMLElement),hS=function(e){return e&&e.instanceString&&gi(e.instanceString)?e.instanceString():null},or=function(e){return e!=null&&ca(e)==Aut},gi=function(e){return e!=null&&ca(e)===_ut},Nn=function(e){return!Po(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},ln=function(e){return e!=null&&ca(e)===X1e&&!Nn(e)&&e.constructor===Object},Lut=function(e){return e!=null&&ca(e)===X1e},Dt=function(e){return e!=null&&ca(e)===ca(1)&&!isNaN(e)},Mut=function(e){return Dt(e)&&Math.floor(e)===e},h_=function(e){if(Rut!=="undefined")return e!=null&&e instanceof HTMLElement},Po=function(e){return dS(e)||j1e(e)},dS=function(e){return hS(e)==="collection"&&e._private.single},j1e=function(e){return hS(e)==="collection"&&!e._private.single},zG=function(e){return hS(e)==="core"},K1e=function(e){return hS(e)==="stylesheet"},Iut=function(e){return hS(e)==="event"},lf=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},Nut=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Dut=function(e){return ln(e)&&Dt(e.x1)&&Dt(e.x2)&&Dt(e.y1)&&Dt(e.y2)},Out=function(e){return Lut(e)&&gi(e.then)},$ut=function(){return jQ&&jQ.userAgent.match(/msie|trident|edge/i)},Wb=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],s=0;s<arguments.length;s++)a.push(arguments[s]);return a.join("$")});var n=function(){var a=this,s=arguments,o,l=r.apply(a,s),u=n.cache;return(o=u[l])||(o=u[l]=e.apply(a,s)),o};return n.cache={},n},VG=Wb(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),rL=Wb(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),Z1e=Wb(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),KQ=function(e){return lf(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Nd=function(e,r){return e.slice(-1*r.length)===r},sa="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Put="rgb[a]?\\(("+sa+"[%]?)\\s*,\\s*("+sa+"[%]?)\\s*,\\s*("+sa+"[%]?)(?:\\s*,\\s*("+sa+"))?\\)",But="rgb[a]?\\((?:"+sa+"[%]?)\\s*,\\s*(?:"+sa+"[%]?)\\s*,\\s*(?:"+sa+"[%]?)(?:\\s*,\\s*(?:"+sa+"))?\\)",Fut="hsl[a]?\\(("+sa+")\\s*,\\s*("+sa+"[%])\\s*,\\s*("+sa+"[%])(?:\\s*,\\s*("+sa+"))?\\)",zut="hsl[a]?\\((?:"+sa+")\\s*,\\s*(?:"+sa+"[%])\\s*,\\s*(?:"+sa+"[%])(?:\\s*,\\s*(?:"+sa+"))?\\)",Vut="\\#[0-9a-fA-F]{3}",Gut="\\#[0-9a-fA-F]{6}",Q1e=function(e,r){return e<r?-1:e>r?1:0},Wut=function(e,r){return-1*Q1e(e,r)},dr=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var n=e[r];if(n!=null)for(var i=Object.keys(n),a=0;a<i.length;a++){var s=i[a];t[s]=n[s]}}return t},Hut=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,n,i,a,s=16;return r?(n=parseInt(e[1]+e[1],s),i=parseInt(e[2]+e[2],s),a=parseInt(e[3]+e[3],s)):(n=parseInt(e[1]+e[2],s),i=parseInt(e[3]+e[4],s),a=parseInt(e[5]+e[6],s)),[n,i,a]}},qut=function(e){var r,n,i,a,s,o,l,u;function h(g,m,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?g+(m-g)*6*y:y<1/2?m:y<2/3?g+(m-g)*(2/3-y)*6:g}var d=new RegExp("^"+Fut+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,i=parseFloat(d[2]),i<0||i>100||(i=i/100,a=parseFloat(d[3]),a<0||a>100)||(a=a/100,s=d[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(i===0)o=l=u=Math.round(a*255);else{var f=a<.5?a*(1+i):a+i-a*i,p=2*a-f;o=Math.round(255*h(p,f,n+1/3)),l=Math.round(255*h(p,f,n)),u=Math.round(255*h(p,f,n-1/3))}r=[o,l,u,s]}return r},Uut=function(e){var r,n=new RegExp("^"+Put+"$").exec(e);if(n){r=[];for(var i=[],a=1;a<=3;a++){var s=n[a];if(s[s.length-1]==="%"&&(i[a]=!0),s=parseFloat(s),i[a]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var o=i[1]||i[2]||i[3],l=i[1]&&i[2]&&i[3];if(o&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},Yut=function(e){return Xut[e.toLowerCase()]},J1e=function(e){return(Nn(e)?e:null)||Yut(e)||Hut(e)||Uut(e)||qut(e)},Xut={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},eve=function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a<i;a++){var s=n[a];if(ln(s))throw Error("Tried to set map with object key");a<n.length-1?(r[s]==null&&(r[s]={}),r=r[s]):r[s]=e.value}},tve=function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a<i;a++){var s=n[a];if(ln(s))throw Error("Tried to get map with object key");if(r=r[s],r==null)return r}return r},UE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fS(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var II,ZQ;function pS(){if(ZQ)return II;ZQ=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return II=t,II}var NI,QQ;function jut(){if(QQ)return NI;QQ=1;var t=typeof UE=="object"&&UE&&UE.Object===Object&&UE;return NI=t,NI}var DI,JQ;function nL(){if(JQ)return DI;JQ=1;var t=jut(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return DI=r,DI}var OI,eJ;function Kut(){if(eJ)return OI;eJ=1;var t=nL(),e=function(){return t.Date.now()};return OI=e,OI}var $I,tJ;function Zut(){if(tJ)return $I;tJ=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return $I=e,$I}var PI,rJ;function Qut(){if(rJ)return PI;rJ=1;var t=Zut(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return PI=r,PI}var BI,nJ;function GG(){if(nJ)return BI;nJ=1;var t=nL(),e=t.Symbol;return BI=e,BI}var FI,iJ;function Jut(){if(iJ)return FI;iJ=1;var t=GG(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,i=t?t.toStringTag:void 0;function a(s){var o=r.call(s,i),l=s[i];try{s[i]=void 0;var u=!0}catch{}var h=n.call(s);return u&&(o?s[i]=l:delete s[i]),h}return FI=a,FI}var zI,aJ;function eht(){if(aJ)return zI;aJ=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return zI=r,zI}var VI,sJ;function rve(){if(sJ)return VI;sJ=1;var t=GG(),e=Jut(),r=eht(),n="[object Null]",i="[object Undefined]",a=t?t.toStringTag:void 0;function s(o){return o==null?o===void 0?i:n:a&&a in Object(o)?e(o):r(o)}return VI=s,VI}var GI,oJ;function tht(){if(oJ)return GI;oJ=1;function t(e){return e!=null&&typeof e=="object"}return GI=t,GI}var WI,lJ;function gS(){if(lJ)return WI;lJ=1;var t=rve(),e=tht(),r="[object Symbol]";function n(i){return typeof i=="symbol"||e(i)&&t(i)==r}return WI=n,WI}var HI,cJ;function rht(){if(cJ)return HI;cJ=1;var t=Qut(),e=pS(),r=gS(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt;function l(u){if(typeof u=="number")return u;if(r(u))return n;if(e(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=e(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=t(u);var d=a.test(u);return d||s.test(u)?o(u.slice(2),d?2:8):i.test(u)?n:+u}return HI=l,HI}var qI,uJ;function nht(){if(uJ)return qI;uJ=1;var t=pS(),e=Kut(),r=rht(),n="Expected a function",i=Math.max,a=Math.min;function s(o,l,u){var h,d,f,p,g,m,y=0,v=!1,T=!1,b=!0;if(typeof o!="function")throw new TypeError(n);l=r(l)||0,t(u)&&(v=!!u.leading,T="maxWait"in u,f=T?i(r(u.maxWait)||0,l):f,b="trailing"in u?!!u.trailing:b);function w(D){var R=h,I=d;return h=d=void 0,y=D,p=o.apply(I,R),p}function C(D){return y=D,g=setTimeout(E,l),v?w(D):p}function S(D){var R=D-m,I=D-y,$=l-R;return T?a($,f-I):$}function k(D){var R=D-m,I=D-y;return m===void 0||R>=l||R<0||T&&I>=f}function E(){var D=e();if(k(D))return _(D);g=setTimeout(E,S(D))}function _(D){return g=void 0,b&&h?w(D):(h=d=void 0,p)}function M(){g!==void 0&&clearTimeout(g),y=0,h=m=d=g=void 0}function L(){return g===void 0?p:_(e())}function P(){var D=e(),R=k(D);if(h=arguments,d=this,m=D,R){if(g===void 0)return C(m);if(T)return clearTimeout(g),g=setTimeout(E,l),w(m)}return g===void 0&&(g=setTimeout(E,l)),p}return P.cancel=M,P.flush=L,P}return qI=s,qI}var iht=nht(),mS=fS(iht),UI=ra?ra.performance:null,nve=UI&&UI.now?function(){return UI.now()}:function(){return Date.now()},aht=(function(){if(ra){if(ra.requestAnimationFrame)return function(t){ra.requestAnimationFrame(t)};if(ra.mozRequestAnimationFrame)return function(t){ra.mozRequestAnimationFrame(t)};if(ra.webkitRequestAnimationFrame)return function(t){ra.webkitRequestAnimationFrame(t)};if(ra.msRequestAnimationFrame)return function(t){ra.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(nve())},1e3/60)}})(),d_=function(e){return aht(e)},Th=nve,Ep=9261,ive=65599,Tm=5381,ave=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ep,n=r,i;i=e.next(),!i.done;)n=n*ive+i.value|0;return n},JC=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ep;return r*ive+e|0},ek=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tm;return(r<<5)+r+e|0},sht=function(e,r){return e*2097152+r},ad=function(e){return e[0]*2097152+e[1]},YE=function(e,r){return[JC(e[0],r[0]),ek(e[1],r[1])]},hJ=function(e,r){var n={value:0,done:!1},i=0,a=e.length,s={next:function(){return i<a?n.value=e[i++]:n.done=!0,n}};return ave(s,r)},z0=function(e,r){var n={value:0,done:!1},i=0,a=e.length,s={next:function(){return i<a?n.value=e.charCodeAt(i++):n.done=!0,n}};return ave(s,r)},sve=function(){return oht(arguments)},oht=function(e){for(var r,n=0;n<e.length;n++){var i=e[n];n===0?r=z0(i):r=z0(i,r)}return r};function lht(t,e,r,n,i){var a=i*Math.PI/180,s=Math.cos(a)*(t-r)-Math.sin(a)*(e-n)+r,o=Math.sin(a)*(t-r)+Math.cos(a)*(e-n)+n;return{x:s,y:o}}var cht=function(e,r,n,i,a,s){return{x:(e-n)*a+n,y:(r-i)*s+i}};function uht(t,e,r){if(r===0)return t;var n=(e.x1+e.x2)/2,i=(e.y1+e.y2)/2,a=e.w/e.h,s=1/a,o=lht(t.x,t.y,n,i,r),l=cht(o.x,o.y,n,i,a,s);return{x:l.x,y:l.y}}var dJ=!0,hht=console.warn!=null,dht=console.trace!=null,WG=Number.MAX_SAFE_INTEGER||9007199254740991,ove=function(){return!0},f_=function(){return!1},fJ=function(){return 0},HG=function(){},oi=function(e){throw new Error(e)},lve=function(e){if(e!==void 0)dJ=!!e;else return dJ},Cn=function(e){lve()&&(hht?console.warn(e):(console.log(e),dht&&console.trace()))},fht=function(e){return dr({},e)},Fc=function(e){return e==null?e:Nn(e)?e.slice():ln(e)?fht(e):e},pht=function(e){return e.slice()},cve=function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},ght={},uve=function(){return ght},ts=function(e){var r=Object.keys(e);return function(n){for(var i={},a=0;a<r.length;a++){var s=r[a],o=n==null?void 0:n[s];i[s]=o===void 0?e[s]:o}return i}},cf=function(e,r,n){for(var i=e.length-1;i>=0;i--)e[i]===r&&e.splice(i,1)},qG=function(e){e.splice(0,e.length)},mht=function(e,r){for(var n=0;n<r.length;n++){var i=r[n];e.push(i)}},Ms=function(e,r,n){return n&&(r=Z1e(n,r)),e[r]},Mc=function(e,r,n,i){n&&(r=Z1e(n,r)),e[r]=i},yht=(function(){function t(){_f(this,t),this._obj={}}return Rf(t,[{key:"set",value:function(r,n){return this._obj[r]=n,this}},{key:"delete",value:function(r){return this._obj[r]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(r){return this._obj[r]!==void 0}},{key:"get",value:function(r){return this._obj[r]}}])})(),th=typeof Map<"u"?Map:yht,vht="undefined",bht=(function(){function t(e){if(_f(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;e.instanceString!=null&&e.instanceString()===this.instanceString()?r=e.toArray():r=e;for(var n=0;n<r.length;n++)this.add(r[n])}}return Rf(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var n=this._obj;n[r]!==1&&(n[r]=1,this.size++)}},{key:"delete",value:function(r){var n=this._obj;n[r]===1&&(n[r]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(r){return this._obj[r]===1}},{key:"toArray",value:function(){var r=this;return Object.keys(this._obj).filter(function(n){return r.has(n)})}},{key:"forEach",value:function(r,n){return this.toArray().forEach(r,n)}}])})(),Rx=(typeof Set>"u"?"undefined":ca(Set))!==vht?Set:bht,iL=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!zG(e)){oi("An element must have a core reference and parameters set");return}var i=r.group;if(i==null&&(r.data&&r.data.source!=null&&r.data.target!=null?i="edges":i="nodes"),i!=="nodes"&&i!=="edges"){oi("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1,this[0]=this;var a=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?i==="edges":!!r.pannable,active:!1,classes:new Rx,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(a.position.x==null&&(a.position.x=0),a.position.y==null&&(a.position.y=0),r.renderedPosition){var s=r.renderedPosition,o=e.pan(),l=e.zoom();a.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];Nn(r.classes)?u=r.classes:or(r.classes)&&(u=r.classes.split(/\s+/));for(var h=0,d=u.length;h<d;h++){var f=u[h];!f||f===""||a.classes.add(f)}this.createEmitter(),(n===void 0||n)&&this.restore();var p=r.style||r.css;p&&(Cn("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(p))},pJ=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,i,a){var s;ln(n)&&!Po(n)&&(s=n,n=s.roots||s.root,i=s.visit,a=s.directed),a=arguments.length===2&&!gi(i)?i:a,i=gi(i)?i:function(){};for(var o=this._private.cy,l=n=or(n)?this.filter(n):n,u=[],h=[],d={},f={},p={},g=0,m,y=this.byGroup(),v=y.nodes,T=y.edges,b=0;b<l.length;b++){var w=l[b],C=w.id();w.isNode()&&(u.unshift(w),e.bfs&&(p[C]=!0,h.push(w)),f[C]=0)}for(var S=function(){var D=e.bfs?u.shift():u.pop(),R=D.id();if(e.dfs){if(p[R])return 0;p[R]=!0,h.push(D)}var I=f[R],$=d[R],O=$!=null?$.source():null,N=$!=null?$.target():null,F=$==null?void 0:D.same(O)?N[0]:O[0],z;if(z=i(D,$,F,g++,I),z===!0)return m=D,1;if(z===!1)return 1;for(var V=D.connectedEdges().filter(function(Z){return(!a||Z.source().same(D))&&T.has(Z)}),B=0;B<V.length;B++){var G=V[B],H=G.connectedNodes().filter(function(Z){return!Z.same(D)&&v.has(Z)}),q=H.id();H.length!==0&&!p[q]&&(H=H[0],u.push(H),e.bfs&&(p[q]=!0,h.push(H)),d[q]=G,f[q]=f[R]+1)}},k;u.length!==0&&(k=S(),!(k!==0&&k===1)););for(var E=o.collection(),_=0;_<h.length;_++){var M=h[_],L=d[M.id()];L!=null&&E.push(L),E.push(M)}return{path:o.collection(E),found:o.collection(m)}}},tk={breadthFirstSearch:pJ({bfs:!0}),depthFirstSearch:pJ({dfs:!0})};tk.bfs=tk.breadthFirstSearch;tk.dfs=tk.depthFirstSearch;var s3={exports:{}},xht=s3.exports,gJ;function Tht(){return gJ||(gJ=1,(function(t,e){(function(){var r,n,i,a,s,o,l,u,h,d,f,p,g,m,y;i=Math.floor,d=Math.min,n=function(v,T){return v<T?-1:v>T?1:0},h=function(v,T,b,w,C){var S;if(b==null&&(b=0),C==null&&(C=n),b<0)throw new Error("lo must be non-negative");for(w==null&&(w=v.length);b<w;)S=i((b+w)/2),C(T,v[S])<0?w=S:b=S+1;return[].splice.apply(v,[b,b-b].concat(T)),T},o=function(v,T,b){return b==null&&(b=n),v.push(T),m(v,0,v.length-1,b)},s=function(v,T){var b,w;return T==null&&(T=n),b=v.pop(),v.length?(w=v[0],v[0]=b,y(v,0,T)):w=b,w},u=function(v,T,b){var w;return b==null&&(b=n),w=v[0],v[0]=T,y(v,0,b),w},l=function(v,T,b){var w;return b==null&&(b=n),v.length&&b(v[0],T)<0&&(w=[v[0],T],T=w[0],v[0]=w[1],y(v,0,b)),T},a=function(v,T){var b,w,C,S,k,E;for(T==null&&(T=n),S=(function(){E=[];for(var _=0,M=i(v.length/2);0<=M?_<M:_>M;0<=M?_++:_--)E.push(_);return E}).apply(this).reverse(),k=[],w=0,C=S.length;w<C;w++)b=S[w],k.push(y(v,b,T));return k},g=function(v,T,b){var w;if(b==null&&(b=n),w=v.indexOf(T),w!==-1)return m(v,0,w,b),y(v,w,b)},f=function(v,T,b){var w,C,S,k,E;if(b==null&&(b=n),C=v.slice(0,T),!C.length)return C;for(a(C,b),E=v.slice(T),S=0,k=E.length;S<k;S++)w=E[S],l(C,w,b);return C.sort(b).reverse()},p=function(v,T,b){var w,C,S,k,E,_,M,L,P;if(b==null&&(b=n),T*10<=v.length){if(S=v.slice(0,T).sort(b),!S.length)return S;for(C=S[S.length-1],M=v.slice(T),k=0,_=M.length;k<_;k++)w=M[k],b(w,C)<0&&(h(S,w,0,null,b),S.pop(),C=S[S.length-1]);return S}for(a(v,b),P=[],E=0,L=d(T,v.length);0<=L?E<L:E>L;0<=L?++E:--E)P.push(s(v,b));return P},m=function(v,T,b,w){var C,S,k;for(w==null&&(w=n),C=v[b];b>T;){if(k=b-1>>1,S=v[k],w(C,S)<0){v[b]=S,b=k;continue}break}return v[b]=C},y=function(v,T,b){var w,C,S,k,E;for(b==null&&(b=n),C=v.length,E=T,S=v[T],w=2*T+1;w<C;)k=w+1,k<C&&!(b(v[w],v[k])<0)&&(w=k),v[T]=v[w],T=w,w=2*T+1;return v[T]=S,m(v,E,T,b)},r=(function(){v.push=o,v.pop=s,v.replace=u,v.pushpop=l,v.heapify=a,v.updateItem=g,v.nlargest=f,v.nsmallest=p;function v(T){this.cmp=T??n,this.nodes=[]}return v.prototype.push=function(T){return o(this.nodes,T,this.cmp)},v.prototype.pop=function(){return s(this.nodes,this.cmp)},v.prototype.peek=function(){return this.nodes[0]},v.prototype.contains=function(T){return this.nodes.indexOf(T)!==-1},v.prototype.replace=function(T){return u(this.nodes,T,this.cmp)},v.prototype.pushpop=function(T){return l(this.nodes,T,this.cmp)},v.prototype.heapify=function(){return a(this.nodes,this.cmp)},v.prototype.updateItem=function(T){return g(this.nodes,T,this.cmp)},v.prototype.clear=function(){return this.nodes=[]},v.prototype.empty=function(){return this.nodes.length===0},v.prototype.size=function(){return this.nodes.length},v.prototype.clone=function(){var T;return T=new v,T.nodes=this.nodes.slice(0),T},v.prototype.toArray=function(){return this.nodes.slice(0)},v.prototype.insert=v.prototype.push,v.prototype.top=v.prototype.peek,v.prototype.front=v.prototype.peek,v.prototype.has=v.prototype.contains,v.prototype.copy=v.prototype.clone,v})(),(function(v,T){return t.exports=T()})(this,function(){return r})}).call(xht)})(s3)),s3.exports}var YI,mJ;function wht(){return mJ||(mJ=1,YI=Tht()),YI}var Cht=wht(),yS=fS(Cht),kht=ts({root:null,weight:function(e){return 1},directed:!1}),Sht={dijkstra:function(e){if(!ln(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var n=kht(e),i=n.root,a=n.weight,s=n.directed,o=this,l=a,u=or(i)?this.filter(i)[0]:i[0],h={},d={},f={},p=this.byGroup(),g=p.nodes,m=p.edges;m.unmergeBy(function(I){return I.isLoop()});for(var y=function($){return h[$.id()]},v=function($,O){h[$.id()]=O,T.updateItem($)},T=new yS(function(I,$){return y(I)-y($)}),b=0;b<g.length;b++){var w=g[b];h[w.id()]=w.same(u)?0:1/0,T.push(w)}for(var C=function($,O){for(var N=(s?$.edgesTo(O):$.edgesWith(O)).intersect(m),F=1/0,z,V=0;V<N.length;V++){var B=N[V],G=l(B);(G<F||!z)&&(F=G,z=B)}return{edge:z,dist:F}};T.size()>0;){var S=T.pop(),k=y(S),E=S.id();if(f[E]=k,k!==1/0)for(var _=S.neighborhood().intersect(g),M=0;M<_.length;M++){var L=_[M],P=L.id(),D=C(S,L),R=k+D.dist;R<y(L)&&(v(L,R),d[P]={node:S,edge:D.edge})}}return{distanceTo:function($){var O=or($)?g.filter($)[0]:$[0];return f[O.id()]},pathTo:function($){var O=or($)?g.filter($)[0]:$[0],N=[],F=O,z=F.id();if(O.length>0)for(N.unshift(O);d[z];){var V=d[z];N.unshift(V.edge),N.unshift(V.node),F=V.node,z=F.id()}return o.spawn(N)}}}},Eht={kruskal:function(e){e=e||function(b){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,a=n.length,s=new Array(a),o=n,l=function(w){for(var C=0;C<s.length;C++){var S=s[C];if(S.has(w))return C}},u=0;u<a;u++)s[u]=this.spawn(n[u]);for(var h=i.sort(function(b,w){return e(b)-e(w)}),d=0;d<h.length;d++){var f=h[d],p=f.source()[0],g=f.target()[0],m=l(p),y=l(g),v=s[m],T=s[y];m!==y&&(o.merge(f),v.merge(T),s.splice(y,1))}return o}},Aht=ts({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),_ht={aStar:function(e){var r=this.cy(),n=Aht(e),i=n.root,a=n.goal,s=n.heuristic,o=n.directed,l=n.weight;i=r.collection(i)[0],a=r.collection(a)[0];var u=i.id(),h=a.id(),d={},f={},p={},g=new yS(function(z,V){return f[z.id()]-f[V.id()]}),m=new Rx,y={},v={},T=function(V,B){g.push(V),m.add(B)},b,w,C=function(){b=g.pop(),w=b.id(),m.delete(w)},S=function(V){return m.has(V)};T(i,u),d[u]=0,f[u]=s(i);for(var k=0;g.size()>0;){if(C(),k++,w===h){for(var E=[],_=a,M=h,L=v[M];E.unshift(_),L!=null&&E.unshift(L),_=y[M],_!=null;)M=_.id(),L=v[M];return{found:!0,distance:d[w],path:this.spawn(E),steps:k}}p[w]=!0;for(var P=b._private.edges,D=0;D<P.length;D++){var R=P[D];if(this.hasElementWithId(R.id())&&!(o&&R.data("source")!==w)){var I=R.source(),$=R.target(),O=I.id()!==w?I:$,N=O.id();if(this.hasElementWithId(N)&&!p[N]){var F=d[w]+l(R);if(!S(N)){d[N]=F,f[N]=F+s(O),T(O,N),y[N]=b,v[N]=R;continue}F<d[N]&&(d[N]=F,f[N]=F+s(O),y[N]=b,v[N]=R)}}}}return{found:!1,distance:void 0,path:void 0,steps:k}}},Rht=ts({weight:function(e){return 1},directed:!1}),Lht={floydWarshall:function(e){for(var r=this.cy(),n=Rht(e),i=n.weight,a=n.directed,s=i,o=this.byGroup(),l=o.nodes,u=o.edges,h=l.length,d=h*h,f=function(G){return l.indexOf(G)},p=function(G){return l[G]},g=new Array(d),m=0;m<d;m++){var y=m%h,v=(m-y)/h;v===y?g[m]=0:g[m]=1/0}for(var T=new Array(d),b=new Array(d),w=0;w<u.length;w++){var C=u[w],S=C.source()[0],k=C.target()[0];if(S!==k){var E=f(S),_=f(k),M=E*h+_,L=s(C);if(g[M]>L&&(g[M]=L,T[M]=_,b[M]=C),!a){var P=_*h+E;!a&&g[P]>L&&(g[P]=L,T[P]=E,b[P]=C)}}}for(var D=0;D<h;D++)for(var R=0;R<h;R++)for(var I=R*h+D,$=0;$<h;$++){var O=R*h+$,N=D*h+$;g[I]+g[N]<g[O]&&(g[O]=g[I]+g[N],T[O]=T[I])}var F=function(G){return(or(G)?r.filter(G):G)[0]},z=function(G){return f(F(G))},V={distance:function(G,H){var q=z(G),Z=z(H);return g[q*h+Z]},path:function(G,H){var q=z(G),Z=z(H),Y=p(q);if(q===Z)return Y.collection();if(T[q*h+Z]==null)return r.collection();var ie=r.collection(),K=q,Q;for(ie.merge(Y);q!==Z;)K=q,q=T[q*h+Z],Q=b[K*h+q],ie.merge(Q),ie.merge(p(q));return ie}};return V}},Mht=ts({weight:function(e){return 1},directed:!1,root:null}),Iht={bellmanFord:function(e){var r=this,n=Mht(e),i=n.weight,a=n.directed,s=n.root,o=i,l=this,u=this.cy(),h=this.byGroup(),d=h.edges,f=h.nodes,p=f.length,g=new th,m=!1,y=[];s=u.collection(s)[0],d.unmergeBy(function(Be){return Be.isLoop()});for(var v=d.length,T=function(ce){var oe=g.get(ce.id());return oe||(oe={},g.set(ce.id(),oe)),oe},b=function(ce){return(or(ce)?u.$(ce):ce)[0]},w=function(ce){return T(b(ce)).dist},C=function(ce){for(var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,be=b(ce),fe=[],Pe=be;;){if(Pe==null)return r.spawn();var ve=T(Pe),Ce=ve.edge,Ve=ve.pred;if(fe.unshift(Pe[0]),Pe.same(oe)&&fe.length>0)break;Ce!=null&&fe.unshift(Ce),Pe=Ve}return l.spawn(fe)},S=0;S<p;S++){var k=f[S],E=T(k);k.same(s)?E.dist=0:E.dist=1/0,E.pred=null,E.edge=null}for(var _=!1,M=function(ce,oe,be,fe,Pe,ve){var Ce=fe.dist+ve;Ce<Pe.dist&&!be.same(fe.edge)&&(Pe.dist=Ce,Pe.pred=ce,Pe.edge=be,_=!0)},L=1;L<p;L++){_=!1;for(var P=0;P<v;P++){var D=d[P],R=D.source(),I=D.target(),$=o(D),O=T(R),N=T(I);M(R,I,D,O,N,$),a||M(I,R,D,N,O,$)}if(!_)break}if(_)for(var F=[],z=0;z<v;z++){var V=d[z],B=V.source(),G=V.target(),H=o(V),q=T(B).dist,Z=T(G).dist;if(q+H<Z||!a&&Z+H<q)if(m||(Cn("Graph contains a negative weight cycle for Bellman-Ford"),m=!0),e.findNegativeWeightCycles!==!1){var Y=[];q+H<Z&&Y.push(B),!a&&Z+H<q&&Y.push(G);for(var ie=Y.length,K=0;K<ie;K++){var Q=Y[K],te=[Q];te.push(T(Q).edge);for(var J=T(Q).pred;te.indexOf(J)===-1;)te.push(J),te.push(T(J).edge),J=T(J).pred;te=te.slice(te.indexOf(J));for(var ge=te[0].id(),ee=0,Re=2;Re<te.length;Re+=2)te[Re].id()<ge&&(ge=te[Re].id(),ee=Re);te=te.slice(ee).concat(te.slice(0,ee)),te.push(te[0]);var Ie=te.map(function(Be){return Be.id()}).join(",");F.indexOf(Ie)===-1&&(y.push(l.spawn(te)),F.push(Ie))}}else break}return{distanceTo:w,pathTo:C,hasNegativeWeightCycle:m,negativeWeightCycles:y}}},Nht=Math.sqrt(2),Dht=function(e,r,n){n.length===0&&oi("Karger-Stein must be run on a connected (sub)graph");for(var i=n[e],a=i[1],s=i[2],o=r[a],l=r[s],u=n,h=u.length-1;h>=0;h--){var d=u[h],f=d[1],p=d[2];(r[f]===o&&r[p]===l||r[f]===l&&r[p]===o)&&u.splice(h,1)}for(var g=0;g<u.length;g++){var m=u[g];m[1]===l?(u[g]=m.slice(),u[g][1]=o):m[2]===l&&(u[g]=m.slice(),u[g][2]=o)}for(var y=0;y<r.length;y++)r[y]===l&&(r[y]=o);return u},XI=function(e,r,n,i){for(;n>i;){var a=Math.floor(Math.random()*r.length);r=Dht(a,e,r),n--}return r},Oht={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,i=r.edges;i.unmergeBy(function(N){return N.isLoop()});var a=n.length,s=i.length,o=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/Nht);if(a<2){oi("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],h=0;h<s;h++){var d=i[h];u.push([h,n.indexOf(d.source()),n.indexOf(d.target())])}for(var f=1/0,p=[],g=new Array(a),m=new Array(a),y=new Array(a),v=function(F,z){for(var V=0;V<a;V++)z[V]=F[V]},T=0;T<=o;T++){for(var b=0;b<a;b++)m[b]=b;var w=XI(m,u.slice(),a,l),C=w.slice();v(m,y);var S=XI(m,w,l,2),k=XI(y,C,l,2);S.length<=k.length&&S.length<f?(f=S.length,p=S,v(m,g)):k.length<=S.length&&k.length<f&&(f=k.length,p=k,v(y,g))}for(var E=this.spawn(p.map(function(N){return i[N[0]]})),_=this.spawn(),M=this.spawn(),L=g[0],P=0;P<g.length;P++){var D=g[P],R=n[P];D===L?_.merge(R):M.merge(R)}var I=function(F){var z=e.spawn();return F.forEach(function(V){z.merge(V),V.connectedEdges().forEach(function(B){e.contains(B)&&!E.contains(B)&&z.merge(B)})}),z},$=[I(_),I(M)],O={cut:E,components:$,partition1:_,partition2:M};return O}},jI,$ht=function(e){return{x:e.x,y:e.y}},aL=function(e,r,n){return{x:e.x*r+n.x,y:e.y*r+n.y}},hve=function(e,r,n){return{x:(e.x-n.x)/r,y:(e.y-n.y)/r}},Xm=function(e){return{x:e[0],y:e[1]}},Pht=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=1/0,a=r;a<n;a++){var s=e[a];isFinite(s)&&(i=Math.min(s,i))}return i},Bht=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=-1/0,a=r;a<n;a++){var s=e[a];isFinite(s)&&(i=Math.max(s,i))}return i},Fht=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=0,a=0,s=r;s<n;s++){var o=e[s];isFinite(o)&&(i+=o,a++)}return i/a},zht=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(r,n):(n<e.length&&e.splice(n,e.length-n),r>0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}a&&e.sort(function(f,p){return f-p});var h=e.length,d=Math.floor(h/2);return h%2!==0?e[d+1+o]:(e[d-1+o]+e[d+o])/2},Vht=function(e){return Math.PI*e/180},XE=function(e,r){return Math.atan2(r,e)-Math.PI/2},UG=Math.log2||function(t){return Math.log(t)/Math.log(2)},YG=function(e){return e>0?1:e<0?-1:0},V0=function(e,r){return Math.sqrt(cp(e,r))},cp=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},Ght=function(e){for(var r=e.length,n=0,i=0;i<r;i++)n+=e[i];for(var a=0;a<r;a++)e[a]=e[a]/n;return e},ya=function(e,r,n,i){return(1-i)*(1-i)*e+2*(1-i)*i*r+i*i*n},by=function(e,r,n,i){return{x:ya(e.x,r.x,n.x,i),y:ya(e.y,r.y,n.y,i)}},Wht=function(e,r,n,i){var a={x:r.x-e.x,y:r.y-e.y},s=V0(e,r),o={x:a.x/s,y:a.y/s};return n=n??0,i=i??n*s,{x:e.x+o.x*i,y:e.y+o.y*i}},rk=function(e,r,n){return Math.max(e,Math.min(n,r))},Us=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},Hht=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},qht=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},Uht=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},dve=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},o3=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},l3=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,a,s;if(r.length===1)n=i=a=s=r[0];else if(r.length===2)n=a=r[0],s=i=r[1];else if(r.length===4){var o=zi(r,4);n=o[0],i=o[1],a=o[2],s=o[3]}return e.x1-=s,e.x2+=i,e.y1-=n,e.y2+=a,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},yJ=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},XG=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2<r.x1||r.x2<e.x1||e.y2<r.y1||r.y2<e.y1||e.y1>r.y2||r.y1>e.y2)},Dd=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},vJ=function(e,r){return Dd(e,r.x,r.y)},fve=function(e,r){return Dd(e,r.x1,r.y1)&&Dd(e,r.x2,r.y2)},Yht=(jI=Math.hypot)!==null&&jI!==void 0?jI:function(t,e){return Math.sqrt(t*t+e*e)};function Xht(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(E,_){return{x:E.x+_.x,y:E.y+_.y}},n=function(E,_){return{x:E.x-_.x,y:E.y-_.y}},i=function(E,_){return{x:E.x*_,y:E.y*_}},a=function(E,_){return E.x*_.y-E.y*_.x},s=function(E){var _=Yht(E.x,E.y);return _===0?{x:0,y:0}:{x:E.x/_,y:E.y/_}},o=function(E){for(var _=0,M=0;M<E.length;M++){var L=E[M],P=E[(M+1)%E.length];_+=L.x*P.y-P.x*L.y}return _/2},l=function(E,_,M,L){var P=n(_,E),D=n(L,M),R=a(P,D);if(Math.abs(R)<1e-9)return r(E,i(P,.5));var I=a(n(M,E),D)/R;return r(E,i(P,I))},u=t.map(function(k){return{x:k.x,y:k.y}});o(u)<0&&u.reverse();for(var h=u.length,d=[],f=0;f<h;f++){var p=u[f],g=u[(f+1)%h],m=n(g,p),y=s({x:m.y,y:-m.x});d.push(y)}for(var v=d.map(function(k,E){var _=r(u[E],i(k,e)),M=r(u[(E+1)%h],i(k,e));return{p1:_,p2:M}}),T=[],b=0;b<h;b++){var w=v[(b-1+h)%h],C=v[b],S=l(w.p1,w.p2,C.p1,C.p2);T.push(S)}return T}function jht(t,e,r,n,i,a){var s=idt(t,e,r,n,i),o=Xht(s,a),l=Us();return o.forEach(function(u){return dve(l,u.x,u.y)}),l}var pve=function(e,r,n,i,a,s,o){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?uf(a,s):l,h=a/2,d=s/2;u=Math.min(u,h,d);var f=u!==h,p=u!==d,g;if(f){var m=n-h+u-o,y=i-d-o,v=n+h-u+o,T=y;if(g=Od(e,r,n,i,m,y,v,T,!1),g.length>0)return g}if(p){var b=n+h+o,w=i-d+u-o,C=b,S=i+d-u+o;if(g=Od(e,r,n,i,b,w,C,S,!1),g.length>0)return g}if(f){var k=n-h+u-o,E=i+d+o,_=n+h-u+o,M=E;if(g=Od(e,r,n,i,k,E,_,M,!1),g.length>0)return g}if(p){var L=n-h-o,P=i-d+u-o,D=L,R=i+d-u+o;if(g=Od(e,r,n,i,L,P,D,R,!1),g.length>0)return g}var I;{var $=n-h+u,O=i-d+u;if(I=JT(e,r,n,i,$,O,u+o),I.length>0&&I[0]<=$&&I[1]<=O)return[I[0],I[1]]}{var N=n+h-u,F=i-d+u;if(I=JT(e,r,n,i,N,F,u+o),I.length>0&&I[0]>=N&&I[1]<=F)return[I[0],I[1]]}{var z=n+h-u,V=i+d-u;if(I=JT(e,r,n,i,z,V,u+o),I.length>0&&I[0]>=z&&I[1]>=V)return[I[0],I[1]]}{var B=n-h+u,G=i+d-u;if(I=JT(e,r,n,i,B,G,u+o),I.length>0&&I[0]<=B&&I[1]>=G)return[I[0],I[1]]}return[]},Kht=function(e,r,n,i,a,s,o){var l=o,u=Math.min(n,a),h=Math.max(n,a),d=Math.min(i,s),f=Math.max(i,s);return u-l<=e&&e<=h+l&&d-l<=r&&r<=f+l},Zht=function(e,r,n,i,a,s,o,l,u){var h={x1:Math.min(n,o,a)-u,x2:Math.max(n,o,a)+u,y1:Math.min(i,l,s)-u,y2:Math.max(i,l,s)+u};return!(e<h.x1||e>h.x2||r<h.y1||r>h.y2)},Qht=function(e,r,n,i){n-=i;var a=r*r-4*e*n;if(a<0)return[];var s=Math.sqrt(a),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},Jht=function(e,r,n,i,a){var s=1e-5;e===0&&(e=s),r/=e,n/=e,i/=e;var o,l,u,h,d,f,p,g;if(l=(3*n-r*r)/9,u=-(27*i)+r*(9*n-2*(r*r)),u/=54,o=l*l*l+u*u,a[1]=0,p=r/3,o>0){d=u+Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=u-Math.sqrt(o),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),a[0]=-p+d+f,p+=(d+f)/2,a[4]=a[2]=-p,p=Math.sqrt(3)*(-f+d)/2,a[3]=p,a[5]=-p;return}if(a[5]=a[3]=0,o===0){g=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),a[0]=-p+2*g,a[4]=a[2]=-(g+p);return}l=-l,h=l*l*l,h=Math.acos(u/Math.sqrt(h)),g=2*Math.sqrt(l),a[0]=-p+g*Math.cos(h/3),a[2]=-p+g*Math.cos((h+2*Math.PI)/3),a[4]=-p+g*Math.cos((h+4*Math.PI)/3)},edt=function(e,r,n,i,a,s,o,l){var u=1*n*n-4*n*a+2*n*o+4*a*a-4*a*o+o*o+i*i-4*i*s+2*i*l+4*s*s-4*s*l+l*l,h=9*n*a-3*n*n-3*n*o-6*a*a+3*a*o+9*i*s-3*i*i-3*i*l-6*s*s+3*s*l,d=3*n*n-6*n*a+n*o-n*e+2*a*a+2*a*e-o*e+3*i*i-6*i*s+i*l-i*r+2*s*s+2*s*r-l*r,f=1*n*a-n*n+n*e-a*e+i*s-i*i+i*r-s*r,p=[];Jht(u,h,d,f,p);for(var g=1e-7,m=[],y=0;y<6;y+=2)Math.abs(p[y+1])<g&&p[y]>=0&&p[y]<=1&&m.push(p[y]);m.push(1),m.push(0);for(var v=-1,T,b,w,C=0;C<m.length;C++)T=Math.pow(1-m[C],2)*n+2*(1-m[C])*m[C]*a+m[C]*m[C]*o,b=Math.pow(1-m[C],2)*i+2*(1-m[C])*m[C]*s+m[C]*m[C]*l,w=Math.pow(T-e,2)+Math.pow(b-r,2),v>=0?w<v&&(v=w):v=w;return v},tdt=function(e,r,n,i,a,s){var o=[e-n,r-i],l=[a-n,s-i],u=l[0]*l[0]+l[1]*l[1],h=o[0]*o[0]+o[1]*o[1],d=o[0]*l[0]+o[1]*l[1],f=d*d/u;return d<0?h:f>u?(e-a)*(e-a)+(r-s)*(r-s):h-f},fo=function(e,r,n){for(var i,a,s,o,l,u=0,h=0;h<n.length/2;h++)if(i=n[h*2],a=n[h*2+1],h+1<n.length/2?(s=n[(h+1)*2],o=n[(h+1)*2+1]):(s=n[(h+1-n.length/2)*2],o=n[(h+1-n.length/2)*2+1]),!(i==e&&s==e))if(i>=e&&e>=s||i<=e&&e<=s)l=(e-i)/(s-i)*(o-a)+a,l>r&&u++;else continue;return u%2!==0},wh=function(e,r,n,i,a,s,o,l,u){var h=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var f=Math.cos(-d),p=Math.sin(-d),g=0;g<h.length/2;g++)h[g*2]=s/2*(n[g*2]*f-n[g*2+1]*p),h[g*2+1]=o/2*(n[g*2+1]*f+n[g*2]*p),h[g*2]+=i,h[g*2+1]+=a;var m;if(u>0){var y=g_(h,-u);m=p_(y)}else m=h;return fo(e,r,m)},rdt=function(e,r,n,i,a,s,o,l){for(var u=new Array(n.length*2),h=0;h<l.length;h++){var d=l[h];u[h*4+0]=d.startX,u[h*4+1]=d.startY,u[h*4+2]=d.stopX,u[h*4+3]=d.stopY;var f=Math.pow(d.cx-e,2)+Math.pow(d.cy-r,2);if(f<=Math.pow(d.radius,2))return!0}return fo(e,r,u)},p_=function(e){for(var r=new Array(e.length/2),n,i,a,s,o,l,u,h,d=0;d<e.length/4;d++){n=e[d*4],i=e[d*4+1],a=e[d*4+2],s=e[d*4+3],d<e.length/4-1?(o=e[(d+1)*4],l=e[(d+1)*4+1],u=e[(d+1)*4+2],h=e[(d+1)*4+3]):(o=e[0],l=e[1],u=e[2],h=e[3]);var f=Od(n,i,a,s,o,l,u,h,!0);r[d*2]=f[0],r[d*2+1]=f[1]}return r},g_=function(e,r){for(var n=new Array(e.length*2),i,a,s,o,l=0;l<e.length/2;l++){i=e[l*2],a=e[l*2+1],l<e.length/2-1?(s=e[(l+1)*2],o=e[(l+1)*2+1]):(s=e[0],o=e[1]);var u=o-a,h=-(s-i),d=Math.sqrt(u*u+h*h),f=u/d,p=h/d;n[l*4]=i+f*r,n[l*4+1]=a+p*r,n[l*4+2]=s+f*r,n[l*4+3]=o+p*r}return n},ndt=function(e,r,n,i,a,s){var o=n-e,l=i-r;o/=a,l/=s;var u=Math.sqrt(o*o+l*l),h=u-1;if(h<0)return[];var d=h/u;return[(n-e)*d+e,(i-r)*d+r]},Jp=function(e,r,n,i,a,s,o){return e-=a,r-=s,e/=n/2+o,r/=i/2+o,e*e+r*r<=1},JT=function(e,r,n,i,a,s,o){var l=[n-e,i-r],u=[e-a,r-s],h=l[0]*l[0]+l[1]*l[1],d=2*(u[0]*l[0]+u[1]*l[1]),f=u[0]*u[0]+u[1]*u[1]-o*o,p=d*d-4*h*f;if(p<0)return[];var g=(-d+Math.sqrt(p))/(2*h),m=(-d-Math.sqrt(p))/(2*h),y=Math.min(g,m),v=Math.max(g,m),T=[];if(y>=0&&y<=1&&T.push(y),v>=0&&v<=1&&T.push(v),T.length===0)return[];var b=T[0]*l[0]+e,w=T[0]*l[1]+r;if(T.length>1){if(T[0]==T[1])return[b,w];var C=T[1]*l[0]+e,S=T[1]*l[1]+r;return[b,w,C,S]}else return[b,w]},KI=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},Od=function(e,r,n,i,a,s,o,l,u){var h=e-a,d=n-e,f=o-a,p=r-s,g=i-r,m=l-s,y=f*p-m*h,v=d*p-g*h,T=m*d-f*g;if(T!==0){var b=y/T,w=v/T,C=.001,S=0-C,k=1+C;return S<=b&&b<=k&&S<=w&&w<=k?[e+b*d,r+b*g]:u?[e+b*d,r+b*g]:[]}else return y===0||v===0?KI(e,n,o)===o?[o,l]:KI(e,n,a)===a?[a,s]:KI(a,o,n)===n?[n,i]:[]:[]},idt=function(e,r,n,i,a){var s=[],o=i/2,l=a/2,u=r,h=n;s.push({x:u+o*e[0],y:h+l*e[1]});for(var d=1;d<e.length/2;d++)s.push({x:u+o*e[d*2],y:h+l*e[d*2+1]});return s},nk=function(e,r,n,i,a,s,o,l){var u=[],h,d=new Array(n.length),f=!0;s==null&&(f=!1);var p;if(f){for(var g=0;g<d.length/2;g++)d[g*2]=n[g*2]*s+i,d[g*2+1]=n[g*2+1]*o+a;if(l>0){var m=g_(d,-l);p=p_(m)}else p=d}else p=n;for(var y,v,T,b,w=0;w<p.length/2;w++)y=p[w*2],v=p[w*2+1],w<p.length/2-1?(T=p[(w+1)*2],b=p[(w+1)*2+1]):(T=p[0],b=p[1]),h=Od(e,r,i,a,y,v,T,b),h.length!==0&&u.push(h[0],h[1]);return u},adt=function(e,r,n,i,a,s,o,l,u){var h=[],d,f=new Array(n.length*2);u.forEach(function(T,b){b===0?(f[f.length-2]=T.startX,f[f.length-1]=T.startY):(f[b*4-2]=T.startX,f[b*4-1]=T.startY),f[b*4]=T.stopX,f[b*4+1]=T.stopY,d=JT(e,r,i,a,T.cx,T.cy,T.radius),d.length!==0&&h.push(d[0],d[1])});for(var p=0;p<f.length/4;p++)d=Od(e,r,i,a,f[p*4],f[p*4+1],f[p*4+2],f[p*4+3],!1),d.length!==0&&h.push(d[0],d[1]);if(h.length>2){for(var g=[h[0],h[1]],m=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),y=1;y<h.length/2;y++){var v=Math.pow(h[y*2]-e,2)+Math.pow(h[y*2+1]-r,2);v<=m&&(g[0]=h[y*2],g[1]=h[y*2+1],m=v)}return g}return h},jE=function(e,r,n){var i=[e[0]-r[0],e[1]-r[1]],a=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=(a-n)/a;return s<0&&(s=1e-5),[r[0]+s*i[0],r[1]+s*i[1]]},Rs=function(e,r){var n=tP(e,r);return n=gve(n),n},gve=function(e){for(var r,n,i=e.length/2,a=1/0,s=1/0,o=-1/0,l=-1/0,u=0;u<i;u++)r=e[2*u],n=e[2*u+1],a=Math.min(a,r),o=Math.max(o,r),s=Math.min(s,n),l=Math.max(l,n);for(var h=2/(o-a),d=2/(l-s),f=0;f<i;f++)r=e[2*f]=e[2*f]*h,n=e[2*f+1]=e[2*f+1]*d,a=Math.min(a,r),o=Math.max(o,r),s=Math.min(s,n),l=Math.max(l,n);if(s<-1)for(var p=0;p<i;p++)n=e[2*p+1]=e[2*p+1]+(-1-s);return e},tP=function(e,r){var n=1/e*2*Math.PI,i=e%2===0?Math.PI/2+n/2:Math.PI/2;i+=r;for(var a=new Array(e*2),s,o=0;o<e;o++)s=o*n+i,a[2*o]=Math.cos(s),a[2*o+1]=Math.sin(-s);return a},uf=function(e,r){return Math.min(e/4,r/4,8)},mve=function(e,r){return Math.min(e/10,r/10,8)},jG=function(){return 8},sdt=function(e,r,n){return[e-2*r+n,2*(r-e),e]},rP=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function ZI(t,e){function r(d){for(var f=[],p=0;p<d.length;p++){var g=d[p],m=d[(p+1)%d.length],y={x:m.x-g.x,y:m.y-g.y},v={x:-y.y,y:y.x},T=Math.sqrt(v.x*v.x+v.y*v.y);f.push({x:v.x/T,y:v.y/T})}return f}function n(d,f){var p=1/0,g=-1/0,m=yo(d),y;try{for(m.s();!(y=m.n()).done;){var v=y.value,T=v.x*f.x+v.y*f.y;p=Math.min(p,T),g=Math.max(g,T)}}catch(b){m.e(b)}finally{m.f()}return{min:p,max:g}}function i(d,f){return!(d.max<f.min||f.max<d.min)}var a=[].concat(u_(r(t)),u_(r(e))),s=yo(a),o;try{for(s.s();!(o=s.n()).done;){var l=o.value,u=n(t,l),h=n(e,l);if(!i(u,h))return!1}}catch(d){s.e(d)}finally{s.f()}return!0}var odt=ts({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),ldt={pageRank:function(e){for(var r=odt(e),n=r.dampingFactor,i=r.precision,a=r.iterations,s=r.weight,o=this._private.cy,l=this.byGroup(),u=l.nodes,h=l.edges,d=u.length,f=d*d,p=h.length,g=new Array(f),m=new Array(d),y=(1-n)/d,v=0;v<d;v++){for(var T=0;T<d;T++){var b=v*d+T;g[b]=0}m[v]=0}for(var w=0;w<p;w++){var C=h[w],S=C.data("source"),k=C.data("target");if(S!==k){var E=u.indexOfId(S),_=u.indexOfId(k),M=s(C),L=_*d+E;g[L]+=M,m[E]+=M}}for(var P=1/d+y,D=0;D<d;D++)if(m[D]===0)for(var R=0;R<d;R++){var I=R*d+D;g[I]=P}else for(var $=0;$<d;$++){var O=$*d+D;g[O]=g[O]/m[D]+y}for(var N=new Array(d),F=new Array(d),z,V=0;V<d;V++)N[V]=1;for(var B=0;B<a;B++){for(var G=0;G<d;G++)F[G]=0;for(var H=0;H<d;H++)for(var q=0;q<d;q++){var Z=H*d+q;F[H]+=g[Z]*N[q]}Ght(F),z=N,N=F,F=z;for(var Y=0,ie=0;ie<d;ie++){var K=z[ie]-N[ie];Y+=K*K}if(Y<i)break}var Q={rank:function(J){return J=o.collection(J)[0],N[u.indexOf(J)]}};return Q}},bJ=ts({root:null,weight:function(e){return 1},directed:!1,alpha:0}),xy={degreeCentralityNormalized:function(e){e=bJ(e);var r=this.cy(),n=this.nodes(),i=n.length;if(e.directed){for(var h={},d={},f=0,p=0,g=0;g<i;g++){var m=n[g],y=m.id();e.root=m;var v=this.degreeCentrality(e);f<v.indegree&&(f=v.indegree),p<v.outdegree&&(p=v.outdegree),h[y]=v.indegree,d[y]=v.outdegree}return{indegree:function(b){return f==0?0:(or(b)&&(b=r.filter(b)),h[b.id()]/f)},outdegree:function(b){return p===0?0:(or(b)&&(b=r.filter(b)),d[b.id()]/p)}}}else{for(var a={},s=0,o=0;o<i;o++){var l=n[o];e.root=l;var u=this.degreeCentrality(e);s<u.degree&&(s=u.degree),a[l.id()]=u.degree}return{degree:function(b){return s===0?0:(or(b)&&(b=r.filter(b)),a[b.id()]/s)}}}},degreeCentrality:function(e){e=bJ(e);var r=this.cy(),n=this,i=e,a=i.root,s=i.weight,o=i.directed,l=i.alpha;if(a=r.collection(a)[0],o){for(var p=a.connectedEdges(),g=p.filter(function(S){return S.target().same(a)&&n.has(S)}),m=p.filter(function(S){return S.source().same(a)&&n.has(S)}),y=g.length,v=m.length,T=0,b=0,w=0;w<g.length;w++)T+=s(g[w]);for(var C=0;C<m.length;C++)b+=s(m[C]);return{indegree:Math.pow(y,1-l)*Math.pow(T,l),outdegree:Math.pow(v,1-l)*Math.pow(b,l)}}else{for(var u=a.connectedEdges().intersection(n),h=u.length,d=0,f=0;f<u.length;f++)d+=s(u[f]);return{degree:Math.pow(h,1-l)*Math.pow(d,l)}}}};xy.dc=xy.degreeCentrality;xy.dcn=xy.degreeCentralityNormalised=xy.degreeCentralityNormalized;var xJ=ts({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Ty={closenessCentralityNormalized:function(e){for(var r=xJ(e),n=r.harmonic,i=r.weight,a=r.directed,s=this.cy(),o={},l=0,u=this.nodes(),h=this.floydWarshall({weight:i,directed:a}),d=0;d<u.length;d++){for(var f=0,p=u[d],g=0;g<u.length;g++)if(d!==g){var m=h.distance(p,u[g]);n?f+=1/m:f+=m}n||(f=1/f),l<f&&(l=f),o[p.id()]=f}return{closeness:function(v){return l==0?0:(or(v)?v=s.filter(v)[0].id():v=v.id(),o[v]/l)}}},closenessCentrality:function(e){var r=xJ(e),n=r.root,i=r.weight,a=r.directed,s=r.harmonic;n=this.filter(n)[0];for(var o=this.dijkstra({root:n,weight:i,directed:a}),l=0,u=this.nodes(),h=0;h<u.length;h++){var d=u[h];if(!d.same(n)){var f=o.distanceTo(d);s?l+=1/f:l+=f}}return s?l:1/l}};Ty.cc=Ty.closenessCentrality;Ty.ccn=Ty.closenessCentralityNormalised=Ty.closenessCentralityNormalized;var cdt=ts({weight:null,directed:!1}),nP={betweennessCentrality:function(e){for(var r=cdt(e),n=r.directed,i=r.weight,a=i!=null,s=this.cy(),o=this.nodes(),l={},u={},h=0,d={set:function(b,w){u[b]=w,w>h&&(h=w)},get:function(b){return u[b]}},f=0;f<o.length;f++){var p=o[f],g=p.id();n?l[g]=p.outgoers().nodes():l[g]=p.openNeighborhood().nodes(),d.set(g,0)}for(var m=function(){for(var b=o[y].id(),w=[],C={},S={},k={},E=new yS(function(H,q){return k[H]-k[q]}),_=0;_<o.length;_++){var M=o[_].id();C[M]=[],S[M]=0,k[M]=1/0}for(S[b]=1,k[b]=0,E.push(b);!E.empty();){var L=E.pop();if(w.push(L),a)for(var P=0;P<l[L].length;P++){var D=l[L][P],R=s.getElementById(L),I=void 0;R.edgesTo(D).length>0?I=R.edgesTo(D)[0]:I=D.edgesTo(R)[0];var $=i(I);D=D.id(),k[D]>k[L]+$&&(k[D]=k[L]+$,E.nodes.indexOf(D)<0?E.push(D):E.updateItem(D),S[D]=0,C[D]=[]),k[D]==k[L]+$&&(S[D]=S[D]+S[L],C[D].push(L))}else for(var O=0;O<l[L].length;O++){var N=l[L][O].id();k[N]==1/0&&(E.push(N),k[N]=k[L]+1),k[N]==k[L]+1&&(S[N]=S[N]+S[L],C[N].push(L))}}for(var F={},z=0;z<o.length;z++)F[o[z].id()]=0;for(;w.length>0;){for(var V=w.pop(),B=0;B<C[V].length;B++){var G=C[V][B];F[G]=F[G]+S[G]/S[V]*(1+F[V])}V!=o[y].id()&&d.set(V,d.get(V)+F[V])}},y=0;y<o.length;y++)m();var v={betweenness:function(b){var w=s.collection(b).id();return d.get(w)},betweennessNormalized:function(b){if(h==0)return 0;var w=s.collection(b).id();return d.get(w)/h}};return v.betweennessNormalised=v.betweennessNormalized,v}};nP.bc=nP.betweennessCentrality;var udt=ts({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),hdt=function(e){return udt(e)},ddt=function(e,r){for(var n=0,i=0;i<r.length;i++)n+=r[i](e);return n},fdt=function(e,r,n){for(var i=0;i<r;i++)e[i*r+i]=n},yve=function(e,r){for(var n,i=0;i<r;i++){n=0;for(var a=0;a<r;a++)n+=e[a*r+i];for(var s=0;s<r;s++)e[s*r+i]=e[s*r+i]/n}},pdt=function(e,r,n){for(var i=new Array(n*n),a=0;a<n;a++){for(var s=0;s<n;s++)i[a*n+s]=0;for(var o=0;o<n;o++)for(var l=0;l<n;l++)i[a*n+l]+=e[a*n+o]*r[o*n+l]}return i},gdt=function(e,r,n){for(var i=e.slice(0),a=1;a<n;a++)e=pdt(e,i,r);return e},mdt=function(e,r,n){for(var i=new Array(r*r),a=0;a<r*r;a++)i[a]=Math.pow(e[a],n);return yve(i,r),i},ydt=function(e,r,n,i){for(var a=0;a<n;a++){var s=Math.round(e[a]*Math.pow(10,i))/Math.pow(10,i),o=Math.round(r[a]*Math.pow(10,i))/Math.pow(10,i);if(s!==o)return!1}return!0},vdt=function(e,r,n,i){for(var a=[],s=0;s<r;s++){for(var o=[],l=0;l<r;l++)Math.round(e[s*r+l]*1e3)/1e3>0&&o.push(n[l]);o.length!==0&&a.push(i.collection(o))}return a},bdt=function(e,r){for(var n=0;n<e.length;n++)if(!r[n]||e[n].id()!==r[n].id())return!1;return!0},xdt=function(e){for(var r=0;r<e.length;r++)for(var n=0;n<e.length;n++)r!=n&&bdt(e[r],e[n])&&e.splice(n,1);return e},TJ=function(e){for(var r=this.nodes(),n=this.edges(),i=this.cy(),a=hdt(e),s={},o=0;o<r.length;o++)s[r[o].id()]=o;for(var l=r.length,u=l*l,h=new Array(u),d,f=0;f<u;f++)h[f]=0;for(var p=0;p<n.length;p++){var g=n[p],m=s[g.source().id()],y=s[g.target().id()],v=ddt(g,a.attributes);h[m*l+y]+=v,h[y*l+m]+=v}fdt(h,l,a.multFactor),yve(h,l);for(var T=!0,b=0;T&&b<a.maxIterations;)T=!1,d=gdt(h,l,a.expandFactor),h=mdt(d,l,a.inflateFactor),ydt(h,d,u,4)||(T=!0),b++;var w=vdt(h,l,r,i);return w=xdt(w),w},Tdt={markovClustering:TJ,mcl:TJ},wdt=function(e){return e},vve=function(e,r){return Math.abs(r-e)},wJ=function(e,r,n){return e+vve(r,n)},CJ=function(e,r,n){return e+Math.pow(n-r,2)},Cdt=function(e){return Math.sqrt(e)},kdt=function(e,r,n){return Math.max(e,vve(r,n))},dT=function(e,r,n,i,a){for(var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:wdt,o=i,l,u,h=0;h<e;h++)l=r(h),u=n(h),o=a(o,l,u);return s(o)},Hb={euclidean:function(e,r,n){return e>=2?dT(e,r,n,0,CJ,Cdt):dT(e,r,n,0,wJ)},squaredEuclidean:function(e,r,n){return dT(e,r,n,0,CJ)},manhattan:function(e,r,n){return dT(e,r,n,0,wJ)},max:function(e,r,n){return dT(e,r,n,-1/0,kdt)}};Hb["squared-euclidean"]=Hb.squaredEuclidean;Hb.squaredeuclidean=Hb.squaredEuclidean;function sL(t,e,r,n,i,a){var s;return gi(t)?s=t:s=Hb[t]||Hb.euclidean,e===0&&gi(t)?s(i,a):s(e,r,n,i,a)}var Sdt=ts({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),KG=function(e){return Sdt(e)},m_=function(e,r,n,i,a){var s=a!=="kMedoids",o=s?function(d){return n[d]}:function(d){return i[d](n)},l=function(f){return i[f](r)},u=n,h=r;return sL(e,i.length,o,l,u,h)},QI=function(e,r,n){for(var i=n.length,a=new Array(i),s=new Array(i),o=new Array(r),l=null,u=0;u<i;u++)a[u]=e.min(n[u]).value,s[u]=e.max(n[u]).value;for(var h=0;h<r;h++){l=[];for(var d=0;d<i;d++)l[d]=Math.random()*(s[d]-a[d])+a[d];o[h]=l}return o},bve=function(e,r,n,i,a){for(var s=1/0,o=0,l=0;l<r.length;l++){var u=m_(n,e,r[l],i,a);u<s&&(s=u,o=l)}return o},xve=function(e,r,n){for(var i=[],a=null,s=0;s<r.length;s++)a=r[s],n[a.id()]===e&&i.push(a);return i},Edt=function(e,r,n){return Math.abs(r-e)<=n},Adt=function(e,r,n){for(var i=0;i<e.length;i++)for(var a=0;a<e[i].length;a++){var s=Math.abs(e[i][a]-r[i][a]);if(s>n)return!1}return!0},_dt=function(e,r,n){for(var i=0;i<n;i++)if(e===r[i])return!0;return!1},kJ=function(e,r){var n=new Array(r);if(e.length<50)for(var i=0;i<r;i++){for(var a=e[Math.floor(Math.random()*e.length)];_dt(a,n,i);)a=e[Math.floor(Math.random()*e.length)];n[i]=a}else for(var s=0;s<r;s++)n[s]=e[Math.floor(Math.random()*e.length)];return n},SJ=function(e,r,n){for(var i=0,a=0;a<r.length;a++)i+=m_("manhattan",r[a],e,n,"kMedoids");return i},Rdt=function(e){var r=this.cy(),n=this.nodes(),i=null,a=KG(e),s=new Array(a.k),o={},l;a.testMode?typeof a.testCentroids=="number"?(a.testCentroids,l=QI(n,a.k,a.attributes)):ca(a.testCentroids)==="object"?l=a.testCentroids:l=QI(n,a.k,a.attributes):l=QI(n,a.k,a.attributes);for(var u=!0,h=0;u&&h<a.maxIterations;){for(var d=0;d<n.length;d++)i=n[d],o[i.id()]=bve(i,l,a.distance,a.attributes,"kMeans");u=!1;for(var f=0;f<a.k;f++){var p=xve(f,n,o);if(p.length!==0){for(var g=a.attributes.length,m=l[f],y=new Array(g),v=new Array(g),T=0;T<g;T++){v[T]=0;for(var b=0;b<p.length;b++)i=p[b],v[T]+=a.attributes[T](i);y[T]=v[T]/p.length,Edt(y[T],m[T],a.sensitivityThreshold)||(u=!0)}l[f]=y,s[f]=r.collection(p)}}h++}return s},Ldt=function(e){var r=this.cy(),n=this.nodes(),i=null,a=KG(e),s=new Array(a.k),o,l={},u,h=new Array(a.k);a.testMode?typeof a.testCentroids=="number"||(ca(a.testCentroids)==="object"?o=a.testCentroids:o=kJ(n,a.k)):o=kJ(n,a.k);for(var d=!0,f=0;d&&f<a.maxIterations;){for(var p=0;p<n.length;p++)i=n[p],l[i.id()]=bve(i,o,a.distance,a.attributes,"kMedoids");d=!1;for(var g=0;g<o.length;g++){var m=xve(g,n,l);if(m.length!==0){h[g]=SJ(o[g],m,a.attributes);for(var y=0;y<m.length;y++)u=SJ(m[y],m,a.attributes),u<h[g]&&(h[g]=u,o[g]=m[y],d=!0);s[g]=r.collection(m)}}f++}return s},Mdt=function(e,r,n,i,a){for(var s,o,l=0;l<r.length;l++)for(var u=0;u<e.length;u++)i[l][u]=Math.pow(n[l][u],a.m);for(var h=0;h<e.length;h++)for(var d=0;d<a.attributes.length;d++){s=0,o=0;for(var f=0;f<r.length;f++)s+=i[f][h]*a.attributes[d](r[f]),o+=i[f][h];e[h][d]=s/o}},Idt=function(e,r,n,i,a){for(var s=0;s<e.length;s++)r[s]=e[s].slice();for(var o,l,u,h=2/(a.m-1),d=0;d<n.length;d++)for(var f=0;f<i.length;f++){o=0;for(var p=0;p<n.length;p++)l=m_(a.distance,i[f],n[d],a.attributes,"cmeans"),u=m_(a.distance,i[f],n[p],a.attributes,"cmeans"),o+=Math.pow(l/u,h);e[f][d]=1/o}},Ndt=function(e,r,n,i){for(var a=new Array(n.k),s=0;s<a.length;s++)a[s]=[];for(var o,l,u=0;u<r.length;u++){o=-1/0,l=-1;for(var h=0;h<r[0].length;h++)r[u][h]>o&&(o=r[u][h],l=h);a[l].push(e[u])}for(var d=0;d<a.length;d++)a[d]=i.collection(a[d]);return a},EJ=function(e){var r=this.cy(),n=this.nodes(),i=KG(e),a,s,o,l,u;l=new Array(n.length);for(var h=0;h<n.length;h++)l[h]=new Array(i.k);o=new Array(n.length);for(var d=0;d<n.length;d++)o[d]=new Array(i.k);for(var f=0;f<n.length;f++){for(var p=0,g=0;g<i.k;g++)o[f][g]=Math.random(),p+=o[f][g];for(var m=0;m<i.k;m++)o[f][m]=o[f][m]/p}s=new Array(i.k);for(var y=0;y<i.k;y++)s[y]=new Array(i.attributes.length);u=new Array(n.length);for(var v=0;v<n.length;v++)u[v]=new Array(i.k);for(var T=!0,b=0;T&&b<i.maxIterations;)T=!1,Mdt(s,n,o,u,i),Idt(o,l,s,n,i),Adt(o,l,i.sensitivityThreshold)||(T=!0),b++;return a=Ndt(n,o,i,r),{clusters:a,degreeOfMembership:o}},Ddt={kMeans:Rdt,kMedoids:Ldt,fuzzyCMeans:EJ,fcm:EJ},Odt=ts({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),$dt={single:"min",complete:"max"},Pdt=function(e){var r=Odt(e),n=$dt[r.linkage];return n!=null&&(r.linkage=n),r},AJ=function(e,r,n,i,a){for(var s=0,o=1/0,l,u=a.attributes,h=function(_,M){return sL(a.distance,u.length,function(L){return u[L](_)},function(L){return u[L](M)},_,M)},d=0;d<e.length;d++){var f=e[d].key,p=n[f][i[f]];p<o&&(s=f,o=p)}if(a.mode==="threshold"&&o>=a.threshold||a.mode==="dendrogram"&&e.length===1)return!1;var g=r[s],m=r[i[s]],y;a.mode==="dendrogram"?y={left:g,right:m,key:g.key}:y={value:g.value.concat(m.value),key:g.key},e[g.index]=y,e.splice(m.index,1),r[g.key]=y;for(var v=0;v<e.length;v++){var T=e[v];g.key===T.key?l=1/0:a.linkage==="min"?(l=n[g.key][T.key],n[g.key][T.key]>n[m.key][T.key]&&(l=n[m.key][T.key])):a.linkage==="max"?(l=n[g.key][T.key],n[g.key][T.key]<n[m.key][T.key]&&(l=n[m.key][T.key])):a.linkage==="mean"?l=(n[g.key][T.key]*g.size+n[m.key][T.key]*m.size)/(g.size+m.size):a.mode==="dendrogram"?l=h(T.value,g.value):l=h(T.value[0],g.value[0]),n[g.key][T.key]=n[T.key][g.key]=l}for(var b=0;b<e.length;b++){var w=e[b].key;if(i[w]===g.key||i[w]===m.key){for(var C=w,S=0;S<e.length;S++){var k=e[S].key;n[w][k]<n[w][C]&&(C=k)}i[w]=C}e[b].index=b}return g.key=m.key=g.index=m.index=null,!0},jm=function(e,r,n){e&&(e.value?r.push(e.value):(e.left&&jm(e.left,r),e.right&&jm(e.right,r)))},iP=function(e,r){if(!e)return"";if(e.left&&e.right){var n=iP(e.left,r),i=iP(e.right,r),a=r.add({group:"nodes",data:{id:n+","+i}});return r.add({group:"edges",data:{source:n,target:a.id()}}),r.add({group:"edges",data:{source:i,target:a.id()}}),a.id()}else if(e.value)return e.value.id()},aP=function(e,r,n){if(!e)return[];var i=[],a=[],s=[];return r===0?(e.left&&jm(e.left,i),e.right&&jm(e.right,a),s=i.concat(a),[n.collection(s)]):r===1?e.value?[n.collection(e.value)]:(e.left&&jm(e.left,i),e.right&&jm(e.right,a),[n.collection(i),n.collection(a)]):e.value?[n.collection(e.value)]:(e.left&&(i=aP(e.left,r-1,n)),e.right&&(a=aP(e.right,r-1,n)),i.concat(a))},_J=function(e){for(var r=this.cy(),n=this.nodes(),i=Pdt(e),a=i.attributes,s=function(b,w){return sL(i.distance,a.length,function(C){return a[C](b)},function(C){return a[C](w)},b,w)},o=[],l=[],u=[],h=[],d=0;d<n.length;d++){var f={value:i.mode==="dendrogram"?n[d]:[n[d]],key:d,index:d};o[d]=f,h[d]=f,l[d]=[],u[d]=0}for(var p=0;p<o.length;p++)for(var g=0;g<=p;g++){var m=void 0;i.mode==="dendrogram"?m=p===g?1/0:s(o[p].value,o[g].value):m=p===g?1/0:s(o[p].value[0],o[g].value[0]),l[p][g]=m,l[g][p]=m,m<l[p][u[p]]&&(u[p]=g)}for(var y=AJ(o,h,l,u,i);y;)y=AJ(o,h,l,u,i);var v;return i.mode==="dendrogram"?(v=aP(o[0],i.dendrogramDepth,r),i.addDendrogram&&iP(o[0],r)):(v=new Array(o.length),o.forEach(function(T,b){T.key=T.index=null,v[b]=r.collection(T.value)})),v},Bdt={hierarchicalClustering:_J,hca:_J},Fdt=ts({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),zdt=function(e){var r=e.damping,n=e.preference;.5<=r&&r<1||oi("Damping must range on [0.5, 1). Got: ".concat(r));var i=["median","mean","min","max"];return i.some(function(a){return a===n})||Dt(n)||oi("Preference must be one of [".concat(i.map(function(a){return"'".concat(a,"'")}).join(", "),"] or a number. Got: ").concat(n)),Fdt(e)},Vdt=function(e,r,n,i){var a=function(o,l){return i[l](o)};return-sL(e,i.length,function(s){return a(r,s)},function(s){return a(n,s)},r,n)},Gdt=function(e,r){var n=null;return r==="median"?n=zht(e):r==="mean"?n=Fht(e):r==="min"?n=Pht(e):r==="max"?n=Bht(e):n=r,n},Wdt=function(e,r,n){for(var i=[],a=0;a<e;a++)r[a*e+a]+n[a*e+a]>0&&i.push(a);return i},RJ=function(e,r,n){for(var i=[],a=0;a<e;a++){for(var s=-1,o=-1/0,l=0;l<n.length;l++){var u=n[l];r[a*e+u]>o&&(s=u,o=r[a*e+u])}s>0&&i.push(s)}for(var h=0;h<n.length;h++)i[n[h]]=n[h];return i},Hdt=function(e,r,n){for(var i=RJ(e,r,n),a=0;a<n.length;a++){for(var s=[],o=0;o<i.length;o++)i[o]===n[a]&&s.push(o);for(var l=-1,u=-1/0,h=0;h<s.length;h++){for(var d=0,f=0;f<s.length;f++)d+=r[s[f]*e+s[h]];d>u&&(l=h,u=d)}n[a]=s[l]}return i=RJ(e,r,n),i},LJ=function(e){for(var r=this.cy(),n=this.nodes(),i=zdt(e),a={},s=0;s<n.length;s++)a[n[s].id()]=s;var o,l,u,h,d,f;o=n.length,l=o*o,u=new Array(l);for(var p=0;p<l;p++)u[p]=-1/0;for(var g=0;g<o;g++)for(var m=0;m<o;m++)g!==m&&(u[g*o+m]=Vdt(i.distance,n[g],n[m],i.attributes));h=Gdt(u,i.preference);for(var y=0;y<o;y++)u[y*o+y]=h;d=new Array(l);for(var v=0;v<l;v++)d[v]=0;f=new Array(l);for(var T=0;T<l;T++)f[T]=0;for(var b=new Array(o),w=new Array(o),C=new Array(o),S=0;S<o;S++)b[S]=0,w[S]=0,C[S]=0;for(var k=new Array(o*i.minIterations),E=0;E<k.length;E++)k[E]=0;var _;for(_=0;_<i.maxIterations;_++){for(var M=0;M<o;M++){for(var L=-1/0,P=-1/0,D=-1,R=0,I=0;I<o;I++)b[I]=d[M*o+I],R=f[M*o+I]+u[M*o+I],R>=L?(P=L,L=R,D=I):R>P&&(P=R);for(var $=0;$<o;$++)d[M*o+$]=(1-i.damping)*(u[M*o+$]-L)+i.damping*b[$];d[M*o+D]=(1-i.damping)*(u[M*o+D]-P)+i.damping*b[D]}for(var O=0;O<o;O++){for(var N=0,F=0;F<o;F++)b[F]=f[F*o+O],w[F]=Math.max(0,d[F*o+O]),N+=w[F];N-=w[O],w[O]=d[O*o+O],N+=w[O];for(var z=0;z<o;z++)f[z*o+O]=(1-i.damping)*Math.min(0,N-w[z])+i.damping*b[z];f[O*o+O]=(1-i.damping)*(N-w[O])+i.damping*b[O]}for(var V=0,B=0;B<o;B++){var G=f[B*o+B]+d[B*o+B]>0?1:0;k[_%i.minIterations*o+B]=G,V+=G}if(V>0&&(_>=i.minIterations-1||_==i.maxIterations-1)){for(var H=0,q=0;q<o;q++){C[q]=0;for(var Z=0;Z<i.minIterations;Z++)C[q]+=k[Z*o+q];(C[q]===0||C[q]===i.minIterations)&&H++}if(H===o)break}}for(var Y=Wdt(o,d,f),ie=Hdt(o,u,Y),K={},Q=0;Q<Y.length;Q++)K[Y[Q]]=[];for(var te=0;te<n.length;te++){var J=a[n[te].id()],ge=ie[J];ge!=null&&K[ge].push(n[te])}for(var ee=new Array(Y.length),Re=0;Re<Y.length;Re++)ee[Re]=r.collection(K[Y[Re]]);return ee},qdt={affinityPropagation:LJ,ap:LJ},Udt=ts({root:void 0,directed:!1}),Ydt={hierholzer:function(e){if(!ln(e)){var r=arguments;e={root:r[0],directed:r[1]}}var n=Udt(e),i=n.root,a=n.directed,s=this,o=!1,l,u,h;i&&(h=or(i)?this.filter(i)[0].id():i[0].id());var d={},f={};a?s.forEach(function(T){var b=T.id();if(T.isNode()){var w=T.indegree(!0),C=T.outdegree(!0),S=w-C,k=C-w;S==1?l?o=!0:l=b:k==1?u?o=!0:u=b:(k>1||S>1)&&(o=!0),d[b]=[],T.outgoers().forEach(function(E){E.isEdge()&&d[b].push(E.id())})}else f[b]=[void 0,T.target().id()]}):s.forEach(function(T){var b=T.id();if(T.isNode()){var w=T.degree(!0);w%2&&(l?u?o=!0:u=b:l=b),d[b]=[],T.connectedEdges().forEach(function(C){return d[b].push(C.id())})}else f[b]=[T.source().id(),T.target().id()]});var p={found:!1,trail:void 0};if(o)return p;if(u&&l)if(a){if(h&&u!=h)return p;h=u}else{if(h&&u!=h&&l!=h)return p;h||(h=u)}else h||(h=s[0].id());var g=function(b){for(var w=b,C=[b],S,k,E;d[w].length;)S=d[w].shift(),k=f[S][0],E=f[S][1],w!=E?(d[E]=d[E].filter(function(_){return _!=S}),w=E):!a&&w!=k&&(d[k]=d[k].filter(function(_){return _!=S}),w=k),C.unshift(S),C.unshift(w);return C},m=[],y=[];for(y=g(h);y.length!=1;)d[y[0]].length==0?(m.unshift(s.getElementById(y.shift())),m.unshift(s.getElementById(y.shift()))):y=g(y.shift()).concat(y);m.unshift(s.getElementById(y.shift()));for(var v in d)if(d[v].length)return p;return p.found=!0,p.trail=this.spawn(m,!0),p}},KE=function(){var e=this,r={},n=0,i=0,a=[],s=[],o={},l=function(f,p){for(var g=s.length-1,m=[],y=e.spawn();s[g].x!=f||s[g].y!=p;)m.push(s.pop().edge),g--;m.push(s.pop().edge),m.forEach(function(v){var T=v.connectedNodes().intersection(e);y.merge(v),T.forEach(function(b){var w=b.id(),C=b.connectedEdges().intersection(e);y.merge(b),r[w].cutVertex?y.merge(C.filter(function(S){return S.isLoop()})):y.merge(C)})}),a.push(y)},u=function(f,p,g){f===g&&(i+=1),r[p]={id:n,low:n++,cutVertex:!1};var m=e.getElementById(p).connectedEdges().intersection(e);if(m.size()===0)a.push(e.spawn(e.getElementById(p)));else{var y,v,T,b;m.forEach(function(w){y=w.source().id(),v=w.target().id(),T=y===p?v:y,T!==g&&(b=w.id(),o[b]||(o[b]=!0,s.push({x:p,y:T,edge:w})),T in r?r[p].low=Math.min(r[p].low,r[T].id):(u(f,T,p),r[p].low=Math.min(r[p].low,r[T].low),r[p].id<=r[T].low&&(r[p].cutVertex=!0,l(p,T))))})}};e.forEach(function(d){if(d.isNode()){var f=d.id();f in r||(i=0,u(f,f),r[f].cutVertex=i>1)}});var h=Object.keys(r).filter(function(d){return r[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(h),components:a}},Xdt={hopcroftTarjanBiconnected:KE,htbc:KE,htb:KE,hopcroftTarjanBiconnectedComponents:KE},ZE=function(){var e=this,r={},n=0,i=[],a=[],s=e.spawn(e),o=function(u){a.push(u),r[u]={index:n,low:n++,explored:!1};var h=e.getElementById(u).connectedEdges().intersection(e);if(h.forEach(function(m){var y=m.target().id();y!==u&&(y in r||o(y),r[y].explored||(r[u].low=Math.min(r[u].low,r[y].low)))}),r[u].index===r[u].low){for(var d=e.spawn();;){var f=a.pop();if(d.merge(e.getElementById(f)),r[f].low=r[u].index,r[f].explored=!0,f===u)break}var p=d.edgesWith(d),g=d.merge(p);i.push(g),s=s.difference(g)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:s,components:i}},jdt={tarjanStronglyConnected:ZE,tsc:ZE,tscc:ZE,tarjanStronglyConnectedComponents:ZE},Tve={};[tk,Sht,Eht,_ht,Lht,Iht,Oht,ldt,xy,Ty,nP,Tdt,Ddt,Bdt,qdt,Ydt,Xdt,jdt].forEach(function(t){dr(Tve,t)});/*!
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
Licensed under The MIT License (http://opensource.org/licenses/MIT)
*/var wve=0,Cve=1,kve=2,oc=function(e){if(!(this instanceof oc))return new oc(e);this.id="Thenable/1.0.7",this.state=wve,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};oc.prototype={fulfill:function(e){return MJ(this,Cve,"fulfillValue",e)},reject:function(e){return MJ(this,kve,"rejectReason",e)},then:function(e,r){var n=this,i=new oc;return n.onFulfilled.push(NJ(e,i,"fulfill")),n.onRejected.push(NJ(r,i,"reject")),Sve(n),i.proxy}};var MJ=function(e,r,n,i){return e.state===wve&&(e.state=r,e[n]=i,Sve(e)),e},Sve=function(e){e.state===Cve?IJ(e,"onFulfilled",e.fulfillValue):e.state===kve&&IJ(e,"onRejected",e.rejectReason)},IJ=function(e,r,n){if(e[r].length!==0){var i=e[r];e[r]=[];var a=function(){for(var o=0;o<i.length;o++)i[o](n)};typeof setImmediate=="function"?setImmediate(a):setTimeout(a,0)}},NJ=function(e,r,n){return function(i){if(typeof e!="function")r[n].call(r,i);else{var a;try{a=e(i)}catch(s){r.reject(s);return}Eve(r,a)}}},Eve=function(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(ca(r)==="object"&&r!==null||typeof r=="function")try{n=r.then}catch(a){e.reject(a);return}if(typeof n=="function"){var i=!1;try{n.call(r,function(a){i||(i=!0,a===r?e.reject(new TypeError("circular thenable chain")):Eve(e,a))},function(a){i||(i=!0,e.reject(a))})}catch(a){i||e.reject(a)}return}e.fulfill(r)};oc.all=function(t){return new oc(function(e,r){for(var n=new Array(t.length),i=0,a=function(l,u){n[l]=u,i++,i===t.length&&e(n)},s=0;s<t.length;s++)(function(o){var l=t[o],u=l!=null&&l.then!=null;if(u)l.then(function(d){a(o,d)},function(d){r(d)});else{var h=l;a(o,h)}})(s)})};oc.resolve=function(t){return new oc(function(e,r){e(t)})};oc.reject=function(t){return new oc(function(e,r){r(t)})};var Lx=typeof Promise<"u"?Promise:oc,sP=function(e,r,n){var i=zG(e),a=!i,s=this._private=dr({duration:1e3},r,n);if(s.target=e,s.style=s.style||s.css,s.started=!1,s.playing=!1,s.hooked=!1,s.applying=!1,s.progress=0,s.completes=[],s.frames=[],s.complete&&gi(s.complete)&&s.completes.push(s.complete),a){var o=e.position();s.startPosition=s.startPosition||{x:o.x,y:o.y},s.startStyle=s.startStyle||e.cy().style().getAnimationStartStyle(e,s.style)}if(i){var l=e.pan();s.startPan={x:l.x,y:l.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},G0=sP.prototype;dr(G0,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var r,n=e.target._private.animation;e.queue?r=n.queue:r=n.current,r.push(this),Po(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var r=this._private;return e===void 0?r.progress*r.duration:this.progress(e/r.duration)},progress:function(e){var r=this._private,n=r.playing;return e===void 0?r.progress:(n&&this.pause(),r.progress=e,r.started=!1,n&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,r=e.playing;r&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(u,h){var d=e[u];d!=null&&(e[u]=e[h],e[h]=d)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var i=0;i<e.style.length;i++){var a=e.style[i],s=a.name,o=e.startStyle[s];e.startStyle[s]=a,e.style[i]=o}return r&&this.play(),this},promise:function(e){var r=this._private,n;switch(e){case"frame":n=r.frames;break;default:case"complete":case"completed":n=r.completes}return new Lx(function(i,a){n.push(function(){i()})})}});G0.complete=G0.completed;G0.run=G0.play;G0.running=G0.playing;var Kdt={animated:function(){return function(){var r=this,n=r.length!==void 0,i=n?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return!1;var s=i[0];if(s)return s._private.animation.current.length>0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,i=n?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var s=0;s<i.length;s++){var o=i[s];o._private.animation.queue=[]}return this}},delay:function(){return function(r,n){var i=this._private.cy||this;return i.styleEnabled()?this.animate({delay:r,duration:r,complete:n}):this}},delayAnimation:function(){return function(r,n){var i=this._private.cy||this;return i.styleEnabled()?this.animation({delay:r,duration:r,complete:n}):this}},animation:function(){return function(r,n){var i=this,a=i.length!==void 0,s=a?i:[i],o=this._private.cy||this,l=!a,u=!l;if(!o.styleEnabled())return this;var h=o.style();r=dr({},r,n);var d=Object.keys(r).length===0;if(d)return new sP(s[0],r);switch(r.duration===void 0&&(r.duration=400),r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200;break}if(u&&(r.style=h.getPropsList(r.style||r.css),r.css=void 0),u&&r.renderedPosition!=null){var f=r.renderedPosition,p=o.pan(),g=o.zoom();r.position=hve(f,g,p)}if(l&&r.panBy!=null){var m=r.panBy,y=o.pan();r.pan={x:y.x+m.x,y:y.y+m.y}}var v=r.center||r.centre;if(l&&v!=null){var T=o.getCenterPan(v.eles,r.zoom);T!=null&&(r.pan=T)}if(l&&r.fit!=null){var b=r.fit,w=o.getFitViewport(b.eles||b.boundingBox,b.padding);w!=null&&(r.pan=w.pan,r.zoom=w.zoom)}if(l&&ln(r.zoom)){var C=o.getZoomedViewport(r.zoom);C!=null?(C.zoomed&&(r.zoom=C.zoom),C.panned&&(r.pan=C.pan)):r.zoom=null}return new sP(s[0],r)}},animate:function(){return function(r,n){var i=this,a=i.length!==void 0,s=a?i:[i],o=this._private.cy||this;if(!o.styleEnabled())return this;n&&(r=dr({},r,n));for(var l=0;l<s.length;l++){var u=s[l],h=u.animated()&&(r.queue===void 0||r.queue),d=u.animation(r,h?{queue:!0}:void 0);d.play()}return this}},stop:function(){return function(r,n){var i=this,a=i.length!==void 0,s=a?i:[i],o=this._private.cy||this;if(!o.styleEnabled())return this;for(var l=0;l<s.length;l++){for(var u=s[l],h=u._private,d=h.animation.current,f=0;f<d.length;f++){var p=d[f],g=p._private;n&&(g.duration=0)}r&&(h.animation.queue=[]),n||(h.animation.current=[])}return o.notify("draw"),this}}},JI,DJ;function oL(){if(DJ)return JI;DJ=1;var t=Array.isArray;return JI=t,JI}var e8,OJ;function Zdt(){if(OJ)return e8;OJ=1;var t=oL(),e=gS(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,s){if(t(a))return!1;var o=typeof a;return o=="number"||o=="symbol"||o=="boolean"||a==null||e(a)?!0:n.test(a)||!r.test(a)||s!=null&&a in Object(s)}return e8=i,e8}var t8,$J;function Qdt(){if($J)return t8;$J=1;var t=rve(),e=pS(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function s(o){if(!e(o))return!1;var l=t(o);return l==n||l==i||l==r||l==a}return t8=s,t8}var r8,PJ;function Jdt(){if(PJ)return r8;PJ=1;var t=nL(),e=t["__core-js_shared__"];return r8=e,r8}var n8,BJ;function eft(){if(BJ)return n8;BJ=1;var t=Jdt(),e=(function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!e&&e in n}return n8=r,n8}var i8,FJ;function tft(){if(FJ)return i8;FJ=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return i8=r,i8}var a8,zJ;function rft(){if(zJ)return a8;zJ=1;var t=Qdt(),e=eft(),r=pS(),n=tft(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,s=Function.prototype,o=Object.prototype,l=s.toString,u=o.hasOwnProperty,h=RegExp("^"+l.call(u).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(f){if(!r(f)||e(f))return!1;var p=t(f)?h:a;return p.test(n(f))}return a8=d,a8}var s8,VJ;function nft(){if(VJ)return s8;VJ=1;function t(e,r){return e==null?void 0:e[r]}return s8=t,s8}var o8,GJ;function ZG(){if(GJ)return o8;GJ=1;var t=rft(),e=nft();function r(n,i){var a=e(n,i);return t(a)?a:void 0}return o8=r,o8}var l8,WJ;function lL(){if(WJ)return l8;WJ=1;var t=ZG(),e=t(Object,"create");return l8=e,l8}var c8,HJ;function ift(){if(HJ)return c8;HJ=1;var t=lL();function e(){this.__data__=t?t(null):{},this.size=0}return c8=e,c8}var u8,qJ;function aft(){if(qJ)return u8;qJ=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return u8=t,u8}var h8,UJ;function sft(){if(UJ)return h8;UJ=1;var t=lL(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var s=this.__data__;if(t){var o=s[a];return o===e?void 0:o}return n.call(s,a)?s[a]:void 0}return h8=i,h8}var d8,YJ;function oft(){if(YJ)return d8;YJ=1;var t=lL(),e=Object.prototype,r=e.hasOwnProperty;function n(i){var a=this.__data__;return t?a[i]!==void 0:r.call(a,i)}return d8=n,d8}var f8,XJ;function lft(){if(XJ)return f8;XJ=1;var t=lL(),e="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=t&&i===void 0?e:i,this}return f8=r,f8}var p8,jJ;function cft(){if(jJ)return p8;jJ=1;var t=ift(),e=aft(),r=sft(),n=oft(),i=lft();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,p8=a,p8}var g8,KJ;function uft(){if(KJ)return g8;KJ=1;function t(){this.__data__=[],this.size=0}return g8=t,g8}var m8,ZJ;function Ave(){if(ZJ)return m8;ZJ=1;function t(e,r){return e===r||e!==e&&r!==r}return m8=t,m8}var y8,QJ;function cL(){if(QJ)return y8;QJ=1;var t=Ave();function e(r,n){for(var i=r.length;i--;)if(t(r[i][0],n))return i;return-1}return y8=e,y8}var v8,JJ;function hft(){if(JJ)return v8;JJ=1;var t=cL(),e=Array.prototype,r=e.splice;function n(i){var a=this.__data__,s=t(a,i);if(s<0)return!1;var o=a.length-1;return s==o?a.pop():r.call(a,s,1),--this.size,!0}return v8=n,v8}var b8,eee;function dft(){if(eee)return b8;eee=1;var t=cL();function e(r){var n=this.__data__,i=t(n,r);return i<0?void 0:n[i][1]}return b8=e,b8}var x8,tee;function fft(){if(tee)return x8;tee=1;var t=cL();function e(r){return t(this.__data__,r)>-1}return x8=e,x8}var T8,ree;function pft(){if(ree)return T8;ree=1;var t=cL();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return T8=e,T8}var w8,nee;function gft(){if(nee)return w8;nee=1;var t=uft(),e=hft(),r=dft(),n=fft(),i=pft();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,w8=a,w8}var C8,iee;function mft(){if(iee)return C8;iee=1;var t=ZG(),e=nL(),r=t(e,"Map");return C8=r,C8}var k8,aee;function yft(){if(aee)return k8;aee=1;var t=cft(),e=gft(),r=mft();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return k8=n,k8}var S8,see;function vft(){if(see)return S8;see=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return S8=t,S8}var E8,oee;function uL(){if(oee)return E8;oee=1;var t=vft();function e(r,n){var i=r.__data__;return t(n)?i[typeof n=="string"?"string":"hash"]:i.map}return E8=e,E8}var A8,lee;function bft(){if(lee)return A8;lee=1;var t=uL();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return A8=e,A8}var _8,cee;function xft(){if(cee)return _8;cee=1;var t=uL();function e(r){return t(this,r).get(r)}return _8=e,_8}var R8,uee;function Tft(){if(uee)return R8;uee=1;var t=uL();function e(r){return t(this,r).has(r)}return R8=e,R8}var L8,hee;function wft(){if(hee)return L8;hee=1;var t=uL();function e(r,n){var i=t(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return L8=e,L8}var M8,dee;function Cft(){if(dee)return M8;dee=1;var t=yft(),e=bft(),r=xft(),n=Tft(),i=wft();function a(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,M8=a,M8}var I8,fee;function kft(){if(fee)return I8;fee=1;var t=Cft(),e="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var a=function(){var s=arguments,o=i?i.apply(this,s):s[0],l=a.cache;if(l.has(o))return l.get(o);var u=n.apply(this,s);return a.cache=l.set(o,u)||l,u};return a.cache=new(r.Cache||t),a}return r.Cache=t,I8=r,I8}var N8,pee;function Sft(){if(pee)return N8;pee=1;var t=kft(),e=500;function r(n){var i=t(n,function(s){return a.size===e&&a.clear(),s}),a=i.cache;return i}return N8=r,N8}var D8,gee;function _ve(){if(gee)return D8;gee=1;var t=Sft(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(e,function(s,o,l,u){a.push(l?u.replace(r,"$1"):o||s)}),a});return D8=n,D8}var O8,mee;function Rve(){if(mee)return O8;mee=1;function t(e,r){for(var n=-1,i=e==null?0:e.length,a=Array(i);++n<i;)a[n]=r(e[n],n,e);return a}return O8=t,O8}var $8,yee;function Eft(){if(yee)return $8;yee=1;var t=GG(),e=Rve(),r=oL(),n=gS(),i=t?t.prototype:void 0,a=i?i.toString:void 0;function s(o){if(typeof o=="string")return o;if(r(o))return e(o,s)+"";if(n(o))return a?a.call(o):"";var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}return $8=s,$8}var P8,vee;function Lve(){if(vee)return P8;vee=1;var t=Eft();function e(r){return r==null?"":t(r)}return P8=e,P8}var B8,bee;function Mve(){if(bee)return B8;bee=1;var t=oL(),e=Zdt(),r=_ve(),n=Lve();function i(a,s){return t(a)?a:e(a,s)?[a]:r(n(a))}return B8=i,B8}var F8,xee;function QG(){if(xee)return F8;xee=1;var t=gS();function e(r){if(typeof r=="string"||t(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return F8=e,F8}var z8,Tee;function Aft(){if(Tee)return z8;Tee=1;var t=Mve(),e=QG();function r(n,i){i=t(i,n);for(var a=0,s=i.length;n!=null&&a<s;)n=n[e(i[a++])];return a&&a==s?n:void 0}return z8=r,z8}var V8,wee;function _ft(){if(wee)return V8;wee=1;var t=Aft();function e(r,n,i){var a=r==null?void 0:t(r,n);return a===void 0?i:a}return V8=e,V8}var Rft=_ft(),Lft=fS(Rft),G8,Cee;function Mft(){if(Cee)return G8;Cee=1;var t=ZG(),e=(function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}})();return G8=e,G8}var W8,kee;function Ift(){if(kee)return W8;kee=1;var t=Mft();function e(r,n,i){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return W8=e,W8}var H8,See;function Nft(){if(See)return H8;See=1;var t=Ift(),e=Ave(),r=Object.prototype,n=r.hasOwnProperty;function i(a,s,o){var l=a[s];(!(n.call(a,s)&&e(l,o))||o===void 0&&!(s in a))&&t(a,s,o)}return H8=i,H8}var q8,Eee;function Dft(){if(Eee)return q8;Eee=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(n,i){var a=typeof n;return i=i??t,!!i&&(a=="number"||a!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<i}return q8=r,q8}var U8,Aee;function Oft(){if(Aee)return U8;Aee=1;var t=Nft(),e=Mve(),r=Dft(),n=pS(),i=QG();function a(s,o,l,u){if(!n(s))return s;o=e(o,s);for(var h=-1,d=o.length,f=d-1,p=s;p!=null&&++h<d;){var g=i(o[h]),m=l;if(g==="__proto__"||g==="constructor"||g==="prototype")return s;if(h!=f){var y=p[g];m=u?u(y,g,p):void 0,m===void 0&&(m=n(y)?y:r(o[h+1])?[]:{})}t(p,g,m),p=p[g]}return s}return U8=a,U8}var Y8,_ee;function $ft(){if(_ee)return Y8;_ee=1;var t=Oft();function e(r,n,i){return r==null?r:t(r,n,i)}return Y8=e,Y8}var Pft=$ft(),Bft=fS(Pft),X8,Ree;function Fft(){if(Ree)return X8;Ree=1;function t(e,r){var n=-1,i=e.length;for(r||(r=Array(i));++n<i;)r[n]=e[n];return r}return X8=t,X8}var j8,Lee;function zft(){if(Lee)return j8;Lee=1;var t=Rve(),e=Fft(),r=oL(),n=gS(),i=_ve(),a=QG(),s=Lve();function o(l){return r(l)?t(l,a):n(l)?[l]:e(i(s(l)))}return j8=o,j8}var Vft=zft(),Gft=fS(Vft),Wft={data:function(e){var r={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(i){},beforeSet:function(i,a){},onSet:function(i){},canSet:function(i){return!0}};return e=dr({},r,e),function(i,a){var s=e,o=this,l=o.length!==void 0,u=l?o:[o],h=l?o[0]:o;if(or(i)){var d=i.indexOf(".")!==-1,f=d&&Gft(i);if(s.allowGetting&&a===void 0){var p;return h&&(s.beforeGet(h),f&&h._private[s.field][i]===void 0?p=Lft(h._private[s.field],f):p=h._private[s.field][i]),p}else if(s.allowSetting&&a!==void 0){var g=!s.immutableKeys[i];if(g){var m=U1e({},i,a);s.beforeSet(o,m);for(var y=0,v=u.length;y<v;y++){var T=u[y];s.canSet(T)&&(f&&h._private[s.field][i]===void 0?Bft(T._private[s.field],f,a):T._private[s.field][i]=a)}s.updateStyle&&o.updateStyle(),s.onSet(o),s.settingTriggersEvent&&o[s.triggerFnName](s.settingEvent)}}}else if(s.allowSetting&&ln(i)){var b=i,w,C,S=Object.keys(b);s.beforeSet(o,b);for(var k=0;k<S.length;k++){w=S[k],C=b[w];var E=!s.immutableKeys[w];if(E)for(var _=0;_<u.length;_++){var M=u[_];s.canSet(M)&&(M._private[s.field][w]=C)}}s.updateStyle&&o.updateStyle(),s.onSet(o),s.settingTriggersEvent&&o[s.triggerFnName](s.settingEvent)}else if(s.allowBinding&&gi(i)){var L=i;o.on(s.bindingEvent,L)}else if(s.allowGetting&&i===void 0){var P;return h&&(s.beforeGet(h),P=h._private[s.field]),P}return o}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=dr({},r,e),function(i){var a=e,s=this,o=s.length!==void 0,l=o?s:[s];if(or(i)){for(var u=i.split(/\s+/),h=u.length,d=0;d<h;d++){var f=u[d];if(!lf(f)){var p=!a.immutableKeys[f];if(p)for(var g=0,m=l.length;g<m;g++)l[g]._private[a.field][f]=void 0}}a.triggerEvent&&s[a.triggerFnName](a.event)}else if(i===void 0){for(var y=0,v=l.length;y<v;y++)for(var T=l[y]._private[a.field],b=Object.keys(T),w=0;w<b.length;w++){var C=b[w],S=!a.immutableKeys[C];S&&(T[C]=void 0)}a.triggerEvent&&s[a.triggerFnName](a.event)}return s}}},Hft={eventAliasesOn:function(e){var r=e;r.addListener=r.listen=r.bind=r.on,r.unlisten=r.unbind=r.off=r.removeListener,r.trigger=r.emit,r.pon=r.promiseOn=function(n,i){var a=this,s=Array.prototype.slice.call(arguments,0);return new Lx(function(o,l){var u=function(p){a.off.apply(a,d),o(p)},h=s.concat([u]),d=h.concat([]);a.on.apply(a,h)})}}},Tn={};[Kdt,Wft,Hft].forEach(function(t){dr(Tn,t)});var qft={animate:Tn.animate(),animation:Tn.animation(),animated:Tn.animated(),clearQueue:Tn.clearQueue(),delay:Tn.delay(),delayAnimation:Tn.delayAnimation(),stop:Tn.stop()},c3={classes:function(e){var r=this;if(e===void 0){var n=[];return r[0]._private.classes.forEach(function(g){return n.push(g)}),n}else Nn(e)||(e=(e||"").match(/\S+/g)||[]);for(var i=[],a=new Rx(e),s=0;s<r.length;s++){for(var o=r[s],l=o._private,u=l.classes,h=!1,d=0;d<e.length;d++){var f=e[d],p=u.has(f);if(!p){h=!0;break}}h||(h=u.size!==e.length),h&&(l.classes=a,i.push(o))}return i.length>0&&this.spawn(i).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){Nn(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=r===void 0,a=[],s=0,o=n.length;s<o;s++)for(var l=n[s],u=l._private.classes,h=!1,d=0;d<e.length;d++){var f=e[d],p=u.has(f),g=!1;r||i&&!p?(u.add(f),g=!0):(!r||i&&p)&&(u.delete(f),g=!0),!h&&g&&(a.push(l),h=!0)}return a.length>0&&this.spawn(a).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};c3.className=c3.classNames=c3.classes;var an={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:sa,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};an.variable="(?:[\\w-.]|(?:\\\\"+an.metaChar+"))+";an.className="(?:[\\w-]|(?:\\\\"+an.metaChar+"))+";an.value=an.string+"|"+an.number;an.id=an.variable;(function(){var t,e,r;for(t=an.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],an.comparatorOp+="|@"+e;for(t=an.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(e.indexOf("!")>=0)&&e!=="="&&(an.comparatorOp+="|\\!"+e)})();var Rn=function(){return{checks:[]}},qt={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},oP=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(t,e){return Wut(t.selector,e.selector)}),Uft=(function(){for(var t={},e,r=0;r<oP.length;r++)e=oP[r],t[e.selector]=e.matches;return t})(),Yft=function(e,r){return Uft[e](r)},Xft="("+oP.map(function(t){return t.selector}).join("|")+")",jg=function(e){return e.replace(new RegExp("\\\\("+an.metaChar+")","g"),function(r,n){return n})},sd=function(e,r,n){e[e.length-1]=n},lP=[{name:"group",query:!0,regex:"("+an.group+")",populate:function(e,r,n){var i=zi(n,1),a=i[0];r.checks.push({type:qt.GROUP,value:a==="*"?a:a+"s"})}},{name:"state",query:!0,regex:Xft,populate:function(e,r,n){var i=zi(n,1),a=i[0];r.checks.push({type:qt.STATE,value:a})}},{name:"id",query:!0,regex:"\\#("+an.id+")",populate:function(e,r,n){var i=zi(n,1),a=i[0];r.checks.push({type:qt.ID,value:jg(a)})}},{name:"className",query:!0,regex:"\\.("+an.className+")",populate:function(e,r,n){var i=zi(n,1),a=i[0];r.checks.push({type:qt.CLASS,value:jg(a)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+an.variable+")\\s*\\]",populate:function(e,r,n){var i=zi(n,1),a=i[0];r.checks.push({type:qt.DATA_EXIST,field:jg(a)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+an.variable+")\\s*("+an.comparatorOp+")\\s*("+an.value+")\\s*\\]",populate:function(e,r,n){var i=zi(n,3),a=i[0],s=i[1],o=i[2],l=new RegExp("^"+an.string+"$").exec(o)!=null;l?o=o.substring(1,o.length-1):o=parseFloat(o),r.checks.push({type:qt.DATA_COMPARE,field:jg(a),operator:s,value:o})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+an.boolOp+")\\s*("+an.variable+")\\s*\\]",populate:function(e,r,n){var i=zi(n,2),a=i[0],s=i[1];r.checks.push({type:qt.DATA_BOOL,field:jg(s),operator:a})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+an.meta+")\\s*("+an.comparatorOp+")\\s*("+an.number+")\\s*\\]\\]",populate:function(e,r,n){var i=zi(n,3),a=i[0],s=i[1],o=i[2];r.checks.push({type:qt.META_COMPARE,field:jg(a),operator:s,value:parseFloat(o)})}},{name:"nextQuery",separator:!0,regex:an.separator,populate:function(e,r){var n=e.currentSubject,i=e.edgeCount,a=e.compoundCount,s=e[e.length-1];n!=null&&(s.subject=n,e.currentSubject=null),s.edgeCount=i,s.compoundCount=a,e.edgeCount=0,e.compoundCount=0;var o=e[e.length++]=Rn();return o}},{name:"directedEdge",separator:!0,regex:an.directedEdge,populate:function(e,r){if(e.currentSubject==null){var n=Rn(),i=r,a=Rn();return n.checks.push({type:qt.DIRECTED_EDGE,source:i,target:a}),sd(e,r,n),e.edgeCount++,a}else{var s=Rn(),o=r,l=Rn();return s.checks.push({type:qt.NODE_SOURCE,source:o,target:l}),sd(e,r,s),e.edgeCount++,l}}},{name:"undirectedEdge",separator:!0,regex:an.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var n=Rn(),i=r,a=Rn();return n.checks.push({type:qt.UNDIRECTED_EDGE,nodes:[i,a]}),sd(e,r,n),e.edgeCount++,a}else{var s=Rn(),o=r,l=Rn();return s.checks.push({type:qt.NODE_NEIGHBOR,node:o,neighbor:l}),sd(e,r,s),l}}},{name:"child",separator:!0,regex:an.child,populate:function(e,r){if(e.currentSubject==null){var n=Rn(),i=Rn(),a=e[e.length-1];return n.checks.push({type:qt.CHILD,parent:a,child:i}),sd(e,r,n),e.compoundCount++,i}else if(e.currentSubject===r){var s=Rn(),o=e[e.length-1],l=Rn(),u=Rn(),h=Rn(),d=Rn();return s.checks.push({type:qt.COMPOUND_SPLIT,left:o,right:l,subject:u}),u.checks=r.checks,r.checks=[{type:qt.TRUE}],d.checks.push({type:qt.TRUE}),l.checks.push({type:qt.PARENT,parent:d,child:h}),sd(e,o,s),e.currentSubject=u,e.compoundCount++,h}else{var f=Rn(),p=Rn(),g=[{type:qt.PARENT,parent:f,child:p}];return f.checks=r.checks,r.checks=g,e.compoundCount++,p}}},{name:"descendant",separator:!0,regex:an.descendant,populate:function(e,r){if(e.currentSubject==null){var n=Rn(),i=Rn(),a=e[e.length-1];return n.checks.push({type:qt.DESCENDANT,ancestor:a,descendant:i}),sd(e,r,n),e.compoundCount++,i}else if(e.currentSubject===r){var s=Rn(),o=e[e.length-1],l=Rn(),u=Rn(),h=Rn(),d=Rn();return s.checks.push({type:qt.COMPOUND_SPLIT,left:o,right:l,subject:u}),u.checks=r.checks,r.checks=[{type:qt.TRUE}],d.checks.push({type:qt.TRUE}),l.checks.push({type:qt.ANCESTOR,ancestor:d,descendant:h}),sd(e,o,s),e.currentSubject=u,e.compoundCount++,h}else{var f=Rn(),p=Rn(),g=[{type:qt.ANCESTOR,ancestor:f,descendant:p}];return f.checks=r.checks,r.checks=g,e.compoundCount++,p}}},{name:"subject",modifier:!0,regex:an.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return Cn("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=r;var n=e[e.length-1],i=n.checks[0],a=i==null?null:i.type;a===qt.DIRECTED_EDGE?i.type=qt.NODE_TARGET:a===qt.UNDIRECTED_EDGE&&(i.type=qt.NODE_NEIGHBOR,i.node=i.nodes[1],i.neighbor=i.nodes[0],i.nodes=null)}}];lP.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var jft=function(e){for(var r,n,i,a=0;a<lP.length;a++){var s=lP[a],o=s.name,l=e.match(s.regexObj);if(l!=null){n=l,r=s,i=o;var u=l[0];e=e.substring(u.length);break}}return{expr:r,match:n,name:i,remaining:e}},Kft=function(e){var r=e.match(/^\s+/);if(r){var n=r[0];e=e.substring(n.length)}return e},Zft=function(e){var r=this,n=r.inputText=e,i=r[0]=Rn();for(r.length=1,n=Kft(n);;){var a=jft(n);if(a.expr==null)return Cn("The selector `"+e+"`is invalid"),!1;var s=a.match.slice(1),o=a.expr.populate(r,i,s);if(o===!1)return!1;if(o!=null&&(i=o),n=a.remaining,n.match(/^\s*$/))break}var l=r[r.length-1];r.currentSubject!=null&&(l.subject=r.currentSubject),l.edgeCount=r.edgeCount,l.compoundCount=r.compoundCount;for(var u=0;u<r.length;u++){var h=r[u];if(h.compoundCount>0&&h.edgeCount>0)return Cn("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return Cn("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&Cn("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},Qft=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return or(h)?'"'+h+'"':e(h)},n=function(h){return" "+h+" "},i=function(h,d){var f=h.type,p=h.value;switch(f){case qt.GROUP:{var g=e(p);return g.substring(0,g.length-1)}case qt.DATA_COMPARE:{var m=h.field,y=h.operator;return"["+m+n(e(y))+r(p)+"]"}case qt.DATA_BOOL:{var v=h.operator,T=h.field;return"["+e(v)+T+"]"}case qt.DATA_EXIST:{var b=h.field;return"["+b+"]"}case qt.META_COMPARE:{var w=h.operator,C=h.field;return"[["+C+n(e(w))+r(p)+"]]"}case qt.STATE:return p;case qt.ID:return"#"+p;case qt.CLASS:return"."+p;case qt.PARENT:case qt.CHILD:return a(h.parent,d)+n(">")+a(h.child,d);case qt.ANCESTOR:case qt.DESCENDANT:return a(h.ancestor,d)+" "+a(h.descendant,d);case qt.COMPOUND_SPLIT:{var S=a(h.left,d),k=a(h.subject,d),E=a(h.right,d);return S+(S.length>0?" ":"")+k+E}case qt.TRUE:return""}},a=function(h,d){return h.checks.reduce(function(f,p,g){return f+(d===h&&g===0?"$":"")+i(p,d)},"")},s="",o=0;o<this.length;o++){var l=this[o];s+=a(l,l.subject),this.length>1&&o<this.length-1&&(s+=", ")}return this.toStringCache=s,s},Jft={parse:Zft,toString:Qft},Ive=function(e,r,n){var i,a=or(e),s=Dt(e),o=or(n),l,u,h=!1,d=!1,f=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),h=!0),(a||o||h)&&(l=!a&&!s?"":""+e,u=""+n),h&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),r){case"*=":i=l.indexOf(u)>=0;break;case"$=":i=l.indexOf(u,l.length-u.length)>=0;break;case"^=":i=l.indexOf(u)===0;break;case"=":i=e===n;break;case">":f=!0,i=e>n;break;case">=":f=!0,i=e>=n;break;case"<":f=!0,i=e<n;break;case"<=":f=!0,i=e<=n;break;default:i=!1;break}return d&&(e!=null||!f)&&(i=!i),i},ept=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},tpt=function(e){return e!==void 0},JG=function(e,r){return e.data(r)},rpt=function(e,r){return e[r]()},_i=[],Qn=function(e,r){return e.checks.every(function(n){return _i[n.type](n,r)})};_i[qt.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()};_i[qt.STATE]=function(t,e){var r=t.value;return Yft(r,e)};_i[qt.ID]=function(t,e){var r=t.value;return e.id()===r};_i[qt.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)};_i[qt.META_COMPARE]=function(t,e){var r=t.field,n=t.operator,i=t.value;return Ive(rpt(e,r),n,i)};_i[qt.DATA_COMPARE]=function(t,e){var r=t.field,n=t.operator,i=t.value;return Ive(JG(e,r),n,i)};_i[qt.DATA_BOOL]=function(t,e){var r=t.field,n=t.operator;return ept(JG(e,r),n)};_i[qt.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,tpt(JG(e,r))};_i[qt.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],n=t.nodes[1],i=e.source(),a=e.target();return Qn(r,i)&&Qn(n,a)||Qn(n,i)&&Qn(r,a)};_i[qt.NODE_NEIGHBOR]=function(t,e){return Qn(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&Qn(t.neighbor,r)})};_i[qt.DIRECTED_EDGE]=function(t,e){return Qn(t.source,e.source())&&Qn(t.target,e.target())};_i[qt.NODE_SOURCE]=function(t,e){return Qn(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&Qn(t.target,r)})};_i[qt.NODE_TARGET]=function(t,e){return Qn(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&Qn(t.source,r)})};_i[qt.CHILD]=function(t,e){return Qn(t.child,e)&&Qn(t.parent,e.parent())};_i[qt.PARENT]=function(t,e){return Qn(t.parent,e)&&e.children().some(function(r){return Qn(t.child,r)})};_i[qt.DESCENDANT]=function(t,e){return Qn(t.descendant,e)&&e.ancestors().some(function(r){return Qn(t.ancestor,r)})};_i[qt.ANCESTOR]=function(t,e){return Qn(t.ancestor,e)&&e.descendants().some(function(r){return Qn(t.descendant,r)})};_i[qt.COMPOUND_SPLIT]=function(t,e){return Qn(t.subject,e)&&Qn(t.left,e)&&Qn(t.right,e)};_i[qt.TRUE]=function(){return!0};_i[qt.COLLECTION]=function(t,e){var r=t.value;return r.has(e)};_i[qt.FILTER]=function(t,e){var r=t.value;return r(e)};var npt=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===qt.ID)return e.getElementById(r[0].checks[0].value).collection();var n=function(a){for(var s=0;s<r.length;s++){var o=r[s];if(Qn(o,a))return!0}return!1};return r.text()==null&&(n=function(){return!0}),e.filter(n)},ipt=function(e){for(var r=this,n=0;n<r.length;n++){var i=r[n];if(Qn(i,e))return!0}return!1},apt={matches:ipt,filter:npt},hf=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||or(e)&&e.match(/^\s*$/)||(Po(e)?this.addQuery({checks:[{type:qt.COLLECTION,value:e.collection()}]}):gi(e)?this.addQuery({checks:[{type:qt.FILTER,value:e}]}):or(e)?this.parse(e)||(this.invalid=!0):oi("A selector must be created from a string; found "))},df=hf.prototype;[Jft,apt].forEach(function(t){return dr(df,t)});df.text=function(){return this.inputText};df.size=function(){return this.length};df.eq=function(t){return this[t]};df.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()};df.addQuery=function(t){this[this.length++]=t};df.selector=df.toString;var Hd={allAre:function(e){var r=new hf(e);return this.every(function(n){return r.matches(n)})},is:function(e){var r=new hf(e);return this.some(function(n){return r.matches(n)})},some:function(e,r){for(var n=0;n<this.length;n++){var i=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(i)return!0}return!1},every:function(e,r){for(var n=0;n<this.length;n++){var i=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(!i)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var r=this.length,n=e.length;return r!==n?!1:r===1?this[0]===e[0]:this.every(function(i){return e.hasElementWithId(i.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(r){return e.hasElementWithId(r.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var r=this.neighborhood();return e.every(function(n){return r.hasElementWithId(n.id())})},contains:function(e){e=this.cy().collection(e);var r=this;return e.every(function(n){return r.hasElementWithId(n.id())})}};Hd.allAreNeighbours=Hd.allAreNeighbors;Hd.has=Hd.contains;Hd.equal=Hd.equals=Hd.same;var pl=function(e,r){return function(i,a,s,o){var l=i,u=this,h;if(l==null?h="":Po(l)&&l.length===1&&(h=l.id()),u.length===1&&h){var d=u[0]._private,f=d.traversalCache=d.traversalCache||{},p=f[r]=f[r]||[],g=z0(h),m=p[g];return m||(p[g]=e.call(u,i,a,s,o))}else return e.call(u,i,a,s,o)}},qb={parent:function(e){var r=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var i=0;i<this.length;i++){var a=this[i],s=a._private.parent;s&&r.push(s)}return this.spawn(r,!0).filter(e)},parents:function(e){for(var r=[],n=this.parent();n.nonempty();){for(var i=0;i<n.length;i++){var a=n[i];r.push(a)}n=n.parent()}return this.spawn(r,!0).filter(e)},commonAncestors:function(e){for(var r,n=0;n<this.length;n++){var i=this[n],a=i.parents();r=r||a,r=r.intersect(a)}return r.filter(e)},orphans:function(e){return this.stdFilter(function(r){return r.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(r){return r.isChild()}).filter(e)},children:pl(function(t){for(var e=[],r=0;r<this.length;r++)for(var n=this[r],i=n._private.children,a=0;a<i.length;a++)e.push(i[a]);return this.spawn(e,!0).filter(t)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var r=[];function n(i){for(var a=0;a<i.length;a++){var s=i[a];r.push(s),s.children().nonempty()&&n(s.children())}}return n(this.children()),this.spawn(r,!0).filter(e)}};function eW(t,e,r,n){for(var i=[],a=new Rx,s=t.cy(),o=s.hasCompoundNodes(),l=0;l<t.length;l++){var u=t[l];r?i.push(u):o&&n(i,a,u)}for(;i.length>0;){var h=i.shift();e(h),a.add(h.id()),o&&n(i,a,h)}return t}function Nve(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i<n.length;i++){var a=n[i];e.has(a.id())||t.push(a)}}qb.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return eW(this,t,e,Nve)};function Dve(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}qb.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return eW(this,t,e,Dve)};function spt(t,e,r){Dve(t,e,r),Nve(t,e,r)}qb.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return eW(this,t,e,spt)};qb.ancestors=qb.parents;var ik,Ove;ik=Ove={data:Tn.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Tn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Tn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Tn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Tn.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Tn.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};ik.attr=ik.data;ik.removeAttr=ik.removeData;var opt=Ove,hL={};function K8(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,i=r[0],a=i._private.edges,s=0;s<a.length;s++){var o=a[s];!e&&o.isLoop()||(n+=t(i,o))}return n}else return}}dr(hL,{degree:K8(function(t,e){return e.source().same(e.target())?2:1}),indegree:K8(function(t,e){return e.target().same(t)?1:0}),outdegree:K8(function(t,e){return e.source().same(t)?1:0})});function Kg(t,e){return function(r){for(var n,i=this.nodes(),a=0;a<i.length;a++){var s=i[a],o=s[t](r);o!==void 0&&(n===void 0||e(o,n))&&(n=o)}return n}}dr(hL,{minDegree:Kg("degree",function(t,e){return t<e}),maxDegree:Kg("degree",function(t,e){return t>e}),minIndegree:Kg("indegree",function(t,e){return t<e}),maxIndegree:Kg("indegree",function(t,e){return t>e}),minOutdegree:Kg("outdegree",function(t,e){return t<e}),maxOutdegree:Kg("outdegree",function(t,e){return t>e})});dr(hL,{totalDegree:function(e){for(var r=0,n=this.nodes(),i=0;i<n.length;i++)r+=n[i].degree(e);return r}});var Jl,$ve,Pve=function(e,r,n){for(var i=0;i<e.length;i++){var a=e[i];if(!a.locked()){var s=a._private.position,o={x:r.x!=null?r.x-s.x:0,y:r.y!=null?r.y-s.y:0};a.isParent()&&!(o.x===0&&o.y===0)&&a.children().shift(o,n),a.dirtyBoundingBoxCache()}}},Mee={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,r){Pve(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};Jl=$ve={position:Tn.data(Mee),silentPosition:Tn.data(dr({},Mee,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){Pve(e,r,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,r){if(ln(e))r?this.silentPosition(e):this.position(e);else if(gi(e)){var n=e,i=this.cy();i.startBatch();for(var a=0;a<this.length;a++){var s=this[a],o=void 0;(o=n(s,a))&&(r?s.silentPosition(o):s.position(o))}i.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,n){var i;if(ln(e)?(i={x:Dt(e.x)?e.x:0,y:Dt(e.y)?e.y:0},n=r):or(e)&&Dt(r)&&(i={x:0,y:0},i[e]=r),i!=null){var a=this.cy();a.startBatch();for(var s=0;s<this.length;s++){var o=this[s];if(!(a.hasCompoundNodes()&&o.isChild()&&o.ancestors().anySame(this))){var l=o.position(),u={x:l.x+i.x,y:l.y+i.y};n?o.silentPosition(u):o.position(u)}}a.endBatch()}return this},silentShift:function(e,r){return ln(e)?this.shift(e,!0):or(e)&&Dt(r)&&this.shift(e,r,!0),this},renderedPosition:function(e,r){var n=this[0],i=this.cy(),a=i.zoom(),s=i.pan(),o=ln(e)?e:void 0,l=o!==void 0||r!==void 0&&or(e);if(n&&n.isNode())if(l)for(var u=0;u<this.length;u++){var h=this[u];r!==void 0?h.position(e,(r-s[e])/a):o!==void 0&&h.position(hve(o,a,s))}else{var d=n.position();return o=aL(d,a,s),e===void 0?o:o[e]}else if(!l)return;return this},relativePosition:function(e,r){var n=this[0],i=this.cy(),a=ln(e)?e:void 0,s=a!==void 0||r!==void 0&&or(e),o=i.hasCompoundNodes();if(n&&n.isNode())if(s)for(var l=0;l<this.length;l++){var u=this[l],h=o?u.parent():null,d=h&&h.length>0,f=d;d&&(h=h[0]);var p=f?h.position():{x:0,y:0};r!==void 0?u.position(e,r+p[e]):a!==void 0&&u.position({x:a.x+p.x,y:a.y+p.y})}else{var g=n.position(),m=o?n.parent():null,y=m&&m.length>0,v=y;y&&(m=m[0]);var T=v?m.position():{x:0,y:0};return a={x:g.x-T.x,y:g.y-T.y},e===void 0?a:a[e]}else if(!s)return;return this}};Jl.modelPosition=Jl.point=Jl.position;Jl.modelPositions=Jl.points=Jl.positions;Jl.renderedPoint=Jl.renderedPosition;Jl.relativePoint=Jl.relativePosition;var lpt=$ve,Ub=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},Yb=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},cpt=function(e){switch(e){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}},wy,Lf;wy=Lf={};Lf.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),i=r.pan(),a=e.x1*n+i.x,s=e.x2*n+i.x,o=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:a,x2:s,y1:o,y2:l,w:s-a,h:l-o}};Lf.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)};Lf.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(s){if(!s.isParent())return;var o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=o.position;(d.w===0||d.h===0)&&(d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},d.x1=f.x-d.w/2,d.x2=f.x+d.w/2,d.y1=f.y-d.h/2,d.y2=f.y+d.h/2);function p(_,M,L){var P=0,D=0,R=M+L;return _>0&&R>0&&(P=M/R*_,D=L/R*_),{biasDiff:P,biasComplementDiff:D}}function g(_,M,L,P){if(L.units==="%")switch(P){case"width":return _>0?L.pfValue*_:0;case"height":return M>0?L.pfValue*M:0;case"average":return _>0&&M>0?L.pfValue*(_+M)/2:0;case"min":return _>0&&M>0?_>M?L.pfValue*M:L.pfValue*_:0;case"max":return _>0&&M>0?_>M?L.pfValue*_:L.pfValue*M:0;default:return 0}else return L.units==="px"?L.pfValue:0}var m=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(m=m*100/h.width.val);var y=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(y=y*100/h.width.val);var v=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(v=v*100/h.height.val);var T=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(T=T*100/h.height.val);var b=p(h.width.val-d.w,m,y),w=b.biasDiff,C=b.biasComplementDiff,S=p(h.height.val-d.h,v,T),k=S.biasDiff,E=S.biasComplementDiff;o.autoPadding=g(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,h.width.val),f.x=(-w+d.x1+d.x2+C)/2,o.autoHeight=Math.max(d.h,h.height.val),f.y=(-k+d.y1+d.y2+E)/2}for(var n=0;n<this.length;n++){var i=this[n],a=i._private;(!a.compoundBoundsClean||t)&&(r(i),e.batching()||(a.compoundBoundsClean=!0))}return this};var ll=function(e){return e===1/0||e===-1/0?0:e},Ol=function(e,r,n,i,a){i-r===0||a-n===0||r==null||n==null||i==null||a==null||(e.x1=r<e.x1?r:e.x1,e.x2=i>e.x2?i:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=a>e.y2?a:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},pd=function(e,r){return r==null?e:Ol(e,r.x1,r.y1,r.x2,r.y2)},fT=function(e,r,n){return Ms(e,r,n)},QE=function(e,r,n){if(!r.cy().headless()){var i=r._private,a=i.rstyle,s=a.arrowWidth/2,o=r.pstyle(n+"-arrow-shape").value,l,u;if(o!=="none"){n==="source"?(l=a.srcX,u=a.srcY):n==="target"?(l=a.tgtX,u=a.tgtY):(l=a.midX,u=a.midY);var h=i.arrowBounds=i.arrowBounds||{},d=h[n]=h[n]||{};d.x1=l-s,d.y1=u-s,d.x2=l+s,d.y2=u+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,o3(d,1),Ol(e,d.x1,d.y1,d.x2,d.y2)}}},Z8=function(e,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var a=r._private,s=a.rstyle,o=r.pstyle(i+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),h=fT(s,"labelWidth",n),d=fT(s,"labelHeight",n),f=fT(s,"labelX",n),p=fT(s,"labelY",n),g=r.pstyle(i+"text-margin-x").pfValue,m=r.pstyle(i+"text-margin-y").pfValue,y=r.isEdge(),v=r.pstyle(i+"text-rotation"),T=r.pstyle("text-outline-width").pfValue,b=r.pstyle("text-border-width").pfValue,w=b/2,C=r.pstyle("text-background-padding").pfValue,S=2,k=d,E=h,_=E/2,M=k/2,L,P,D,R;if(y)L=f-_,P=f+_,D=p-M,R=p+M;else{switch(Ub(l.value)){case"left":L=f-E,P=f;break;case"center":L=f-_,P=f+_;break;case"right":L=f,P=f+E;break}switch(Yb(u.value)){case"top":D=p-k,R=p;break;case"center":D=p-M,R=p+M;break;case"bottom":D=p,R=p+k;break}}var I=g-Math.max(T,w)-C-S,$=g+Math.max(T,w)+C+S,O=m-Math.max(T,w)-C-S,N=m+Math.max(T,w)+C+S;L+=I,P+=$,D+=O,R+=N;var F=n||"main",z=a.labelBounds,V=z[F]=z[F]||{};V.x1=L,V.y1=D,V.x2=P,V.y2=R,V.w=P-L,V.h=R-D,V.leftPad=I,V.rightPad=$,V.topPad=O,V.botPad=N;var B=y&&v.strValue==="autorotate",G=v.pfValue!=null&&v.pfValue!==0;if(B||G){var H=B?fT(a.rstyle,"labelAngle",n):v.pfValue,q=Math.cos(H),Z=Math.sin(H),Y=(L+P)/2,ie=(D+R)/2;if(!y){switch(Ub(l.value)){case"left":Y=P;break;case"right":Y=L;break}switch(Yb(u.value)){case"top":ie=R;break;case"bottom":ie=D;break}}var K=function(Be,ce){return Be=Be-Y,ce=ce-ie,{x:Be*q-ce*Z+Y,y:Be*Z+ce*q+ie}},Q=K(L,D),te=K(L,R),J=K(P,D),ge=K(P,R);L=Math.min(Q.x,te.x,J.x,ge.x),P=Math.max(Q.x,te.x,J.x,ge.x),D=Math.min(Q.y,te.y,J.y,ge.y),R=Math.max(Q.y,te.y,J.y,ge.y)}var ee=F+"Rot",Re=z[ee]=z[ee]||{};Re.x1=L,Re.y1=D,Re.x2=P,Re.y2=R,Re.w=P-L,Re.h=R-D,Ol(e,L,D,P,R),Ol(a.labelBounds.all,L,D,P,R)}return e}},Iee=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,i=r.pstyle("outline-width").value,a=r.pstyle("outline-offset").value,s=i+a;Bve(e,r,n,s,"outside",s/2)}},Bve=function(e,r,n,i,a,s){if(!(n===0||i<=0||a==="inside")){var o=r.cy(),l=o.renderer(),u=l.nodeShapes[l.getNodeShape(r)];if(u){var h=r.position(),d=h.x,f=h.y,p=r.width(),g=r.height();if(u.hasMiterBounds){a==="center"&&(i/=2);var m=u.miterBounds(d,f,p,g,i);pd(e,m)}else s!=null&&s>0&&l3(e,[s,s,s,s])}}},upt=function(e,r){if(!r.cy().headless()){var n=r.pstyle("border-opacity").value,i=r.pstyle("border-width").pfValue,a=r.pstyle("border-position").value;Bve(e,r,n,i,a)}},hpt=function(e,r){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),s=Us(),o=e._private,l=e.isNode(),u=e.isEdge(),h,d,f,p,g,m,y=o.rstyle,v=l&&i?e.pstyle("bounds-expansion").pfValue:[0],T=function(Ie){return Ie.pstyle("display").value!=="none"},b=!i||T(e)&&(!u||T(e.source())&&T(e.target()));if(b){var w=0,C=0;i&&r.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(C=e.pstyle("overlay-padding").value));var S=0,k=0;i&&r.includeUnderlays&&(S=e.pstyle("underlay-opacity").value,S!==0&&(k=e.pstyle("underlay-padding").value));var E=Math.max(C,k),_=0,M=0;if(i&&(_=e.pstyle("width").pfValue,M=_/2),l&&r.includeNodes){var L=e.position();g=L.x,m=L.y;var P=e.outerWidth(),D=P/2,R=e.outerHeight(),I=R/2;h=g-D,d=g+D,f=m-I,p=m+I,Ol(s,h,f,d,p),i&&Iee(s,e),i&&r.includeOutlines&&!a&&Iee(s,e),i&&upt(s,e)}else if(u&&r.includeEdges)if(i&&!a){var $=e.pstyle("curve-style").strValue;if(h=Math.min(y.srcX,y.midX,y.tgtX),d=Math.max(y.srcX,y.midX,y.tgtX),f=Math.min(y.srcY,y.midY,y.tgtY),p=Math.max(y.srcY,y.midY,y.tgtY),h-=M,d+=M,f-=M,p+=M,Ol(s,h,f,d,p),$==="haystack"){var O=y.haystackPts;if(O&&O.length===2){if(h=O[0].x,f=O[0].y,d=O[1].x,p=O[1].y,h>d){var N=h;h=d,d=N}if(f>p){var F=f;f=p,p=F}Ol(s,h-M,f-M,d+M,p+M)}}else if($==="bezier"||$==="unbundled-bezier"||Nd($,"segments")||Nd($,"taxi")){var z;switch($){case"bezier":case"unbundled-bezier":z=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":z=y.linePts;break}if(z!=null)for(var V=0;V<z.length;V++){var B=z[V];h=B.x-M,d=B.x+M,f=B.y-M,p=B.y+M,Ol(s,h,f,d,p)}}}else{var G=e.source(),H=G.position(),q=e.target(),Z=q.position();if(h=H.x,d=Z.x,f=H.y,p=Z.y,h>d){var Y=h;h=d,d=Y}if(f>p){var ie=f;f=p,p=ie}h-=M,d+=M,f-=M,p+=M,Ol(s,h,f,d,p)}if(i&&r.includeEdges&&u&&(QE(s,e,"mid-source"),QE(s,e,"mid-target"),QE(s,e,"source"),QE(s,e,"target")),i){var K=e.pstyle("ghost").value==="yes";if(K){var Q=e.pstyle("ghost-offset-x").pfValue,te=e.pstyle("ghost-offset-y").pfValue;Ol(s,s.x1+Q,s.y1+te,s.x2+Q,s.y2+te)}}var J=o.bodyBounds=o.bodyBounds||{};yJ(J,s),l3(J,v),o3(J,1),i&&(h=s.x1,d=s.x2,f=s.y1,p=s.y2,Ol(s,h-E,f-E,d+E,p+E));var ge=o.overlayBounds=o.overlayBounds||{};yJ(ge,s),l3(ge,v),o3(ge,1);var ee=o.labelBounds=o.labelBounds||{};ee.all!=null?qht(ee.all):ee.all=Us(),i&&r.includeLabels&&(r.includeMainLabels&&Z8(s,e,null),u&&(r.includeSourceLabels&&Z8(s,e,"source"),r.includeTargetLabels&&Z8(s,e,"target")))}return s.x1=ll(s.x1),s.y1=ll(s.y1),s.x2=ll(s.x2),s.y2=ll(s.y2),s.w=ll(s.x2-s.x1),s.h=ll(s.y2-s.y1),s.w>0&&s.h>0&&b&&(l3(s,v),o3(s,1)),s},Fve=function(e){var r=0,n=function(s){return(s?1:0)<<r++},i=0;return i+=n(e.incudeNodes),i+=n(e.includeEdges),i+=n(e.includeLabels),i+=n(e.includeMainLabels),i+=n(e.includeSourceLabels),i+=n(e.includeTargetLabels),i+=n(e.includeOverlays),i+=n(e.includeOutlines),i},zve=function(e){var r=function(o){return Math.round(o)};if(e.isEdge()){var n=e.source().position(),i=e.target().position();return hJ([r(n.x),r(n.y),r(i.x),r(i.y)])}else{var a=e.position();return hJ([r(a.x),r(a.y)])}},Nee=function(e,r){var n=e._private,i,a=e.isEdge(),s=r==null?Dee:Fve(r),o=s===Dee;if(n.bbCache==null?(i=hpt(e,ak),n.bbCache=i,n.bbCachePosKey=zve(e)):i=n.bbCache,!o){var l=e.isNode();i=Us(),(r.includeNodes&&l||r.includeEdges&&!l)&&(r.includeOverlays?pd(i,n.overlayBounds):pd(i,n.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!a||r.includeSourceLabels&&r.includeTargetLabels)?pd(i,n.labelBounds.all):(r.includeMainLabels&&pd(i,n.labelBounds.mainRot),r.includeSourceLabels&&pd(i,n.labelBounds.sourceRot),r.includeTargetLabels&&pd(i,n.labelBounds.targetRot))),i.w=i.x2-i.x1,i.h=i.y2-i.y1}return i},ak={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},Dee=Fve(ak),Oee=ts(ak);Lf.boundingBox=function(t){var e,r=t===void 0||t.useCache===void 0||t.useCache===!0,n=Wb(function(h){var d=h._private;return d.bbCache==null||d.styleDirty||d.bbCachePosKey!==zve(h)},function(h){return h.id()});if(r&&this.length===1&&!n(this[0]))t===void 0?t=ak:t=Oee(t),e=Nee(this[0],t);else{e=Us(),t=t||ak;var i=Oee(t),a=this,s=a.cy(),o=s.styleEnabled();this.edges().forEach(n),this.nodes().forEach(n),o&&this.recalculateRenderedStyle(r),this.updateCompoundBounds(!r);for(var l=0;l<a.length;l++){var u=a[l];n(u)&&u.dirtyBoundingBoxCache(),pd(e,Nee(u,i))}}return e.x1=ll(e.x1),e.y1=ll(e.y1),e.x2=ll(e.x2),e.y2=ll(e.y2),e.w=ll(e.x2-e.x1),e.h=ll(e.y2-e.y1),e};Lf.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this};Lf.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),n=r.hasCompoundNodes(),i=r.collection();if(n&&(i=e.filter(function(u){return u.isParent()}),e=e.not(i)),ln(t)){var a=t;t=function(){return a}}var s=function(h,d){return h._private.bbAtOldPos=t(h,d)},o=function(h){return h._private.bbAtOldPos};r.startBatch(),e.forEach(s).silentPositions(t),n&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0));var l=Hht(this.boundingBox({useCache:!1}));return e.silentPositions(o),n&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),r.endBatch(),l};wy.boundingbox=wy.bb=wy.boundingBox;wy.renderedBoundingbox=wy.renderedBoundingBox;var dpt=Lf,ew,vS;ew=vS={};var Vve=function(e){e.uppercaseName=KQ(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=KQ(e.outerName),ew[e.name]=function(){var n=this[0],i=n._private,a=i.cy,s=a._private.styleEnabled;if(n)if(s){if(n.isParent())return n.updateCompoundBounds(),i[e.autoName]||0;var o=n.pstyle(e.name);switch(o.strValue){case"label":return n.recalculateRenderedStyle(),i.rstyle[e.labelName]||0;default:return o.pfValue}}else return 1},ew["outer"+e.uppercaseName]=function(){var n=this[0],i=n._private,a=i.cy,s=a._private.styleEnabled;if(n)if(s){var o=n[e.name](),l=n.pstyle("border-position").value,u;l==="center"?u=n.pstyle("border-width").pfValue:l==="outside"?u=2*n.pstyle("border-width").pfValue:u=0;var h=2*n.padding();return o+u+h}else return 1},ew["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var i=n[e.name]();return i*this.cy().zoom()}},ew["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var i=n[e.outerName]();return i*this.cy().zoom()}}};Vve({name:"width"});Vve({name:"height"});vS.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue};vS.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()};vS.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var fpt=vS,ppt=function(e,r){if(e.isEdge()&&e.takesUpSpace())return r(e)},gpt=function(e,r){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy();return aL(r(e),n.zoom(),n.pan())}},mpt=function(e,r){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy(),i=n.pan(),a=n.zoom();return r(e).map(function(s){return aL(s,a,i)})}},ypt=function(e){return e.renderer().getControlPoints(e)},vpt=function(e){return e.renderer().getSegmentPoints(e)},bpt=function(e){return e.renderer().getSourceEndpoint(e)},xpt=function(e){return e.renderer().getTargetEndpoint(e)},Tpt=function(e){return e.renderer().getEdgeMidpoint(e)},$ee={controlPoints:{get:ypt,mult:!0},segmentPoints:{get:vpt,mult:!0},sourceEndpoint:{get:bpt},targetEndpoint:{get:xpt},midpoint:{get:Tpt}},wpt=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},Cpt=Object.keys($ee).reduce(function(t,e){var r=$ee[e],n=wpt(e);return t[e]=function(){return ppt(this,r.get)},r.mult?t[n]=function(){return mpt(this,r.get)}:t[n]=function(){return gpt(this,r.get)},t},{}),kpt=dr({},lpt,dpt,fpt,Cpt);/*!
Event object based on jQuery events, MIT license
https://jquery.org/license/
https://tldrlegal.com/license/mit-license
https://github.com/jquery/jquery/blob/master/src/event.js
*/var Gve=function(e,r){this.recycle(e,r)};function pT(){return!1}function JE(){return!0}Gve.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=pT,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?JE:pT):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,i=this.cy.zoom(),a=this.cy.pan();this.renderedPosition={x:n.x*i+a.x,y:n.y*i+a.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=JE;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=JE;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=JE,this.stopPropagation()},isDefaultPrevented:pT,isPropagationStopped:pT,isImmediatePropagationStopped:pT};var Wve=/^([^.]+)(\.(?:[^.]+))?$/,Spt=".*",Hve={qualifierCompare:function(e,r){return e===r},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},Pee=Object.keys(Hve),Ept={};function dL(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ept,e=arguments.length>1?arguments[1]:void 0,r=0;r<Pee.length;r++){var n=Pee[r];this[n]=t[n]||Hve[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var ff=dL.prototype,qve=function(e,r,n,i,a,s,o){gi(i)&&(a=i,i=null),o&&(s==null?s=o:s=dr({},s,o));for(var l=Nn(n)?n:n.split(/\s+/),u=0;u<l.length;u++){var h=l[u];if(!lf(h)){var d=h.match(Wve);if(d){var f=d[1],p=d[2]?d[2]:null,g=r(e,h,f,p,i,a,s);if(g===!1)break}}}},Bee=function(e,r){return e.addEventFields(e.context,r),new Gve(r.type,r)},Apt=function(e,r,n){if(Iut(n)){r(e,n);return}else if(ln(n)){r(e,Bee(e,n));return}for(var i=Nn(n)?n:n.split(/\s+/),a=0;a<i.length;a++){var s=i[a];if(!lf(s)){var o=s.match(Wve);if(o){var l=o[1],u=o[2]?o[2]:null,h=Bee(e,{type:l,namespace:u,target:e.context});r(e,h)}}}};ff.on=ff.addListener=function(t,e,r,n,i){return qve(this,function(a,s,o,l,u,h,d){gi(h)&&a.listeners.push({event:s,callback:h,type:o,namespace:l,qualifier:u,conf:d})},t,e,r,n,i),this};ff.one=function(t,e,r,n){return this.on(t,e,r,n,{one:!0})};ff.removeListener=ff.off=function(t,e,r,n){var i=this;this.emitting!==0&&(this.listeners=pht(this.listeners));for(var a=this.listeners,s=function(u){var h=a[u];qve(i,function(d,f,p,g,m,y){if((h.type===p||t==="*")&&(!g&&h.namespace!==".*"||h.namespace===g)&&(!m||d.qualifierCompare(h.qualifier,m))&&(!y||h.callback===y))return a.splice(u,1),!1},t,e,r,n)},o=a.length-1;o>=0;o--)s(o);return this};ff.removeAllListeners=function(){return this.removeListener("*")};ff.emit=ff.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,Nn(e)||(e=[e]),Apt(this,function(a,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],i=n.length);for(var o=function(){var h=n[l];if(h.type===s.type&&(!h.namespace||h.namespace===s.namespace||h.namespace===Spt)&&a.eventMatches(a.context,h,s)){var d=[s];e!=null&&mht(d,e),a.beforeEmit(a.context,h,s),h.conf&&h.conf.one&&(a.listeners=a.listeners.filter(function(g){return g!==h}));var f=a.callbackContext(a.context,h,s),p=h.callback.apply(f,d);a.afterEmit(a.context,h,s),p===!1&&(s.stopPropagation(),s.preventDefault())}},l=0;l<i;l++)o();a.bubble(a.context)&&!s.isPropagationStopped()&&a.parent(a.context).emit(s,e)},t),this.emitting--,this};var _pt={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&dS(n.target)&&i.matches(n.target):!0},addEventFields:function(e,r){r.cy=e.cy(),r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e},beforeEmit:function(e,r){r.conf&&r.conf.once&&r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},e4=function(e){return or(e)?new hf(e):e},Uve={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],n=r._private;n.emitter||(n.emitter=new dL(_pt,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,n){for(var i=e4(r),a=0;a<this.length;a++){var s=this[a];s.emitter().on(e,i,n)}return this},removeListener:function(e,r,n){for(var i=e4(r),a=0;a<this.length;a++){var s=this[a];s.emitter().removeListener(e,i,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var r=this[e];r.emitter().removeAllListeners()}return this},one:function(e,r,n){for(var i=e4(r),a=0;a<this.length;a++){var s=this[a];s.emitter().one(e,i,n)}return this},once:function(e,r,n){for(var i=e4(r),a=0;a<this.length;a++){var s=this[a];s.emitter().on(e,i,n,{once:!0,onceCollection:this})}},emit:function(e,r){for(var n=0;n<this.length;n++){var i=this[n];i.emitter().emit(e,r)}return this},emitAndNotify:function(e,r){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,r),this}};Tn.eventAliasesOn(Uve);var Yve={nodes:function(e){return this.filter(function(r){return r.isNode()}).filter(e)},edges:function(e){return this.filter(function(r){return r.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),r=this.spawn(),n=0;n<this.length;n++){var i=this[n];i.isNode()?e.push(i):r.push(i)}return{nodes:e,edges:r}},filter:function(e,r){if(e===void 0)return this;if(or(e)||Po(e))return new hf(e).filter(this);if(gi(e)){for(var n=this.spawn(),i=this,a=0;a<i.length;a++){var s=i[a],o=r?e.apply(r,[s,a,i]):e(s,a,i);o&&n.push(s)}return n}return this.spawn()},not:function(e){if(e){or(e)&&(e=this.filter(e));for(var r=this.spawn(),n=0;n<this.length;n++){var i=this[n],a=e.has(i);a||r.push(i)}return r}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(or(e)){var r=e;return this.filter(r)}for(var n=this.spawn(),i=this,a=e,s=this.length<e.length,o=s?i:a,l=s?a:i,u=0;u<o.length;u++){var h=o[u];l.has(h)&&n.push(h)}return n},xor:function(e){var r=this._private.cy;or(e)&&(e=r.$(e));var n=this.spawn(),i=this,a=e,s=function(l,u){for(var h=0;h<l.length;h++){var d=l[h],f=d._private.data.id,p=u.hasElementWithId(f);p||n.push(d)}};return s(i,a),s(a,i),n},diff:function(e){var r=this._private.cy;or(e)&&(e=r.$(e));var n=this.spawn(),i=this.spawn(),a=this.spawn(),s=this,o=e,l=function(h,d,f){for(var p=0;p<h.length;p++){var g=h[p],m=g._private.data.id,y=d.hasElementWithId(m);y?a.merge(g):f.push(g)}};return l(s,o,n),l(o,s,i),{left:n,right:i,both:a}},add:function(e){var r=this._private.cy;if(!e)return this;if(or(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=this.spawnSelf(),a=0;a<e.length;a++){var s=e[a],o=!this.has(s);o&&i.push(s)}return i},merge:function(e){var r=this._private,n=r.cy;if(!e)return this;if(e&&or(e)){var i=e;e=n.mutableElements().filter(i)}for(var a=r.map,s=0;s<e.length;s++){var o=e[s],l=o._private.data.id,u=!a.has(l);if(u){var h=this.length++;this[h]=o,a.set(l,{ele:o,index:h})}}return this},unmergeAt:function(e){var r=this[e],n=r.id(),i=this._private,a=i.map;this[e]=void 0,a.delete(n);var s=e===this.length-1;if(this.length>1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,a.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,i=r.map,a=i.get(n);if(!a)return this;var s=a.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&or(e)){var n=e;e=r.mutableElements().filter(n)}for(var i=0;i<e.length;i++)this.unmergeOne(e[i]);return this},unmergeBy:function(e){for(var r=this.length-1;r>=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],i=this,a=0;a<i.length;a++){var s=i[a],o=r?e.apply(r,[s,a,i]):e(s,a,i);n.push(o)}return n},reduce:function(e,r){for(var n=r,i=this,a=0;a<i.length;a++)n=e(n,i[a],a,i);return n},max:function(e,r){for(var n=-1/0,i,a=this,s=0;s<a.length;s++){var o=a[s],l=r?e.apply(r,[o,s,a]):e(o,s,a);l>n&&(n=l,i=o)}return{value:n,ele:i}},min:function(e,r){for(var n=1/0,i,a=this,s=0;s<a.length;s++){var o=a[s],l=r?e.apply(r,[o,s,a]):e(o,s,a);l<n&&(n=l,i=o)}return{value:n,ele:i}}},dn=Yve;dn.u=dn["|"]=dn["+"]=dn.union=dn.or=dn.add;dn["\\"]=dn["!"]=dn["-"]=dn.difference=dn.relativeComplement=dn.subtract=dn.not;dn.n=dn["&"]=dn["."]=dn.and=dn.intersection=dn.intersect;dn["^"]=dn["(+)"]=dn["(-)"]=dn.symmetricDifference=dn.symdiff=dn.xor;dn.fnFilter=dn.filterFn=dn.stdFilter=dn.filter;dn.complement=dn.abscomp=dn.absoluteComplement;var Rpt={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},Xve=function(e,r){var n=e.cy(),i=n.hasCompoundNodes();function a(h){var d=h.pstyle("z-compound-depth");return d.value==="auto"?i?h.zDepth():0:d.value==="bottom"?-1:d.value==="top"?WG:0}var s=a(e)-a(r);if(s!==0)return s;function o(h){var d=h.pstyle("z-index-compare");return d.value==="auto"&&h.isNode()?1:0}var l=o(e)-o(r);if(l!==0)return l;var u=e.pstyle("z-index").value-r.pstyle("z-index").value;return u!==0?u:e.poolIndex()-r.poolIndex()},y_={forEach:function(e,r){if(gi(e))for(var n=this.length,i=0;i<n;i++){var a=this[i],s=r?e.apply(r,[a,i,this]):e(a,i,this);if(s===!1)break}return this},toArray:function(){for(var e=[],r=0;r<this.length;r++)e.push(this[r]);return e},slice:function(e,r){var n=[],i=this.length;r==null&&(r=i),e==null&&(e=0),e<0&&(e=i+e),r<0&&(r=i+r);for(var a=e;a>=0&&a<r&&a<i;a++)n.push(this[a]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!gi(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(Xve)},zDepth:function(){var e=this[0];if(e){var r=e._private,n=r.group;if(n==="nodes"){var i=r.data.parent?e.parents().size():0;return e.isParent()?i:WG-1}else{var a=r.source,s=r.target,o=a.zDepth(),l=s.zDepth();return Math.max(o,l,0)}}}};y_.each=y_.forEach;var Lpt=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":ca(Symbol))!=e&&ca(Symbol.iterator)!=e;r&&(y_[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,s=this.length;return U1e({next:function(){return a<s?i.value=n[a++]:(i.value=void 0,i.done=!0),i}},Symbol.iterator,function(){return this})})};Lpt();var Mpt=ts({nodeDimensionsIncludeLabels:!1}),u3={layoutDimensions:function(e){e=Mpt(e);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();r={w:n.w,h:n.h}}else r={w:this.outerWidth(),h:this.outerHeight()};return(r.w===0||r.h===0)&&(r.w=r.h=1),r},layoutPositions:function(e,r,n){var i=this.nodes().filter(function(C){return!C.isParent()}),a=this.cy(),s=r.eles,o=function(S){return S.id()},l=Wb(n,o);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=function(S,k,E){var _={x:k.x1+k.w/2,y:k.y1+k.h/2},M={x:(E.x-_.x)*S,y:(E.y-_.y)*S};return{x:_.x+M.x,y:_.y+M.y}},h=r.spacingFactor&&r.spacingFactor!==1,d=function(){if(!h)return null;for(var S=Us(),k=0;k<i.length;k++){var E=i[k],_=l(E,k);dve(S,_.x,_.y)}return S},f=d(),p=Wb(function(C,S){var k=l(C,S);if(h){var E=Math.abs(r.spacingFactor);k=u(E,f,k)}return r.transform!=null&&(k=r.transform(C,k)),k},o);if(r.animate){for(var g=0;g<i.length;g++){var m=i[g],y=p(m,g),v=r.animateFilter==null||r.animateFilter(m,g);if(v){var T=m.animation({position:y,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(T)}else m.position(y)}if(r.fit){var b=a.animation({fit:{boundingBox:s.boundingBoxAt(p),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(b)}else if(r.zoom!==void 0&&r.pan!==void 0){var w=a.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(w)}e.animations.forEach(function(C){return C.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),Lx.all(e.animations.map(function(C){return C.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else i.positions(p),r.fit&&a.fit(r.eles,r.padding),r.zoom!=null&&a.zoom(r.zoom),r.pan&&a.pan(r.pan),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var r=this.cy();return r.makeLayout(dr({},e,{eles:this}))}};u3.createLayout=u3.makeLayout=u3.layout;function jve(t,e,r){var n=r._private,i=n.styleCache=n.styleCache||[],a;return(a=i[t])!=null||(a=i[t]=e(r)),a}function fL(t,e){return t=z0(t),function(n){return jve(t,e,n)}}function pL(t,e){t=z0(t);var r=function(i){return e.call(i)};return function(){var i=this[0];if(i)return jve(t,r,i)}}var Ka={recalculateRenderedStyle:function(e){var r=this.cy(),n=r.renderer(),i=r.styleEnabled();return n&&i&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),r=function(a){return a._private.styleCache=null};if(e.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents()),n.merge(n.connectedEdges()),n.forEach(r)}else this.forEach(function(i){r(i),i.connectedEdges().forEach(r)});return this},updateStyle:function(e){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching()){var n=r._private.batchStyleEles;return n.merge(this),this}var i=r.hasCompoundNodes(),a=this;e=!!(e||e===void 0),i&&(a=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var s=a;return e?s.emitAndNotify("style"):s.emit("style"),a.forEach(function(o){return o._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var r=0;r<this.length;r++){var n=this[r];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],i=n.cy();if(i.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,i.style().apply(n));var a=n._private.style[e];return a??(r?i.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,a=n.style();if(ln(e)){var s=e;a.applyBypass(this,s,i),this.emitAndNotify("style")}else if(or(e))if(r===void 0){var o=this[0];return o?a.getStylePropertyValue(o,e):void 0}else a.applyBypass(this,e,r,i),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?a.getRawStyle(l):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,i=r.style(),a=this;if(e===void 0)for(var s=0;s<a.length;s++){var o=a[s];i.removeAllBypasses(o,n)}else{e=e.split(/\s+/);for(var l=0;l<a.length;l++){var u=a[l];i.removeBypasses(u,e,n)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var r=e.hasCompoundNodes(),n=this[0];if(n){var i=n._private,a=n.pstyle("opacity").value;if(!r)return a;var s=i.data.parent?n.parents():null;if(s)for(var o=0;o<s.length;o++){var l=s[o],u=l.pstyle("opacity").value;a=u*a}return a}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0],n=r.cy().hasCompoundNodes();if(r)return n?r.effectiveOpacity()===0:r.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0];return!!r._private.backgrounding}};function Q8(t,e){var r=t._private,n=r.data.parent?t.parents():null;if(n)for(var i=0;i<n.length;i++){var a=n[i];if(!e(a))return!1}return!0}function tW(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,n=t.parentOk||t.ok;return function(){var i=this.cy();if(!i.styleEnabled())return!0;var a=this[0],s=i.hasCompoundNodes();if(a){var o=a._private;if(!e(a))return!1;if(a.isNode())return!s||Q8(a,n);var l=o.source,u=o.target;return r(l)&&(!s||Q8(l,r))&&(l===u||r(u)&&(!s||Q8(u,r)))}}}var Mx=fL("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});Ka.takesUpSpace=pL("takesUpSpace",tW({ok:Mx}));var Ipt=fL("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Mx(t)}),Npt=fL("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Mx(t)});Ka.interactive=pL("interactive",tW({ok:Ipt,parentOk:Npt,edgeOkViaNode:Mx}));Ka.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var Dpt=fL("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Mx(t)}),Opt=Mx;Ka.visible=pL("visible",tW({ok:Dpt,edgeOkViaNode:Opt}));Ka.hidden=function(){var t=this[0];if(t)return!t.visible()};Ka.isBundledBezier=pL("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});Ka.bypass=Ka.css=Ka.style;Ka.renderedCss=Ka.renderedStyle;Ka.removeBypass=Ka.removeCss=Ka.removeStyle;Ka.pstyle=Ka.parsedStyle;var qd={};function Fee(t){return function(){var e=arguments,r=[];if(e.length===2){var n=e[0],i=e[1];this.on(t.event,n,i)}else if(e.length===1&&gi(e[0])){var a=e[0];this.on(t.event,a)}else if(e.length===0||e.length===1&&Nn(e[0])){for(var s=e.length===1?e[0]:null,o=0;o<this.length;o++){var l=this[o],u=!t.ableField||l._private[t.ableField],h=l._private[t.field]!=t.value;if(t.overrideAble){var d=t.overrideAble(l);if(d!==void 0&&(u=d,!d))return this}u&&(l._private[t.field]=t.value,h&&r.push(l))}var f=this.spawn(r);f.updateStyle(),f.emit(t.event),s&&f.emit(s)}return this}}function Ix(t){qd[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(r!==void 0)return r}return e._private[t.field]}},qd[t.on]=Fee({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),qd[t.off]=Fee({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}Ix({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});Ix({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});Ix({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});Ix({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});qd.deselect=qd.unselect;qd.grabbed=function(){var t=this[0];if(t)return t._private.grabbed};Ix({field:"active",on:"activate",off:"unactivate"});Ix({field:"pannable",on:"panify",off:"unpanify"});qd.inactive=function(){var t=this[0];if(t)return!t._private.active};var ys={},zee=function(e){return function(n){for(var i=this,a=[],s=0;s<i.length;s++){var o=i[s];if(o.isNode()){for(var l=!1,u=o.connectedEdges(),h=0;h<u.length;h++){var d=u[h],f=d.source(),p=d.target();if(e.noIncomingEdges&&p===o&&f!==o||e.noOutgoingEdges&&f===o&&p!==o){l=!0;break}}l||a.push(o)}}return this.spawn(a,!0).filter(n)}},Vee=function(e){return function(r){for(var n=this,i=[],a=0;a<n.length;a++){var s=n[a];if(s.isNode())for(var o=s.connectedEdges(),l=0;l<o.length;l++){var u=o[l],h=u.source(),d=u.target();e.outgoing&&h===s?(i.push(u),i.push(d)):e.incoming&&d===s&&(i.push(u),i.push(h))}}return this.spawn(i,!0).filter(r)}},Gee=function(e){return function(r){for(var n=this,i=[],a={};;){var s=e.outgoing?n.outgoers():n.incomers();if(s.length===0)break;for(var o=!1,l=0;l<s.length;l++){var u=s[l],h=u.id();a[h]||(a[h]=!0,i.push(u),o=!0)}if(!o)break;n=s}return this.spawn(i,!0).filter(r)}};ys.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null};dr(ys,{roots:zee({noIncomingEdges:!0}),leaves:zee({noOutgoingEdges:!0}),outgoers:pl(Vee({outgoing:!0}),"outgoers"),successors:Gee({outgoing:!0}),incomers:pl(Vee({incoming:!0}),"incomers"),predecessors:Gee({})});dr(ys,{neighborhood:pl(function(t){for(var e=[],r=this.nodes(),n=0;n<r.length;n++)for(var i=r[n],a=i.connectedEdges(),s=0;s<a.length;s++){var o=a[s],l=o.source(),u=o.target(),h=i===l?u:l;h.length>0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}});ys.neighbourhood=ys.neighborhood;ys.closedNeighbourhood=ys.closedNeighborhood;ys.openNeighbourhood=ys.openNeighborhood;dr(ys,{source:pl(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:pl(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:Wee({attr:"source"}),targets:Wee({attr:"target"})});function Wee(t){return function(r){for(var n=[],i=0;i<this.length;i++){var a=this[i],s=a._private[t.attr];s&&n.push(s)}return this.spawn(n,!0).filter(r)}}dr(ys,{edgesWith:pl(Hee(),"edgesWith"),edgesTo:pl(Hee({thisIsSrc:!0}),"edgesTo")});function Hee(t){return function(r){var n=[],i=this._private.cy,a=t||{};or(r)&&(r=i.$(r));for(var s=0;s<r.length;s++)for(var o=r[s]._private.edges,l=0;l<o.length;l++){var u=o[l],h=u._private.data,d=this.hasElementWithId(h.source)&&r.hasElementWithId(h.target),f=r.hasElementWithId(h.source)&&this.hasElementWithId(h.target),p=d||f;p&&((a.thisIsSrc||a.thisIsTgt)&&(a.thisIsSrc&&!d||a.thisIsTgt&&!f)||n.push(u))}return this.spawn(n,!0)}}dr(ys,{connectedEdges:pl(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var i=r[n];if(i.isNode())for(var a=i._private.edges,s=0;s<a.length;s++){var o=a[s];e.push(o)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:pl(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var i=r[n];i.isEdge()&&(e.push(i.source()[0]),e.push(i.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:pl(qee(),"parallelEdges"),codirectedEdges:pl(qee({codirected:!0}),"codirectedEdges")});function qee(t){var e={codirected:!1};return t=dr({},e,t),function(n){for(var i=[],a=this.edges(),s=t,o=0;o<a.length;o++)for(var l=a[o],u=l._private,h=u.source,d=h._private.data.id,f=u.data.target,p=h._private.edges,g=0;g<p.length;g++){var m=p[g],y=m._private.data,v=y.target,T=y.source,b=v===f&&T===d,w=d===v&&f===T;(s.codirected&&b||!s.codirected&&(b||w))&&i.push(m)}return this.spawn(i,!0).filter(n)}}dr(ys,{components:function(e){var r=this,n=r.cy(),i=n.collection(),a=e==null?r.nodes():e.nodes(),s=[];e!=null&&a.empty()&&(a=e.sources());var o=function(h,d){i.merge(h),a.unmerge(h),d.merge(h)};if(a.empty())return r.spawn();var l=function(){var h=n.collection();s.push(h);var d=a[0];o(d,h),r.bfs({directed:!1,roots:d,visit:function(p){return o(p,h)}}),h.forEach(function(f){f.connectedEdges().forEach(function(p){r.has(p)&&h.has(p.source())&&h.has(p.target())&&h.merge(p)})})};do l();while(a.length>0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});ys.componentsOf=ys.components;var Za=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){oi("A collection must have a reference to the core");return}var a=new th,s=!1;if(!r)r=[];else if(r.length>0&&ln(r[0])&&!dS(r[0])){s=!0;for(var o=[],l=new Rx,u=0,h=r.length;u<h;u++){var d=r[u];d.data==null&&(d.data={});var f=d.data;if(f.id==null)f.id=cve();else if(e.hasElementWithId(f.id)||l.has(f.id))continue;var p=new iL(e,d,!1);o.push(p),l.add(f.id)}r=o}this.length=0;for(var g=0,m=r.length;g<m;g++){var y=r[g][0];if(y!=null){var v=y._private.data.id;(!n||!a.has(v))&&(n&&a.set(v,{index:this.length,ele:y}),this[this.length]=y,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(T){this.lazyMap=T},rebuildMap:function(){for(var b=this.lazyMap=new th,w=this.eles,C=0;C<w.length;C++){var S=w[C];b.set(S.id(),{index:C,ele:S})}}},n&&(this._private.map=a),s&&!i&&this.restore()},qn=iL.prototype=Za.prototype=Object.create(Array.prototype);qn.instanceString=function(){return"collection"};qn.spawn=function(t,e){return new Za(this.cy(),t,e)};qn.spawnSelf=function(){return this.spawn(this)};qn.cy=function(){return this._private.cy};qn.renderer=function(){return this._private.cy.renderer()};qn.element=function(){return this[0]};qn.collection=function(){return j1e(this)?this:new Za(this._private.cy,[this])};qn.unique=function(){return new Za(this._private.cy,this,!0)};qn.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)};qn.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new Za(e)};qn.$id=qn.getElementById;qn.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index};qn.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index};qn.indexOfId=function(t){return t=""+t,this._private.map.get(t).index};qn.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e!=null){var n=e._private;if(ln(t)){if(r.startBatch(),t.data){e.data(t.data);var i=n.data;if(e.isEdge()){var a=!1,s={},o=t.data.source,l=t.data.target;o!=null&&o!=i.source&&(s.source=""+o,a=!0),l!=null&&l!=i.target&&(s.target=""+l,a=!0),a&&(e=e.move(s))}else{var u="parent"in t.data,h=t.data.parent;u&&(h!=null||i.parent!=null)&&h!=i.parent&&(h===void 0&&(h=null),h!=null&&(h=""+h),e=e.move({parent:h}))}}t.position&&e.position(t.position);var d=function(m,y,v){var T=t[m];T!=null&&T!==n[m]&&(T?e[y]():e[v]())};return d("removed","remove","restore"),d("selected","select","unselect"),d("selectable","selectify","unselectify"),d("locked","lock","unlock"),d("grabbable","grabify","ungrabify"),d("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),r.endBatch(),this}else if(t===void 0){var f={data:Fc(n.data),position:Fc(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:null};f.classes="";var p=0;return n.classes.forEach(function(g){return f.classes+=p++===0?g:" "+g}),f}}};qn.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],n=r.json();t.push(n)}return t};qn.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var n=this[r],i=n.json(),a=new iL(t,i,!1);e.push(a)}return new Za(t,e)};qn.copy=qn.clone;qn.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),i=n._private,a=[],s=[],o,l=0,u=r.length;l<u;l++){var h=r[l];e&&!h.removed()||(h.isNode()?a.push(h):s.push(h))}o=a.concat(s);var d,f=function(){o.splice(d,1),d--};for(d=0;d<o.length;d++){var p=o[d],g=p._private,m=g.data;if(p.clearTraversalCache(),!(!e&&!g.removed)){if(m.id===void 0)m.id=cve();else if(Dt(m.id))m.id=""+m.id;else if(lf(m.id)||!or(m.id)){oi("Can not create element with invalid string ID `"+m.id+"`"),f();continue}else if(n.hasElementWithId(m.id)){oi("Can not create second element with ID `"+m.id+"`"),f();continue}}var y=m.id;if(p.isNode()){var v=g.position;v.x==null&&(v.x=0),v.y==null&&(v.y=0)}if(p.isEdge()){for(var T=p,b=["source","target"],w=b.length,C=!1,S=0;S<w;S++){var k=b[S],E=m[k];Dt(E)&&(E=m[k]=""+m[k]),E==null||E===""?(oi("Can not create edge `"+y+"` with unspecified "+k),C=!0):n.hasElementWithId(E)||(oi("Can not create edge `"+y+"` with nonexistent "+k+" `"+E+"`"),C=!0)}if(C){f();continue}var _=n.getElementById(m.source),M=n.getElementById(m.target);_.same(M)?_._private.edges.push(T):(_._private.edges.push(T),M._private.edges.push(T)),T._private.source=_,T._private.target=M}g.map=new th,g.map.set(y,{ele:p,index:0}),g.removed=!1,e&&n.addToPool(p)}for(var L=0;L<a.length;L++){var P=a[L],D=P._private.data;Dt(D.parent)&&(D.parent=""+D.parent);var R=D.parent,I=R!=null;if(I||P._private.parent){var $=P._private.parent?n.collection().merge(P._private.parent):n.getElementById(R);if($.empty())D.parent=void 0;else if($[0].removed())Cn("Node added with missing parent, reference to parent removed"),D.parent=void 0,P._private.parent=null;else{for(var O=!1,N=$;!N.empty();){if(P.same(N)){O=!0,D.parent=void 0;break}N=N.parent()}O||($[0]._private.children.push(P),P._private.parent=$[0],i.hasCompoundNodes=!0)}}}if(o.length>0){for(var F=o.length===r.length?r:new Za(n,o),z=0;z<F.length;z++){var V=F[z];V.isNode()||(V.parallelEdges().clearTraversalCache(),V.source().clearTraversalCache(),V.target().clearTraversalCache())}var B;i.hasCompoundNodes?B=n.collection().merge(F).merge(F.connectedNodes()).merge(F.parent()):B=F,B.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?F.emitAndNotify("add"):e&&F.emit("add")}return r};qn.removed=function(){var t=this[0];return t&&t._private.removed};qn.inside=function(){var t=this[0];return t&&!t._private.removed};qn.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],i={},a=r._private.cy;function s(R){for(var I=R._private.edges,$=0;$<I.length;$++)l(I[$])}function o(R){for(var I=R._private.children,$=0;$<I.length;$++)l(I[$])}function l(R){var I=i[R.id()];e&&R.removed()||I||(i[R.id()]=!0,R.isNode()?(n.push(R),s(R),o(R)):n.unshift(R))}for(var u=0,h=r.length;u<h;u++){var d=r[u];l(d)}function f(R,I){var $=R._private.edges;cf($,I),R.clearTraversalCache()}function p(R){R.clearTraversalCache()}var g=[];g.ids={};function m(R,I){I=I[0],R=R[0];var $=R._private.children,O=R.id();cf($,I),I._private.parent=null,g.ids[O]||(g.ids[O]=!0,g.push(R))}r.dirtyCompoundBoundsCache(),e&&a.removeFromPool(n);for(var y=0;y<n.length;y++){var v=n[y];if(v.isEdge()){var T=v.source()[0],b=v.target()[0];f(T,v),f(b,v);for(var w=v.parallelEdges(),C=0;C<w.length;C++){var S=w[C];p(S),S.isBundledBezier()&&S.dirtyBoundingBoxCache()}}else{var k=v.parent();k.length!==0&&m(k,v)}e&&(v._private.removed=!0)}var E=a._private.elements;a._private.hasCompoundNodes=!1;for(var _=0;_<E.length;_++){var M=E[_];if(M.isParent()){a._private.hasCompoundNodes=!0;break}}var L=new Za(this.cy(),n);L.size()>0&&(t?L.emitAndNotify("remove"):e&&L.emit("remove"));for(var P=0;P<g.length;P++){var D=g[P];(!e||!D.removed())&&D.updateStyle()}return L};qn.move=function(t){var e=this._private.cy,r=this,n=!1,i=!1,a=function(g){return g==null?g:""+g};if(t.source!==void 0||t.target!==void 0){var s=a(t.source),o=a(t.target),l=s!=null&&e.hasElementWithId(s),u=o!=null&&e.hasElementWithId(o);(l||u)&&(e.batch(function(){r.remove(n,i),r.emitAndNotify("moveout");for(var p=0;p<r.length;p++){var g=r[p],m=g._private.data;g.isEdge()&&(l&&(m.source=s),u&&(m.target=o))}r.restore(n,i)}),r.emitAndNotify("move"))}else if(t.parent!==void 0){var h=a(t.parent),d=h===null||e.hasElementWithId(h);if(d){var f=h===null?void 0:h;e.batch(function(){var p=r.remove(n,i);p.emitAndNotify("moveout");for(var g=0;g<r.length;g++){var m=r[g],y=m._private.data;m.isNode()&&(y.parent=f)}p.restore(n,i)}),r.emitAndNotify("move")}}return this};[Tve,qft,c3,Hd,qb,opt,hL,kpt,Uve,Yve,Rpt,y_,u3,Ka,qd,ys].forEach(function(t){dr(qn,t)});var $pt={add:function(e){var r,n=this;if(Po(e)){var i=e;if(i._private.cy===n)r=i.restore();else{for(var a=[],s=0;s<i.length;s++){var o=i[s];a.push(o.json())}r=new Za(n,a)}}else if(Nn(e)){var l=e;r=new Za(n,l)}else if(ln(e)&&(Nn(e.nodes)||Nn(e.edges))){for(var u=e,h=[],d=["nodes","edges"],f=0,p=d.length;f<p;f++){var g=d[f],m=u[g];if(Nn(m))for(var y=0,v=m.length;y<v;y++){var T=dr({group:g},m[y]);h.push(T)}}r=new Za(n,h)}else{var b=e;r=new iL(n,b).collection()}return r},remove:function(e){if(!Po(e)){if(or(e)){var r=e;e=this.$(r)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function Ppt(t,e,r,n){var i=4,a=.001,s=1e-7,o=10,l=11,u=1/(l-1),h=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var d=0;d<4;++d)if(typeof arguments[d]!="number"||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var f=h?new Float32Array(l):new Array(l);function p(M,L){return 1-3*L+3*M}function g(M,L){return 3*L-6*M}function m(M){return 3*M}function y(M,L,P){return((p(L,P)*M+g(L,P))*M+m(L))*M}function v(M,L,P){return 3*p(L,P)*M*M+2*g(L,P)*M+m(L)}function T(M,L){for(var P=0;P<i;++P){var D=v(L,t,r);if(D===0)return L;var R=y(L,t,r)-M;L-=R/D}return L}function b(){for(var M=0;M<l;++M)f[M]=y(M*u,t,r)}function w(M,L,P){var D,R,I=0;do R=L+(P-L)/2,D=y(R,t,r)-M,D>0?P=R:L=R;while(Math.abs(D)>s&&++I<o);return R}function C(M){for(var L=0,P=1,D=l-1;P!==D&&f[P]<=M;++P)L+=u;--P;var R=(M-f[P])/(f[P+1]-f[P]),I=L+R*u,$=v(I,t,r);return $>=a?T(M,I):$===0?I:w(M,L,L+u)}var S=!1;function k(){S=!0,(t!==e||r!==n)&&b()}var E=function(L){return S||k(),t===e&&r===n?L:L===0?0:L===1?1:y(C(L),e,n)};E.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var _="generateBezier("+[t,e,r,n]+")";return E.toString=function(){return _},E}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var Bpt=(function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,i,a){var s={x:n.x+a.dx*i,v:n.v+a.dv*i,tension:n.tension,friction:n.friction};return{dx:s.v,dv:t(s)}}function r(n,i){var a={dx:n.v,dv:t(n)},s=e(n,i*.5,a),o=e(n,i*.5,s),l=e(n,i,o),u=1/6*(a.dx+2*(s.dx+o.dx)+l.dx),h=1/6*(a.dv+2*(s.dv+o.dv)+l.dv);return n.x=n.x+u*i,n.v=n.v+h*i,n}return function n(i,a,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,h=1/1e4,d=16/1e3,f,p,g;for(i=parseFloat(i)||500,a=parseFloat(a)||20,s=s||null,o.tension=i,o.friction=a,f=s!==null,f?(u=n(i,a),p=u/s*d):p=d;g=r(g||o,p),l.push(1+g.x),u+=16,Math.abs(g.x)>h&&Math.abs(g.v)>h;);return f?function(m){return l[m*(l.length-1)|0]}:u}})(),$n=function(e,r,n,i){var a=Ppt(e,r,n,i);return function(s,o,l){return s+(o-s)*a(l)}},h3={linear:function(e,r,n){return e+(r-e)*n},ease:$n(.25,.1,.25,1),"ease-in":$n(.42,0,1,1),"ease-out":$n(0,0,.58,1),"ease-in-out":$n(.42,0,.58,1),"ease-in-sine":$n(.47,0,.745,.715),"ease-out-sine":$n(.39,.575,.565,1),"ease-in-out-sine":$n(.445,.05,.55,.95),"ease-in-quad":$n(.55,.085,.68,.53),"ease-out-quad":$n(.25,.46,.45,.94),"ease-in-out-quad":$n(.455,.03,.515,.955),"ease-in-cubic":$n(.55,.055,.675,.19),"ease-out-cubic":$n(.215,.61,.355,1),"ease-in-out-cubic":$n(.645,.045,.355,1),"ease-in-quart":$n(.895,.03,.685,.22),"ease-out-quart":$n(.165,.84,.44,1),"ease-in-out-quart":$n(.77,0,.175,1),"ease-in-quint":$n(.755,.05,.855,.06),"ease-out-quint":$n(.23,1,.32,1),"ease-in-out-quint":$n(.86,0,.07,1),"ease-in-expo":$n(.95,.05,.795,.035),"ease-out-expo":$n(.19,1,.22,1),"ease-in-out-expo":$n(1,0,0,1),"ease-in-circ":$n(.6,.04,.98,.335),"ease-out-circ":$n(.075,.82,.165,1),"ease-in-out-circ":$n(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return h3.linear;var i=Bpt(e,r,n);return function(a,s,o){return a+(s-a)*i(o)}},"cubic-bezier":$n};function Uee(t,e,r,n,i){if(n===1||e===r)return r;var a=i(e,r,n);return t==null||((t.roundValue||t.color)&&(a=Math.round(a)),t.min!==void 0&&(a=Math.max(a,t.min)),t.max!==void 0&&(a=Math.min(a,t.max))),a}function Yee(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Zg(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var s=Yee(t,i),o=Yee(e,i);if(Dt(s)&&Dt(o))return Uee(a,s,o,r,n);if(Nn(s)&&Nn(o)){for(var l=[],u=0;u<o.length;u++){var h=s[u],d=o[u];if(h!=null&&d!=null){var f=Uee(a,h,d,r,n);l.push(f)}else l.push(d)}return l}}function Fpt(t,e,r,n){var i=!n,a=t._private,s=e._private,o=s.easing,l=s.startTime,u=n?t:t.cy(),h=u.style();if(!s.easingImpl)if(o==null)s.easingImpl=h3.linear;else{var d;if(or(o)){var f=h.parse("transition-timing-function",o);d=f.value}else d=o;var p,g;or(d)?(p=d,g=[]):(p=d[1],g=d.slice(2).map(function(F){return+F})),g.length>0?(p==="spring"&&g.push(s.duration),s.easingImpl=h3[p].apply(null,g)):s.easingImpl=h3[p]}var m=s.easingImpl,y;if(s.duration===0?y=1:y=(r-l)/s.duration,s.applying&&(y=s.progress),y<0?y=0:y>1&&(y=1),s.delay==null){var v=s.startPosition,T=s.position;if(T&&i&&!t.locked()){var b={};gT(v.x,T.x)&&(b.x=Zg(v.x,T.x,y,m)),gT(v.y,T.y)&&(b.y=Zg(v.y,T.y,y,m)),t.position(b)}var w=s.startPan,C=s.pan,S=a.pan,k=C!=null&&n;k&&(gT(w.x,C.x)&&(S.x=Zg(w.x,C.x,y,m)),gT(w.y,C.y)&&(S.y=Zg(w.y,C.y,y,m)),t.emit("pan"));var E=s.startZoom,_=s.zoom,M=_!=null&&n;M&&(gT(E,_)&&(a.zoom=rk(a.minZoom,Zg(E,_,y,m),a.maxZoom)),t.emit("zoom")),(k||M)&&t.emit("viewport");var L=s.style;if(L&&L.length>0&&i){for(var P=0;P<L.length;P++){var D=L[P],R=D.name,I=D,$=s.startStyle[R],O=h.properties[$.name],N=Zg($,I,y,m,O);h.overrideBypass(t,R,N)}t.emit("style")}}return s.progress=y,y}function gT(t,e){return t==null||e==null?!1:Dt(t)&&Dt(e)?!0:!!(t&&e)}function zpt(t,e,r,n){var i=e._private;i.started=!0,i.startTime=r-i.progress*i.duration}function Xee(t,e){var r=e._private.aniEles,n=[];function i(h,d){var f=h._private,p=f.animation.current,g=f.animation.queue,m=!1;if(p.length===0){var y=g.shift();y&&p.push(y)}for(var v=function(S){for(var k=S.length-1;k>=0;k--){var E=S[k];E()}S.splice(0,S.length)},T=p.length-1;T>=0;T--){var b=p[T],w=b._private;if(w.stopped){p.splice(T,1),w.hooked=!1,w.playing=!1,w.started=!1,v(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||zpt(h,b,t),Fpt(h,b,t,d),w.applying&&(w.applying=!1),v(w.frames),w.step!=null&&w.step(t),b.completed()&&(p.splice(T,1),w.hooked=!1,w.playing=!1,w.started=!1,v(w.completes)),m=!0)}return!d&&p.length===0&&g.length===0&&n.push(h),m}for(var a=!1,s=0;s<r.length;s++){var o=r[s],l=i(o);a=a||l}var u=i(e,!0);(a||u)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var Vpt={animate:Tn.animate(),animation:Tn.animation(),animated:Tn.animated(),clearQueue:Tn.clearQueue(),delay:Tn.delay(),delayAnimation:Tn.delayAnimation(),stop:Tn.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&d_(function(a){Xee(a,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,s){Xee(s,e)},n.beforeRenderPriorities.animations):r()}},Gpt={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var i=r.qualifier;return i!=null?e!==n.target&&dS(n.target)&&i.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},t4=function(e){return or(e)?new hf(e):e},Kve={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new dL(Gpt,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,t4(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,t4(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,t4(r),n),this},once:function(e,r,n){return this.emitter().one(e,t4(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};Tn.eventAliasesOn(Kve);var cP={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};cP.jpeg=cP.jpg;var d3={layout:function(e){var r=this;if(e==null){oi("Layout options must be specified to make a layout");return}if(e.name==null){oi("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){oi("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;or(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var s=new i(dr({},e,{cy:r,eles:a}));return s}};d3.createLayout=d3.makeLayout=d3.layout;var Wpt={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var i=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&i.merge(r);return}if(n.notificationsEnabled){var a=this.renderer();this.destroyed()||!a||a.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var i=e.batchNotifications[n];i.empty()?r.notify(n):r.notify(n,i)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i<n.length;i++){var a=n[i],s=e[a],o=r.getElementById(a);o.data(s)}})}},Hpt=ts({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),uP={renderTo:function(e,r,n,i){var a=this._private.renderer;return a.renderTo(e,r,n,i),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var r=this,n=r.extension("renderer",e.name);if(n==null){oi("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&Cn("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var i=Hpt(e);i.cy=r,r._private.renderer=new n(i),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var r=e.container();if(r)for(r._cyreg=null;r.childNodes.length>0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var i=n._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};uP.invalidateDimensions=uP.resize;var f3={collection:function(e,r){return or(e)?this.$(e):Po(e)?e.collection():Nn(e)?(r||(r={}),new Za(this,e,r.unique,r.removed)):new Za(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};f3.elements=f3.filter=f3.$;var Ra={},qw="t",qpt="f";Ra.apply=function(t){for(var e=this,r=e._private,n=r.cy,i=n.collection(),a=0;a<t.length;a++){var s=t[a],o=e.getContextMeta(s);if(!o.empty){var l=e.getContextStyle(o),u=e.applyContextStyle(o,l,s);s._private.appliedInitStyle?e.updateTransitions(s,u.diffProps):s._private.appliedInitStyle=!0;var h=e.updateStyleHints(s);h&&i.push(s)}}return i};Ra.getPropertiesDiff=function(t,e){var r=this,n=r._private.propDiffs=r._private.propDiffs||{},i=t+"-"+e,a=n[i];if(a)return a;for(var s=[],o={},l=0;l<r.length;l++){var u=r[l],h=t[l]===qw,d=e[l]===qw,f=h!==d,p=u.mappedProperties.length>0;if(f||d&&p){var g=void 0;f&&p||f?g=u.properties:p&&(g=u.mappedProperties);for(var m=0;m<g.length;m++){for(var y=g[m],v=y.name,T=!1,b=l+1;b<r.length;b++){var w=r[b],C=e[b]===qw;if(C&&(T=w.properties[y.name]!=null,T))break}!o[v]&&!T&&(o[v]=!0,s.push(v))}}}return n[i]=s,s};Ra.getContextMeta=function(t){for(var e=this,r="",n,i=t._private.styleCxtKey||"",a=0;a<e.length;a++){var s=e[a],o=s.selector&&s.selector.matches(t);o?r+=qw:r+=qpt}return n=e.getPropertiesDiff(i,r),t._private.styleCxtKey=r,{key:r,diffPropNames:n,empty:n.length===0}};Ra.getContextStyle=function(t){var e=t.key,r=this,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var i={_private:{key:e}},a=0;a<r.length;a++){var s=r[a],o=e[a]===qw;if(o)for(var l=0;l<s.properties.length;l++){var u=s.properties[l];i[u.name]=u}}return n[e]=i,i};Ra.applyContextStyle=function(t,e,r){for(var n=this,i=t.diffPropNames,a={},s=n.types,o=0;o<i.length;o++){var l=i[o],u=e[l],h=r.pstyle(l);if(!u)if(h)h.bypass?u={name:l,deleteBypassed:!0}:u={name:l,delete:!0};else continue;if(h!==u){if(u.mapped===s.fn&&h!=null&&h.mapping!=null&&h.mapping.value===u.value){var d=h.mapping,f=d.fnValue=u.value(r);if(f===d.prevFnValue)continue}var p=a[l]={prev:h};n.applyParsedProperty(r,u),p.next=r.pstyle(l),p.next&&p.next.bypass&&(p.next=p.next.bypassed)}}return{diffProps:a}};Ra.updateStyleHints=function(t){var e=t._private,r=this,n=r.propertyGroupNames,i=r.propertyGroupKeys,a=function(J,ge,ee){return r.getPropertiesHash(J,ge,ee)},s=e.styleKey;if(t.removed())return!1;var o=e.group==="nodes",l=t._private.style;n=Object.keys(l);for(var u=0;u<i.length;u++){var h=i[u];e.styleKeys[h]=[Ep,Tm]}for(var d=function(J,ge){return e.styleKeys[ge][0]=JC(J,e.styleKeys[ge][0])},f=function(J,ge){return e.styleKeys[ge][1]=ek(J,e.styleKeys[ge][1])},p=function(J,ge){d(J,ge),f(J,ge)},g=function(J,ge){for(var ee=0;ee<J.length;ee++){var Re=J.charCodeAt(ee);d(Re,ge),f(Re,ge)}},m=2e9,y=function(J){return-128<J&&J<128&&Math.floor(J)!==J?m-(J*1024|0):J},v=0;v<n.length;v++){var T=n[v],b=l[T];if(b!=null){var w=this.properties[T],C=w.type,S=w.groupKey,k=void 0;w.hashOverride!=null?k=w.hashOverride(t,b):b.pfValue!=null&&(k=b.pfValue);var E=w.enums==null?b.value:null,_=k!=null,M=E!=null,L=_||M,P=b.units;if(C.number&&L&&!C.multiple){var D=_?k:E;p(y(D),S),!_&&P!=null&&g(P,S)}else g(b.strValue,S)}}for(var R=[Ep,Tm],I=0;I<i.length;I++){var $=i[I],O=e.styleKeys[$];R[0]=JC(O[0],R[0]),R[1]=ek(O[1],R[1])}e.styleKey=sht(R[0],R[1]);var N=e.styleKeys;e.labelDimsKey=ad(N.labelDimensions);var F=a(t,["label"],N.labelDimensions);if(e.labelKey=ad(F),e.labelStyleKey=ad(YE(N.commonLabel,F)),!o){var z=a(t,["source-label"],N.labelDimensions);e.sourceLabelKey=ad(z),e.sourceLabelStyleKey=ad(YE(N.commonLabel,z));var V=a(t,["target-label"],N.labelDimensions);e.targetLabelKey=ad(V),e.targetLabelStyleKey=ad(YE(N.commonLabel,V))}if(o){var B=e.styleKeys,G=B.nodeBody,H=B.nodeBorder,q=B.nodeOutline,Z=B.backgroundImage,Y=B.compound,ie=B.pie,K=B.stripe,Q=[G,H,q,Z,Y,ie,K].filter(function(te){return te!=null}).reduce(YE,[Ep,Tm]);e.nodeKey=ad(Q),e.hasPie=ie!=null&&ie[0]!==Ep&&ie[1]!==Tm,e.hasStripe=K!=null&&K[0]!==Ep&&K[1]!==Tm}return s!==e.styleKey};Ra.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null,e.hasStripe=null};Ra.applyParsedProperty=function(t,e){var r=this,n=e,i=t._private.style,a,s=r.types,o=r.properties[n.name].type,l=n.bypass,u=i[n.name],h=u&&u.bypass,d=t._private,f="mapping",p=function(G){return G==null?null:G.pfValue!=null?G.pfValue:G.value},g=function(){var G=p(u),H=p(n);r.checkTriggers(t,n.name,G,H)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(n=e=this.parse(e.name,"bezier",l)),n.delete)return i[n.name]=void 0,g(),!0;if(n.deleteBypassed)return u?u.bypass?(u.bypassed=void 0,g(),!0):!1:(g(),!0);if(n.deleteBypass)return u?u.bypass?(i[n.name]=u.bypassed,g(),!0):!1:(g(),!0);var m=function(){Cn("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+n.name+"` with data field `"+n.field+"`); try a `["+n.field+"]` selector to limit scope to elements with `"+n.field+"` defined")};switch(n.mapped){case s.mapData:{for(var y=n.field.split("."),v=d.data,T=0;T<y.length&&v;T++){var b=y[T];v=v[b]}if(v==null)return m(),!1;var w;if(Dt(v)){var C=n.fieldMax-n.fieldMin;C===0?w=0:w=(v-n.fieldMin)/C}else return Cn("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+v+"` for `"+t.id()+"` is non-numeric)"),!1;if(w<0?w=0:w>1&&(w=1),o.color){var S=n.valueMin[0],k=n.valueMax[0],E=n.valueMin[1],_=n.valueMax[1],M=n.valueMin[2],L=n.valueMax[2],P=n.valueMin[3]==null?1:n.valueMin[3],D=n.valueMax[3]==null?1:n.valueMax[3],R=[Math.round(S+(k-S)*w),Math.round(E+(_-E)*w),Math.round(M+(L-M)*w),Math.round(P+(D-P)*w)];a={bypass:n.bypass,name:n.name,value:R,strValue:"rgb("+R[0]+", "+R[1]+", "+R[2]+")"}}else if(o.number){var I=n.valueMin+(n.valueMax-n.valueMin)*w;a=this.parse(n.name,I,n.bypass,f)}else return!1;if(!a)return m(),!1;a.mapping=n,n=a;break}case s.data:{for(var $=n.field.split("."),O=d.data,N=0;N<$.length&&O;N++){var F=$[N];O=O[F]}if(O!=null&&(a=this.parse(n.name,O,n.bypass,f)),!a)return m(),!1;a.mapping=n,n=a;break}case s.fn:{var z=n.value,V=n.fnValue!=null?n.fnValue:z(t);if(n.prevFnValue=V,V==null)return Cn("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(a=this.parse(n.name,V,n.bypass,f),!a)return Cn("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+t.id()+"` is invalid)"),!1;a.mapping=Fc(n),n=a;break}case void 0:break;default:return!1}return l?(h?n.bypassed=u.bypassed:n.bypassed=u,i[n.name]=n):h?u.bypassed=n:i[n.name]=n,g(),!0};Ra.cleanElements=function(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(this.clearStyleHints(n),n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),!e)n._private.style={};else for(var i=n._private.style,a=Object.keys(i),s=0;s<a.length;s++){var o=a[s],l=i[o];l!=null&&(l.bypass?l.bypassed=null:i[o]=null)}}};Ra.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()};Ra.updateTransitions=function(t,e){var r=this,n=t._private,i=t.pstyle("transition-property").value,a=t.pstyle("transition-duration").pfValue,s=t.pstyle("transition-delay").pfValue;if(i.length>0&&a>0){for(var o={},l=!1,u=0;u<i.length;u++){var h=i[u],d=t.pstyle(h),f=e[h];if(f){var p=f.prev,g=p,m=f.next!=null?f.next:d,y=!1,v=void 0,T=1e-6;g&&(Dt(g.pfValue)&&Dt(m.pfValue)?(y=m.pfValue-g.pfValue,v=g.pfValue+T*y):Dt(g.value)&&Dt(m.value)?(y=m.value-g.value,v=g.value+T*y):Nn(g.value)&&Nn(m.value)&&(y=g.value[0]!==m.value[0]||g.value[1]!==m.value[1]||g.value[2]!==m.value[2],v=g.strValue),y&&(o[h]=m.strValue,this.applyBypass(t,h,v),l=!0))}}if(!l)return;n.transitioning=!0,new Lx(function(b){s>0?t.delayAnimation(s).play().promise().then(b):b()}).then(function(){return t.animation({style:o,duration:a,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,i),t.emitAndNotify("style"),n.transitioning=!1)};Ra.checkTrigger=function(t,e,r,n,i,a){var s=this.properties[e],o=i(s);t.removed()||o!=null&&o(r,n,t)&&a(s)};Ra.checkZOrderTrigger=function(t,e,r,n){var i=this;this.checkTrigger(t,e,r,n,function(a){return a.triggersZOrder},function(){i._private.cy.notify("zorder",t)})};Ra.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})};Ra.checkConnectedEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){t.connectedEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};Ra.checkParallelEdgesBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){t.parallelEdges().forEach(function(a){a.dirtyBoundingBoxCache()})})};Ra.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n),this.checkConnectedEdgesBoundsTrigger(t,e,r,n),this.checkParallelEdgesBoundsTrigger(t,e,r,n)};var bS={};bS.applyBypass=function(t,e,r,n){var i=this,a=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;o<i.properties.length;o++){var l=i.properties[o],u=l.name,h=this.parse(u,r,!0);h&&a.push(h)}}else if(or(e)){var d=this.parse(e,r,!0);d&&a.push(d)}else if(ln(e)){var f=e;n=r;for(var p=Object.keys(f),g=0;g<p.length;g++){var m=p[g],y=f[m];if(y===void 0&&(y=f[rL(m)]),y!==void 0){var v=this.parse(m,y,!0);v&&a.push(v)}}}else return!1;if(a.length===0)return!1;for(var T=!1,b=0;b<t.length;b++){for(var w=t[b],C={},S=void 0,k=0;k<a.length;k++){var E=a[k];if(n){var _=w.pstyle(E.name);S=C[E.name]={prev:_}}T=this.applyParsedProperty(w,Fc(E))||T,n&&(S.next=w.pstyle(E.name))}T&&this.updateStyleHints(w),n&&this.updateTransitions(w,C,s)}return T};bS.overrideBypass=function(t,e,r){e=VG(e);for(var n=0;n<t.length;n++){var i=t[n],a=i._private.style[e],s=this.properties[e].type,o=s.color,l=s.mutiple,u=a?a.pfValue!=null?a.pfValue:a.value:null;!a||!a.bypass?this.applyBypass(i,e,r):(a.value=r,a.pfValue!=null&&(a.pfValue=r),o?a.strValue="rgb("+r.join(",")+")":l?a.strValue=r.join(" "):a.strValue=""+r,this.updateStyleHints(i)),this.checkTriggers(i,e,u,r)}};bS.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)};bS.removeBypasses=function(t,e,r){for(var n=!0,i=0;i<t.length;i++){for(var a=t[i],s={},o=0;o<e.length;o++){var l=e[o],u=this.properties[l],h=a.pstyle(u.name);if(!(!h||!h.bypass)){var d="",f=this.parse(l,d,!0),p=s[u.name]={prev:h};this.applyParsedProperty(a,f),p.next=a.pstyle(u.name)}}this.updateStyleHints(a),r&&this.updateTransitions(a,s,n)}};var rW={};rW.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1};rW.containerCss=function(t){var e=this._private.cy,r=e.container(),n=e.window();if(n&&r&&n.getComputedStyle)return n.getComputedStyle(r).getPropertyValue(t)};var Jc={};Jc.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)};Jc.getRawStyle=function(t,e){var r=this;if(t=t[0],t){for(var n={},i=0;i<r.properties.length;i++){var a=r.properties[i],s=r.getStylePropertyValue(t,a.name,e);s!=null&&(n[a.name]=s,n[rL(a.name)]=s)}return n}};Jc.getIndexedStyle=function(t,e,r,n){var i=t.pstyle(e)[r][n];return i??t.cy().style().getDefaultProperty(e)[r][0]};Jc.getStylePropertyValue=function(t,e,r){var n=this;if(t=t[0],t){var i=n.properties[e];i.alias&&(i=i.pointsTo);var a=i.type,s=t.pstyle(i.name);if(s){var o=s.value,l=s.units,u=s.strValue;if(r&&a.number&&o!=null&&Dt(o)){var h=t.cy().zoom(),d=function(y){return y*h},f=function(y,v){return d(y)+v},p=Nn(o),g=p?l.every(function(m){return m!=null}):l!=null;return g?p?o.map(function(m,y){return f(m,l[y])}).join(" "):f(o,l):p?o.map(function(m){return or(m)?m:""+d(m)}).join(" "):""+d(o)}else if(u!=null)return u}return null}};Jc.getAnimationStartStyle=function(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n],a=i.name,s=t.pstyle(a);s!==void 0&&(ln(s)?s=this.parse(a,s.strValue):s=this.parse(a,s)),s&&(r[a]=s)}return r};Jc.getPropsList=function(t){var e=this,r=[],n=t,i=e.properties;if(n)for(var a=Object.keys(n),s=0;s<a.length;s++){var o=a[s],l=n[o],u=i[o]||i[VG(o)],h=this.parse(u.name,l);h&&r.push(h)}return r};Jc.getNonDefaultPropertiesHash=function(t,e,r){var n=r.slice(),i,a,s,o,l,u;for(l=0;l<e.length;l++)if(i=e[l],a=t.pstyle(i,!1),a!=null)if(a.pfValue!=null)n[0]=JC(o,n[0]),n[1]=ek(o,n[1]);else for(s=a.strValue,u=0;u<s.length;u++)o=s.charCodeAt(u),n[0]=JC(o,n[0]),n[1]=ek(o,n[1]);return n};Jc.getPropertiesHash=Jc.getNonDefaultPropertiesHash;var gL={};gL.appendFromJson=function(t){for(var e=this,r=0;r<t.length;r++){var n=t[r],i=n.selector,a=n.style||n.css,s=Object.keys(a);e.selector(i);for(var o=0;o<s.length;o++){var l=s[o],u=a[l];e.css(l,u)}}return e};gL.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e};gL.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],n=r.selector,i=r.properties,a={},s=0;s<i.length;s++){var o=i[s];a[o.name]=o.strValue}t.push({selector:n?n.toString():"core",style:a})}return t};var nW={};nW.appendFromString=function(t){var e=this,r=this,n=""+t,i,a,s;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function o(){n.length>i.length?n=n.substr(i.length):n=""}function l(){a.length>s.length?a=a.substr(s.length):a=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){Cn("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=h[0];var d=h[1];if(d!=="core"){var f=new hf(d);if(f.invalid){Cn("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var p=h[2],g=!1;a=p;for(var m=[];;){var y=a.match(/^\s*$/);if(y)break;var v=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!v){Cn("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}s=v[0];var T=v[1],b=v[2],w=e.properties[T];if(!w){Cn("Skipping property: Invalid property name in: "+s),l();continue}var C=r.parse(T,b);if(!C){Cn("Skipping property: Invalid property definition in: "+s),l();continue}m.push({name:T,val:b}),l()}if(g){o();break}r.selector(d);for(var S=0;S<m.length;S++){var k=m[S];r.css(k.name,k.val)}o()}return r};nW.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var Fi={};(function(){var t=sa,e=But,r=zut,n=Vut,i=Gut,a=function(te){return"^"+te+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(te){var J=t+"|\\w+|"+e+"|"+r+"|"+n+"|"+i;return"^"+te+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+J+")\\s*\\,\\s*("+J+")\\)$"},o=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];Fi.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},boxSelection:{enums:["contain","overlap","none"]},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle","circle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","top-inside","center","bottom","bottom-inside"]},halign:{enums:["left","left-inside","center","right","right-inside"]},justification:{enums:["left","center","right","auto"]},textMetrics:{enums:["font","glyph"]},text:{string:!0},data:{mapping:!0,regex:a("data")},layoutData:{mapping:!0,regex:a("layoutData")},scratch:{mapping:!0,regex:a("scratch")},mapData:{mapping:!0,regex:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:o,singleRegexMatchValue:!0},urls:{regexes:o,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(te,J){switch(te.length){case 2:return J[0]!=="deg"&&J[0]!=="rad"&&J[1]!=="deg"&&J[1]!=="rad";case 1:return or(te[0])||J[0]==="deg"||J[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(te){var J=te.length;return J===1||J===2||J===4}}};var l={zeroNonZero:function(te,J){return(te==null||J==null)&&te!==J||te==0&&J!=0?!0:te!=0&&J==0},any:function(te,J){return te!=J},emptyNonEmpty:function(te,J){var ge=lf(te),ee=lf(J);return ge&&!ee||!ge&&ee}},u=Fi.types,h=[{name:"label",type:u.text,triggersBounds:l.any,triggersZOrder:l.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any}],d=[{name:"source-label",type:u.text,triggersBounds:l.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-offset",type:u.size,triggersBounds:l.any}],f=[{name:"target-label",type:u.text,triggersBounds:l.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-offset",type:u.size,triggersBounds:l.any}],p=[{name:"font-family",type:u.fontFamily,triggersBounds:l.any},{name:"font-style",type:u.fontStyle,triggersBounds:l.any},{name:"font-weight",type:u.fontWeight,triggersBounds:l.any},{name:"font-size",type:u.size,triggersBounds:l.any},{name:"text-transform",type:u.textTransform,triggersBounds:l.any},{name:"text-wrap",type:u.textWrap,triggersBounds:l.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:l.any},{name:"text-max-width",type:u.size,triggersBounds:l.any},{name:"text-outline-width",type:u.size,triggersBounds:l.any},{name:"line-height",type:u.positiveNumber,triggersBounds:l.any}],g=[{name:"text-valign",type:u.valign,triggersBounds:l.any},{name:"text-halign",type:u.halign,triggersBounds:l.any},{name:"color",type:u.color},{name:"text-outline-color",type:u.color},{name:"text-outline-opacity",type:u.zeroOneNumber},{name:"text-background-color",type:u.color},{name:"text-background-opacity",type:u.zeroOneNumber},{name:"text-background-padding",type:u.size,triggersBounds:l.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:l.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:l.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:l.any},{name:"text-justification",type:u.justification},{name:"text-metrics",type:u.textMetrics},{name:"box-select-labels",type:u.bool,triggersBounds:l.any}],m=[{name:"events",type:u.bool,triggersZOrder:l.any},{name:"text-events",type:u.bool,triggersZOrder:l.any},{name:"box-selection",type:u.boxSelection,triggersZOrder:l.any}],y=[{name:"display",type:u.display,triggersZOrder:l.any,triggersBounds:l.any,triggersBoundsOfConnectedEdges:l.any,triggersBoundsOfParallelEdges:function(te,J,ge){return te===J?!1:ge.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:u.visibility,triggersZOrder:l.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:l.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:l.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:l.any},{name:"z-index",type:u.number,triggersZOrder:l.any}],v=[{name:"overlay-padding",type:u.size,triggersBounds:l.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"overlay-corner-radius",type:u.cornerRadius}],T=[{name:"underlay-padding",type:u.size,triggersBounds:l.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"underlay-corner-radius",type:u.cornerRadius}],b=[{name:"transition-property",type:u.propList},{name:"transition-duration",type:u.time},{name:"transition-delay",type:u.time},{name:"transition-timing-function",type:u.easing}],w=function(te,J){return J.value==="label"?-te.poolIndex():J.pfValue},C=[{name:"height",type:u.nodeSize,triggersBounds:l.any,hashOverride:w},{name:"width",type:u.nodeSize,triggersBounds:l.any,hashOverride:w},{name:"shape",type:u.nodeShape,triggersBounds:l.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:l.any},{name:"corner-radius",type:u.cornerRadius},{name:"background-color",type:u.color},{name:"background-fill",type:u.fill},{name:"background-opacity",type:u.zeroOneNumber},{name:"background-blacken",type:u.nOneOneNumber},{name:"background-gradient-stop-colors",type:u.colors},{name:"background-gradient-stop-positions",type:u.percentages},{name:"background-gradient-direction",type:u.gradientDirection},{name:"padding",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:l.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:l.any}],S=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:l.any},{name:"border-style",type:u.borderStyle},{name:"border-cap",type:u.lineCap},{name:"border-join",type:u.lineJoin},{name:"border-dash-pattern",type:u.numbers},{name:"border-dash-offset",type:u.number},{name:"border-position",type:u.linePosition}],k=[{name:"outline-color",type:u.color},{name:"outline-opacity",type:u.zeroOneNumber},{name:"outline-width",type:u.size,triggersBounds:l.any},{name:"outline-style",type:u.borderStyle},{name:"outline-offset",type:u.size,triggersBounds:l.any}],E=[{name:"background-image",type:u.urls},{name:"background-image-crossorigin",type:u.bgCrossOrigin},{name:"background-image-opacity",type:u.zeroOneNumbers},{name:"background-image-containment",type:u.bgContainment},{name:"background-image-smoothing",type:u.bools},{name:"background-position-x",type:u.bgPos},{name:"background-position-y",type:u.bgPos},{name:"background-width-relative-to",type:u.bgRelativeTo},{name:"background-height-relative-to",type:u.bgRelativeTo},{name:"background-repeat",type:u.bgRepeat},{name:"background-fit",type:u.bgFit},{name:"background-clip",type:u.bgClip},{name:"background-width",type:u.bgWH},{name:"background-height",type:u.bgWH},{name:"background-offset-x",type:u.bgPos},{name:"background-offset-y",type:u.bgPos}],_=[{name:"position",type:u.position,triggersBounds:l.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:l.any},{name:"min-width",type:u.size,triggersBounds:l.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height",type:u.size,triggersBounds:l.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:l.any}],M=[{name:"line-style",type:u.lineStyle},{name:"line-color",type:u.color},{name:"line-fill",type:u.fill},{name:"line-cap",type:u.lineCap},{name:"line-opacity",type:u.zeroOneNumber},{name:"line-dash-pattern",type:u.numbers},{name:"line-dash-offset",type:u.number},{name:"line-outline-width",type:u.size},{name:"line-outline-color",type:u.color},{name:"line-gradient-stop-colors",type:u.colors},{name:"line-gradient-stop-positions",type:u.percentages},{name:"curve-style",type:u.curveStyle,triggersBounds:l.any,triggersBoundsOfParallelEdges:function(te,J){return te===J?!1:te==="bezier"||J==="bezier"}},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:l.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"control-point-step-size",type:u.size,triggersBounds:l.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"control-point-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"segment-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-radii",type:u.numbers,triggersBounds:l.any},{name:"radius-type",type:u.radiusType,triggersBounds:l.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:l.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:l.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:l.any},{name:"taxi-radius",type:u.number,triggersBounds:l.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:l.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:l.any},{name:"loop-direction",type:u.angle,triggersBounds:l.any},{name:"loop-sweep",type:u.angle,triggersBounds:l.any},{name:"source-distance-from-node",type:u.size,triggersBounds:l.any},{name:"target-distance-from-node",type:u.size,triggersBounds:l.any}],L=[{name:"ghost",type:u.bool,triggersBounds:l.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-opacity",type:u.zeroOneNumber}],P=[{name:"selection-box-color",type:u.color},{name:"selection-box-opacity",type:u.zeroOneNumber},{name:"selection-box-border-color",type:u.color},{name:"selection-box-border-width",type:u.size},{name:"active-bg-color",type:u.color},{name:"active-bg-opacity",type:u.zeroOneNumber},{name:"active-bg-size",type:u.size},{name:"outside-texture-bg-color",type:u.color},{name:"outside-texture-bg-opacity",type:u.zeroOneNumber}],D=[];Fi.pieBackgroundN=16,D.push({name:"pie-size",type:u.sizeMaybePercent}),D.push({name:"pie-hole",type:u.sizeMaybePercent}),D.push({name:"pie-start-angle",type:u.angle});for(var R=1;R<=Fi.pieBackgroundN;R++)D.push({name:"pie-"+R+"-background-color",type:u.color}),D.push({name:"pie-"+R+"-background-size",type:u.percent}),D.push({name:"pie-"+R+"-background-opacity",type:u.zeroOneNumber});var I=[];Fi.stripeBackgroundN=16,I.push({name:"stripe-size",type:u.sizeMaybePercent}),I.push({name:"stripe-direction",type:u.axisDirectionPrimary});for(var $=1;$<=Fi.stripeBackgroundN;$++)I.push({name:"stripe-"+$+"-background-color",type:u.color}),I.push({name:"stripe-"+$+"-background-size",type:u.percent}),I.push({name:"stripe-"+$+"-background-opacity",type:u.zeroOneNumber});var O=[],N=Fi.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:l.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill},{name:"arrow-width",type:u.arrowWidth}].forEach(function(Q){N.forEach(function(te){var J=te+"-"+Q.name,ge=Q.type,ee=Q.triggersBounds;O.push({name:J,type:ge,triggersBounds:ee})})},{});var F=Fi.properties=[].concat(m,b,y,v,T,L,g,p,h,d,f,C,S,k,E,D,I,_,M,O,P),z=Fi.propertyGroups={behavior:m,transition:b,visibility:y,overlay:v,underlay:T,ghost:L,commonLabel:g,labelDimensions:p,mainLabel:h,sourceLabel:d,targetLabel:f,nodeBody:C,nodeBorder:S,nodeOutline:k,backgroundImage:E,pie:D,stripe:I,compound:_,edgeLine:M,edgeArrow:O,core:P},V=Fi.propertyGroupNames={},B=Fi.propertyGroupKeys=Object.keys(z);B.forEach(function(Q){V[Q]=z[Q].map(function(te){return te.name}),z[Q].forEach(function(te){return te.groupKey=Q})});var G=Fi.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];Fi.propertyNames=F.map(function(Q){return Q.name});for(var H=0;H<F.length;H++){var q=F[H];F[q.name]=q}for(var Z=0;Z<G.length;Z++){var Y=G[Z],ie=F[Y.pointsTo],K={name:Y.name,alias:!0,pointsTo:ie};F.push(K),F[Y.name]=K}})();Fi.getDefaultProperty=function(t){return this.getDefaultProperties()[t]};Fi.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=dr({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","box-selection":"contain","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","text-metrics":"font","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var h=1;h<=Fi.pieBackgroundN;h++){var d=u.name.replace("{{i}}",h),f=u.value;l[d]=f}return l},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var h=1;h<=Fi.stripeBackgroundN;h++){var d=u.name.replace("{{i}}",h),f=u.value;l[d]=f}return l},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(l,u){return Fi.arrowPrefixes.forEach(function(h){var d=h+"-"+u.name,f=u.value;l[d]=f}),l},{})),r={},n=0;n<this.properties.length;n++){var i=this.properties[n];if(!i.pointsTo){var a=i.name,s=e[a],o=this.parse(a,s);r[a]=o}}return t.defaultProperties=r,t.defaultProperties};Fi.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var mL={};mL.parse=function(t,e,r,n){var i=this;if(gi(e))return i.parseImplWarn(t,e,r,n);var a=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,s=r?"t":"f",o=""+e,l=sve(t,o,s,a),u=i.propCache=i.propCache||[],h;return(h=u[l])||(h=u[l]=i.parseImplWarn(t,e,r,n)),(r||n==="mapping")&&(h=Fc(h),h&&(h.value=Fc(h.value))),h};mL.parseImplWarn=function(t,e,r,n){var i=this.parseImpl(t,e,r,n);return!i&&e!=null&&Cn("The style property `".concat(t,": ").concat(e,"` is invalid")),i&&(i.name==="width"||i.name==="height")&&e==="label"&&Cn("The style value of `label` is deprecated for `"+i.name+"`"),i};mL.parseImpl=function(t,e,r,n){var i=this;t=VG(t);var a=i.properties[t],s=e,o=i.types;if(!a||e===void 0)return null;a.alias&&(a=a.pointsTo,t=a.name);var l=or(e);l&&(e=e.trim());var u=a.type;if(!u)return null;if(r&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(gi(e))return{name:t,value:e,strValue:"fn",mapped:o.fn,bypass:r};var h,d;if(!(!l||n||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(h=new RegExp(o.data.regex).exec(e))){if(r)return!1;var f=o.data;return{name:t,value:h,strValue:""+e,mapped:f,field:h[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var p=o.mapData;if(!(u.color||u.number))return!1;var g=this.parse(t,d[4]);if(!g||g.mapped)return!1;var m=this.parse(t,d[5]);if(!m||m.mapped)return!1;if(g.pfValue===m.pfValue||g.strValue===m.strValue)return Cn("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+g.strValue+"`"),this.parse(t,g.strValue);if(u.color){var y=g.value,v=m.value,T=y[0]===v[0]&&y[1]===v[1]&&y[2]===v[2]&&(y[3]===v[3]||(y[3]==null||y[3]===1)&&(v[3]==null||v[3]===1));if(T)return!1}return{name:t,value:d,strValue:""+e,mapped:p,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:g.value,valueMax:m.value,bypass:r}}}if(u.multiple&&n!=="multiple"){var b;if(l?b=e.split(/\s+/):Nn(e)?b=e:b=[e],u.evenMultiple&&b.length%2!==0)return null;for(var w=[],C=[],S=[],k="",E=!1,_=0;_<b.length;_++){var M=i.parse(t,b[_],r,"multiple");E=E||or(M.value),w.push(M.value),S.push(M.pfValue!=null?M.pfValue:M.value),C.push(M.units),k+=(_>0?" ":"")+M.strValue}return u.validate&&!u.validate(w,C)?null:u.singleEnum&&E?w.length===1&&or(w[0])?{name:t,value:w[0],strValue:w[0],bypass:r}:null:{name:t,value:w,pfValue:S,strValue:k,bypass:r,units:C}}var L=function(){for(var K=0;K<u.enums.length;K++){var Q=u.enums[K];if(Q===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(u.number){var P,D="px";if(u.units&&(P=u.units),u.implicitUnits&&(D=u.implicitUnits),!u.unitless)if(l){var R="px|em"+(u.allowPercent?"|\\%":"");P&&(R=P);var I=e.match("^("+sa+")("+R+")?$");I&&(e=I[1],P=I[2]||D)}else(!P||u.implicitUnits)&&(P=D);if(e=parseFloat(e),isNaN(e)&&u.enums===void 0)return null;if(isNaN(e)&&u.enums!==void 0)return e=s,L();if(u.integer&&!Mut(e)||u.min!==void 0&&(e<u.min||u.strictMin&&e===u.min)||u.max!==void 0&&(e>u.max||u.strictMax&&e===u.max))return null;var $={name:t,value:e,strValue:""+e+(P||""),units:P,bypass:r};return u.unitless||P!=="px"&&P!=="em"?$.pfValue=e:$.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&($.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&($.pfValue=P==="rad"?e:Vht(e)),P==="%"&&($.pfValue=e/100),$}else if(u.propList){var O=[],N=""+e;if(N!=="none"){for(var F=N.split(/\s*,\s*|\s+/),z=0;z<F.length;z++){var V=F[z].trim();i.properties[V]?O.push(V):Cn("`"+V+"` is not a valid property name")}if(O.length===0)return null}return{name:t,value:O,strValue:O.length===0?"none":O.join(" "),bypass:r}}else if(u.color){var B=J1e(e);return B?{name:t,value:B,pfValue:B,strValue:"rgb("+B[0]+","+B[1]+","+B[2]+")",bypass:r}:null}else if(u.regex||u.regexes){if(u.enums){var G=L();if(G)return G}for(var H=u.regexes?u.regexes:[u.regex],q=0;q<H.length;q++){var Z=new RegExp(H[q]),Y=Z.exec(e);if(Y)return{name:t,value:u.singleRegexMatchValue?Y[1]:Y,strValue:""+e,bypass:r}}return null}else return u.string?{name:t,value:""+e,strValue:""+e,bypass:r}:u.enums?L():null};var Sa=function(e){if(!(this instanceof Sa))return new Sa(e);if(!zG(e)){oi("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},vs=Sa.prototype;vs.instanceString=function(){return"style"};vs.clear=function(){for(var t=this._private,e=t.cy,r=e.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(r,!0),r.forEach(function(i){var a=i[0]._private;a.styleDirty=!0,a.appliedInitStyle=!1}),this};vs.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};vs.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)};vs.selector=function(t){var e=t==="core"?null:new hf(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this};vs.css=function(){var t=this,e=arguments;if(e.length===1)for(var r=e[0],n=0;n<t.properties.length;n++){var i=t.properties[n],a=r[i.name];a===void 0&&(a=r[rL(i.name)]),a!==void 0&&this.cssRule(i.name,a)}else e.length===2&&this.cssRule(e[0],e[1]);return this};vs.style=vs.css;vs.cssRule=function(t,e){var r=this.parse(t,e);if(r){var n=this.length-1;this[n].properties.push(r),this[n].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value&&(this._private.hasPie=!0),r.name.match(/stripe-(\d+)-background-size/)&&r.value&&(this._private.hasStripe=!0),r.mapped&&this[n].mappedProperties.push(r);var i=!this[n].selector;i&&(this._private.coreStyle[r.name]=r)}return this};vs.append=function(t){return K1e(t)?t.appendToStyle(this):Nn(t)?this.appendFromJson(t):or(t)&&this.appendFromString(t),this};Sa.fromJson=function(t,e){var r=new Sa(t);return r.fromJson(e),r};Sa.fromString=function(t,e){return new Sa(t).fromString(e)};[Ra,bS,rW,Jc,gL,nW,Fi,mL].forEach(function(t){dr(vs,t)});Sa.types=vs.types;Sa.properties=vs.properties;Sa.propertyGroups=vs.propertyGroups;Sa.propertyGroupNames=vs.propertyGroupNames;Sa.propertyGroupKeys=vs.propertyGroupKeys;var Upt={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return K1e(e)?r.style=e.generateStyle(this):Nn(e)?r.style=Sa.fromJson(this,e):or(e)?r.style=Sa.fromString(this,e):r.style=Sa(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},Ypt="single",W0={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var r=this._private;if(r.selectionType==null&&(r.selectionType=Ypt),e!==void 0)(e==="additive"||e==="single")&&(r.selectionType=e);else return r.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,r=this._private.pan,n,i,a,s,o;switch(e.length){case 0:return r;case 1:if(or(e[0]))return n=e[0],r[n];if(ln(e[0])){if(!this._private.panningEnabled)return this;a=e[0],s=a.x,o=a.y,Dt(s)&&(r.x=s),Dt(o)&&(r.y=o),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],i=e[1],(n==="x"||n==="y")&&Dt(i)&&(r[n]=i),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,r){var n=arguments,i=this._private.pan,a,s,o,l,u;if(!this._private.panningEnabled)return this;switch(n.length){case 1:ln(e)&&(o=n[0],l=o.x,u=o.y,Dt(l)&&(i.x+=l),Dt(u)&&(i.y+=u),this.emit("pan viewport"));break;case 2:a=e,s=r,(a==="x"||a==="y")&&Dt(s)&&(i[a]+=s),this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(e,r){var n=this.getFitViewport(e,r);if(n){var i=this._private;i.zoom=n.zoom,i.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,r){if(Dt(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(or(e)){var i=e;e=this.$(i)}else if(Dut(e)){var a=e;n={x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else Po(e)||(e=this.mutableElements());if(!(Po(e)&&e.empty())){n=n||e.boundingBox();var s=this.width(),o=this.height(),l;if(r=Dt(r)?r:0,!isNaN(s)&&!isNaN(o)&&s>0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((s-2*r)/n.w,(o-2*r)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l<this._private.minZoom?this._private.minZoom:l;var u={x:(s-l*(n.x1+n.x2))/2,y:(o-l*(n.y1+n.y2))/2};return{zoom:l,pan:u}}}}},zoomRange:function(e,r){var n=this._private;if(r==null){var i=e;e=i.min,r=i.max}return Dt(e)&&Dt(r)&&e<=r?(n.minZoom=e,n.maxZoom=r):Dt(e)&&r===void 0&&e<=n.maxZoom?n.minZoom=e:Dt(r)&&e===void 0&&r>=n.minZoom&&(n.maxZoom=r),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var r=this._private,n=r.pan,i=r.zoom,a,s,o=!1;if(r.zoomingEnabled||(o=!0),Dt(e)?s=e:ln(e)&&(s=e.level,e.position!=null?a=aL(e.position,i,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!r.panningEnabled&&(o=!0)),s=s>r.maxZoom?r.maxZoom:s,s=s<r.minZoom?r.minZoom:s,o||!Dt(s)||s===i||a!=null&&(!Dt(a.x)||!Dt(a.y)))return null;if(a!=null){var l=n,u=i,h=s,d={x:-h/u*(a.x-l.x)+a.x,y:-h/u*(a.y-l.y)+a.y};return{zoomed:!0,panned:!0,zoom:h,pan:d}}else return{zoomed:!0,panned:!1,zoom:s,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var r=this.getZoomedViewport(e),n=this._private;return r==null||!r.zoomed?this:(n.zoom=r.zoom,r.panned&&(n.pan.x=r.pan.x,n.pan.y=r.pan.y),this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var r=this._private,n=!0,i=!0,a=[],s=!1,o=!1;if(!e)return this;if(Dt(e.zoom)||(n=!1),ln(e.pan)||(i=!1),!n&&!i)return this;if(n){var l=e.zoom;l<r.minZoom||l>r.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=l,a.push("zoom"))}if(i&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;Dt(u.x)&&(r.pan.x=u.x,o=!1),Dt(u.y)&&(r.pan.y=u.y,o=!1),o||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(or(e)){var n=e;e=this.mutableElements().filter(n)}else Po(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),a=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var o={x:(a-r*(i.x1+i.x2))/2,y:(s-r*(i.y1+i.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?(function(){var i=n.window().getComputedStyle(r),a=function(o){return parseFloat(i.getPropertyValue(o))};return{width:r.clientWidth-a("padding-left")-a("padding-right"),height:r.clientHeight-a("padding-top")-a("padding-bottom")}})():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,r=this._private.zoom,n=this.renderedExtent(),i={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};W0.centre=W0.center;W0.autolockNodes=W0.autolock;W0.autoungrabifyNodes=W0.autoungrabify;var sk={data:Tn.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Tn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Tn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Tn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};sk.attr=sk.data;sk.removeAttr=sk.removeData;var ok=function(e){var r=this;e=dr({},e);var n=e.container;n&&!h_(n)&&h_(n[0])&&(n=n[0]);var i=n?n._cyreg:null;i=i||{},i&&i.cy&&(i.cy.destroy(),i={});var a=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=r;var s=ra!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=dr({name:s?"grid":"null"},o.layout),o.renderer=dr({name:s?"canvas":"null"},o.renderer);var l=function(g,m,y){return m!==void 0?m:y!==void 0?y:g},u=this._private={container:n,ready:!1,options:o,elements:new Za(this),listeners:[],aniEles:new Za(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:Dt(o.zoom)?o.zoom:1,pan:{x:ln(o.pan)&&Dt(o.pan.x)?o.pan.x:0,y:ln(o.pan)&&Dt(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var h=function(g,m){var y=g.some(Out);if(y)return Lx.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=dr({},o,o.renderer);r.initRenderer(d);var f=function(g,m,y){r.notifications(!1);var v=r.mutableElements();v.length>0&&v.remove(),g!=null&&(ln(g)||Nn(g))&&r.add(g),r.one("layoutready",function(b){r.notifications(!0),r.emit(b),r.one("load",m),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var T=dr({},r._private.options.layout);T.eles=r.elements(),r.layout(T).run()};h([o.style,o.elements],function(p){var g=p[0],m=p[1];u.styleEnabled&&r.style().append(g),f(m,function(){r.startAnimationLoop(),u.ready=!0,gi(o.ready)&&r.on("ready",o.ready);for(var y=0;y<a.length;y++){var v=a[y];r.on("ready",v)}i&&(i.readies=[]),r.emit("ready")},o.done)})},v_=ok.prototype;dr(v_,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return ra;var r=this._private.container.ownerDocument;return r===void 0||r==null?ra:r.defaultView||ra},mount:function(e){if(e!=null){var r=this,n=r._private,i=n.options;return!h_(e)&&h_(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),n.container=e,n.styleEnabled=!0,r.invalidateSize(),r.initRenderer(dr({},i,i.renderer,{name:i.renderer.name==="null"?"canvas":i.renderer.name})),r.startAnimationLoop(),r.style(i.style),r.emit("mount"),r}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Fc(this._private.options)},json:function(e){var r=this,n=r._private,i=r.mutableElements(),a=function(w){return r.getElementById(w.id())};if(ln(e)){if(r.startBatch(),e.elements){var s={},o=function(w,C){for(var S=[],k=[],E=0;E<w.length;E++){var _=w[E];if(!_.data.id){Cn("cy.json() cannot handle elements without an ID attribute");continue}var M=""+_.data.id,L=r.getElementById(M);s[M]=!0,L.length!==0?k.push({ele:L,json:_}):(C&&(_.group=C),S.push(_))}r.add(S);for(var P=0;P<k.length;P++){var D=k[P],R=D.ele,I=D.json;R.json(I)}};if(Nn(e.elements))o(e.elements);else for(var l=["nodes","edges"],u=0;u<l.length;u++){var h=l[u],d=e.elements[h];Nn(d)&&o(d,h)}var f=r.collection();i.filter(function(b){return!s[b.id()]}).forEach(function(b){b.isParent()?f.merge(b):b.remove()}),f.forEach(function(b){return b.children().move({parent:null})}),f.forEach(function(b){return a(b).remove()})}e.style&&r.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&r.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&r.pan(e.pan),e.data&&r.data(e.data);for(var p=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],g=0;g<p.length;g++){var m=p[g];e[m]!=null&&r[m](e[m])}return r.endBatch(),this}else{var y=!!e,v={};y?v.elements=this.elements().map(function(b){return b.json()}):(v.elements={},i.forEach(function(b){var w=b.group();v.elements[w]||(v.elements[w]=[]),v.elements[w].push(b.json())})),this._private.styleEnabled&&(v.style=r.style().json()),v.data=Fc(r.data());var T=n.options;return v.zoomingEnabled=n.zoomingEnabled,v.userZoomingEnabled=n.userZoomingEnabled,v.zoom=n.zoom,v.minZoom=n.minZoom,v.maxZoom=n.maxZoom,v.panningEnabled=n.panningEnabled,v.userPanningEnabled=n.userPanningEnabled,v.pan=Fc(n.pan),v.boxSelectionEnabled=n.boxSelectionEnabled,v.renderer=Fc(T.renderer),v.hideEdgesOnViewport=T.hideEdgesOnViewport,v.textureOnViewport=T.textureOnViewport,v.wheelSensitivity=T.wheelSensitivity,v.motionBlur=T.motionBlur,v.multiClickDebounceTime=T.multiClickDebounceTime,v}}});v_.$id=v_.getElementById;[$pt,Vpt,Kve,cP,d3,Wpt,uP,f3,Upt,W0,sk].forEach(function(t){dr(v_,t)});var Xpt={fit:!0,directed:!1,direction:"downward",padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}},jpt={maximal:!1,acyclic:!1},Qg=function(e){return e.scratch("breadthfirst")},jee=function(e,r){return e.scratch("breadthfirst",r)};function Zve(t){this.options=dr({},Xpt,jpt,t)}Zve.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=r.nodes().filter(function(oe){return oe.isChildless()}),i=r,a=t.directed,s=t.acyclic||t.maximal||t.maximalAdjustments>0,o=!!t.boundingBox,l=Us(o?t.boundingBox:structuredClone(e.extent())),u;if(Po(t.roots))u=t.roots;else if(Nn(t.roots)){for(var h=[],d=0;d<t.roots.length;d++){var f=t.roots[d],p=e.getElementById(f);h.push(p)}u=e.collection(h)}else if(or(t.roots))u=e.$(t.roots);else if(a)u=n.roots();else{var g=r.components();u=e.collection();for(var m=function(){var be=g[y],fe=be.maxDegree(!1),Pe=be.filter(function(ve){return ve.degree(!1)===fe});u=u.add(Pe)},y=0;y<g.length;y++)m()}var v=[],T={},b=function(be,fe){v[fe]==null&&(v[fe]=[]);var Pe=v[fe].length;v[fe].push(be),jee(be,{index:Pe,depth:fe})},w=function(be,fe){var Pe=Qg(be),ve=Pe.depth,Ce=Pe.index;v[ve][Ce]=null,be.isChildless()&&b(be,fe)};i.bfs({roots:u,directed:t.directed,visit:function(be,fe,Pe,ve,Ce){var Ve=be[0],se=Ve.id();Ve.isChildless()&&b(Ve,Ce),T[se]=!0}});for(var C=[],S=0;S<n.length;S++){var k=n[S];T[k.id()]||C.push(k)}var E=function(be){for(var fe=v[be],Pe=0;Pe<fe.length;Pe++){var ve=fe[Pe];if(ve==null){fe.splice(Pe,1),Pe--;continue}jee(ve,{depth:be,index:Pe})}},_=function(be,fe){for(var Pe=Qg(be),ve=be.incomers().filter(function(he){return he.isNode()&&r.has(he)}),Ce=-1,Ve=be.id(),se=0;se<ve.length;se++){var de=ve[se],Te=Qg(de);Ce=Math.max(Ce,Te.depth)}if(Pe.depth<=Ce){if(!t.acyclic&&fe[Ve])return null;var ae=Ce+1;return w(be,ae),fe[Ve]=ae,!0}return!1};if(a&&s){var M=[],L={},P=function(be){return M.push(be)},D=function(){return M.shift()};for(n.forEach(function(oe){return M.push(oe)});M.length>0;){var R=D(),I=_(R,L);if(I)R.outgoers().filter(function(oe){return oe.isNode()&&r.has(oe)}).forEach(P);else if(I===null){Cn("Detected double maximal shift for node `"+R.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var $=0;if(t.avoidOverlap)for(var O=0;O<n.length;O++){var N=n[O],F=N.layoutDimensions(t),z=F.w,V=F.h;$=Math.max($,z,V)}var B={},G=function(be){if(B[be.id()])return B[be.id()];for(var fe=Qg(be).depth,Pe=be.neighborhood(),ve=0,Ce=0,Ve=0;Ve<Pe.length;Ve++){var se=Pe[Ve];if(!(se.isEdge()||se.isParent()||!n.has(se))){var de=Qg(se);if(de!=null){var Te=de.index,ae=de.depth;if(!(Te==null||ae==null)){var he=v[ae].length;ae<fe&&(ve+=Te/he,Ce++)}}}}return Ce=Math.max(1,Ce),ve=ve/Ce,Ce===0&&(ve=0),B[be.id()]=ve,ve},H=function(be,fe){var Pe=G(be),ve=G(fe),Ce=Pe-ve;return Ce===0?Q1e(be.id(),fe.id()):Ce};t.depthSort!==void 0&&(H=t.depthSort);for(var q=v.length,Z=0;Z<q;Z++)v[Z].sort(H),E(Z);for(var Y=[],ie=0;ie<C.length;ie++)Y.push(C[ie]);var K=function(){for(var be=0;be<q;be++)E(be)};Y.length&&(v.unshift(Y),q=v.length,K());for(var Q=0,te=0;te<q;te++)Q=Math.max(v[te].length,Q);var J={x:l.x1+l.w/2,y:l.y1+l.h/2},ge=n.reduce(function(oe,be){return(function(fe){return{w:oe.w===-1?fe.w:(oe.w+fe.w)/2,h:oe.h===-1?fe.h:(oe.h+fe.h)/2}})(be.boundingBox({includeLabels:t.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),ee=Math.max(q===1?0:o?(l.h-t.padding*2-ge.h)/(q-1):(l.h-t.padding*2-ge.h)/(q+1),$),Re=v.reduce(function(oe,be){return Math.max(oe,be.length)},0),Ie=function(be){var fe=Qg(be),Pe=fe.depth,ve=fe.index;if(t.circle){var Ce=Math.min(l.w/2/q,l.h/2/q);Ce=Math.max(Ce,$);var Ve=Ce*Pe+Ce-(q>0&&v[0].length<=3?Ce/2:0),se=2*Math.PI/v[Pe].length*ve;return Pe===0&&v[0].length===1&&(Ve=1),{x:J.x+Ve*Math.cos(se),y:J.y+Ve*Math.sin(se)}}else{var de=v[Pe].length,Te=Math.max(de===1?0:o?(l.w-t.padding*2-ge.w)/((t.grid?Re:de)-1):(l.w-t.padding*2-ge.w)/((t.grid?Re:de)+1),$),ae={x:J.x+(ve+1-(de+1)/2)*Te,y:J.y+(Pe+1-(q+1)/2)*ee};return ae}},Be={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Be).indexOf(t.direction)===-1&&oi("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Be).join(", ")));var ce=function(be){return uht(Ie(be),l,Be[t.direction])};return r.nodes().layoutPositions(this,t,ce),this};var Kpt={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Qve(t){this.options=dr({},Kpt,t)}Qve.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));for(var s=Us(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/a.length:e.sweep,u=l/Math.max(1,a.length-1),h,d=0,f=0;f<a.length;f++){var p=a[f],g=p.layoutDimensions(e),m=g.w,y=g.h;d=Math.max(d,m,y)}if(Dt(e.radius)?h=e.radius:a.length<=1?h=0:h=Math.min(s.h,s.w)/2-d,a.length>1&&e.avoidOverlap){d*=1.75;var v=Math.cos(u)-Math.cos(0),T=Math.sin(u)-Math.sin(0),b=Math.sqrt(d*d/(v*v+T*T));h=Math.max(b,h)}var w=function(S,k){var E=e.startAngle+k*u*(i?1:-1),_=h*Math.cos(E),M=h*Math.sin(E),L={x:o.x+_,y:o.y+M};return L};return n.nodes().layoutPositions(this,e,w),this};var Zpt={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function Jve(t){this.options=dr({},Zpt,t)}Jve.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,i=e.eles,a=i.nodes().not(":parent"),s=Us(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0,h=0;h<a.length;h++){var d=a[h],f=void 0;f=e.concentric(d),l.push({value:f,node:d}),d._private.scratch.concentric=f}a.updateStyle();for(var p=0;p<a.length;p++){var g=a[p],m=g.layoutDimensions(e);u=Math.max(u,m.w,m.h)}l.sort(function(ee,Re){return Re.value-ee.value});for(var y=e.levelWidth(a),v=[[]],T=v[0],b=0;b<l.length;b++){var w=l[b];if(T.length>0){var C=Math.abs(T[0].value-w.value);C>=y&&(T=[],v.push(T))}T.push(w)}var S=u+e.minNodeSpacing;if(!e.avoidOverlap){var k=v.length>0&&v[0].length>1,E=Math.min(s.w,s.h)/2-S,_=E/(v.length+k?1:0);S=Math.min(S,_)}for(var M=0,L=0;L<v.length;L++){var P=v[L],D=e.sweep===void 0?2*Math.PI-2*Math.PI/P.length:e.sweep,R=P.dTheta=D/Math.max(1,P.length-1);if(P.length>1&&e.avoidOverlap){var I=Math.cos(R)-Math.cos(0),$=Math.sin(R)-Math.sin(0),O=Math.sqrt(S*S/(I*I+$*$));M=Math.max(O,M)}P.r=M,M+=S}if(e.equidistant){for(var N=0,F=0,z=0;z<v.length;z++){var V=v[z],B=V.r-F;N=Math.max(N,B)}F=0;for(var G=0;G<v.length;G++){var H=v[G];G===0&&(F=H.r),H.r=F,F+=N}}for(var q={},Z=0;Z<v.length;Z++)for(var Y=v[Z],ie=Y.dTheta,K=Y.r,Q=0;Q<Y.length;Q++){var te=Y[Q],J=e.startAngle+(r?1:-1)*ie*Q,ge={x:o.x+K*Math.cos(J),y:o.y+K*Math.sin(J)};q[te.node.id()]=ge}return i.nodes().layoutPositions(this,e,function(ee){var Re=ee.id();return q[Re]}),this};var J8,Qpt={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,r){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function yL(t){this.options=dr({},Qpt,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges(),n=r.filter(function(i){var a=i.source().data("id"),s=i.target().data("id"),o=e.some(function(u){return u.data("id")===a}),l=e.some(function(u){return u.data("id")===s});return!o||!l});this.options.eles=this.options.eles.not(n)}yL.prototype.run=function(){var t=this.options,e=t.cy,r=this;r.stopped=!1,(t.animate===!0||t.animate===!1)&&r.emit({type:"layoutstart",layout:r}),t.debug===!0?J8=!0:J8=!1;var n=Jpt(e,r,t);J8&&t0t(n),t.randomize&&r0t(n);var i=Th(),a=function(){n0t(n,e,t),t.fit===!0&&e.fit(t.padding)},s=function(f){return!(r.stopped||f>=t.numIter||(i0t(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature<t.minTemp))},o=function(){if(t.animate===!0||t.animate===!1)a(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var f=t.eles.nodes(),p=t2e(n,t,f);f.layoutPositions(r,t,p)}},l=0,u=!0;if(t.animate===!0){var h=function(){for(var f=0;u&&f<t.refresh;)u=s(l),l++,f++;if(!u)Zee(n,t),o();else{var p=Th();p-i>=t.animationThreshold&&a(),d_(h)}};h()}else{for(;u;)u=s(l),l++;Zee(n,t),o()}return this};yL.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};yL.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Jpt=function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),s=Us(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=n.eles.components(),u={},h=0;h<l.length;h++)for(var d=l[h],f=0;f<d.length;f++){var p=d[f];u[p.id()]=h}for(var h=0;h<o.nodeSize;h++){var g=a[h],m=g.layoutDimensions(n),y={};y.isLocked=g.locked(),y.id=g.data("id"),y.parentId=g.data("parent"),y.cmptId=u[g.id()],y.children=[],y.positionX=g.position("x"),y.positionY=g.position("y"),y.offsetX=0,y.offsetY=0,y.height=m.w,y.width=m.h,y.maxX=y.positionX+y.width/2,y.minX=y.positionX-y.width/2,y.maxY=y.positionY+y.height/2,y.minY=y.positionY-y.height/2,y.padLeft=parseFloat(g.style("padding")),y.padRight=parseFloat(g.style("padding")),y.padTop=parseFloat(g.style("padding")),y.padBottom=parseFloat(g.style("padding")),y.nodeRepulsion=gi(n.nodeRepulsion)?n.nodeRepulsion(g):n.nodeRepulsion,o.layoutNodes.push(y),o.idToIndex[y.id]=h}for(var v=[],T=0,b=-1,w=[],h=0;h<o.nodeSize;h++){var g=o.layoutNodes[h],C=g.parentId;C!=null?o.layoutNodes[o.idToIndex[C]].children.push(g.id):(v[++b]=g.id,w.push(g.id))}for(o.graphSet.push(w);T<=b;){var S=v[T++],k=o.idToIndex[S],p=o.layoutNodes[k],E=p.children;if(E.length>0){o.graphSet.push(E);for(var h=0;h<E.length;h++)v[++b]=E[h]}}for(var h=0;h<o.graphSet.length;h++)for(var _=o.graphSet[h],f=0;f<_.length;f++){var M=o.idToIndex[_[f]];o.indexToGraph[M]=h}for(var h=0;h<o.edgeSize;h++){var L=i[h],P={};P.id=L.data("id"),P.sourceId=L.data("source"),P.targetId=L.data("target");var D=gi(n.idealEdgeLength)?n.idealEdgeLength(L):n.idealEdgeLength,R=gi(n.edgeElasticity)?n.edgeElasticity(L):n.edgeElasticity,I=o.idToIndex[P.sourceId],$=o.idToIndex[P.targetId],O=o.indexToGraph[I],N=o.indexToGraph[$];if(O!=N){for(var F=e0t(P.sourceId,P.targetId,o),z=o.graphSet[F],V=0,y=o.layoutNodes[I];z.indexOf(y.id)===-1;)y=o.layoutNodes[o.idToIndex[y.parentId]],V++;for(y=o.layoutNodes[$];z.indexOf(y.id)===-1;)y=o.layoutNodes[o.idToIndex[y.parentId]],V++;D*=V*n.nestingFactor}P.idealLength=D,P.elasticity=R,o.layoutEdges.push(P)}return o},e0t=function(e,r,n){var i=e2e(e,r,0,n);return 2>i.count?0:i.graph},e2e=function(e,r,n,i){var a=i.graphSet[n];if(-1<a.indexOf(e)&&-1<a.indexOf(r))return{count:2,graph:n};for(var s=0,o=0;o<a.length;o++){var l=a[o],u=i.idToIndex[l],h=i.layoutNodes[u].children;if(h.length!==0){var d=i.indexToGraph[i.idToIndex[h[0]]],f=e2e(e,r,d,i);if(f.count!==0)if(f.count===1){if(s++,s===2)break}else return f}}return{count:s,graph:n}},t0t,r0t=function(e,r){for(var n=e.clientWidth,i=e.clientHeight,a=0;a<e.nodeSize;a++){var s=e.layoutNodes[a];s.children.length===0&&!s.isLocked&&(s.positionX=Math.random()*n,s.positionY=Math.random()*i)}},t2e=function(e,r,n){var i=e.boundingBox,a={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(n.forEach(function(s){var o=e.layoutNodes[e.idToIndex[s.data("id")]];a.x1=Math.min(a.x1,o.positionX),a.x2=Math.max(a.x2,o.positionX),a.y1=Math.min(a.y1,o.positionY),a.y2=Math.max(a.y2,o.positionY)}),a.w=a.x2-a.x1,a.h=a.y2-a.y1),function(s,o){var l=e.layoutNodes[e.idToIndex[s.data("id")]];if(r.boundingBox){var u=a.w===0?.5:(l.positionX-a.x1)/a.w,h=a.h===0?.5:(l.positionY-a.y1)/a.h;return{x:i.x1+u*i.w,y:i.y1+h*i.h}}else return{x:l.positionX,y:l.positionY}}},n0t=function(e,r,n){var i=n.layout,a=n.eles.nodes(),s=t2e(e,n,a);a.positions(s),e.ready!==!0&&(e.ready=!0,i.one("layoutready",n.ready),i.emit({type:"layoutready",layout:this}))},i0t=function(e,r,n){a0t(e,r),l0t(e),c0t(e,r),u0t(e),h0t(e)},a0t=function(e,r){for(var n=0;n<e.graphSet.length;n++)for(var i=e.graphSet[n],a=i.length,s=0;s<a;s++)for(var o=e.layoutNodes[e.idToIndex[i[s]]],l=s+1;l<a;l++){var u=e.layoutNodes[e.idToIndex[i[l]]];s0t(o,u,e,r)}},Kee=function(e){return-e+2*e*Math.random()},s0t=function(e,r,n,i){var a=e.cmptId,s=r.cmptId;if(!(a!==s&&!n.isCompound)){var o=r.positionX-e.positionX,l=r.positionY-e.positionY,u=1;o===0&&l===0&&(o=Kee(u),l=Kee(u));var h=o0t(e,r,o,l);if(h>0)var d=i.nodeOverlap*h,f=Math.sqrt(o*o+l*l),p=d*o/f,g=d*l/f;else var m=b_(e,o,l),y=b_(r,-1*o,-1*l),v=y.x-m.x,T=y.y-m.y,b=v*v+T*T,f=Math.sqrt(b),d=(e.nodeRepulsion+r.nodeRepulsion)/b,p=d*v/f,g=d*T/f;e.isLocked||(e.offsetX-=p,e.offsetY-=g),r.isLocked||(r.offsetX+=p,r.offsetY+=g)}},o0t=function(e,r,n,i){if(n>0)var a=e.maxX-r.minX;else var a=r.maxX-e.minX;if(i>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return a>=0&&s>=0?Math.sqrt(a*a+s*s):0},b_=function(e,r,n){var i=e.positionX,a=e.positionY,s=e.height||1,o=e.width||1,l=n/r,u=s/o,h={};return r===0&&0<n||r===0&&0>n?(h.x=i,h.y=a+s/2,h):0<r&&-1*u<=l&&l<=u?(h.x=i+o/2,h.y=a+o*n/2/r,h):0>r&&-1*u<=l&&l<=u?(h.x=i-o/2,h.y=a-o*n/2/r,h):0<n&&(l<=-1*u||l>=u)?(h.x=i+s*r/2/n,h.y=a+s/2,h):(0>n&&(l<=-1*u||l>=u)&&(h.x=i-s*r/2/n,h.y=a-s/2),h)},l0t=function(e,r){for(var n=0;n<e.edgeSize;n++){var i=e.layoutEdges[n],a=e.idToIndex[i.sourceId],s=e.layoutNodes[a],o=e.idToIndex[i.targetId],l=e.layoutNodes[o],u=l.positionX-s.positionX,h=l.positionY-s.positionY;if(!(u===0&&h===0)){var d=b_(s,u,h),f=b_(l,-1*u,-1*h),p=f.x-d.x,g=f.y-d.y,m=Math.sqrt(p*p+g*g),y=Math.pow(i.idealLength-m,2)/i.elasticity;if(m!==0)var v=y*p/m,T=y*g/m;else var v=0,T=0;s.isLocked||(s.offsetX+=v,s.offsetY+=T),l.isLocked||(l.offsetX-=v,l.offsetY-=T)}}},c0t=function(e,r){if(r.gravity!==0)for(var n=1,i=0;i<e.graphSet.length;i++){var a=e.graphSet[i],s=a.length;if(i===0)var o=e.clientHeight/2,l=e.clientWidth/2;else var u=e.layoutNodes[e.idToIndex[a[0]]],h=e.layoutNodes[e.idToIndex[u.parentId]],o=h.positionX,l=h.positionY;for(var d=0;d<s;d++){var f=e.layoutNodes[e.idToIndex[a[d]]];if(!f.isLocked){var p=o-f.positionX,g=l-f.positionY,m=Math.sqrt(p*p+g*g);if(m>n){var y=r.gravity*p/m,v=r.gravity*g/m;f.offsetX+=y,f.offsetY+=v}}}}},u0t=function(e,r){var n=[],i=0,a=-1;for(n.push.apply(n,e.graphSet[0]),a+=e.graphSet[0].length;i<=a;){var s=n[i++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0<u.length&&!l.isLocked){for(var h=l.offsetX,d=l.offsetY,f=0;f<u.length;f++){var p=e.layoutNodes[e.idToIndex[u[f]]];p.offsetX+=h,p.offsetY+=d,n[++a]=u[f]}l.offsetX=0,l.offsetY=0}}},h0t=function(e,r){for(var n=0;n<e.nodeSize;n++){var i=e.layoutNodes[n];0<i.children.length&&(i.maxX=void 0,i.minX=void 0,i.maxY=void 0,i.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var i=e.layoutNodes[n];if(!(0<i.children.length||i.isLocked)){var a=d0t(i.offsetX,i.offsetY,e.temperature);i.positionX+=a.x,i.positionY+=a.y,i.offsetX=0,i.offsetY=0,i.minX=i.positionX-i.width,i.maxX=i.positionX+i.width,i.minY=i.positionY-i.height,i.maxY=i.positionY+i.height,r2e(i,e)}}for(var n=0;n<e.nodeSize;n++){var i=e.layoutNodes[n];0<i.children.length&&!i.isLocked&&(i.positionX=(i.maxX+i.minX)/2,i.positionY=(i.maxY+i.minY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY)}},d0t=function(e,r,n){var i=Math.sqrt(e*e+r*r);if(i>n)var a={x:n*e/i,y:n*r/i};else var a={x:e,y:r};return a},r2e=function(e,r){var n=e.parentId;if(n!=null){var i=r.layoutNodes[r.idToIndex[n]],a=!1;if((i.maxX==null||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,a=!0),(i.minX==null||e.minX-i.padLeft<i.minX)&&(i.minX=e.minX-i.padLeft,a=!0),(i.maxY==null||e.maxY+i.padBottom>i.maxY)&&(i.maxY=e.maxY+i.padBottom,a=!0),(i.minY==null||e.minY-i.padTop<i.minY)&&(i.minY=e.minY-i.padTop,a=!0),a)return r2e(i,r)}},Zee=function(e,r){for(var n=e.layoutNodes,i=[],a=0;a<n.length;a++){var s=n[a],o=s.cmptId,l=i[o]=i[o]||[];l.push(s)}for(var u=0,a=0;a<i.length;a++){var h=i[a];if(h){h.x1=1/0,h.x2=-1/0,h.y1=1/0,h.y2=-1/0;for(var d=0;d<h.length;d++){var f=h[d];h.x1=Math.min(h.x1,f.positionX-f.width/2),h.x2=Math.max(h.x2,f.positionX+f.width/2),h.y1=Math.min(h.y1,f.positionY-f.height/2),h.y2=Math.max(h.y2,f.positionY+f.height/2)}h.w=h.x2-h.x1,h.h=h.y2-h.y1,u+=h.w*h.h}}i.sort(function(T,b){return b.w*b.h-T.w*T.h});for(var p=0,g=0,m=0,y=0,v=Math.sqrt(u)*e.clientWidth/e.clientHeight,a=0;a<i.length;a++){var h=i[a];if(h){for(var d=0;d<h.length;d++){var f=h[d];f.isLocked||(f.positionX+=p-h.x1,f.positionY+=g-h.y1)}p+=h.w+r.componentSpacing,m+=h.w+r.componentSpacing,y=Math.max(y,h.h),m>v&&(g+=y+r.componentSpacing,p=0,m=0,y=0)}}},f0t={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function n2e(t){this.options=dr({},f0t,t)}n2e.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var a=Us(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(a.h===0||a.w===0)n.nodes().layoutPositions(this,e,function(G){return{x:a.x1,y:a.y1}});else{var s=i.size(),o=Math.sqrt(s*a.h/a.w),l=Math.round(o),u=Math.round(a.w/a.h*o),h=function(H){if(H==null)return Math.min(l,u);var q=Math.min(l,u);q==l?l=H:u=H},d=function(H){if(H==null)return Math.max(l,u);var q=Math.max(l,u);q==l?l=H:u=H},f=e.rows,p=e.cols!=null?e.cols:e.columns;if(f!=null&&p!=null)l=f,u=p;else if(f!=null&&p==null)l=f,u=Math.ceil(s/l);else if(f==null&&p!=null)u=p,l=Math.ceil(s/u);else if(u*l>s){var g=h(),m=d();(g-1)*m>=s?h(g-1):(m-1)*g>=s&&d(m-1)}else for(;u*l<s;){var y=h(),v=d();(v+1)*y>=s?d(v+1):h(y+1)}var T=a.w/u,b=a.h/l;if(e.condense&&(T=0,b=0),e.avoidOverlap)for(var w=0;w<i.length;w++){var C=i[w],S=C._private.position;(S.x==null||S.y==null)&&(S.x=0,S.y=0);var k=C.layoutDimensions(e),E=e.avoidOverlapPadding,_=k.w+E,M=k.h+E;T=Math.max(T,_),b=Math.max(b,M)}for(var L={},P=function(H,q){return!!L["c-"+H+"-"+q]},D=function(H,q){L["c-"+H+"-"+q]=!0},R=0,I=0,$=function(){I++,I>=u&&(I=0,R++)},O={},N=0;N<i.length;N++){var F=i[N],z=e.position(F);if(z&&(z.row!==void 0||z.col!==void 0)){var V={row:z.row,col:z.col};if(V.col===void 0)for(V.col=0;P(V.row,V.col);)V.col++;else if(V.row===void 0)for(V.row=0;P(V.row,V.col);)V.row++;O[F.id()]=V,D(V.row,V.col)}}var B=function(H,q){var Z,Y;if(H.locked()||H.isParent())return!1;var ie=O[H.id()];if(ie)Z=ie.col*T+T/2+a.x1,Y=ie.row*b+b/2+a.y1;else{for(;P(R,I);)$();Z=I*T+T/2+a.x1,Y=R*b+b/2+a.y1,D(R,I),$()}return{x:Z,y:Y}};i.layoutPositions(this,e,B)}return this};var p0t={ready:function(){},stop:function(){}};function iW(t){this.options=dr({},p0t,t)}iW.prototype.run=function(){var t=this.options,e=t.eles,r=this;return t.cy,r.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",t.ready),r.emit("layoutready"),r.one("layoutstop",t.stop),r.emit("layoutstop"),this};iW.prototype.stop=function(){return this};var g0t={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function i2e(t){this.options=dr({},g0t,t)}i2e.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),n=gi(t.positions);function i(a){if(t.positions==null)return $ht(a.position());if(n)return t.positions(a);var s=t.positions[a._private.data.id];return s??null}return r.layoutPositions(this,t,function(a,s){var o=i(a);return a.locked()||o==null?!1:o}),this};var m0t={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function a2e(t){this.options=dr({},m0t,t)}a2e.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=Us(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),i=function(s,o){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}};return r.nodes().layoutPositions(this,t,i),this};var y0t=[{name:"breadthfirst",impl:Zve},{name:"circle",impl:Qve},{name:"concentric",impl:Jve},{name:"cose",impl:yL},{name:"grid",impl:n2e},{name:"null",impl:iW},{name:"preset",impl:i2e},{name:"random",impl:a2e}];function s2e(t){this.options=t,this.notifications=0}var Qee=function(){},Jee=function(){throw new Error("A headless instance can not render images")};s2e.prototype={recalculateRenderedStyle:Qee,notify:function(){this.notifications++},init:Qee,isHeadless:function(){return!0},png:Jee,jpg:Jee};var aW={};aW.arrowShapeWidth=.3;aW.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(u,h,d,f,p,g,m){var y=p.x-d/2-m,v=p.x+d/2+m,T=p.y-d/2-m,b=p.y+d/2+m,w=y<=u&&u<=v&&T<=h&&h<=b;return w},n=function(u,h,d,f,p){var g=u*Math.cos(f)-h*Math.sin(f),m=u*Math.sin(f)+h*Math.cos(f),y=g*d,v=m*d,T=y+p.x,b=v+p.y;return{x:T,y:b}},i=function(u,h,d,f){for(var p=[],g=0;g<u.length;g+=2){var m=u[g],y=u[g+1];p.push(n(m,y,h,d,f))}return p},a=function(u){for(var h=[],d=0;d<u.length;d++){var f=u[d];h.push(f.x,f.y)}return h},s=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},o=function(u,h){or(h)&&(h=t[h]),t[u]=dr({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(f,p,g,m,y,v){var T=a(i(this.points,g+2*v,m,y)),b=fo(f,p,T);return b},roughCollide:r,draw:function(f,p,g,m){var y=i(this.points,p,g,m);e.arrowShapeImpl("polygon")(f,y)},spacing:function(f){return 0},gap:s},h)};o("none",{collide:f_,roughCollide:f_,draw:HG,spacing:fJ,gap:fJ}),o("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),o("arrow","triangle"),o("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:function(u,h,d,f,p){var g=i(this.points,h,d,f),m=this.controlPoint,y=n(m[0],m[1],h,d,f);e.arrowShapeImpl(this.name)(u,g,y)},gap:function(u){return s(u)*.8}}),o("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(u,h,d,f,p,g,m){var y=a(i(this.points,d+2*m,f,p)),v=a(i(this.pointsTee,d+2*m,f,p)),T=fo(u,h,y)||fo(u,h,v);return T},draw:function(u,h,d,f,p){var g=i(this.points,h,d,f),m=i(this.pointsTee,h,d,f);e.arrowShapeImpl(this.name)(u,g,m)}}),o("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,h,d,f,p,g,m){var y=p,v=Math.pow(y.x-u,2)+Math.pow(y.y-h,2)<=Math.pow((d+2*m)*this.radius,2),T=a(i(this.points,d+2*m,f,p));return fo(u,h,T)||v},draw:function(u,h,d,f,p){var g=i(this.pointsTr,h,d,f);e.arrowShapeImpl(this.name)(u,g,f.x,f.y,this.radius*h)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),o("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(u,h){var d=this.baseCrossLinePts.slice(),f=h/u,p=3,g=5;return d[p]=d[p]-f,d[g]=d[g]-f,d},collide:function(u,h,d,f,p,g,m){var y=a(i(this.points,d+2*m,f,p)),v=a(i(this.crossLinePts(d,g),d+2*m,f,p)),T=fo(u,h,y)||fo(u,h,v);return T},draw:function(u,h,d,f,p){var g=i(this.points,h,d,f),m=i(this.crossLinePts(h,p),h,d,f);e.arrowShapeImpl(this.name)(u,g,m)}}),o("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return s(u)*.525}}),o("circle",{radius:.15,collide:function(u,h,d,f,p,g,m){var y=p,v=Math.pow(y.x-u,2)+Math.pow(y.y-h,2)<=Math.pow((d+2*m)*this.radius,2);return v},draw:function(u,h,d,f,p){e.arrowShapeImpl(this.name)(u,f.x,f.y,this.radius*h)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),o("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(u){return 1},gap:function(u){return 1}}),o("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),o("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),o("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(u){return .95*u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}})};var pg={};pg.projectIntoViewport=function(t,e){var r=this.cy,n=this.findContainerClientCoords(),i=n[0],a=n[1],s=n[4],o=r.pan(),l=r.zoom(),u=((t-i)/s-o.x)/l,h=((e-a)/s-o.y)/l;return[u,h]};pg.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),n=function(v){return parseFloat(r.getPropertyValue(v))},i={left:n("padding-left"),right:n("padding-right"),top:n("padding-top"),bottom:n("padding-bottom")},a={left:n("border-left-width"),right:n("border-right-width"),top:n("border-top-width"),bottom:n("border-bottom-width")},s=t.clientWidth,o=t.clientHeight,l=i.left+i.right,u=i.top+i.bottom,h=a.left+a.right,d=e.width/(s+h),f=s-l,p=o-u,g=e.left+i.left+a.left,m=e.top+i.top+a.top;return this.containerBB=[g,m,f,p,d]};pg.invalidateContainerClientCoordsCache=function(){this.containerBB=null};pg.findNearestElement=function(t,e,r,n){return this.findNearestElements(t,e,r,n)[0]};pg.findNearestElements=function(t,e,r,n){var i=this,a=this,s=a.getCachedZSortedEles(),o=[],l=a.cy.zoom(),u=a.cy.hasCompoundNodes(),h=(n?24:8)/l,d=(n?8:2)/l,f=(n?8:2)/l,p=1/0,g,m;r&&(s=s.interactive);function y(k,E){if(k.isNode()){if(m)return;m=k,o.push(k)}if(k.isEdge()&&(E==null||E<p))if(g){if(g.pstyle("z-compound-depth").value===k.pstyle("z-compound-depth").value&&g.pstyle("z-compound-depth").value===k.pstyle("z-compound-depth").value){for(var _=0;_<o.length;_++)if(o[_].isEdge()){o[_]=k,g=k,p=E??p;break}}}else o.push(k),g=k,p=E??p}function v(k){var E=k.outerWidth()+2*d,_=k.outerHeight()+2*d,M=E/2,L=_/2,P=k.position(),D=k.pstyle("corner-radius").value==="auto"?"auto":k.pstyle("corner-radius").pfValue,R=k._private.rscratch;if(P.x-M<=t&&t<=P.x+M&&P.y-L<=e&&e<=P.y+L){var I=a.nodeShapes[i.getNodeShape(k)];if(I.checkPoint(t,e,0,E,_,P.x,P.y,D,R))return y(k,0),!0}}function T(k){var E=k._private,_=E.rscratch,M=k.pstyle("width").pfValue,L=k.pstyle("arrow-scale").value,P=M/2+h,D=P*P,R=P*2,N=E.source,F=E.target,I;if(_.edgeType==="segments"||_.edgeType==="straight"||_.edgeType==="haystack"){for(var $=_.allpts,O=0;O+3<$.length;O+=2)if(Kht(t,e,$[O],$[O+1],$[O+2],$[O+3],R)&&D>(I=tdt(t,e,$[O],$[O+1],$[O+2],$[O+3])))return y(k,I),!0}else if(_.edgeType==="bezier"||_.edgeType==="multibezier"||_.edgeType==="self"||_.edgeType==="compound"){for(var $=_.allpts,O=0;O+5<_.allpts.length;O+=4)if(Zht(t,e,$[O],$[O+1],$[O+2],$[O+3],$[O+4],$[O+5],R)&&D>(I=edt(t,e,$[O],$[O+1],$[O+2],$[O+3],$[O+4],$[O+5])))return y(k,I),!0}for(var N=N||E.source,F=F||E.target,z=i.getArrowWidth(M,L),V=[{name:"source",x:_.arrowStartX,y:_.arrowStartY,angle:_.srcArrowAngle},{name:"target",x:_.arrowEndX,y:_.arrowEndY,angle:_.tgtArrowAngle},{name:"mid-source",x:_.midX,y:_.midY,angle:_.midsrcArrowAngle},{name:"mid-target",x:_.midX,y:_.midY,angle:_.midtgtArrowAngle}],O=0;O<V.length;O++){var B=V[O],G=a.arrowShapes[k.pstyle(B.name+"-arrow-shape").value],H=k.pstyle("width").pfValue;if(G.roughCollide(t,e,z,B.angle,{x:B.x,y:B.y},H,h)&&G.collide(t,e,z,B.angle,{x:B.x,y:B.y},H,h))return y(k),!0}u&&o.length>0&&(v(N),v(F))}function b(k,E,_){return Ms(k,E,_)}function w(k,E){var _=k._private,M=f,L;E?L=E+"-":L="",k.boundingBox();var P=_.labelBounds[E||"main"],D=k.pstyle(L+"label").value,R=k.pstyle("text-events").strValue==="yes";if(!(!R||!D)){var I=b(_.rscratch,"labelX",E),$=b(_.rscratch,"labelY",E),O=b(_.rscratch,"labelAngle",E),N=k.pstyle(L+"text-margin-x").pfValue,F=k.pstyle(L+"text-margin-y").pfValue,z=P.x1-M-N,V=P.x2+M-N,B=P.y1-M-F,G=P.y2+M-F;if(O){var H=Math.cos(O),q=Math.sin(O),Z=function(ge,ee){return ge=ge-I,ee=ee-$,{x:ge*H-ee*q+I,y:ge*q+ee*H+$}},Y=Z(z,B),ie=Z(z,G),K=Z(V,B),Q=Z(V,G),te=[Y.x+N,Y.y+F,K.x+N,K.y+F,Q.x+N,Q.y+F,ie.x+N,ie.y+F];if(fo(t,e,te))return y(k),!0}else if(Dd(P,t,e))return y(k),!0}}for(var C=s.length-1;C>=0;C--){var S=s[C];S.isNode()?v(S)||w(S):T(S)||w(S)||w(S,"source")||w(S,"target")}return o};pg.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,a=this.cy.zoom(),s=2/a,o=[],l=Math.min(t,r),u=Math.max(t,r),h=Math.min(e,n),d=Math.max(e,n);t=l,r=u,e=h,n=d;var f=Us({x1:t,y1:e,x2:r,y2:n}),p=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],g=[[p[0],p[1]],[p[1],p[2]],[p[2],p[3]],[p[3],p[0]]];function m(ge,ee,Re){return Ms(ge,ee,Re)}function y(ge,ee){var Re=ge._private,Ie=s,Be="";ge.boundingBox();var ce=Re.labelBounds.main;if(!ce)return null;var oe=m(Re.rscratch,"labelX",ee),be=m(Re.rscratch,"labelY",ee),fe=m(Re.rscratch,"labelAngle",ee),Pe=ge.pstyle(Be+"text-margin-x").pfValue,ve=ge.pstyle(Be+"text-margin-y").pfValue,Ce=ce.x1-Ie-Pe,Ve=ce.x2+Ie-Pe,se=ce.y1-Ie-ve,de=ce.y2+Ie-ve;if(fe){var Te=Math.cos(fe),ae=Math.sin(fe),he=function(ne,j){return ne=ne-oe,j=j-be,{x:ne*Te-j*ae+oe,y:ne*ae+j*Te+be}};return[he(Ce,se),he(Ve,se),he(Ve,de),he(Ce,de)]}else return[{x:Ce,y:se},{x:Ve,y:se},{x:Ve,y:de},{x:Ce,y:de}]}function v(ge,ee,Re,Ie){function Be(ce,oe,be){return(be.y-ce.y)*(oe.x-ce.x)>(oe.y-ce.y)*(be.x-ce.x)}return Be(ge,Re,Ie)!==Be(ee,Re,Ie)&&Be(ge,ee,Re)!==Be(ge,ee,Ie)}for(var T=0;T<i.length;T++){var b=i[T];if(b.isNode()){var w=b,C=w.pstyle("text-events").strValue==="yes",S=w.pstyle("box-selection").strValue,k=w.pstyle("box-select-labels").strValue==="yes";if(S==="none")continue;var E=(S==="overlap"||k)&&C,_=w.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:E});if(S==="contain"){var M=!1;if(k&&C){var L=y(w);L&&ZI(L,p)&&(o.push(w),M=!0)}!M&&fve(f,_)&&o.push(w)}else if(S==="overlap"&&XG(f,_)){var P=w.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),D=[{x:P.x1,y:P.y1},{x:P.x2,y:P.y1},{x:P.x2,y:P.y2},{x:P.x1,y:P.y2}];if(ZI(D,p))o.push(w);else{var R=y(w);R&&ZI(R,p)&&o.push(w)}}}else{var I=b,$=I._private,O=$.rscratch,N=I.pstyle("box-selection").strValue;if(N==="none")continue;if(N==="contain"){if(O.startX!=null&&O.startY!=null&&!Dd(f,O.startX,O.startY)||O.endX!=null&&O.endY!=null&&!Dd(f,O.endX,O.endY))continue;if(O.edgeType==="bezier"||O.edgeType==="multibezier"||O.edgeType==="self"||O.edgeType==="compound"||O.edgeType==="segments"||O.edgeType==="haystack"){for(var F=$.rstyle.bezierPts||$.rstyle.linePts||$.rstyle.haystackPts,z=!0,V=0;V<F.length;V++)if(!vJ(f,F[V])){z=!1;break}z&&o.push(I)}else O.edgeType==="straight"&&o.push(I)}else if(N==="overlap"){var B=!1;if(O.startX!=null&&O.startY!=null&&O.endX!=null&&O.endY!=null&&(Dd(f,O.startX,O.startY)||Dd(f,O.endX,O.endY)))o.push(I),B=!0;else if(!B&&O.edgeType==="haystack"){for(var G=$.rstyle.haystackPts,H=0;H<G.length;H++)if(vJ(f,G[H])){o.push(I),B=!0;break}}if(!B){var q=$.rstyle.bezierPts||$.rstyle.linePts||$.rstyle.haystackPts;if((!q||q.length<2)&&O.edgeType==="straight"&&O.startX!=null&&O.startY!=null&&O.endX!=null&&O.endY!=null&&(q=[{x:O.startX,y:O.startY},{x:O.endX,y:O.endY}]),!q||q.length<2)continue;for(var Z=0;Z<q.length-1;Z++){for(var Y=q[Z],ie=q[Z+1],K=0;K<g.length;K++){var Q=zi(g[K],2),te=Q[0],J=Q[1];if(v(Y,ie,te,J)){o.push(I),B=!0;break}}if(B)break}}}}}return o};var x_={};x_.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",n=e.edgeType==="bezier",i=e.edgeType==="multibezier",a=e.edgeType==="segments",s=e.edgeType==="compound",o=e.edgeType==="self",l,u,h,d,f,p,v,T;if(r?(h=e.haystackPts[0],d=e.haystackPts[1],f=e.haystackPts[2],p=e.haystackPts[3]):(h=e.arrowStartX,d=e.arrowStartY,f=e.arrowEndX,p=e.arrowEndY),v=e.midX,T=e.midY,a)l=h-e.segpts[0],u=d-e.segpts[1];else if(i||s||o||n){var g=e.allpts,m=ya(g[0],g[2],g[4],.1),y=ya(g[1],g[3],g[5],.1);l=h-m,u=d-y}else l=h-v,u=d-T;e.srcArrowAngle=XE(l,u);var v=e.midX,T=e.midY;if(r&&(v=(h+f)/2,T=(d+p)/2),l=f-h,u=p-d,a){var g=e.allpts;if(g.length/2%2===0){var b=g.length/2,w=b-2;l=g[b]-g[w],u=g[b+1]-g[w+1]}else if(e.isRound)l=e.midVector[1],u=-e.midVector[0];else{var b=g.length/2-1,w=b-2;l=g[b]-g[w],u=g[b+1]-g[w+1]}}else if(i||s||o){var g=e.allpts,C=e.ctrlpts,S,k,E,_;if(C.length/2%2===0){var M=g.length/2-1,L=M+2,P=L+2;S=ya(g[M],g[L],g[P],0),k=ya(g[M+1],g[L+1],g[P+1],0),E=ya(g[M],g[L],g[P],1e-4),_=ya(g[M+1],g[L+1],g[P+1],1e-4)}else{var L=g.length/2-1,M=L-2,P=L+2;S=ya(g[M],g[L],g[P],.4999),k=ya(g[M+1],g[L+1],g[P+1],.4999),E=ya(g[M],g[L],g[P],.5),_=ya(g[M+1],g[L+1],g[P+1],.5)}l=E-S,u=_-k}if(e.midtgtArrowAngle=XE(l,u),e.midDispX=l,e.midDispY=u,l*=-1,u*=-1,a){var g=e.allpts;if(g.length/2%2!==0){if(!e.isRound){var b=g.length/2-1,D=b+2;l=-(g[D]-g[b]),u=-(g[D+1]-g[b+1])}}}if(e.midsrcArrowAngle=XE(l,u),a)l=f-e.segpts[e.segpts.length-2],u=p-e.segpts[e.segpts.length-1];else if(i||s||o||n){var g=e.allpts,R=g.length,m=ya(g[R-6],g[R-4],g[R-2],.9),y=ya(g[R-5],g[R-3],g[R-1],.9);l=f-m,u=p-y}else l=f-v,u=p-T;e.tgtArrowAngle=XE(l,u)};x_.getArrowWidth=x_.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},n=r[t+", "+e];return n||(n=Math.max(Math.pow(t*13.37,.9),29)*e,r[t+", "+e]=n,n)};var hP,dP,Cc={},rl={},ete,tte,Ap,p3,Lu,Kf,up,yc,Jg,r4,o2e,l2e,fP,pP,rte,nte=function(e,r,n){n.x=r.x-e.x,n.y=r.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},v0t=function(e,r){r.x=e.x*-1,r.y=e.y*-1,r.nx=e.nx*-1,r.ny=e.ny*-1,r.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},b0t=function(e,r,n,i,a){if(e!==rte?nte(r,e,Cc):v0t(rl,Cc),nte(r,n,rl),ete=Cc.nx*rl.ny-Cc.ny*rl.nx,tte=Cc.nx*rl.nx-Cc.ny*-rl.ny,Lu=Math.asin(Math.max(-1,Math.min(1,ete))),Math.abs(Lu)<1e-6){hP=r.x,dP=r.y,up=Jg=0;return}Ap=1,p3=!1,tte<0?Lu<0?Lu=Math.PI+Lu:(Lu=Math.PI-Lu,Ap=-1,p3=!0):Lu>0&&(Ap=-1,p3=!0),r.radius!==void 0?Jg=r.radius:Jg=i,Kf=Lu/2,r4=Math.min(Cc.len/2,rl.len/2),a?(yc=Math.abs(Math.cos(Kf)*Jg/Math.sin(Kf)),yc>r4?(yc=r4,up=Math.abs(yc*Math.sin(Kf)/Math.cos(Kf))):up=Jg):(yc=Math.min(r4,Jg),up=Math.abs(yc*Math.sin(Kf)/Math.cos(Kf))),fP=r.x+rl.nx*yc,pP=r.y+rl.ny*yc,hP=fP-rl.ny*up*Ap,dP=pP+rl.nx*up*Ap,o2e=r.x+Cc.nx*yc,l2e=r.y+Cc.ny*yc,rte=r};function c2e(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function sW(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(b0t(t,e,r,n,i),{cx:hP,cy:dP,radius:up,startX:o2e,startY:l2e,stopX:fP,stopY:pP,startAngle:Cc.ang+Math.PI/2*Ap,endAngle:rl.ang-Math.PI/2*Ap,counterClockwise:p3})}var lk=.01,x0t=Math.sqrt(2*lk),Cs={};Cs.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=function(C,S,k,E){var _=E-S,M=k-C,L=Math.sqrt(M*M+_*_);return{x:-_/L,y:M/L}},h=t.pstyle("edge-distances").value;switch(h){case"node-position":a=r;break;case"intersection":a=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(t.source()[0],s),f=zi(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],o),y=zi(m,2),v=y[0],T=y[1],b={x1:p,y1:g,x2:v,y2:T};i=u(p,g,v,T),a=b}else Cn("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),a=n;break}}return{midptPts:a,vectorNormInverse:i}};Cs.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],n=r._private,i=n.rscratch;if(!i.haystack){var a=Math.random()*2*Math.PI;i.source={x:Math.cos(a),y:Math.sin(a)},a=Math.random()*2*Math.PI,i.target={x:Math.cos(a),y:Math.sin(a)}}var s=n.source,o=n.target,l=s.position(),u=o.position(),h=s.width(),d=o.width(),f=s.height(),p=o.height(),g=r.pstyle("haystack-radius").value,m=g/2;i.haystackPts=i.allpts=[i.source.x*h*m+l.x,i.source.y*f*m+l.y,i.target.x*d*m+u.x,i.target.y*p*m+u.y],i.midX=(i.allpts[0]+i.allpts[2])/2,i.midY=(i.allpts[1]+i.allpts[3])/2,i.edgeType="haystack",i.haystack=!0,this.storeEdgeProjections(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}};Cs.findSegmentsPoints=function(t,e){var r=t._private.rscratch,n=t.pstyle("segment-weights"),i=t.pstyle("segment-distances"),a=t.pstyle("segment-radii"),s=t.pstyle("radius-type"),o=Math.min(n.pfValue.length,i.pfValue.length),l=a.pfValue[a.pfValue.length-1],u=s.pfValue[s.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var h=0;h<o;h++){var d=n.pfValue[h],f=i.pfValue[h],p=1-d,g=d,m=this.findMidptPtsEtc(t,e),y=m.midptPts,v=m.vectorNormInverse,T={x:y.x1*p+y.x2*g,y:y.y1*p+y.y2*g};r.segpts.push(T.x+v.x*f,T.y+v.y*f),r.radii.push(a.pfValue[h]!==void 0?a.pfValue[h]:l),r.isArcRadius.push((s.pfValue[h]!==void 0?s.pfValue[h]:u)==="arc-radius")}};Cs.findLoopPoints=function(t,e,r,n){var i=t._private.rscratch,a=e.dirCounts,s=e.srcPos,o=t.pstyle("control-point-distances"),l=o?o.pfValue[0]:void 0,u=t.pstyle("loop-direction").pfValue,h=t.pstyle("loop-sweep").pfValue,d=t.pstyle("control-point-step-size").pfValue;i.edgeType="self";var f=r,p=d;n&&(f=0,p=l);var g=u-Math.PI/2,m=g-h/2,y=g+h/2,v=u+"_"+h;f=a[v]===void 0?a[v]=0:++a[v],i.ctrlpts=[s.x+Math.cos(m)*1.4*p*(f/3+1),s.y+Math.sin(m)*1.4*p*(f/3+1),s.x+Math.cos(y)*1.4*p*(f/3+1),s.y+Math.sin(y)*1.4*p*(f/3+1)]};Cs.findCompoundLoopPoints=function(t,e,r,n){var i=t._private.rscratch;i.edgeType="compound";var a=e.srcPos,s=e.tgtPos,o=e.srcW,l=e.srcH,u=e.tgtW,h=e.tgtH,d=t.pstyle("control-point-step-size").pfValue,f=t.pstyle("control-point-distances"),p=f?f.pfValue[0]:void 0,g=r,m=d;n&&(g=0,m=p);var y=50,v={x:a.x-o/2,y:a.y-l/2},T={x:s.x-u/2,y:s.y-h/2},b={x:Math.min(v.x,T.x),y:Math.min(v.y,T.y)},w=.5,C=Math.max(w,Math.log(o*lk)),S=Math.max(w,Math.log(u*lk));i.ctrlpts=[b.x,b.y-(1+Math.pow(y,1.12)/100)*m*(g/3+1)*C,b.x-(1+Math.pow(y,1.12)/100)*m*(g/3+1)*S,b.y]};Cs.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"};Cs.findBezierPoints=function(t,e,r,n,i){var a=t._private.rscratch,s=t.pstyle("control-point-step-size").pfValue,o=t.pstyle("control-point-distances"),l=t.pstyle("control-point-weights"),u=o&&l?Math.min(o.value.length,l.value.length):1,h=o?o.pfValue[0]:void 0,d=l.value[0],f=n;a.edgeType=f?"multibezier":"bezier",a.ctrlpts=[];for(var p=0;p<u;p++){var g=(.5-e.eles.length/2+r)*s*(i?-1:1),m=void 0,y=YG(g);f&&(h=o?o.pfValue[p]:s,d=l.value[p]),n?m=h:m=h!==void 0?y*h:void 0;var v=m!==void 0?m:g,T=1-d,b=d,w=this.findMidptPtsEtc(t,e),C=w.midptPts,S=w.vectorNormInverse,k={x:C.x1*T+C.x2*b,y:C.y1*T+C.y2*b};a.ctrlpts.push(k.x+S.x*v,k.y+S.y*v)}};Cs.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var n="vertical",i="horizontal",a="leftward",s="rightward",o="downward",l="upward",u="auto",h=e.posPts,d=e.srcW,f=e.srcH,p=e.tgtW,g=e.tgtH,m=t.pstyle("edge-distances").value,y=m!=="node-position",v=t.pstyle("taxi-direction").value,T=v,b=t.pstyle("taxi-turn"),w=b.units==="%",C=b.pfValue,S=C<0,k=t.pstyle("taxi-turn-min-distance").pfValue,E=y?(d+p)/2:0,_=y?(f+g)/2:0,M=h.x2-h.x1,L=h.y2-h.y1,P=function(j,ue){return j>0?Math.max(j-ue,0):Math.min(j+ue,0)},D=P(M,E),R=P(L,_),I=!1;T===u?v=Math.abs(D)>Math.abs(R)?i:n:T===l||T===o?(v=n,I=!0):(T===a||T===s)&&(v=i,I=!0);var $=v===n,O=$?R:D,N=$?L:M,F=YG(N),z=!1;!(I&&(w||S))&&(T===o&&N<0||T===l&&N>0||T===a&&N>0||T===s&&N<0)&&(F*=-1,O=F*Math.abs(O),z=!0);var V;if(w){var B=C<0?1+C:C;V=B*O}else{var G=C<0?O:0;V=G+C*F}var H=function(j){return Math.abs(j)<k||Math.abs(j)>=Math.abs(O)},q=H(V),Z=H(Math.abs(O)-Math.abs(V)),Y=q||Z;if(Y&&!z)if($){var ie=Math.abs(N)<=f/2,K=Math.abs(M)<=p/2;if(ie){var Q=(h.x1+h.x2)/2,te=h.y1,J=h.y2;r.segpts=[Q,te,Q,J]}else if(K){var ge=(h.y1+h.y2)/2,ee=h.x1,Re=h.x2;r.segpts=[ee,ge,Re,ge]}else r.segpts=[h.x1,h.y2]}else{var Ie=Math.abs(N)<=d/2,Be=Math.abs(L)<=g/2;if(Ie){var ce=(h.y1+h.y2)/2,oe=h.x1,be=h.x2;r.segpts=[oe,ce,be,ce]}else if(Be){var fe=(h.x1+h.x2)/2,Pe=h.y1,ve=h.y2;r.segpts=[fe,Pe,fe,ve]}else r.segpts=[h.x2,h.y1]}else if($){var Ce=h.y1+V+(y?f/2*F:0),Ve=h.x1,se=h.x2;r.segpts=[Ve,Ce,se,Ce]}else{var de=h.x1+V+(y?d/2*F:0),Te=h.y1,ae=h.y2;r.segpts=[de,Te,de,ae]}if(r.isRound){var he=t.pstyle("taxi-radius").value,W=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(he),r.isArcRadius=new Array(r.segpts.length/2).fill(W)}};Cs.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,a=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,h=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,m=!Dt(r.startX)||!Dt(r.startY),y=!Dt(r.arrowStartX)||!Dt(r.arrowStartY),v=!Dt(r.endX)||!Dt(r.endY),T=!Dt(r.arrowEndX)||!Dt(r.arrowEndY),b=3,w=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,C=b*w,S=V0({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),k=S<C,E=V0({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),_=E<C,M=!1;if(m||y||k){M=!0;var L={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},P=Math.sqrt(L.x*L.x+L.y*L.y),D={x:L.x/P,y:L.y/P},R=Math.max(a,s),I={x:r.ctrlpts[0]+D.x*2*R,y:r.ctrlpts[1]+D.y*2*R},$=u.intersectLine(n.x,n.y,a,s,I.x,I.y,0,d,p);k?(r.ctrlpts[0]=r.ctrlpts[0]+D.x*(C-S),r.ctrlpts[1]=r.ctrlpts[1]+D.y*(C-S)):(r.ctrlpts[0]=$[0]+D.x*C,r.ctrlpts[1]=$[1]+D.y*C)}if(v||T||_){M=!0;var O={x:r.ctrlpts[0]-i.x,y:r.ctrlpts[1]-i.y},N=Math.sqrt(O.x*O.x+O.y*O.y),F={x:O.x/N,y:O.y/N},z=Math.max(a,s),V={x:r.ctrlpts[0]+F.x*2*z,y:r.ctrlpts[1]+F.y*2*z},B=h.intersectLine(i.x,i.y,o,l,V.x,V.y,0,f,g);_?(r.ctrlpts[0]=r.ctrlpts[0]+F.x*(C-E),r.ctrlpts[1]=r.ctrlpts[1]+F.y*(C-E)):(r.ctrlpts[0]=B[0]+F.x*C,r.ctrlpts[1]=B[1]+F.y*C)}M&&this.findEndpoints(t)}};Cs.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var r=0;r+1<e.ctrlpts.length;r+=2)e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);e.allpts.push(e.endX,e.endY);var n,i;e.ctrlpts.length/2%2===0?(n=e.allpts.length/2-1,e.midX=e.allpts[n],e.midY=e.allpts[n+1]):(n=e.allpts.length/2-3,i=.5,e.midX=ya(e.allpts[n],e.allpts[n+2],e.allpts[n+4],i),e.midY=ya(e.allpts[n+1],e.allpts[n+3],e.allpts[n+5],i))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var a=2;a+3<e.allpts.length;a+=2){var s=e.radii[a/2-1],o=e.isArcRadius[a/2-1];e.roundCorners.push(sW({x:e.allpts[a-2],y:e.allpts[a-1]},{x:e.allpts[a],y:e.allpts[a+1],radius:s},{x:e.allpts[a+2],y:e.allpts[a+3]},s,o))}}if(e.segpts.length%4===0){var l=e.segpts.length/2,u=l-2;e.midX=(e.segpts[u]+e.segpts[l])/2,e.midY=(e.segpts[u+1]+e.segpts[l+1])/2}else{var h=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[h],e.midY=e.segpts[h+1];else{var d={x:e.segpts[h],y:e.segpts[h+1]},f=e.roundCorners[h/2];if(f.radius===0){var p={x:e.segpts[h+2],y:e.segpts[h+3]};e.midX=d.x,e.midY=d.y,e.midVector=[d.y-p.y,p.x-d.x]}else{var g=[d.x-f.cx,d.y-f.cy],m=f.radius/Math.sqrt(Math.pow(g[0],2)+Math.pow(g[1],2));g=g.map(function(y){return y*m}),e.midX=f.cx+g[0],e.midY=f.cy+g[1],e.midVector=g}}}}};Cs.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||Dt(e.startX)&&Dt(e.startY)&&Dt(e.endX)&&Dt(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Cn("Edge `"+t.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))};Cs.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,n=r.cy,i=n.hasCompoundNodes(),a=new th,s=function(_,M){return[].concat(u_(_),[M?1:0]).join("-")},o=[],l=[],u=0;u<t.length;u++){var h=t[u],d=h._private,f=h.pstyle("curve-style").value;if(!(h.removed()||!h.takesUpSpace())){if(f==="haystack"){l.push(h);continue}var p=f==="unbundled-bezier"||Nd(f,"segments")||f==="straight"||f==="straight-triangle"||Nd(f,"taxi"),g=f==="unbundled-bezier"||f==="bezier",m=d.source,y=d.target,v=m.poolIndex(),T=y.poolIndex(),b=[v,T].sort(),w=s(b,p),C=a.get(w);C==null&&(C={eles:[]},o.push({pairId:b,edgeIsUnbundled:p}),a.set(w,C)),C.eles.push(h),p&&(C.hasUnbundled=!0),g&&(C.hasBezier=!0)}}for(var S=function(){var _=o[k],M=_.pairId,L=_.edgeIsUnbundled,P=s(M,L),D=a.get(P),R;if(!D.hasUnbundled){var I=D.eles[0].parallelEdges().filter(function(W){return W.isBundledBezier()});qG(D.eles),I.forEach(function(W){return D.eles.push(W)}),D.eles.sort(function(W,ne){return W.poolIndex()-ne.poolIndex()})}var $=D.eles[0],O=$.source(),N=$.target();if(O.poolIndex()>N.poolIndex()){var F=O;O=N,N=F}var z=D.srcPos=O.position(),V=D.tgtPos=N.position(),B=D.srcW=O.outerWidth(),G=D.srcH=O.outerHeight(),H=D.tgtW=N.outerWidth(),q=D.tgtH=N.outerHeight(),Z=D.srcShape=r.nodeShapes[e.getNodeShape(O)],Y=D.tgtShape=r.nodeShapes[e.getNodeShape(N)],ie=D.srcCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,K=D.tgtCornerRadius=N.pstyle("corner-radius").value==="auto"?"auto":N.pstyle("corner-radius").pfValue,Q=D.tgtRs=N._private.rscratch,te=D.srcRs=O._private.rscratch;D.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var J=0;J<D.eles.length;J++){var ge=D.eles[J],ee=ge[0]._private.rscratch,Re=ge.pstyle("curve-style").value,Ie=Re==="unbundled-bezier"||Nd(Re,"segments")||Nd(Re,"taxi"),Be=!O.same(ge.source());if(!D.calculatedIntersection&&O!==N&&(D.hasBezier||D.hasUnbundled)){D.calculatedIntersection=!0;var ce=Z.intersectLine(z.x,z.y,B,G,V.x,V.y,0,ie,te),oe=D.srcIntn=ce,be=Y.intersectLine(V.x,V.y,H,q,z.x,z.y,0,K,Q),fe=D.tgtIntn=be,Pe=D.intersectionPts={x1:ce[0],x2:be[0],y1:ce[1],y2:be[1]},ve=D.posPts={x1:z.x,x2:V.x,y1:z.y,y2:V.y},Ce=be[1]-ce[1],Ve=be[0]-ce[0],se=Math.sqrt(Ve*Ve+Ce*Ce);Dt(se)&&se>=x0t||(se=Math.sqrt(Math.max(Ve*Ve,lk)+Math.max(Ce*Ce,lk)));var de=D.vector={x:Ve,y:Ce},Te=D.vectorNorm={x:de.x/se,y:de.y/se},ae={x:-Te.y,y:Te.x};D.nodesOverlap=!Dt(se)||Y.checkPoint(ce[0],ce[1],0,H,q,V.x,V.y,K,Q)||Z.checkPoint(be[0],be[1],0,B,G,z.x,z.y,ie,te),D.vectorNormInverse=ae,R={nodesOverlap:D.nodesOverlap,dirCounts:D.dirCounts,calculatedIntersection:!0,hasBezier:D.hasBezier,hasUnbundled:D.hasUnbundled,eles:D.eles,srcPos:V,srcRs:Q,tgtPos:z,tgtRs:te,srcW:H,srcH:q,tgtW:B,tgtH:G,srcIntn:fe,tgtIntn:oe,srcShape:Y,tgtShape:Z,posPts:{x1:ve.x2,y1:ve.y2,x2:ve.x1,y2:ve.y1},intersectionPts:{x1:Pe.x2,y1:Pe.y2,x2:Pe.x1,y2:Pe.y1},vector:{x:-de.x,y:-de.y},vectorNorm:{x:-Te.x,y:-Te.y},vectorNormInverse:{x:-ae.x,y:-ae.y}}}var he=Be?R:D;ee.nodesOverlap=he.nodesOverlap,ee.srcIntn=he.srcIntn,ee.tgtIntn=he.tgtIntn,ee.isRound=Re.startsWith("round"),i&&(O.isParent()||O.isChild()||N.isParent()||N.isChild())&&(O.parents().anySame(N)||N.parents().anySame(O)||O.same(N)&&O.isParent())?e.findCompoundLoopPoints(ge,he,J,Ie):O===N?e.findLoopPoints(ge,he,J,Ie):Re.endsWith("segments")?e.findSegmentsPoints(ge,he):Re.endsWith("taxi")?e.findTaxiPoints(ge,he):Re==="straight"||!Ie&&D.eles.length%2===1&&J===Math.floor(D.eles.length/2)?e.findStraightEdgePoints(ge):e.findBezierPoints(ge,he,J,Ie,Be),e.findEndpoints(ge),e.tryToCorrectInvalidPoints(ge,he),e.checkForInvalidEdgeWarning(ge),e.storeAllpts(ge),e.storeEdgeProjections(ge),e.calculateArrowAngles(ge),e.recalculateEdgeLabelProjections(ge),e.calculateLabelAngles(ge)}},k=0;k<o.length;k++)S();this.findHaystackPoints(l)}};function u2e(t){var e=[];if(t!=null){for(var r=0;r<t.length;r+=2){var n=t[r],i=t[r+1];e.push({x:n,y:i})}return e}}Cs.getSegmentPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="segments")return u2e(e.segpts)};Cs.getControlPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return u2e(e.ctrlpts)};Cs.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var xS={};xS.manualEndptToPx=function(t,e){var r=this,n=t.position(),i=t.outerWidth(),a=t.outerHeight(),s=t._private.rscratch;if(e.value.length===2){var o=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(o[0]=o[0]*i),e.units[1]==="%"&&(o[1]=o[1]*a),o[0]+=n.x,o[1]+=n.y,o}else{var l=e.pfValue[0];l=-Math.PI/2+l;var u=2*Math.max(i,a),h=[n.x+Math.cos(l)*u,n.y+Math.sin(l)*u];return r.nodeShapes[this.getNodeShape(t)].intersectLine(n.x,n.y,i,a,h[0],h[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,s)}};xS.findEndpoints=function(t){var e,r,n,i,a=this,s,o=t.source()[0],l=t.target()[0],u=o.position(),h=l.position(),d=t.pstyle("target-arrow-shape").value,f=t.pstyle("source-arrow-shape").value,p=t.pstyle("target-distance-from-node").pfValue,g=t.pstyle("source-distance-from-node").pfValue,m=o._private.rscratch,y=l._private.rscratch,v=t.pstyle("curve-style").value,T=t._private.rscratch,b=T.edgeType,w=Nd(v,"taxi"),C=b==="self"||b==="compound",S=b==="bezier"||b==="multibezier"||C,k=b!=="bezier",E=b==="straight"||b==="segments",_=b==="segments",M=S||k||E,L=C||w,P=t.pstyle("source-endpoint"),D=L?"outside-to-node":P.value,R=o.pstyle("corner-radius").value==="auto"?"auto":o.pstyle("corner-radius").pfValue,I=t.pstyle("target-endpoint"),$=L?"outside-to-node":I.value,O=l.pstyle("corner-radius").value==="auto"?"auto":l.pstyle("corner-radius").pfValue;T.srcManEndpt=P,T.tgtManEndpt=I;var N,F,z,V,B=(e=(I==null||(r=I.pfValue)===null||r===void 0?void 0:r.length)===2?I.pfValue:null)!==null&&e!==void 0?e:[0,0],G=(n=(P==null||(i=P.pfValue)===null||i===void 0?void 0:i.length)===2?P.pfValue:null)!==null&&n!==void 0?n:[0,0];if(S){var H=[T.ctrlpts[0],T.ctrlpts[1]],q=k?[T.ctrlpts[T.ctrlpts.length-2],T.ctrlpts[T.ctrlpts.length-1]]:H;N=q,F=H}else if(E){var Z=_?T.segpts.slice(0,2):[h.x+B[0],h.y+B[1]],Y=_?T.segpts.slice(T.segpts.length-2):[u.x+G[0],u.y+G[1]];N=Y,F=Z}if($==="inside-to-node")s=[h.x,h.y];else if(I.units)s=this.manualEndptToPx(l,I);else if($==="outside-to-line")s=T.tgtIntn;else if($==="outside-to-node"||$==="outside-to-node-or-label"?z=N:($==="outside-to-line"||$==="outside-to-line-or-label")&&(z=[u.x,u.y]),s=a.nodeShapes[this.getNodeShape(l)].intersectLine(h.x,h.y,l.outerWidth(),l.outerHeight(),z[0],z[1],0,O,y),$==="outside-to-node-or-label"||$==="outside-to-line-or-label"){var ie=l._private.rscratch,K=ie.labelWidth,Q=ie.labelHeight,te=ie.labelX,J=ie.labelY,ge=K/2,ee=Q/2,Re=l.pstyle("text-valign").value;Re=Yb(Re),Re==="top"?J-=ee:Re==="bottom"&&(J+=ee);var Ie=l.pstyle("text-halign").value;Ie=Ub(Ie),Ie==="left"?te-=ge:Ie==="right"&&(te+=ge);var Be=nk(z[0],z[1],[te-ge,J-ee,te+ge,J-ee,te+ge,J+ee,te-ge,J+ee],h.x,h.y);if(Be.length>0){var ce=u,oe=cp(ce,Xm(s)),be=cp(ce,Xm(Be)),fe=oe;if(be<oe&&(s=Be,fe=be),Be.length>2){var Pe=cp(ce,{x:Be[2],y:Be[3]});Pe<fe&&(s=[Be[2],Be[3]])}}}var ve=jE(s,N,a.arrowShapes[d].spacing(t)+p),Ce=jE(s,N,a.arrowShapes[d].gap(t)+p);if(T.endX=Ce[0],T.endY=Ce[1],T.arrowEndX=ve[0],T.arrowEndY=ve[1],D==="inside-to-node")s=[u.x,u.y];else if(P.units)s=this.manualEndptToPx(o,P);else if(D==="outside-to-line")s=T.srcIntn;else if(D==="outside-to-node"||D==="outside-to-node-or-label"?V=F:(D==="outside-to-line"||D==="outside-to-line-or-label")&&(V=[h.x,h.y]),s=a.nodeShapes[this.getNodeShape(o)].intersectLine(u.x,u.y,o.outerWidth(),o.outerHeight(),V[0],V[1],0,R,m),D==="outside-to-node-or-label"||D==="outside-to-line-or-label"){var Ve=o._private.rscratch,se=Ve.labelWidth,de=Ve.labelHeight,Te=Ve.labelX,ae=Ve.labelY,he=se/2,W=de/2,ne=o.pstyle("text-valign").value;ne=Yb(ne),ne==="top"?ae-=W:ne==="bottom"&&(ae+=W);var j=o.pstyle("text-halign").value;j=Ub(j),j==="left"?Te-=he:j==="right"&&(Te+=he);var ue=nk(V[0],V[1],[Te-he,ae-W,Te+he,ae-W,Te+he,ae+W,Te-he,ae+W],u.x,u.y);if(ue.length>0){var X=h,Oe=cp(X,Xm(s)),xe=cp(X,Xm(ue)),Ge=Oe;if(xe<Oe&&(s=[ue[0],ue[1]],Ge=xe),ue.length>2){var _e=cp(X,{x:ue[2],y:ue[3]});_e<Ge&&(s=[ue[2],ue[3]])}}}var $e=jE(s,F,a.arrowShapes[f].spacing(t)+g),Me=jE(s,F,a.arrowShapes[f].gap(t)+g);T.startX=Me[0],T.startY=Me[1],T.arrowStartX=$e[0],T.arrowStartY=$e[1],M&&(!Dt(T.startX)||!Dt(T.startY)||!Dt(T.endX)||!Dt(T.endY)?T.badLine=!0:T.badLine=!1)};xS.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}};xS.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var oW={};function T0t(t,e,r){for(var n=function(u,h,d,f){return ya(u,h,d,f)},i=e._private,a=i.rstyle.bezierPts,s=0;s<t.bezierProjPcts.length;s++){var o=t.bezierProjPcts[s];a.push({x:n(r[0],r[2],r[4],o),y:n(r[1],r[3],r[5],o)})}}oW.storeEdgeProjections=function(t){var e=t._private,r=e.rscratch,n=r.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,n==="multibezier"||n==="bezier"||n==="self"||n==="compound"){e.rstyle.bezierPts=[];for(var i=0;i+5<r.allpts.length;i+=4)T0t(this,t,r.allpts.slice(i,i+6))}else if(n==="segments")for(var a=e.rstyle.linePts=[],i=0;i+1<r.allpts.length;i+=2)a.push({x:r.allpts[i],y:r.allpts[i+1]});else if(n==="haystack"){var s=r.haystackPts;e.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth};oW.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var du={};du.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!lf(e)){var r,n,i=t._private,a=t.width(),s=t.height(),o=t.padding(),l=t.position(),u=t.pstyle("text-halign").strValue,h=t.pstyle("text-valign").strValue,d=i.rscratch,f=i.rstyle;switch(u){case"left":r=l.x-a/2-o;break;case"left-inside":r=l.x-a/2+o;break;case"right":r=l.x+a/2+o;break;case"right-inside":r=l.x+a/2-o;break;default:r=l.x}switch(h){case"top":n=l.y-s/2-o;break;case"top-inside":n=l.y-s/2+o;break;case"bottom":n=l.y+s/2+o;break;case"bottom-inside":n=l.y+s/2-o;break;default:n=l.y}d.labelX=r,d.labelY=n,f.labelX=r,f.labelY=n,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var h2e=function(e,r){var n=Math.atan(r/e);return e===0&&n<0&&(n=n*-1),n},d2e=function(e,r){var n=r.x-e.x,i=r.y-e.y;return h2e(n,i)},w0t=function(e,r,n,i){var a=rk(0,i-.001,1),s=rk(0,i+.001,1),o=by(e,r,n,a),l=by(e,r,n,s);return d2e(o,l)};du.recalculateEdgeLabelProjections=function(t){var e,r=t._private,n=r.rscratch,i=this,a={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(a.mid||a.source||a.target){e={x:n.midX,y:n.midY};var s=function(d,f,p){Mc(r.rscratch,d,f,p),Mc(r.rstyle,d,f,p)};s("labelX",null,e.x),s("labelY",null,e.y);var o=h2e(n.midDispX,n.midDispY);s("labelAutoAngle",null,o);var l=function(){if(l.cache)return l.cache;for(var d=[],f=0;f+5<n.allpts.length;f+=4){var p={x:n.allpts[f],y:n.allpts[f+1]},g={x:n.allpts[f+2],y:n.allpts[f+3]},m={x:n.allpts[f+4],y:n.allpts[f+5]};d.push({p0:p,p1:g,p2:m,startDist:0,length:0,segments:[]})}var y=r.rstyle.bezierPts,v=i.bezierProjPcts.length;function T(k,E,_,M,L){var P=V0(E,_),D=k.segments[k.segments.length-1],R={p0:E,p1:_,t0:M,t1:L,startDist:D?D.startDist+D.length:0,length:P};k.segments.push(R),k.length+=P}for(var b=0;b<d.length;b++){var w=d[b],C=d[b-1];C&&(w.startDist=C.startDist+C.length),T(w,w.p0,y[b*v],0,i.bezierProjPcts[0]);for(var S=0;S<v-1;S++)T(w,y[b*v+S],y[b*v+S+1],i.bezierProjPcts[S],i.bezierProjPcts[S+1]);T(w,y[b*v+v-1],w.p2,i.bezierProjPcts[v-1],1)}return l.cache=d},u=function(d){var f,p=d==="source";if(a[d]){var g=t.pstyle(d+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var m=l(),y,v=0,T=0,b=0;b<m.length;b++){for(var w=m[p?b:m.length-1-b],C=0;C<w.segments.length;C++){var S=w.segments[p?C:w.segments.length-1-C],k=b===m.length-1&&C===w.segments.length-1;if(v=T,T+=S.length,T>=g||k){y={cp:w,segment:S};break}}if(y)break}var E=y.cp,_=y.segment,M=(g-v)/_.length,L=_.t1-_.t0,P=p?_.t0+L*M:_.t1-L*M;P=rk(0,P,1),e=by(E.p0,E.p1,E.p2,P),f=w0t(E.p0,E.p1,E.p2,P);break}case"straight":case"segments":case"haystack":{for(var D=0,R,I,$,O,N=n.allpts.length,F=0;F+3<N&&(p?($={x:n.allpts[F],y:n.allpts[F+1]},O={x:n.allpts[F+2],y:n.allpts[F+3]}):($={x:n.allpts[N-2-F],y:n.allpts[N-1-F]},O={x:n.allpts[N-4-F],y:n.allpts[N-3-F]}),R=V0($,O),I=D,D+=R,!(D>=g));F+=2);var z=g-I,V=z/R;V=rk(0,V,1),e=Wht($,O,V),f=d2e($,O);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}};du.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};du.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=z0(n,t._private.labelDimsKey);if(Ms(r.rscratch,"prefixedLabelDimsKey",e)!==i){Mc(r.rscratch,"prefixedLabelDimsKey",e,i);var a=this.calculateLabelDimensions(t,n),s=t.pstyle("line-height").pfValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("text-wrap").strValue,u=Ms(r.rscratch,"labelWrapCachedLines",e)||[],h=l!=="wrap"?1:Math.max(u.length,1),d=o*s,f=a.width,p=a.height+(h-1)*(s-1)*o;Mc(r.rstyle,"labelWidth",e,f),Mc(r.rscratch,"labelWidth",e,f),Mc(r.rstyle,"labelHeight",e,p),Mc(r.rscratch,"labelHeight",e,p),Mc(r.rscratch,"labelLineHeight",e,d),Mc(r.rscratch,"labelActualDescent",e,a.labelActualDescent)}};du.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,a=t.pstyle("text-transform").value,s=function(G,H){return H?(Mc(r.rscratch,G,e,H),H):Ms(r.rscratch,G,e)};if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="​",h=i.split(`
`),d=t.pstyle("text-max-width").pfValue,f=t.pstyle("text-overflow-wrap").value,p=f==="anywhere",g=[],m=/[\s\u200b]+|$/g,y=0;y<h.length;y++){var v=h[y],T=this.calculateLabelDimensions(t,v),b=T.width;if(p){var w=v.split("").join(u);v=w}if(b>d){var C=v.matchAll(m),S="",k=0,E=yo(C),_;try{for(E.s();!(_=E.n()).done;){var M=_.value,L=M[0],P=v.substring(k,M.index);k=M.index+L.length;var D=S.length===0?P:S+P+L,R=this.calculateLabelDimensions(t,D),I=R.width;I<=d?S+=P+L:(S&&g.push(S),S=P+L)}}catch(B){E.e(B)}finally{E.f()}S.match(/^[\s\u200b]+$/)||g.push(S)}else g.push(v)}s("labelWrapCachedLines",g),i=s("labelWrapCachedText",g.join(`
`)),s("labelWrapKey",l)}else if(o==="ellipsis"){var $=t.pstyle("text-max-width").pfValue,O="",N="…",F=!1;if(this.calculateLabelDimensions(t,i).width<$)return i;for(var z=0;z<i.length;z++){var V=this.calculateLabelDimensions(t,O+i[z]+N).width;if(V>$)break;O+=i[z],z===i.length-1&&(F=!0)}return F||(O+=N),O}return i};du.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?cpt(r):"center":e};du.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),i=n.document,a=0,s=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue,l=t.pstyle("font-family").strValue,u=t.pstyle("font-weight").strValue,h=t.pstyle("text-metrics").strValue||"font",d=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=i.createElement("canvas"),f=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}f.font="".concat(s," ").concat(u," ").concat(o,"px ").concat(l);for(var g=0,m=0,y=e.split(`
`),v=y.length,T=0,b=0,w=0;w<v;w++){var C=y[w],S=f.measureText(C),k=Math.ceil(S.width),E=o;h==="glyph"&&(w===0&&(b=S.actualBoundingBoxAscent),w===v-1&&(T=S.actualBoundingBoxDescent)),g=Math.max(k,g),m+=E}return h==="glyph"&&(m-=o-b-T),g+=a,m+=a,{width:g,height:m,labelActualAscent:b,labelActualDescent:T}};du.calculateLabelAngle=function(t,e){var r=t._private,n=r.rscratch,i=t.isEdge(),a=e?e+"-":"",s=t.pstyle(a+"text-rotation"),o=s.strValue;return o==="none"?0:i&&o==="autorotate"?n.labelAutoAngle:o==="autorotate"?0:s.pfValue};du.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),n=t._private,i=n.rscratch;i.labelAngle=e.calculateLabelAngle(t),r&&(i.sourceLabelAngle=e.calculateLabelAngle(t,"source"),i.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var f2e={},ite=28,ate=!1;f2e.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<ite||t.height()<ite))return ate||(Cn("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),ate=!0),"rectangle";if(t.isParent())return r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"?r:"rectangle";if(r==="polygon"){var n=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(n).name}return r};var vL={};vL.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,n=function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l<s.length;l++){var u=s[l],h=u._private,d=h.rstyle;d.clean=!1,d.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(s){var o=s.target;n(o)}).on("style.* background.*",function(s){var o=s.target;n(o,!1)});var i=function(s){if(s){var o=r.onUpdateEleCalcsFns;e.cleanStyle();for(var l=0;l<e.length;l++){var u=e[l],h=u._private.rstyle;u.isNode()&&!h.cleanConnected&&(n(u.connectedEdges()),h.cleanConnected=!0)}if(o)for(var d=0;d<o.length;d++){var f=o[d];f(s,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){i(!0)},r.beforeRender(i,r.beforeRenderPriorities.eleCalcs)};vL.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)};vL.recalculateRenderedStyle=function(t,e){var r=function(w){return w._private.rstyle.cleanConnected};if(t.length!==0){var n=[],i=[];if(!this.destroyed){e===void 0&&(e=!0);for(var a=0;a<t.length;a++){var s=t[a],o=s._private,l=o.rstyle;s.isEdge()&&(!r(s.source())||!r(s.target()))&&(l.clean=!1),s.isEdge()&&s.isBundledBezier()&&s.parallelEdges().some(function(b){return!b._private.rstyle.clean&&b.isBundledBezier()})&&(l.clean=!1),!(e&&l.clean||s.removed())&&s.pstyle("display").value!=="none"&&(o.group==="nodes"?i.push(s):n.push(s),l.clean=!0)}for(var u=0;u<i.length;u++){var h=i[u],d=h._private,f=d.rstyle,p=h.position();this.recalculateNodeLabelProjection(h),f.nodeX=p.x,f.nodeY=p.y,f.nodeW=h.pstyle("width").pfValue,f.nodeH=h.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var g=0;g<n.length;g++){var m=n[g],y=m._private,v=y.rstyle,T=y.rscratch;v.srcX=T.arrowStartX,v.srcY=T.arrowStartY,v.tgtX=T.arrowEndX,v.tgtY=T.arrowEndY,v.midX=T.midX,v.midY=T.midY,v.labelAngle=T.labelAngle,v.sourceLabelAngle=T.sourceLabelAngle,v.targetLabelAngle=T.targetLabelAngle}}}};var bL={};bL.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],r=0;r<t.length;r++){var n=t[r],i=n._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):i.inDragLayer?t.drag.push(n):t.nondrag.push(n)}for(var r=0;r<e.length;r++){var n=e[r];t.drag.push(n)}}};bL.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};bL.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(Xve),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var p2e={};[pg,x_,Cs,xS,oW,du,f2e,vL,bL].forEach(function(t){dr(p2e,t)});var g2e={};g2e.getCachedImage=function(t,e,r){var n=this,i=n.imageCache=n.imageCache||{},a=i[t];if(a)return a.image.complete||a.image.addEventListener("load",r),a.image;a=i[t]=i[t]||{};var s=a.image=new Image;s.addEventListener("load",r),s.addEventListener("error",function(){s.error=!0});var o="data:",l=t.substring(0,o.length).toLowerCase()===o;return l||(e=e==="null"?null:e,s.crossOrigin=e),s.src=t,s};var m2e=function(e,r){var n=e[0];!n||n._private.grabbed===r||(n._private.grabbed=r,e.updateStyle(!1))},C0t=function(e){m2e(e,!0)},k0t=function(e){m2e(e,!1)},Nx={};Nx.registerBinding=function(t,e,r,n){var i=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(t)){for(var a=[],s=0;s<t.length;s++){var o=t[s];if(o!==void 0){var l=this.binder(o);a.push(l.on.apply(l,i))}}return a}var l=this.binder(t);return l.on.apply(l,i)};Nx.binder=function(t){var e=this,r=e.cy.window(),n=t===r||t===r.document||t===r.document.body||Nut(t);if(e.supportsPassiveEvents==null){var i=!1;try{var a=Object.defineProperty({},"passive",{get:function(){return i=!0,!0}});r.addEventListener("test",null,a)}catch{}e.supportsPassiveEvents=i}var s=function(l,u,h){var d=Array.prototype.slice.call(arguments);return n&&e.supportsPassiveEvents&&(d[2]={capture:h??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:d}),(t.addEventListener||t.on).apply(t,d),this};return{on:s,addEventListener:s,addListener:s,bind:s}};Nx.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()};Nx.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()};Nx.load=function(){var t=this,e=t.cy.window(),r=function(W){return W.selected()},n=function(W){var ne=W.getRootNode();if(ne&&ne.nodeType===11&&ne.host!==void 0)return ne},i=function(W,ne,j,ue){W==null&&(W=t.cy);for(var X=0;X<ne.length;X++){var Oe=ne[X];W.emit({originalEvent:j,type:Oe,position:ue})}},a=function(W){return W.shiftKey||W.metaKey||W.ctrlKey},s=function(W,ne){var j=!0;if(t.cy.hasCompoundNodes()&&W&&W.pannable())for(var ue=0;ne&&ue<ne.length;ue++){var W=ne[ue];if(W.isNode()&&W.isParent()&&!W.pannable()){j=!1;break}}else j=!0;return j},o=function(W){W[0]._private.rscratch.inDragLayer=!0},l=function(W){W[0]._private.rscratch.inDragLayer=!1},u=function(W){W[0]._private.rscratch.isGrabTarget=!0},h=function(W){W[0]._private.rscratch.isGrabTarget=!1},d=function(W,ne){var j=ne.addToList,ue=j.has(W);!ue&&W.grabbable()&&!W.locked()&&(j.merge(W),C0t(W))},f=function(W,ne){if(W.cy().hasCompoundNodes()&&!(ne.inDragLayer==null&&ne.addToList==null)){var j=W.descendants();ne.inDragLayer&&(j.forEach(o),j.connectedEdges().forEach(o)),ne.addToList&&d(j,ne)}},p=function(W,ne){ne=ne||{};var j=W.cy().hasCompoundNodes();ne.inDragLayer&&(W.forEach(o),W.neighborhood().stdFilter(function(ue){return!j||ue.isEdge()}).forEach(o)),ne.addToList&&W.forEach(function(ue){d(ue,ne)}),f(W,ne),y(W,{inDragLayer:ne.inDragLayer}),t.updateCachedGrabbedEles()},g=p,m=function(W){W&&(t.getCachedZSortedEles().forEach(function(ne){k0t(ne),l(ne),h(ne)}),t.updateCachedGrabbedEles())},y=function(W,ne){if(!(ne.inDragLayer==null&&ne.addToList==null)&&W.cy().hasCompoundNodes()){var j=W.ancestors().orphans();if(!j.same(W)){var ue=j.descendants().spawnSelf().merge(j).unmerge(W).unmerge(W.descendants()),X=ue.connectedEdges();ne.inDragLayer&&(X.forEach(o),ue.forEach(o)),ne.addToList&&ue.forEach(function(Oe){d(Oe,ne)})}}},v=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},T=typeof MutationObserver<"u",b=typeof ResizeObserver<"u";T?(t.removeObserver=new MutationObserver(function(he){for(var W=0;W<he.length;W++){var ne=he[W],j=ne.removedNodes;if(j)for(var ue=0;ue<j.length;ue++){var X=j[ue];if(X===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(he){t.destroy()});var w=mS(function(){t.cy.resize()},100);T&&(t.styleObserver=new MutationObserver(w),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",w),b&&(t.resizeObserver=new ResizeObserver(w),t.resizeObserver.observe(t.container));var C=function(W,ne){for(;W!=null;)ne(W),W=W.parentNode},S=function(){t.invalidateContainerClientCoordsCache()};C(t.container,function(he){t.registerBinding(he,"transitionend",S),t.registerBinding(he,"animationend",S),t.registerBinding(he,"scroll",S)}),t.registerBinding(t.container,"contextmenu",function(he){he.preventDefault()});var k=function(){return t.selection[4]!==0},E=function(W){for(var ne=t.findContainerClientCoords(),j=ne[0],ue=ne[1],X=ne[2],Oe=ne[3],xe=W.touches?W.touches:[W],Ge=!1,_e=0;_e<xe.length;_e++){var $e=xe[_e];if(j<=$e.clientX&&$e.clientX<=j+X&&ue<=$e.clientY&&$e.clientY<=ue+Oe){Ge=!0;break}}if(!Ge)return!1;for(var Me=t.container,He=W.target,De=He.parentNode,Ke=!1;De;){if(De===Me){Ke=!0;break}De=De.parentNode}return!!Ke};t.registerBinding(t.container,"mousedown",function(W){if(E(W)&&!(t.hoverData.which===1&&W.which!==1)){W.preventDefault(),v(),t.hoverData.capture=!0,t.hoverData.which=W.which;var ne=t.cy,j=[W.clientX,W.clientY],ue=t.projectIntoViewport(j[0],j[1]),X=t.selection,Oe=t.findNearestElements(ue[0],ue[1],!0,!1),xe=Oe[0],Ge=t.dragData.possibleDragElements;t.hoverData.mdownPos=ue,t.hoverData.mdownGPos=j;var _e=function(Ae){return{originalEvent:W,type:Ae,position:{x:ue[0],y:ue[1]}}},$e=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var Ae=t.hoverData.down;Ae?Ae.emit(_e("taphold")):ne.emit(_e("taphold"))}},t.tapholdDuration)};if(W.which==3){t.hoverData.cxtStarted=!0;var Me={originalEvent:W,type:"cxttapstart",position:{x:ue[0],y:ue[1]}};xe?(xe.activate(),xe.emit(Me),t.hoverData.down=xe):ne.emit(Me),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(W.which==1){xe&&xe.activate();{if(xe!=null&&t.nodeIsGrabbable(xe)){var He=function(Ae){Ae.emit(_e("grab"))};if(u(xe),!xe.selected())Ge=t.dragData.possibleDragElements=ne.collection(),g(xe,{addToList:Ge}),xe.emit(_e("grabon")).emit(_e("grab"));else{Ge=t.dragData.possibleDragElements=ne.collection();var De=ne.$(function(Ke){return Ke.isNode()&&Ke.selected()&&t.nodeIsGrabbable(Ke)});p(De,{addToList:Ge}),xe.emit(_e("grabon")),De.forEach(He)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=xe,t.hoverData.downs=Oe,t.hoverData.downTime=new Date().getTime()}i(xe,["mousedown","tapstart","vmousedown"],W,{x:ue[0],y:ue[1]}),xe==null?(X[4]=1,t.data.bgActivePosistion={x:ue[0],y:ue[1]},t.redrawHint("select",!0),t.redraw()):xe.pannable()&&(X[4]=1),$e()}X[0]=X[2]=ue[0],X[1]=X[3]=ue[1]}},!1);var _=n(t.container);t.registerBinding([e,_],"mousemove",function(W){var ne=t.hoverData.capture;if(!(!ne&&!E(W))){var j=!1,ue=t.cy,X=ue.zoom(),Oe=[W.clientX,W.clientY],xe=t.projectIntoViewport(Oe[0],Oe[1]),Ge=t.hoverData.mdownPos,_e=t.hoverData.mdownGPos,$e=t.selection,Me=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(Me=t.findNearestElement(xe[0],xe[1],!0,!1));var He=t.hoverData.last,De=t.hoverData.down,Ke=[xe[0]-$e[2],xe[1]-$e[3]],Ae=t.dragData.possibleDragElements,at;if(_e){var Ee=Oe[0]-_e[0],pt=Ee*Ee,ht=Oe[1]-_e[1],rt=ht*ht,Et=pt+rt;t.hoverData.isOverThresholdDrag=at=Et>=t.desktopTapThreshold2}var vt=a(W);at&&(t.hoverData.tapholdCancelled=!0);var ot=function(){var Nt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Nt.length===0?(Nt.push(Ke[0]),Nt.push(Ke[1])):(Nt[0]+=Ke[0],Nt[1]+=Ke[1])};j=!0,i(Me,["mousemove","vmousemove","tapdrag"],W,{x:xe[0],y:xe[1]});var pe=function(Nt){return{originalEvent:W,type:Nt,position:{x:xe[0],y:xe[1]}}},Ct=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||ue.emit(pe("boxstart")),$e[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(at){var lt=pe("cxtdrag");De?De.emit(lt):ue.emit(lt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||Me!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(pe("cxtdragout")),t.hoverData.cxtOver=Me,Me&&Me.emit(pe("cxtdragover")))}}else if(t.hoverData.dragging){if(j=!0,ue.panningEnabled()&&ue.userPanningEnabled()){var st;if(t.hoverData.justStartedPan){var mt=t.hoverData.mdownPos;st={x:(xe[0]-mt[0])*X,y:(xe[1]-mt[1])*X},t.hoverData.justStartedPan=!1}else st={x:Ke[0]*X,y:Ke[1]*X};ue.panBy(st),ue.emit(pe("dragpan")),t.hoverData.dragged=!0}xe=t.projectIntoViewport(W.clientX,W.clientY)}else if($e[4]==1&&(De==null||De.pannable())){if(at){if(!t.hoverData.dragging&&ue.boxSelectionEnabled()&&(vt||!ue.panningEnabled()||!ue.userPanningEnabled()))Ct();else if(!t.hoverData.selecting&&ue.panningEnabled()&&ue.userPanningEnabled()){var _r=s(De,t.hoverData.downs);_r&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,$e[4]=0,t.data.bgActivePosistion=Xm(Ge),t.redrawHint("select",!0),t.redraw())}De&&De.pannable()&&De.active()&&De.unactivate()}}else{if(De&&De.pannable()&&De.active()&&De.unactivate(),(!De||!De.grabbed())&&Me!=He&&(He&&i(He,["mouseout","tapdragout"],W,{x:xe[0],y:xe[1]}),Me&&i(Me,["mouseover","tapdragover"],W,{x:xe[0],y:xe[1]}),t.hoverData.last=Me),De)if(at){if(ue.boxSelectionEnabled()&&vt)De&&De.grabbed()&&(m(Ae),De.emit(pe("freeon")),Ae.emit(pe("free")),t.dragData.didDrag&&(De.emit(pe("dragfreeon")),Ae.emit(pe("dragfree")))),Ct();else if(De&&De.grabbed()&&t.nodeIsDraggable(De)){var Se=!t.dragData.didDrag;Se&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(Ae,{inDragLayer:!0});var Ue={x:0,y:0};if(Dt(Ke[0])&&Dt(Ke[1])&&(Ue.x+=Ke[0],Ue.y+=Ke[1],Se)){var tt=t.hoverData.dragDelta;tt&&Dt(tt[0])&&Dt(tt[1])&&(Ue.x+=tt[0],Ue.y+=tt[1])}t.hoverData.draggingEles=!0,Ae.silentShift(Ue).emit(pe("position")).emit(pe("drag")),t.redrawHint("drag",!0),t.redraw()}}else ot();j=!0}if($e[2]=xe[0],$e[3]=xe[1],j)return W.stopPropagation&&W.stopPropagation(),W.preventDefault&&W.preventDefault(),!1}},!1);var M,L,P;t.registerBinding(e,"mouseup",function(W){if(!(t.hoverData.which===1&&W.which!==1&&t.hoverData.capture)){var ne=t.hoverData.capture;if(ne){t.hoverData.capture=!1;var j=t.cy,ue=t.projectIntoViewport(W.clientX,W.clientY),X=t.selection,Oe=t.findNearestElement(ue[0],ue[1],!0,!1),xe=t.dragData.possibleDragElements,Ge=t.hoverData.down,_e=a(W);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Ge&&Ge.unactivate();var $e=function(Ee){return{originalEvent:W,type:Ee,position:{x:ue[0],y:ue[1]}}};if(t.hoverData.which===3){var Me=$e("cxttapend");if(Ge?Ge.emit(Me):j.emit(Me),!t.hoverData.cxtDragged){var He=$e("cxttap");Ge?Ge.emit(He):j.emit(He)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(Oe,["mouseup","tapend","vmouseup"],W,{x:ue[0],y:ue[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Ge,["click","tap","vclick"],W,{x:ue[0],y:ue[1]}),L=!1,W.timeStamp-P<=j.multiClickDebounceTime()?(M&&clearTimeout(M),L=!0,P=null,i(Ge,["dblclick","dbltap","vdblclick"],W,{x:ue[0],y:ue[1]})):(M=setTimeout(function(){L||i(Ge,["oneclick","onetap","voneclick"],W,{x:ue[0],y:ue[1]})},j.multiClickDebounceTime()),P=W.timeStamp)),Ge==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(W)&&(j.$(r).unselect(["tapunselect"]),xe.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=xe=j.collection()),Oe==Ge&&!t.dragData.didDrag&&!t.hoverData.selecting&&Oe!=null&&Oe._private.selectable&&(t.hoverData.dragging||(j.selectionType()==="additive"||_e?Oe.selected()?Oe.unselect(["tapunselect"]):Oe.select(["tapselect"]):_e||(j.$(r).unmerge(Oe).unselect(["tapunselect"]),Oe.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var De=j.collection(t.getAllInBox(X[0],X[1],X[2],X[3]));t.redrawHint("select",!0),De.length>0&&t.redrawHint("eles",!0),j.emit($e("boxend"));var Ke=function(Ee){return Ee.selectable()&&!Ee.selected()};j.selectionType()==="additive"||_e||j.$(r).unmerge(De).unselect(),De.emit($e("box")).stdFilter(Ke).select().emit($e("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!X[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var Ae=Ge&&Ge.grabbed();m(xe),Ae&&(Ge.emit($e("freeon")),xe.emit($e("free")),t.dragData.didDrag&&(Ge.emit($e("dragfreeon")),xe.emit($e("dragfree"))))}}X[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var D=[],R=4,I,$=1e5,O=function(W,ne){for(var j=0;j<W.length;j++)if(W[j]%ne!==0)return!1;return!0},N=function(W){for(var ne=Math.abs(W[0]),j=1;j<W.length;j++)if(Math.abs(W[j])!==ne)return!1;return!0},F=function(W){var ne=!1,j=W.deltaY;if(j==null&&(W.wheelDeltaY!=null?j=W.wheelDeltaY/4:W.wheelDelta!=null&&(j=W.wheelDelta/4)),j!==0){if(I==null)if(D.length>=R){var ue=D;if(I=O(ue,5),!I){var X=Math.abs(ue[0]);I=N(ue)&&X>5}if(I)for(var Oe=0;Oe<ue.length;Oe++)$=Math.min(Math.abs(ue[Oe]),$)}else D.push(j),ne=!0;else I&&($=Math.min(Math.abs(j),$));if(!t.scrollingPage){var xe=t.cy,Ge=xe.zoom(),_e=xe.pan(),$e=t.projectIntoViewport(W.clientX,W.clientY),Me=[$e[0]*Ge+_e.x,$e[1]*Ge+_e.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||k()){W.preventDefault();return}if(xe.panningEnabled()&&xe.userPanningEnabled()&&xe.zoomingEnabled()&&xe.userZoomingEnabled()){W.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var He;ne&&Math.abs(j)>5&&(j=YG(j)*5),He=j/-250,I&&(He/=$,He*=3),He=He*t.wheelSensitivity;var De=W.deltaMode===1;De&&(He*=33);var Ke=xe.zoom()*Math.pow(10,He);W.type==="gesturechange"&&(Ke=t.gestureStartZoom*W.scale),xe.zoom({level:Ke,renderedPosition:{x:Me[0],y:Me[1]}}),xe.emit({type:W.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:W,position:{x:$e[0],y:$e[1]}})}}}};t.registerBinding(t.container,"wheel",F,!0),t.registerBinding(e,"scroll",function(W){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(W){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||W.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(he){t.hasTouchStarted||F(he)},!0),t.registerBinding(t.container,"mouseout",function(W){var ne=t.projectIntoViewport(W.clientX,W.clientY);t.cy.emit({originalEvent:W,type:"mouseout",position:{x:ne[0],y:ne[1]}})},!1),t.registerBinding(t.container,"mouseover",function(W){var ne=t.projectIntoViewport(W.clientX,W.clientY);t.cy.emit({originalEvent:W,type:"mouseover",position:{x:ne[0],y:ne[1]}})},!1);var z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge=function(W,ne,j,ue){return Math.sqrt((j-W)*(j-W)+(ue-ne)*(ue-ne))},ee=function(W,ne,j,ue){return(j-W)*(j-W)+(ue-ne)*(ue-ne)},Re;t.registerBinding(t.container,"touchstart",Re=function(W){if(t.hasTouchStarted=!0,!!E(W)){v(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var ne=t.cy,j=t.touchData.now,ue=t.touchData.earlier;if(W.touches[0]){var X=t.projectIntoViewport(W.touches[0].clientX,W.touches[0].clientY);j[0]=X[0],j[1]=X[1]}if(W.touches[1]){var X=t.projectIntoViewport(W.touches[1].clientX,W.touches[1].clientY);j[2]=X[0],j[3]=X[1]}if(W.touches[2]){var X=t.projectIntoViewport(W.touches[2].clientX,W.touches[2].clientY);j[4]=X[0],j[5]=X[1]}var Oe=function(vt){return{originalEvent:W,type:vt,position:{x:j[0],y:j[1]}}};if(W.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var xe=t.findContainerClientCoords();ie=xe[0],K=xe[1],Q=xe[2],te=xe[3],z=W.touches[0].clientX-ie,V=W.touches[0].clientY-K,B=W.touches[1].clientX-ie,G=W.touches[1].clientY-K,J=0<=z&&z<=Q&&0<=B&&B<=Q&&0<=V&&V<=te&&0<=G&&G<=te;var Ge=ne.pan(),_e=ne.zoom();H=ge(z,V,B,G),q=ee(z,V,B,G),Z=[(z+B)/2,(V+G)/2],Y=[(Z[0]-Ge.x)/_e,(Z[1]-Ge.y)/_e];var $e=200,Me=$e*$e;if(q<Me&&!W.touches[2]){var He=t.findNearestElement(j[0],j[1],!0,!0),De=t.findNearestElement(j[2],j[3],!0,!0);He&&He.isNode()?(He.activate().emit(Oe("cxttapstart")),t.touchData.start=He):De&&De.isNode()?(De.activate().emit(Oe("cxttapstart")),t.touchData.start=De):ne.emit(Oe("cxttapstart")),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(W.touches[2])ne.boxSelectionEnabled()&&W.preventDefault();else if(!W.touches[1]){if(W.touches[0]){var Ke=t.findNearestElements(j[0],j[1],!0,!0),Ae=Ke[0];if(Ae!=null&&(Ae.activate(),t.touchData.start=Ae,t.touchData.starts=Ke,t.nodeIsGrabbable(Ae))){var at=t.dragData.touchDragEles=ne.collection(),Ee=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),Ae.selected()?(Ee=ne.$(function(Et){return Et.selected()&&t.nodeIsGrabbable(Et)}),p(Ee,{addToList:at})):g(Ae,{addToList:at}),u(Ae),Ae.emit(Oe("grabon")),Ee?Ee.forEach(function(Et){Et.emit(Oe("grab"))}):Ae.emit(Oe("grab"))}i(Ae,["touchstart","tapstart","vmousedown"],W,{x:j[0],y:j[1]}),Ae==null&&(t.data.bgActivePosistion={x:X[0],y:X[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&i(t.touchData.start,["taphold"],W,{x:j[0],y:j[1]})},t.tapholdDuration)}}if(W.touches.length>=1){for(var pt=t.touchData.startPosition=[null,null,null,null,null,null],ht=0;ht<j.length;ht++)pt[ht]=ue[ht]=j[ht];var rt=W.touches[0];t.touchData.startGPosition=[rt.clientX,rt.clientY]}}},!1);var Ie;t.registerBinding(e,"touchmove",Ie=function(W){var ne=t.touchData.capture;if(!(!ne&&!E(W))){var j=t.selection,ue=t.cy,X=t.touchData.now,Oe=t.touchData.earlier,xe=ue.zoom();if(W.touches[0]){var Ge=t.projectIntoViewport(W.touches[0].clientX,W.touches[0].clientY);X[0]=Ge[0],X[1]=Ge[1]}if(W.touches[1]){var Ge=t.projectIntoViewport(W.touches[1].clientX,W.touches[1].clientY);X[2]=Ge[0],X[3]=Ge[1]}if(W.touches[2]){var Ge=t.projectIntoViewport(W.touches[2].clientX,W.touches[2].clientY);X[4]=Ge[0],X[5]=Ge[1]}var _e=function(Mr){return{originalEvent:W,type:Mr,position:{x:X[0],y:X[1]}}},$e=t.touchData.startGPosition,Me;if(ne&&W.touches[0]&&$e){for(var He=[],De=0;De<X.length;De++)He[De]=X[De]-Oe[De];var Ke=W.touches[0].clientX-$e[0],Ae=Ke*Ke,at=W.touches[0].clientY-$e[1],Ee=at*at,pt=Ae+Ee;Me=pt>=t.touchTapThreshold2}if(ne&&t.touchData.cxt){W.preventDefault();var ht=W.touches[0].clientX-ie,rt=W.touches[0].clientY-K,Et=W.touches[1].clientX-ie,vt=W.touches[1].clientY-K,ot=ee(ht,rt,Et,vt),pe=ot/q,Ct=150,lt=Ct*Ct,st=1.5,mt=st*st;if(pe>=mt||ot>=lt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var _r=_e("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(_r),t.touchData.start=null):ue.emit(_r)}}if(ne&&t.touchData.cxt){var _r=_e("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(_r):ue.emit(_r),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var Se=t.findNearestElement(X[0],X[1],!0,!0);(!t.touchData.cxtOver||Se!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(_e("cxtdragout")),t.touchData.cxtOver=Se,Se&&Se.emit(_e("cxtdragover")))}else if(ne&&W.touches[2]&&ue.boxSelectionEnabled())W.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||ue.emit(_e("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,j[4]=1,!j||j.length===0||j[0]===void 0?(j[0]=(X[0]+X[2]+X[4])/3,j[1]=(X[1]+X[3]+X[5])/3,j[2]=(X[0]+X[2]+X[4])/3+1,j[3]=(X[1]+X[3]+X[5])/3+1):(j[2]=(X[0]+X[2]+X[4])/3,j[3]=(X[1]+X[3]+X[5])/3),t.redrawHint("select",!0),t.redraw();else if(ne&&W.touches[1]&&!t.touchData.didSelect&&ue.zoomingEnabled()&&ue.panningEnabled()&&ue.userZoomingEnabled()&&ue.userPanningEnabled()){W.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ue=t.dragData.touchDragEles;if(Ue){t.redrawHint("drag",!0);for(var tt=0;tt<Ue.length;tt++){var kt=Ue[tt]._private;kt.grabbed=!1,kt.rscratch.inDragLayer=!1}}var Nt=t.touchData.start,ht=W.touches[0].clientX-ie,rt=W.touches[0].clientY-K,Et=W.touches[1].clientX-ie,vt=W.touches[1].clientY-K,sr=ge(ht,rt,Et,vt),Qt=sr/H;if(J){var vr=ht-z,nr=rt-V,Rr=Et-B,Zt=vt-G,gr=(vr+Rr)/2,Dr=(nr+Zt)/2,Qe=ue.zoom(),ct=Qe*Qt,It=ue.pan(),cr=Y[0]*Qe+It.x,Or=Y[1]*Qe+It.y,yt={x:-ct/Qe*(cr-It.x-gr)+cr,y:-ct/Qe*(Or-It.y-Dr)+Or};if(Nt&&Nt.active()){var Ue=t.dragData.touchDragEles;m(Ue),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Nt.unactivate().emit(_e("freeon")),Ue.emit(_e("free")),t.dragData.didDrag&&(Nt.emit(_e("dragfreeon")),Ue.emit(_e("dragfree")))}ue.viewport({zoom:ct,pan:yt,cancelOnFailedZoom:!0}),ue.emit(_e("pinchzoom")),H=sr,z=ht,V=rt,B=Et,G=vt,t.pinching=!0}if(W.touches[0]){var Ge=t.projectIntoViewport(W.touches[0].clientX,W.touches[0].clientY);X[0]=Ge[0],X[1]=Ge[1]}if(W.touches[1]){var Ge=t.projectIntoViewport(W.touches[1].clientX,W.touches[1].clientY);X[2]=Ge[0],X[3]=Ge[1]}if(W.touches[2]){var Ge=t.projectIntoViewport(W.touches[2].clientX,W.touches[2].clientY);X[4]=Ge[0],X[5]=Ge[1]}}else if(W.touches[0]&&!t.touchData.didSelect){var it=t.touchData.start,xt=t.touchData.last,Se;if(!t.hoverData.draggingEles&&!t.swipePanning&&(Se=t.findNearestElement(X[0],X[1],!0,!0)),ne&&it!=null&&W.preventDefault(),ne&&it!=null&&t.nodeIsDraggable(it))if(Me){var Ue=t.dragData.touchDragEles,nt=!t.dragData.didDrag;nt&&p(Ue,{inDragLayer:!0}),t.dragData.didDrag=!0;var Ht={x:0,y:0};if(Dt(He[0])&&Dt(He[1])&&(Ht.x+=He[0],Ht.y+=He[1],nt)){t.redrawHint("eles",!0);var ke=t.touchData.dragDelta;ke&&Dt(ke[0])&&Dt(ke[1])&&(Ht.x+=ke[0],Ht.y+=ke[1])}t.hoverData.draggingEles=!0,Ue.silentShift(Ht).emit(_e("position")).emit(_e("drag")),t.redrawHint("drag",!0),t.touchData.startPosition[0]==Oe[0]&&t.touchData.startPosition[1]==Oe[1]&&t.redrawHint("eles",!0),t.redraw()}else{var ke=t.touchData.dragDelta=t.touchData.dragDelta||[];ke.length===0?(ke.push(He[0]),ke.push(He[1])):(ke[0]+=He[0],ke[1]+=He[1])}if(i(it||Se,["touchmove","tapdrag","vmousemove"],W,{x:X[0],y:X[1]}),(!it||!it.grabbed())&&Se!=xt&&(xt&&xt.emit(_e("tapdragout")),Se&&Se.emit(_e("tapdragover"))),t.touchData.last=Se,ne)for(var tt=0;tt<X.length;tt++)X[tt]&&t.touchData.startPosition[tt]&&Me&&(t.touchData.singleTouchMoved=!0);if(ne&&(it==null||it.pannable())&&ue.panningEnabled()&&ue.userPanningEnabled()){var rn=s(it,t.touchData.starts);rn&&(W.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=Xm(t.touchData.startPosition)),t.swipePanning?(ue.panBy({x:He[0]*xe,y:He[1]*xe}),ue.emit(_e("dragpan"))):Me&&(t.swipePanning=!0,ue.panBy({x:Ke*xe,y:at*xe}),ue.emit(_e("dragpan")),it&&(it.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var Ge=t.projectIntoViewport(W.touches[0].clientX,W.touches[0].clientY);X[0]=Ge[0],X[1]=Ge[1]}}for(var De=0;De<X.length;De++)Oe[De]=X[De];ne&&W.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var Be;t.registerBinding(e,"touchcancel",Be=function(W){var ne=t.touchData.start;t.touchData.capture=!1,ne&&ne.unactivate()});var ce,oe,be,fe;if(t.registerBinding(e,"touchend",ce=function(W){var ne=t.touchData.start,j=t.touchData.capture;if(j)W.touches.length===0&&(t.touchData.capture=!1),W.preventDefault();else return;var ue=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var X=t.cy,Oe=X.zoom(),xe=t.touchData.now,Ge=t.touchData.earlier;if(W.touches[0]){var _e=t.projectIntoViewport(W.touches[0].clientX,W.touches[0].clientY);xe[0]=_e[0],xe[1]=_e[1]}if(W.touches[1]){var _e=t.projectIntoViewport(W.touches[1].clientX,W.touches[1].clientY);xe[2]=_e[0],xe[3]=_e[1]}if(W.touches[2]){var _e=t.projectIntoViewport(W.touches[2].clientX,W.touches[2].clientY);xe[4]=_e[0],xe[5]=_e[1]}var $e=function(lt){return{originalEvent:W,type:lt,position:{x:xe[0],y:xe[1]}}};ne&&ne.unactivate();var Me;if(t.touchData.cxt){if(Me=$e("cxttapend"),ne?ne.emit(Me):X.emit(Me),!t.touchData.cxtDragged){var He=$e("cxttap");ne?ne.emit(He):X.emit(He)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!W.touches[2]&&X.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var De=X.collection(t.getAllInBox(ue[0],ue[1],ue[2],ue[3]));ue[0]=void 0,ue[1]=void 0,ue[2]=void 0,ue[3]=void 0,ue[4]=0,t.redrawHint("select",!0),X.emit($e("boxend"));var Ke=function(lt){return lt.selectable()&&!lt.selected()};De.emit($e("box")).stdFilter(Ke).select().emit($e("boxselect")),De.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(ne!=null&&ne.unactivate(),W.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!W.touches[1]){if(!W.touches[0]){if(!W.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ae=t.dragData.touchDragEles;if(ne!=null){var at=ne._private.grabbed;m(Ae),t.redrawHint("drag",!0),t.redrawHint("eles",!0),at&&(ne.emit($e("freeon")),Ae.emit($e("free")),t.dragData.didDrag&&(ne.emit($e("dragfreeon")),Ae.emit($e("dragfree")))),i(ne,["touchend","tapend","vmouseup","tapdragout"],W,{x:xe[0],y:xe[1]}),ne.unactivate(),t.touchData.start=null}else{var Ee=t.findNearestElement(xe[0],xe[1],!0,!0);i(Ee,["touchend","tapend","vmouseup","tapdragout"],W,{x:xe[0],y:xe[1]})}var pt=t.touchData.startPosition[0]-xe[0],ht=pt*pt,rt=t.touchData.startPosition[1]-xe[1],Et=rt*rt,vt=ht+Et,ot=vt*Oe*Oe;t.touchData.singleTouchMoved||(ne||X.$(":selected").unselect(["tapunselect"]),i(ne,["tap","vclick"],W,{x:xe[0],y:xe[1]}),oe=!1,W.timeStamp-fe<=X.multiClickDebounceTime()?(be&&clearTimeout(be),oe=!0,fe=null,i(ne,["dbltap","vdblclick"],W,{x:xe[0],y:xe[1]})):(be=setTimeout(function(){oe||i(ne,["onetap","voneclick"],W,{x:xe[0],y:xe[1]})},X.multiClickDebounceTime()),fe=W.timeStamp)),ne!=null&&!t.dragData.didDrag&&ne._private.selectable&&ot<t.touchTapThreshold2&&!t.pinching&&(X.selectionType()==="single"?(X.$(r).unmerge(ne).unselect(["tapunselect"]),ne.select(["tapselect"])):ne.selected()?ne.unselect(["tapunselect"]):ne.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var pe=0;pe<xe.length;pe++)Ge[pe]=xe[pe];t.dragData.didDrag=!1,W.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),W.touches.length<2&&(W.touches.length===1&&(t.touchData.startGPosition=[W.touches[0].clientX,W.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var Pe=[],ve=function(W){return{clientX:W.clientX,clientY:W.clientY,force:1,identifier:W.pointerId,pageX:W.pageX,pageY:W.pageY,radiusX:W.width/2,radiusY:W.height/2,screenX:W.screenX,screenY:W.screenY,target:W.target}},Ce=function(W){return{event:W,touch:ve(W)}},Ve=function(W){Pe.push(Ce(W))},se=function(W){for(var ne=0;ne<Pe.length;ne++){var j=Pe[ne];if(j.event.pointerId===W.pointerId){Pe.splice(ne,1);return}}},de=function(W){var ne=Pe.filter(function(j){return j.event.pointerId===W.pointerId})[0];ne.event=W,ne.touch=ve(W)},Te=function(W){W.touches=Pe.map(function(ne){return ne.touch})},ae=function(W){return W.pointerType==="mouse"||W.pointerType===4};t.registerBinding(t.container,"pointerdown",function(he){ae(he)||(he.preventDefault(),Ve(he),Te(he),Re(he))}),t.registerBinding(t.container,"pointerup",function(he){ae(he)||(se(he),Te(he),ce(he))}),t.registerBinding(t.container,"pointercancel",function(he){ae(he)||(se(he),Te(he),Be(he))}),t.registerBinding(t.container,"pointermove",function(he){ae(he)||(he.preventDefault(),de(he),Te(he),Ie(he))})}};var Hh={};Hh.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(n,i,a,s,o,l){this.renderer.nodeShapeImpl("polygon",n,i,a,s,o,this.points)},intersectLine:function(n,i,a,s,o,l,u,h){return nk(o,l,this.points,n,i,a/2,s/2,u)},checkPoint:function(n,i,a,s,o,l,u,h){return wh(n,i,this.points,l,u,s,o,[0,-1],a)},hasMiterBounds:t!=="rectangle",miterBounds:function(n,i,a,s,o,l){return jht(this.points,n,i,a,s,o)}}};Hh.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a)},intersectLine:function(e,r,n,i,a,s,o,l){return ndt(a,s,e,r,n/2+o,i/2+o)},checkPoint:function(e,r,n,i,a,s,o,l){return Jp(e,r,i,a,s,o,n)}}};Hh.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(n,i,a,s,o,l,u){if(l[u]!==void 0&&l[u+"-cx"]===n&&l[u+"-cy"]===i)return l[u];l[u]=new Array(e.length/2),l[u+"-cx"]=n,l[u+"-cy"]=i;var h=a/2,d=s/2;o=o==="auto"?mve(a,s):o;for(var f=new Array(e.length/2),p=0;p<e.length/2;p++)f[p]={x:n+h*e[p*2],y:i+d*e[p*2+1]};var g,m,y,v,T=f.length;for(m=f[T-1],g=0;g<T;g++)y=f[g%T],v=f[(g+1)%T],l[u][g]=sW(m,y,v,o),m=y,y=v;return l[u]},draw:function(n,i,a,s,o,l,u){this.renderer.nodeShapeImpl("round-polygon",n,i,a,s,o,this.points,this.getOrCreateCorners(i,a,s,o,l,u,"drawCorners"))},intersectLine:function(n,i,a,s,o,l,u,h,d){return adt(o,l,this.points,n,i,a,s,u,this.getOrCreateCorners(n,i,a,s,h,d,"corners"))},checkPoint:function(n,i,a,s,o,l,u,h,d){return rdt(n,i,this.points,l,u,s,o,this.getOrCreateCorners(l,u,s,o,h,d,"corners"))}}};Hh.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Rs(4,0),draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a,this.points,s)},intersectLine:function(e,r,n,i,a,s,o,l){return pve(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){var u=i/2,h=a/2;l=l==="auto"?uf(i,a):l,l=Math.min(u,h,l);var d=l*2;return!!(wh(e,r,this.points,s,o,i,a-d,[0,-1],n)||wh(e,r,this.points,s,o,i-d,a,[0,-1],n)||Jp(e,r,d,d,s-u+l,o-h+l,n)||Jp(e,r,d,d,s+u-l,o-h+l,n)||Jp(e,r,d,d,s+u-l,o+h-l,n)||Jp(e,r,d,d,s-u+l,o+h-l,n))}}};Hh.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:jG(),points:Rs(4,0),draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a,null,s)},generateCutTrianglePts:function(e,r,n,i,a){var s=a==="auto"?this.cornerLength:a,o=r/2,l=e/2,u=n-l,h=n+l,d=i-o,f=i+o;return{topLeft:[u,d+s,u+s,d,u+s,d+s],topRight:[h-s,d,h,d+s,h-s,d+s],bottomRight:[h,f-s,h-s,f,h-s,f-s],bottomLeft:[u+s,f,u,f-s,u+s,f-s]}},intersectLine:function(e,r,n,i,a,s,o,l){var u=this.generateCutTrianglePts(n+2*o,i+2*o,e,r,l),h=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return nk(a,s,h,e,r)},checkPoint:function(e,r,n,i,a,s,o,l){var u=l==="auto"?this.cornerLength:l;if(wh(e,r,this.points,s,o,i,a-2*u,[0,-1],n)||wh(e,r,this.points,s,o,i-2*u,a,[0,-1],n))return!0;var h=this.generateCutTrianglePts(i,a,s,o);return fo(e,r,h.topLeft)||fo(e,r,h.topRight)||fo(e,r,h.bottomRight)||fo(e,r,h.bottomLeft)}}};Hh.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Rs(4,0),draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a)},intersectLine:function(e,r,n,i,a,s,o,l){var u=.15,h=.5,d=.85,f=this.generateBarrelBezierPts(n+2*o,i+2*o,e,r),p=function(y){var v=by({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},u),T=by({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},h),b=by({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},d);return[y[0],y[1],v.x,v.y,T.x,T.y,b.x,b.y,y[4],y[5]]},g=[].concat(p(f.topLeft),p(f.topRight),p(f.bottomRight),p(f.bottomLeft));return nk(a,s,g,e,r)},generateBarrelBezierPts:function(e,r,n,i){var a=r/2,s=e/2,o=n-s,l=n+s,u=i-a,h=i+a,d=rP(e,r),f=d.heightOffset,p=d.widthOffset,g=d.ctrlPtOffsetPct*e,m={topLeft:[o,u+f,o+g,u,o+p,u],topRight:[l-p,u,l-g,u,l,u+f],bottomRight:[l,h-f,l-g,h,l-p,h],bottomLeft:[o+p,h,o+g,h,o,h-f]};return m.topLeft.isTop=!0,m.topRight.isTop=!0,m.bottomLeft.isBottom=!0,m.bottomRight.isBottom=!0,m},checkPoint:function(e,r,n,i,a,s,o,l){var u=rP(i,a),h=u.heightOffset,d=u.widthOffset;if(wh(e,r,this.points,s,o,i,a-2*h,[0,-1],n)||wh(e,r,this.points,s,o,i-2*d,a,[0,-1],n))return!0;for(var f=this.generateBarrelBezierPts(i,a,s,o),p=function(E,_,M){var L=M[4],P=M[2],D=M[0],R=M[5],I=M[1],$=Math.min(L,D),O=Math.max(L,D),N=Math.min(R,I),F=Math.max(R,I);if($<=E&&E<=O&&N<=_&&_<=F){var z=sdt(L,P,D),V=Qht(z[0],z[1],z[2],E),B=V.filter(function(G){return 0<=G&&G<=1});if(B.length>0)return B[0]}return null},g=Object.keys(f),m=0;m<g.length;m++){var y=g[m],v=f[y],T=p(e,r,v);if(T!=null){var b=v[5],w=v[3],C=v[1],S=ya(b,w,C,T);if(v.isTop&&S<=r||v.isBottom&&r<=S)return!0}}return!1}}};Hh.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Rs(4,0),draw:function(e,r,n,i,a,s){this.renderer.nodeShapeImpl(this.name,e,r,n,i,a,this.points,s)},intersectLine:function(e,r,n,i,a,s,o,l){var u=e-(n/2+o),h=r-(i/2+o),d=h,f=e+(n/2+o),p=Od(a,s,e,r,u,h,f,d,!1);return p.length>0?p:pve(a,s,e,r,n,i,o,l)},checkPoint:function(e,r,n,i,a,s,o,l){l=l==="auto"?uf(i,a):l;var u=2*l;if(wh(e,r,this.points,s,o,i,a-u,[0,-1],n)||wh(e,r,this.points,s,o,i-u,a,[0,-1],n))return!0;var h=i/2+2*n,d=a/2+2*n,f=[s-h,o-d,s-h,o,s+h,o,s+h,o-d];return!!(fo(e,r,f)||Jp(e,r,u,u,s+i/2-l,o+a/2-l,n)||Jp(e,r,u,u,s-i/2+l,o+a/2-l,n))}}};Hh.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Rs(3,0)),this.generateRoundPolygon("round-triangle",Rs(3,0)),this.generatePolygon("rectangle",Rs(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Rs(5,0)),this.generateRoundPolygon("round-pentagon",Rs(5,0)),this.generatePolygon("hexagon",Rs(6,0)),this.generateRoundPolygon("round-hexagon",Rs(6,0)),this.generatePolygon("heptagon",Rs(7,0)),this.generateRoundPolygon("round-heptagon",Rs(7,0)),this.generatePolygon("octagon",Rs(8,0)),this.generateRoundPolygon("round-octagon",Rs(8,0));var n=new Array(20);{var i=tP(5,0),a=tP(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o<a.length/2;o++)a[o*2]*=s,a[o*2+1]*=s;for(var o=0;o<20/4;o++)n[o*4]=i[o*2],n[o*4+1]=i[o*2+1],n[o*4+2]=a[o*2],n[o*4+3]=a[o*2+1]}n=gve(n),this.generatePolygon("star",n),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var l=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l)}t.makePolygon=function(u){var h=u.join("$"),d="polygon-"+h,f;return(f=this[d])?f:e.generatePolygon(d,u)}};var TS={};TS.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};TS.redraw=function(t){t=t||uve();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t};TS.beforeRender=function(t,e){if(!this.destroyed){e==null&&oi("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:t,priority:e}),r.sort(function(n,i){return i.priority-n.priority})}};var ste=function(e,r,n){for(var i=e.beforeRenderCallbacks,a=0;a<i.length;a++)i[a].fn(r,n)};TS.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var r=function(i){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){ste(t,!0,i);var a=Th();t.render(t.renderOptions);var s=t.lastDrawTime=Th();t.averageRedrawTime===void 0&&(t.averageRedrawTime=s-a),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var o=s-a;t.redrawTotalTime+=o,t.lastRedrawTime=o,t.averageRedrawTime=t.averageRedrawTime/2+o/2,t.requestedFrame=!1}else ste(t,!1,i);t.skipFrame=!1,d_(r)}};d_(r)}};var S0t=function(e){this.init(e)},y2e=S0t,Dx=y2e.prototype;Dx.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];Dx.init=function(t){var e=this;e.options=t,e.cy=t.cy;var r=e.container=t.cy.container(),n=e.cy.window();if(n){var i=n.document,a=i.head,s="__________cytoscape_stylesheet",o="__________cytoscape_container",l=i.getElementById(s)!=null;if(r.className.indexOf(o)<0&&(r.className=(r.className||"")+" "+o),!l){var u=i.createElement("style");u.id=s,u.textContent="."+o+" { position: relative; }",a.insertBefore(u,a.children[0])}var h=n.getComputedStyle(r),d=h.getPropertyValue("position");d==="static"&&Cn("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=t.showFps,e.debug=t.debug,e.webgl=t.webgl,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=Dt(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()};Dx.notify=function(t,e){var r=this,n=r.cy;if(!this.destroyed){if(t==="init"){r.load();return}if(t==="destroy"){r.destroy();return}(t==="add"||t==="remove"||t==="move"&&n.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&r.invalidateCachedZSortedEles(),t==="viewport"&&r.redrawHint("select",!0),t==="gc"&&r.redrawHint("gc",!0),(t==="load"||t==="resize"||t==="mount")&&(r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container)),r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};Dx.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var r=t.bindings[e],n=r,i=n.target;(i.off||i.removeEventListener).apply(i,n.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver&&t.removeObserver.disconnect(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch{}};Dx.isHeadless=function(){return!1};[aW,p2e,g2e,Nx,Hh,TS].forEach(function(t){dr(Dx,t)});var eN=1e3/60,v2e={setupDequeueing:function(e){return function(){var n=this,i=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var a=mS(function(){i.redrawHint("eles",!0),i.redrawHint("drag",!0),i.redraw()},e.deqRedrawThreshold),s=function(u,h){var d=Th(),f=i.averageRedrawTime,p=i.lastRedrawTime,g=[],m=i.cy.extent(),y=i.getPixelRatio();for(u||i.flushRenderedStyleQueue();;){var v=Th(),T=v-d,b=v-h;if(p<eN){var w=eN-(u?f:0);if(b>=e.deqFastCost*w)break}else if(u){if(T>=e.deqCost*p||T>=e.deqAvgCost*f)break}else if(b>=e.deqNoDrawCost*eN)break;var C=e.deq(n,y,m);if(C.length>0)for(var S=0;S<C.length;S++)g.push(C[S]);else break}g.length>0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,y,m)&&a())},o=e.priority||HG;i.beforeRender(s,o(n))}}}},E0t=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f_;_f(this,t),this.idsByKey=new th,this.keyForId=new th,this.cachesByLvl=new th,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return Rf(t,[{key:"getIdsFor",value:function(r){r==null&&oi("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new Rx,n.set(r,i)),i}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);this.deleteIdForKey(i,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),i=this.keyForId.get(n),a=this.getKey(r);return i!==a}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,i=this.lvls,a=n.get(r);return a||(a=new th,n.set(r,a),i.push(r)),a}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var i=this.getKey(r),a=this.getCache(i,n);return a!=null&&this.updateKeyMappingFor(r),a}},{key:"getForCachedKey",value:function(r,n){var i=this.keyForId.get(r.id()),a=this.getCache(i,n);return a}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var i=this.getKey(r);return this.hasCache(i,n)}},{key:"setCache",value:function(r,n,i){i.key=r,this.getCachesAt(n).set(r,i)}},{key:"set",value:function(r,n,i){var a=this.getKey(r);this.setCache(a,n,i),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var i=this.getKey(r);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(i){return n.deleteCache(r,i)})}},{key:"invalidate",value:function(r){var n=r.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(r);var a=this.doesEleInvalidateKey(r);return a&&this.invalidateKey(i),a||this.getNumberOfIdsForKey(i)===0}}])})(),ote=25,n4=50,g3=-4,gP=3,b2e=7.99,A0t=8,_0t=1024,R0t=1024,L0t=1024,M0t=.2,I0t=.8,N0t=10,D0t=.15,O0t=.1,$0t=.9,P0t=.9,B0t=100,F0t=1,Km={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},z0t=ts({getKey:null,doesEleInvalidateKey:f_,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:ove,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),tw=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=z0t(r);dr(n,i),n.lookup=new E0t(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},ha=tw.prototype;ha.reasons=Km;ha.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};ha.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n};ha.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new yS(function(r,n){return n.reqs-r.reqs});return e};ha.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};ha.getElement=function(t,e,r,n,i){var a=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!a.allowEdgeTxrCaching&&t.isEdge()||!a.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(UG(o*r))),n<g3)n=g3;else if(o>=b2e||n>gP)return null;var u=Math.pow(2,n),h=e.h*u,d=e.w*u,f=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,f))return null;var p=l.get(t,n);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;var g;if(h<=ote?g=ote:h<=n4?g=n4:g=Math.ceil(h/n4)*n4,h>L0t||d>R0t)return null;var m=a.getTextureQueue(g),y=m[m.length-2],v=function(){return a.recycleTexture(g,d)||a.addTexture(g,d)};y||(y=m[m.length-1]),y||(y=v()),y.width-y.usedWidth<d&&(y=v());for(var T=function($){return $&&$.scaledLabelShown===f},b=i&&i===Km.dequeue,w=i&&i===Km.highQuality,C=i&&i===Km.downscale,S,k=n+1;k<=gP;k++){var E=l.get(t,k);if(E){S=E;break}}var _=S&&S.level===n+1?S:null,M=function(){y.context.drawImage(_.texture.canvas,_.x,0,_.width,_.height,y.usedWidth,0,d,h)};if(y.context.setTransform(1,0,0,1,0,0),y.context.clearRect(y.usedWidth,0,d,g),T(_))M();else if(T(S))if(w){for(var L=S.level;L>n;L--)_=a.getElement(t,e,r,L,Km.downscale);M()}else return a.queueElement(t,S.level-1),S;else{var P;if(!b&&!w&&!C)for(var D=n-1;D>=g3;D--){var R=l.get(t,D);if(R){P=R;break}}if(T(P))return a.queueElement(t,n),P;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,f,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return p={x:y.usedWidth,texture:y,level:n,scale:u,width:d,height:h,scaledLabelShown:f},y.usedWidth+=Math.ceil(d+A0t),y.eleCaches.push(p),l.set(t,n,p),a.checkTextureFullness(y),p};ha.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])};ha.invalidateElement=function(t){var e=this,r=e.lookup,n=[],i=r.isInvalid(t);if(i){for(var a=g3;a<=gP;a++){var s=r.getForCachedKey(t,a);s&&n.push(s)}var o=r.invalidate(t);if(o)for(var l=0;l<n.length;l++){var u=n[l],h=u.texture;h.invalidatedWidth+=u.width,u.invalidated=!0,e.checkTextureUtility(h)}e.removeFromQueue(t)}};ha.checkTextureUtility=function(t){t.invalidatedWidth>=M0t*t.width&&this.retireTexture(t)};ha.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>I0t&&t.fullnessChecks>=N0t?cf(r,t):t.fullnessChecks++};ha.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;cf(n,t),t.retired=!0;for(var a=t.eleCaches,s=0;s<a.length;s++){var o=a[s];i.deleteCache(o.key,o.level)}qG(a);var l=e.getRetiredTextureQueue(r);l.push(t)};ha.addTexture=function(t,e){var r=this,n=r.getTextureQueue(t),i={};return n.push(i),i.eleCaches=[],i.height=t,i.width=Math.max(_0t,e),i.usedWidth=0,i.invalidatedWidth=0,i.fullnessChecks=0,i.canvas=r.renderer.makeOffscreenCanvas(i.width,i.height),i.context=i.canvas.getContext("2d"),i};ha.recycleTexture=function(t,e){for(var r=this,n=r.getTextureQueue(t),i=r.getRetiredTextureQueue(t),a=0;a<i.length;a++){var s=i[a];if(s.width>=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,qG(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),cf(i,s),n.push(s),s}};ha.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),a=this.getKey(t),s=i[a];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:a};n.push(o),i[a]=o}};ha.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,s=0;s<F0t&&r.size()>0;s++){var o=r.pop(),l=o.key,u=o.eles[0],h=a.hasCache(u,o.level);if(n[l]=null,h)continue;i.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,t,o.level,Km.dequeue)}return i};ha.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=this.getKey(t),a=n[i];a!=null&&(a.eles.length===1?(a.reqs=WG,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))};ha.onDequeue=function(t){this.onDequeues.push(t)};ha.offDequeue=function(t){cf(this.onDequeues,t)};ha.setupDequeueing=v2e.setupDequeueing({deqRedrawThreshold:B0t,deqCost:D0t,deqAvgCost:O0t,deqNoDrawCost:$0t,deqFastCost:P0t,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n<e.onDequeues.length;n++){var i=e.onDequeues[n];i(r)}},shouldRedraw:function(e,r,n,i){for(var a=0;a<r.length;a++)for(var s=r[a].eles,o=0;o<s.length;o++){var l=s[o].boundingBox();if(XG(l,i))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var V0t=1,Uw=-4,T_=2,G0t=3.99,W0t=50,H0t=50,q0t=.15,U0t=.1,Y0t=.9,X0t=.9,j0t=1,lte=250,K0t=4e3*4e3,cte=32767,Z0t=!0,x2e=function(e){var r=this,n=r.renderer=e,i=n.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=Th()-2*lte,r.skipping=!1,r.eleTxrDeqs=i.collection(),r.scheduleElementRefinement=mS(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},H0t),n.beforeRender(function(s,o){o-r.lastInvalidationTime<=lte?r.skipping=!0:r.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var a=function(o,l){return l.reqs-o.reqs};r.layersQueue=new yS(a),r.setupDequeueing()},rs=x2e.prototype,ute=0,Q0t=Math.pow(2,53)-1;rs.makeLayer=function(t,e){var r=Math.pow(2,e),n=Math.ceil(t.w*r),i=Math.ceil(t.h*r),a=this.renderer.makeOffscreenCanvas(n,i),s={id:ute=++ute%Q0t,bb:t,level:e,width:n,height:i,canvas:a,context:a.getContext("2d"),eles:[],elesQueue:[],reqs:0},o=s.context,l=-s.bb.x1,u=-s.bb.y1;return o.scale(r,r),o.translate(l,u),s};rs.getLayers=function(t,e,r){var n=this,i=n.renderer,a=i.cy,s=a.zoom(),o=n.firstGet;if(n.firstGet=!1,r==null){if(r=Math.ceil(UG(s*e)),r<Uw)r=Uw;else if(s>=G0t||r>T_)return null}n.validateLayersElesOrdering(r,t);var l=n.layersByLevel,u=Math.pow(2,r),h=l[r]=l[r]||[],d,f=n.levelIsComplete(r,t),p,g=function(){var M=function(I){if(n.validateLayersElesOrdering(I,t),n.levelIsComplete(I,t))return p=l[I],!0},L=function(I){if(!p)for(var $=r+I;Uw<=$&&$<=T_&&!M($);$+=I);};L(1),L(-1);for(var P=h.length-1;P>=0;P--){var D=h[P];D.invalid&&cf(h,D)}};if(!f)g();else return h;var m=function(){if(!d){d=Us();for(var M=0;M<t.length;M++)Uht(d,t[M].boundingBox())}return d},y=function(M){M=M||{};var L=M.after;m();var P=Math.ceil(d.w*u),D=Math.ceil(d.h*u);if(P>cte||D>cte)return null;var R=P*D;if(R>K0t)return null;var I=n.makeLayer(d,r);if(L!=null){var $=h.indexOf(L)+1;h.splice($,0,I)}else(M.insert===void 0||M.insert)&&h.unshift(I);return I};if(n.skipping&&!o)return null;for(var v=null,T=t.length/V0t,b=!o,w=0;w<t.length;w++){var C=t[w],S=C._private.rscratch,k=S.imgLayerCaches=S.imgLayerCaches||{},E=k[r];if(E){v=E;continue}if((!v||v.eles.length>=T||!fve(v.bb,C.boundingBox()))&&(v=y({insert:!0,after:v}),!v))return null;p||b?n.queueLayer(v,C):n.drawEleInLayer(v,C,r,e),v.eles.push(C),k[r]=v}return p||(b?null:h)};rs.getEleLevelForLayerLevel=function(t,e){return t};rs.drawEleInLayer=function(t,e,r,n){var i=this,a=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),a.setImgSmoothing(s,!1),a.drawCachedElement(s,e,null,null,r,Z0t),a.setImgSmoothing(s,!0))};rs.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var i=0,a=0;a<n.length;a++){var s=n[a];if(s.reqs>0||s.invalid)return!1;i+=s.eles.length}return i===e.length};rs.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n<r.length;n++){for(var i=r[n],a=-1,s=0;s<e.length;s++)if(i.eles[0]===e[s]){a=s;break}if(a<0){this.invalidateLayer(i);continue}for(var o=a,s=0;s<i.eles.length;s++)if(i.eles[s]!==e[o+s]){this.invalidateLayer(i);break}}};rs.updateElementsInLayers=function(t,e){for(var r=this,n=dS(t[0]),i=0;i<t.length;i++)for(var a=n?null:t[i],s=n?t[i]:t[i].ele,o=s._private.rscratch,l=o.imgLayerCaches=o.imgLayerCaches||{},u=Uw;u<=T_;u++){var h=l[u];h&&(a&&r.getEleLevelForLayerLevel(h.level)!==a.level||e(h,s,a))}};rs.haveLayers=function(){for(var t=this,e=!1,r=Uw;r<=T_;r++){var n=t.layersByLevel[r];if(n&&n.length>0){e=!0;break}}return e};rs.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Th(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,a){e.invalidateLayer(n)}))};rs.invalidateLayer=function(t){if(this.lastInvalidationTime=Th(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];cf(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var i=0;i<r.length;i++){var a=r[i]._private.rscratch.imgLayerCaches;a&&(a[e]=null)}}};rs.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(n,i,a){var s=n.replacement;if(s||(s=n.replacement=e.makeLayer(n.bb,n.level),s.replaces=n,s.eles=n.eles),!s.reqs)for(var o=0;o<s.eles.length;o++)e.queueLayer(s,s.eles[o])})};rs.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()};rs.queueLayer=function(t,e){var r=this,n=r.layersQueue,i=t.elesQueue,a=i.hasId=i.hasId||{};if(!t.replacement){if(e){if(a[e.id()])return;i.push(e),a[e.id()]=!0}t.reqs?(t.reqs++,n.updateItem(t)):(t.reqs=1,n.push(t))}};rs.dequeue=function(t){for(var e=this,r=e.layersQueue,n=[],i=0;i<j0t&&r.size()!==0;){var a=r.peek();if(a.replacement){r.pop();continue}if(a.replaces&&a!==a.replaces.replacement){r.pop();continue}if(a.invalid){r.pop();continue}var s=a.elesQueue.shift();s&&(e.drawEleInLayer(a,s,a.level,t),i++),n.length===0&&n.push(!0),a.elesQueue.length===0&&(r.pop(),a.reqs=0,a.replaces&&e.applyLayerReplacement(a),e.requestRedraw())}return n};rs.applyLayerReplacement=function(t){var e=this,r=e.layersByLevel[t.level],n=t.replaces,i=r.indexOf(n);if(!(i<0||n.invalid)){r[i]=t;for(var a=0;a<t.eles.length;a++){var s=t.eles[a]._private,o=s.imgLayerCaches=s.imgLayerCaches||{};o&&(o[t.level]=t)}e.requestRedraw()}};rs.requestRedraw=mS(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100);rs.setupDequeueing=v2e.setupDequeueing({deqRedrawThreshold:W0t,deqCost:q0t,deqAvgCost:U0t,deqNoDrawCost:Y0t,deqFastCost:X0t,deq:function(e,r){return e.dequeue(r)},onDeqd:HG,shouldRedraw:ove,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var T2e={},hte;function J0t(t,e){for(var r=0;r<e.length;r++){var n=e[r];t.lineTo(n.x,n.y)}}function egt(t,e,r){for(var n,i=0;i<e.length;i++){var a=e[i];i===0&&(n=a),t.lineTo(a.x,a.y)}t.quadraticCurveTo(r.x,r.y,n.x,n.y)}function dte(t,e,r){t.beginPath&&t.beginPath();for(var n=e,i=0;i<n.length;i++){var a=n[i];t.lineTo(a.x,a.y)}var s=r,o=r[0];t.moveTo(o.x,o.y);for(var i=1;i<s.length;i++){var a=s[i];t.lineTo(a.x,a.y)}t.closePath&&t.closePath()}function tgt(t,e,r,n,i){t.beginPath&&t.beginPath(),t.arc(r,n,i,0,Math.PI*2,!1);var a=e,s=a[0];t.moveTo(s.x,s.y);for(var o=0;o<a.length;o++){var l=a[o];t.lineTo(l.x,l.y)}t.closePath&&t.closePath()}function rgt(t,e,r,n){t.arc(e,r,n,0,Math.PI*2,!1)}T2e.arrowShapeImpl=function(t){return(hte||(hte={polygon:J0t,"triangle-backcurve":egt,"triangle-tee":dte,"circle-triangle":tgt,"triangle-cross":dte,circle:rgt}))[t]};var fu={};fu.drawElement=function(t,e,r,n,i,a){var s=this;e.isNode()?s.drawNode(t,e,r,n,i,a):s.drawEdge(t,e,r,n,i,a)};fu.drawElementOverlay=function(t,e){var r=this;e.isNode()?r.drawNodeOverlay(t,e):r.drawEdgeOverlay(t,e)};fu.drawElementUnderlay=function(t,e){var r=this;e.isNode()?r.drawNodeUnderlay(t,e):r.drawEdgeUnderlay(t,e)};fu.drawCachedElementPortion=function(t,e,r,n,i,a,s,o){var l=this,u=r.getBoundingBox(e);if(!(u.w===0||u.h===0)){var h=r.getElement(e,u,n,i,a);if(h!=null){var d=o(l,e);if(d===0)return;var f=s(l,e),p=u.x1,g=u.y1,m=u.w,y=u.h,v,T,b,w,C;if(f!==0){var S=r.getRotationPoint(e);b=S.x,w=S.y,t.translate(b,w),t.rotate(f),C=l.getImgSmoothing(t),C||l.setImgSmoothing(t,!0);var k=r.getRotationOffset(e);v=k.x,T=k.y}else v=p,T=g;var E;d!==1&&(E=t.globalAlpha,t.globalAlpha=E*d),t.drawImage(h.texture.canvas,h.x,0,h.width,h.height,v,T,m,y),d!==1&&(t.globalAlpha=E),f!==0&&(t.rotate(-f),t.translate(-b,-w),C||l.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var ngt=function(){return 0},igt=function(e,r){return e.getTextAngle(r,null)},agt=function(e,r){return e.getTextAngle(r,"source")},sgt=function(e,r){return e.getTextAngle(r,"target")},ogt=function(e,r){return r.effectiveOpacity()},tN=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};fu.drawCachedElement=function(t,e,r,n,i,a){var s=this,o=s.data,l=o.eleTxrCache,u=o.lblTxrCache,h=o.slbTxrCache,d=o.tlbTxrCache,f=e.boundingBox(),p=a===!0?l.reasons.highQuality:null;if(!(f.w===0||f.h===0||!e.visible())&&(!n||XG(f,n))){var g=e.isEdge(),m=e.element()._private.rscratch.badLine;s.drawElementUnderlay(t,e),s.drawCachedElementPortion(t,e,l,r,i,p,ngt,ogt),(!g||!m)&&s.drawCachedElementPortion(t,e,u,r,i,p,igt,tN),g&&!m&&(s.drawCachedElementPortion(t,e,h,r,i,p,agt,tN),s.drawCachedElementPortion(t,e,d,r,i,p,sgt,tN)),s.drawElementOverlay(t,e)}};fu.drawElements=function(t,e){for(var r=this,n=0;n<e.length;n++){var i=e[n];r.drawElement(t,i)}};fu.drawCachedElements=function(t,e,r,n){for(var i=this,a=0;a<e.length;a++){var s=e[a];i.drawCachedElement(t,s,r,n)}};fu.drawCachedNodes=function(t,e,r,n){for(var i=this,a=0;a<e.length;a++){var s=e[a];s.isNode()&&i.drawCachedElement(t,s,r,n)}};fu.drawLayeredElements=function(t,e,r,n){var i=this,a=i.data.lyrTxrCache.getLayers(e,r);if(a)for(var s=0;s<a.length;s++){var o=a[s],l=o.bb;l.w===0||l.h===0||t.drawImage(o.canvas,l.x1,l.y1,l.w,l.h)}else i.drawCachedElements(t,e,r,n)};var qh={};qh.drawEdge=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(a&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=a?e.pstyle("opacity").value:1,h=a?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,p=e.pstyle("width").pfValue,g=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,v=u*h,T=u*h,b=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;d==="straight-triangle"?(s.eleStrokeStyle(t,e,I),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=p,t.lineCap=g,s.eleStrokeStyle(t,e,I),s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},w=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;if(t.lineWidth=p+m,t.lineCap=g,m>0)s.colorStrokeStyle(t,y[0],y[1],y[2],I);else{t.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,t,o.allpts):(s.drawEdgePath(e,t,o.allpts,f),t.lineCap="butt")},C=function(){i&&s.drawEdgeOverlay(t,e)},S=function(){i&&s.drawEdgeUnderlay(t,e)},k=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:T;s.drawArrowheads(t,e,I)},E=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var _=e.pstyle("ghost").value==="yes";if(_){var M=e.pstyle("ghost-offset-x").pfValue,L=e.pstyle("ghost-offset-y").pfValue,P=e.pstyle("ghost-opacity").value,D=v*P;t.translate(M,L),b(D),k(D),t.translate(-M,-L)}else w();S(),b(),k(),C(),E(),r&&t.translate(l.x1,l.y1)}};var w2e=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(i!==0){var a=this,s=a.usePaths(),o=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,h=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",a.colorStrokeStyle(r,h[0],h[1],h[2],i),a.drawEdgePath(n,r,o.allpts,"solid")}}}};qh.drawEdgeOverlay=w2e("overlay");qh.drawEdgeUnderlay=w2e("underlay");qh.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,a=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var d=r.join("$"),f=i.pathCacheKey&&i.pathCacheKey===d;f?(s=e=i.pathCache,o=!0):(s=e=new Path2D,i.pathCacheKey=d,i.pathCache=s)}if(a.setLineDash)switch(n){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=h;break;case"solid":a.setLineDash([]);break}if(!o&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+3<r.length;p+=4)e.quadraticCurveTo(r[p],r[p+1],r[p+2],r[p+3]);break;case"straight":case"haystack":for(var g=2;g+1<r.length;g+=2)e.lineTo(r[g],r[g+1]);break;case"segments":if(i.isRound){var m=yo(i.roundCorners),y;try{for(m.s();!(y=m.n()).done;){var v=y.value;c2e(e,v)}}catch(b){m.e(b)}finally{m.f()}e.lineTo(r[r.length-2],r[r.length-1])}else for(var T=2;T+1<r.length;T+=2)e.lineTo(r[T],r[T+1]);break}e=a,l?e.stroke(s):e.stroke(),e.setLineDash&&e.setLineDash([])};qh.drawEdgeTrianglePath=function(t,e,r){e.fillStyle=e.strokeStyle;for(var n=t.pstyle("width").pfValue,i=0;i+1<r.length;i+=2){var a=[r[i+2]-r[i],r[i+3]-r[i+1]],s=Math.sqrt(a[0]*a[0]+a[1]*a[1]),o=[a[1]/s,-a[0]/s],l=[o[0]*n/2,o[1]*n/2];e.beginPath(),e.moveTo(r[i]-l[0],r[i+1]-l[1]),e.lineTo(r[i]+l[0],r[i+1]+l[1]),e.lineTo(r[i+2],r[i+3]),e.closePath(),e.fill()}};qh.drawArrowheads=function(t,e,r){var n=e._private.rscratch,i=n.edgeType==="haystack";i||this.drawArrowhead(t,e,"source",n.arrowStartX,n.arrowStartY,n.srcArrowAngle,r),this.drawArrowhead(t,e,"mid-target",n.midX,n.midY,n.midtgtArrowAngle,r),this.drawArrowhead(t,e,"mid-source",n.midX,n.midY,n.midsrcArrowAngle,r),i||this.drawArrowhead(t,e,"target",n.arrowEndX,n.arrowEndY,n.tgtArrowAngle,r)};qh.drawArrowhead=function(t,e,r,n,i,a,s){if(!(isNaN(n)||n==null||isNaN(i)||i==null||isNaN(a)||a==null)){var o=this,l=e.pstyle(r+"-arrow-shape").value;if(l!=="none"){var u=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",h=e.pstyle(r+"-arrow-fill").value,d=e.pstyle("width").pfValue,f=e.pstyle(r+"-arrow-width"),p=f.value==="match-line"?d:f.pfValue;f.units==="%"&&(p*=d);var g=e.pstyle("opacity").value;s===void 0&&(s=g);var m=t.globalCompositeOperation;(s!==1||h==="hollow")&&(t.globalCompositeOperation="destination-out",o.colorFillStyle(t,255,255,255,1),o.colorStrokeStyle(t,255,255,255,1),o.drawArrowShape(e,t,u,d,l,p,n,i,a),t.globalCompositeOperation=m);var y=e.pstyle(r+"-arrow-color").value;o.colorFillStyle(t,y[0],y[1],y[2],s),o.colorStrokeStyle(t,y[0],y[1],y[2],s),o.drawArrowShape(e,t,h,d,l,p,n,i,a)}}};qh.drawArrowShape=function(t,e,r,n,i,a,s,o,l){var u=this,h=this.usePaths()&&i!=="triangle-cross",d=!1,f,p=e,g={x:s,y:o},m=t.pstyle("arrow-scale").value,y=this.getArrowWidth(n,m),v=u.arrowShapes[i];if(h){var T=u.arrowPathCache=u.arrowPathCache||[],b=z0(i),w=T[b];w!=null?(f=e=w,d=!0):(f=e=new Path2D,T[b]=f)}d||(e.beginPath&&e.beginPath(),h?v.draw(e,1,0,{x:0,y:0},1):v.draw(e,y,l,g,n),e.closePath&&e.closePath()),e=p,h&&(e.translate(s,o),e.rotate(l),e.scale(y,y)),(r==="filled"||r==="both")&&(h?e.fill(f):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=a/(h?y:1),e.lineJoin="miter",h?e.stroke(f):e.stroke()),h&&(e.scale(1/y,1/y),e.rotate(-l),e.translate(-s,-o))};var lW={};lW.safeDrawImage=function(t,e,r,n,i,a,s,o,l,u){if(!(i<=0||a<=0||l<=0||u<=0))try{t.drawImage(e,r,n,i,a,s,o,l,u)}catch(h){Cn(h)}};lW.drawInscribedImage=function(t,e,r,n,i){var a=this,s=r.position(),o=s.x,l=s.y,u=r.cy().style(),h=u.getIndexedStyle.bind(u),d=h(r,"background-fit","value",n),f=h(r,"background-repeat","value",n),p=r.width(),g=r.height(),m=r.padding()*2,y=p+(h(r,"background-width-relative-to","value",n)==="inner"?0:m),v=g+(h(r,"background-height-relative-to","value",n)==="inner"?0:m),T=r._private.rscratch,b=h(r,"background-clip","value",n),w=b==="node",C=h(r,"background-image-opacity","value",n)*i,S=h(r,"background-image-smoothing","value",n),k=r.pstyle("corner-radius").value;k!=="auto"&&(k=r.pstyle("corner-radius").pfValue);var E=e.width||e.cachedW,_=e.height||e.cachedH;(E==null||_==null)&&(document.body.appendChild(e),E=e.cachedW=e.width||e.offsetWidth,_=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var M=E,L=_;if(h(r,"background-width","value",n)!=="auto"&&(h(r,"background-width","units",n)==="%"?M=h(r,"background-width","pfValue",n)*y:M=h(r,"background-width","pfValue",n)),h(r,"background-height","value",n)!=="auto"&&(h(r,"background-height","units",n)==="%"?L=h(r,"background-height","pfValue",n)*v:L=h(r,"background-height","pfValue",n)),!(M===0||L===0)){if(d==="contain"){var P=Math.min(y/M,v/L);M*=P,L*=P}else if(d==="cover"){var P=Math.max(y/M,v/L);M*=P,L*=P}var D=o-y/2,R=h(r,"background-position-x","units",n),I=h(r,"background-position-x","pfValue",n);R==="%"?D+=(y-M)*I:D+=I;var $=h(r,"background-offset-x","units",n),O=h(r,"background-offset-x","pfValue",n);$==="%"?D+=(y-M)*O:D+=O;var N=l-v/2,F=h(r,"background-position-y","units",n),z=h(r,"background-position-y","pfValue",n);F==="%"?N+=(v-L)*z:N+=z;var V=h(r,"background-offset-y","units",n),B=h(r,"background-offset-y","pfValue",n);V==="%"?N+=(v-L)*B:N+=B,T.pathCache&&(D-=o,N-=l,o=0,l=0);var G=t.globalAlpha;t.globalAlpha=C;var H=a.getImgSmoothing(t),q=!1;if(S==="no"&&H?(a.setImgSmoothing(t,!1),q=!0):S==="yes"&&!H&&(a.setImgSmoothing(t,!0),q=!0),f==="no-repeat")w&&(t.save(),T.pathCache?t.clip(T.pathCache):(a.nodeShapes[a.getNodeShape(r)].draw(t,o,l,y,v,k,T),t.clip())),a.safeDrawImage(t,e,0,0,E,_,D,N,M,L),w&&t.restore();else{var Z=t.createPattern(e,f);t.fillStyle=Z,a.nodeShapes[a.getNodeShape(r)].draw(t,o,l,y,v,k,T),t.translate(D,N),t.fill(),t.translate(-D,-N)}t.globalAlpha=G,q&&a.setImgSmoothing(t,H)}};var gg={};gg.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),n=this.getPixelRatio(),i=Math.ceil(UG(r*n));e=Math.pow(2,i)}var a=t.pstyle("font-size").pfValue*e,s=t.pstyle("min-zoomed-font-size").pfValue;return!(a<s)};gg.drawElementText=function(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(a&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e),u=e.pstyle("text-metrics").strValue==="glyph";t.textAlign=l,t.textBaseline=u?"alphabetic":"bottom"}else{var h=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),p=e.pstyle("target-label");if(h||(!d||!d.value)&&(!f||!f.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var g=!r,m;r&&(m=r,t.translate(-m.x1,-m.y1)),i==null?(s.drawText(t,e,null,g,a),e.isEdge()&&(s.drawText(t,e,"source",g,a),s.drawText(t,e,"target",g,a))):s.drawText(t,e,i,g,a),r&&t.translate(m.x1,m.y1)};gg.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(e=this.fontCaches[r],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e};gg.setupTextStyle=function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",a=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function lgt(t,e,r,n,i){var a=Math.min(n,i),s=a/2,o=e+n/2,l=r+i/2;t.beginPath(),t.arc(o,l,s,0,Math.PI*2),t.closePath()}function fte(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=Math.min(a,n/2,i/2);t.beginPath(),t.moveTo(e+s,r),t.lineTo(e+n-s,r),t.quadraticCurveTo(e+n,r,e+n,r+s),t.lineTo(e+n,r+i-s),t.quadraticCurveTo(e+n,r+i,e+n-s,r+i),t.lineTo(e+s,r+i),t.quadraticCurveTo(e,r+i,e,r+i-s),t.lineTo(e,r+s),t.quadraticCurveTo(e,r,e+s,r),t.closePath()}gg.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,a=e?e+"-":"",s=t.pstyle(a+"text-rotation");if(s.strValue==="autorotate"){var o=Ms(i,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r};gg.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=e._private,s=a.rscratch,o=i?e.effectiveOpacity():1;if(!(i&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=Ms(s,"labelX",r),u=Ms(s,"labelY",r),h,d,f=this.getLabelText(e,r);if(f!=null&&f!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,i);var p=r?r+"-":"",g=Ms(s,"labelWidth",r),m=Ms(s,"labelHeight",r),y=Ms(s,"labelActualDescent",r),v=e.pstyle(p+"text-margin-x").pfValue,T=e.pstyle(p+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,C=e.pstyle("text-valign").value;b&&(w="center",C="center"),l+=v,u+=T;var S;n?S=this.getTextAngle(e,r):S=0,S!==0&&(h=l,d=u,t.translate(h,d),t.rotate(S),l=0,u=0);var k=Ub(w),E=Yb(C);switch(E){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var _=e.pstyle("text-background-opacity").value,M=e.pstyle("text-border-opacity").value,L=e.pstyle("text-border-width").pfValue,P=e.pstyle("text-background-padding").pfValue,D=e.pstyle("text-background-shape").strValue,R=D==="round-rectangle"||D==="roundrectangle",I=D==="circle",$=2;if(_>0||L>0&&M>0){var O=t.fillStyle,N=t.strokeStyle,F=t.lineWidth,z=e.pstyle("text-background-color").value,V=e.pstyle("text-border-color").value,B=e.pstyle("text-border-style").value,G=_>0,H=L>0&&M>0,q=l-P;switch(k){case"left":q-=g;break;case"center":q-=g/2;break}var Z=u-m-P,Y=g+2*P,ie=m+2*P;if(G&&(t.fillStyle="rgba(".concat(z[0],",").concat(z[1],",").concat(z[2],",").concat(_*o,")")),H&&(t.strokeStyle="rgba(".concat(V[0],",").concat(V[1],",").concat(V[2],",").concat(M*o,")"),t.lineWidth=L,t.setLineDash))switch(B){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=L/4,t.setLineDash([]);break;case"solid":default:t.setLineDash([]);break}if(R?(t.beginPath(),fte(t,q,Z,Y,ie,$)):I?(t.beginPath(),lgt(t,q,Z,Y,ie)):(t.beginPath(),t.rect(q,Z,Y,ie)),G&&t.fill(),H&&t.stroke(),H&&B==="double"){var K=L/2;t.beginPath(),R?fte(t,q+K,Z+K,Y-2*K,ie-2*K,$):t.rect(q+K,Z+K,Y-2*K,ie-2*K),t.stroke()}t.fillStyle=O,t.strokeStyle=N,t.lineWidth=F,t.setLineDash&&t.setLineDash([])}var Q=2*e.pstyle("text-outline-width").pfValue;if(Q>0&&(t.lineWidth=Q),u-=y,e.pstyle("text-wrap").value==="wrap"){var te=Ms(s,"labelWrapCachedLines",r),J=Ms(s,"labelLineHeight",r),ge=g/2,ee=this.getLabelJustification(e);switch(ee==="auto"||(k==="left"?ee==="left"?l+=-g:ee==="center"&&(l+=-ge):k==="center"?ee==="left"?l+=-ge:ee==="right"&&(l+=ge):k==="right"&&(ee==="center"?l+=ge:ee==="right"&&(l+=g))),E){case"top":u-=(te.length-1)*J;break;case"center":case"bottom":u-=(te.length-1)*J;break}for(var Re=0;Re<te.length;Re++)Q>0&&t.strokeText(te[Re],l,u),t.fillText(te[Re],l,u),u+=J}else Q>0&&t.strokeText(f,l,u),t.fillText(f,l,u);S!==0&&(t.rotate(-S),t.translate(-h,-d))}}};var Mf={};Mf.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,h=u.rscratch,d=e.position();if(!(!Dt(d.x)||!Dt(d.y))&&!(a&&!e.visible())){var f=a?e.effectiveOpacity():1,p=s.usePaths(),g,m=!1,y=e.padding();o=e.width()+2*y,l=e.height()+2*y;var v;r&&(v=r,t.translate(-v.x1,-v.y1));for(var T=e.pstyle("background-image"),b=T.value,w=new Array(b.length),C=new Array(b.length),S=0,k=0;k<b.length;k++){var E=b[k],_=w[k]=E!=null&&E!=="none";if(_){var M=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",k);S++,C[k]=s.getCachedImage(E,M,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var L=e.pstyle("background-blacken").value,P=e.pstyle("border-width").pfValue,D=e.pstyle("background-opacity").value*f,R=e.pstyle("border-color").value,I=e.pstyle("border-style").value,$=e.pstyle("border-join").value,O=e.pstyle("border-cap").value,N=e.pstyle("border-position").value,F=e.pstyle("border-dash-pattern").pfValue,z=e.pstyle("border-dash-offset").pfValue,V=e.pstyle("border-opacity").value*f,B=e.pstyle("outline-width").pfValue,G=e.pstyle("outline-color").value,H=e.pstyle("outline-style").value,q=e.pstyle("outline-opacity").value*f,Z=e.pstyle("outline-offset").value,Y=e.pstyle("corner-radius").value;Y!=="auto"&&(Y=e.pstyle("corner-radius").pfValue);var ie=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:D;s.eleFillStyle(t,e,W)},K=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V;s.colorStrokeStyle(t,R[0],R[1],R[2],W)},Q=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q;s.colorStrokeStyle(t,G[0],G[1],G[2],W)},te=function(W,ne,j,ue){var X=s.nodePathCache=s.nodePathCache||[],Oe=sve(j==="polygon"?j+","+ue.join(","):j,""+ne,""+W,""+Y),xe=X[Oe],Ge,_e=!1;return xe!=null?(Ge=xe,_e=!0,h.pathCache=Ge):(Ge=new Path2D,X[Oe]=h.pathCache=Ge),{path:Ge,cacheHit:_e}},J=e.pstyle("shape").strValue,ge=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var ee=te(o,l,J,ge);g=ee.path,m=ee.cacheHit}var Re=function(){if(!m){var W=d;p&&(W={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(g||t,W.x,W.y,o,l,Y,h)}p?t.fill(g):t.fill()},Ie=function(){for(var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,j=u.backgrounding,ue=0,X=0;X<C.length;X++){var Oe=e.cy().style().getIndexedStyle(e,"background-image-containment","value",X);if(ne&&Oe==="over"||!ne&&Oe==="inside"){ue++;continue}w[X]&&C[X].complete&&!C[X].error&&(ue++,s.drawInscribedImage(t,C[X],e,X,W))}u.backgrounding=ue!==S,j!==u.backgrounding&&e.updateStyle(!1)},Be=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasPie(e)&&(s.drawPie(t,e,ne),W&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Y,h)))},ce=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;s.hasStripe(e)&&(t.save(),p?t.clip(h.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Y,h),t.clip()),s.drawStripe(t,e,ne),t.restore(),W&&(p||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,l,Y,h)))},oe=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,ne=(L>0?L:-L)*W,j=L>0?0:255;L!==0&&(s.colorFillStyle(t,j,j,j,ne),p?t.fill(g):t.fill())},be=function(){if(P>0){if(t.lineWidth=P,t.lineCap=O,t.lineJoin=$,t.setLineDash)switch(I){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(F),t.lineDashOffset=z;break;case"solid":case"double":t.setLineDash([]);break}if(N!=="center"){if(t.save(),t.lineWidth*=2,N==="inside")p?t.clip(g):t.clip();else{var W=new Path2D;W.rect(-o/2-P,-l/2-P,o+2*P,l+2*P),W.addPath(g),t.clip(W,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(I==="double"){t.lineWidth=P/3;var ne=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=ne}t.setLineDash&&t.setLineDash([])}},fe=function(){if(B>0){if(t.lineWidth=B,t.lineCap="butt",t.setLineDash)switch(H){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var W=d;p&&(W={x:0,y:0});var ne=s.getNodeShape(e),j=P;N==="inside"&&(j=0),N==="outside"&&(j*=2);var ue=(o+j+(B+Z))/o,X=(l+j+(B+Z))/l,Oe=o*ue,xe=l*X,Ge=s.nodeShapes[ne].points,_e;if(p){var $e=te(Oe,xe,ne,Ge);_e=$e.path}if(ne==="ellipse")s.drawEllipsePath(_e||t,W.x,W.y,Oe,xe);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ne)){var Me=0,He=0,De=0;ne==="round-diamond"?Me=(j+Z+B)*1.4:ne==="round-heptagon"?(Me=(j+Z+B)*1.075,De=-(j/2+Z+B)/35):ne==="round-hexagon"?Me=(j+Z+B)*1.12:ne==="round-pentagon"?(Me=(j+Z+B)*1.13,De=-(j/2+Z+B)/15):ne==="round-tag"?(Me=(j+Z+B)*1.12,He=(j/2+B+Z)*.07):ne==="round-triangle"&&(Me=(j+Z+B)*(Math.PI/2),De=-(j+Z/2+B)/Math.PI),Me!==0&&(ue=(o+Me)/o,Oe=o*ue,["round-hexagon","round-tag"].includes(ne)||(X=(l+Me)/l,xe=l*X)),Y=Y==="auto"?mve(Oe,xe):Y;for(var Ke=Oe/2,Ae=xe/2,at=Y+(j+B+Z)/2,Ee=new Array(Ge.length/2),pt=new Array(Ge.length/2),ht=0;ht<Ge.length/2;ht++)Ee[ht]={x:W.x+He+Ke*Ge[ht*2],y:W.y+De+Ae*Ge[ht*2+1]};var rt,Et,vt,ot,pe=Ee.length;for(Et=Ee[pe-1],rt=0;rt<pe;rt++)vt=Ee[rt%pe],ot=Ee[(rt+1)%pe],pt[rt]=sW(Et,vt,ot,at),Et=vt,vt=ot;s.drawRoundPolygonPath(_e||t,W.x+He,W.y+De,o*ue,l*X,Ge,pt)}else if(["roundrectangle","round-rectangle"].includes(ne))Y=Y==="auto"?uf(Oe,xe):Y,s.drawRoundRectanglePath(_e||t,W.x,W.y,Oe,xe,Y+(j+B+Z)/2);else if(["cutrectangle","cut-rectangle"].includes(ne))Y=Y==="auto"?jG():Y,s.drawCutRectanglePath(_e||t,W.x,W.y,Oe,xe,null,Y+(j+B+Z)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(ne))Y=Y==="auto"?uf(Oe,xe):Y,s.drawBottomRoundRectanglePath(_e||t,W.x,W.y,Oe,xe,Y+(j+B+Z)/2);else if(ne==="barrel")s.drawBarrelPath(_e||t,W.x,W.y,Oe,xe);else if(ne.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(ne)){var Ct=(j+B+Z)/o;Ge=p_(g_(Ge,Ct)),s.drawPolygonPath(_e||t,W.x,W.y,o,l,Ge)}else{var lt=(j+B+Z)/o;Ge=p_(g_(Ge,-lt)),s.drawPolygonPath(_e||t,W.x,W.y,o,l,Ge)}if(p?t.stroke(_e):t.stroke(),H==="double"){t.lineWidth=j/3;var st=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(_e):t.stroke(),t.globalCompositeOperation=st}t.setLineDash&&t.setLineDash([])}},Pe=function(){i&&s.drawNodeOverlay(t,e,d,o,l)},ve=function(){i&&s.drawNodeUnderlay(t,e,d,o,l)},Ce=function(){s.drawElementText(t,e,null,n)},Ve=e.pstyle("ghost").value==="yes";if(Ve){var se=e.pstyle("ghost-offset-x").pfValue,de=e.pstyle("ghost-offset-y").pfValue,Te=e.pstyle("ghost-opacity").value,ae=Te*f;t.translate(se,de),Q(),fe(),ie(Te*D),Re(),Ie(ae,!0),K(Te*V),be(),Be(L!==0||P!==0),ce(L!==0||P!==0),Ie(ae,!1),oe(ae),t.translate(-se,-de)}p&&t.translate(-d.x,-d.y),ve(),p&&t.translate(d.x,d.y),Q(),fe(),ie(),Re(),Ie(f,!0),K(),be(),Be(L!==0||P!==0),ce(L!==0||P!==0),Ie(f,!1),oe(),p&&t.translate(-d.x,-d.y),Ce(),Pe(),r&&t.translate(v.x1,v.y1)}};var C2e=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n,i,a,s){var o=this;if(n.visible()){var l=n.pstyle("".concat(e,"-padding")).pfValue,u=n.pstyle("".concat(e,"-opacity")).value,h=n.pstyle("".concat(e,"-color")).value,d=n.pstyle("".concat(e,"-shape")).value,f=n.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(i=i||n.position(),a==null||s==null){var p=n.padding();a=n.width()+2*p,s=n.height()+2*p}o.colorFillStyle(r,h[0],h[1],h[2],u),o.nodeShapes[d].draw(r,i.x,i.y,a+l*2,s+l*2,f),r.fill()}}}};Mf.drawNodeOverlay=C2e("overlay");Mf.drawNodeUnderlay=C2e("underlay");Mf.hasPie=function(t){return t=t[0],t._private.hasPie};Mf.hasStripe=function(t){return t=t[0],t._private.hasStripe};Mf.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,h=e.width(),d=e.height(),f=Math.min(h,d)/2,p,g=0,m=this.usePaths();if(m&&(l=0,u=0),a.units==="%"?f=f*a.pfValue:a.pfValue!==void 0&&(f=a.pfValue/2),s.units==="%"?p=f*s.pfValue:s.pfValue!==void 0&&(p=s.pfValue/2),!(p>=f))for(var y=1;y<=i.pieBackgroundN;y++){var v=e.pstyle("pie-"+y+"-background-size").value,T=e.pstyle("pie-"+y+"-background-color").value,b=e.pstyle("pie-"+y+"-background-opacity").value*r,w=v/100;w+g>1&&(w=1-g);var C=1.5*Math.PI+2*Math.PI*g;C+=o;var S=2*Math.PI*w,k=C+S;v===0||g>=1||g+w>1||(p===0?(t.beginPath(),t.moveTo(l,u),t.arc(l,u,f,C,k),t.closePath()):(t.beginPath(),t.arc(l,u,f,C,k),t.arc(l,u,p,k,C,!0),t.closePath()),this.colorFillStyle(t,T[0],T[1],T[2],b),t.fill(),g+=w)}};Mf.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=n.x,s=n.y,o=e.width(),l=e.height(),u=0,h=this.usePaths();t.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":t.rotate(-Math.PI/2);break}var p=o,g=l;f.units==="%"?(p=p*f.pfValue,g=g*f.pfValue):f.pfValue!==void 0&&(p=f.pfValue,g=f.pfValue),h&&(a=0,s=0),s-=p/2,a-=g/2;for(var m=1;m<=i.stripeBackgroundN;m++){var y=e.pstyle("stripe-"+m+"-background-size").value,v=e.pstyle("stripe-"+m+"-background-color").value,T=e.pstyle("stripe-"+m+"-background-opacity").value*r,b=y/100;b+u>1&&(b=1-u),!(y===0||u>=1||u+b>1)&&(t.beginPath(),t.rect(a,s+g*u,p,g*b),t.closePath(),this.colorFillStyle(t,v[0],v[1],v[2],T),t.fill(),u+=b)}t.restore()};var Js={},cgt=100;Js.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};Js.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,i=0;i<e.length;i++)if(n=e[i],n.context===t){r=!1;break}return r&&(n={context:t},e.push(n)),n};Js.createGradientStyleFor=function(t,e,r,n,i){var a,s=this.usePaths(),o=r.pstyle(e+"-gradient-stop-colors").value,l=r.pstyle(e+"-gradient-stop-positions").pfValue;if(n==="radial-gradient")if(r.isEdge()){var u=r.sourceEndpoint(),h=r.targetEndpoint(),d=r.midpoint(),f=V0(u,d),p=V0(h,d);a=t.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(f,p))}else{var g=s?{x:0,y:0}:r.position(),m=r.paddedWidth(),y=r.paddedHeight();a=t.createRadialGradient(g.x,g.y,0,g.x,g.y,Math.max(m,y))}else if(r.isEdge()){var v=r.sourceEndpoint(),T=r.targetEndpoint();a=t.createLinearGradient(v.x,v.y,T.x,T.y)}else{var b=s?{x:0,y:0}:r.position(),w=r.paddedWidth(),C=r.paddedHeight(),S=w/2,k=C/2,E=r.pstyle("background-gradient-direction").value;switch(E){case"to-bottom":a=t.createLinearGradient(b.x,b.y-k,b.x,b.y+k);break;case"to-top":a=t.createLinearGradient(b.x,b.y+k,b.x,b.y-k);break;case"to-left":a=t.createLinearGradient(b.x+S,b.y,b.x-S,b.y);break;case"to-right":a=t.createLinearGradient(b.x-S,b.y,b.x+S,b.y);break;case"to-bottom-right":case"to-right-bottom":a=t.createLinearGradient(b.x-S,b.y-k,b.x+S,b.y+k);break;case"to-top-right":case"to-right-top":a=t.createLinearGradient(b.x-S,b.y+k,b.x+S,b.y-k);break;case"to-bottom-left":case"to-left-bottom":a=t.createLinearGradient(b.x+S,b.y-k,b.x-S,b.y+k);break;case"to-top-left":case"to-left-top":a=t.createLinearGradient(b.x+S,b.y+k,b.x-S,b.y-k);break}}if(!a)return null;for(var _=l.length===o.length,M=o.length,L=0;L<M;L++)a.addColorStop(_?l[L]:L/(M-1),"rgba("+o[L][0]+","+o[L][1]+","+o[L][2]+","+i+")");return a};Js.gradientFillStyle=function(t,e,r,n){var i=this.createGradientStyleFor(t,"background",e,r,n);if(!i)return null;t.fillStyle=i};Js.colorFillStyle=function(t,e,r,n,i){t.fillStyle="rgba("+e+","+r+","+n+","+i+")"};Js.eleFillStyle=function(t,e,r){var n=e.pstyle("background-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientFillStyle(t,e,n,r);else{var i=e.pstyle("background-color").value;this.colorFillStyle(t,i[0],i[1],i[2],r)}};Js.gradientStrokeStyle=function(t,e,r,n){var i=this.createGradientStyleFor(t,"line",e,r,n);if(!i)return null;t.strokeStyle=i};Js.colorStrokeStyle=function(t,e,r,n,i){t.strokeStyle="rgba("+e+","+r+","+n+","+i+")"};Js.eleStrokeStyle=function(t,e,r){var n=e.pstyle("line-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientStrokeStyle(t,e,n,r);else{var i=e.pstyle("line-color").value;this.colorStrokeStyle(t,i[0],i[1],i[2],r)}};Js.matchCanvasSize=function(t){var e=this,r=e.data,n=e.findContainerClientCoords(),i=n[2],a=n[3],s=e.getPixelRatio(),o=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(s=o);var l=i*s,u=a*s,h;if(!(l===e.canvasWidth&&u===e.canvasHeight)){e.fontCaches=null;var d=r.canvasContainer;d.style.width=i+"px",d.style.height=a+"px";for(var f=0;f<e.CANVAS_LAYERS;f++)h=r.canvases[f],h.width=l,h.height=u,h.style.width=i+"px",h.style.height=a+"px";for(var f=0;f<e.BUFFER_COUNT;f++)h=r.bufferCanvases[f],h.width=l,h.height=u,h.style.width=i+"px",h.style.height=a+"px";e.textureMult=1,s<=1&&(h=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,h.width=l*e.textureMult,h.height=u*e.textureMult),e.canvasWidth=l,e.canvasHeight=u,e.pixelRatio=s}};Js.renderTo=function(t,e,r,n){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:n})};Js.clearCanvas=function(){var t=this,e=t.data;function r(n){n.clearRect(0,0,t.canvasWidth,t.canvasHeight)}r(e.contexts[t.NODE]),r(e.contexts[t.DRAG])};Js.render=function(t){var e=this;t=t||uve();var r=e.cy,n=t.forcedContext,i=t.drawAllLayers,a=t.drawOnlyNodeLayer,s=t.forcedZoom,o=t.forcedPan,l=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,u=e.data,h=u.canvasNeedsRedraw,d=e.textureOnViewport&&!n&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),f=t.motionBlur!==void 0?t.motionBlur:e.motionBlur,p=e.motionBlurPxRatio,g=r.hasCompoundNodes(),m=e.hoverData.draggingEles,y=!!(e.hoverData.selecting||e.touchData.selecting);f=f&&!n&&e.motionBlurEnabled&&!y;var v=f;n||(e.prevPxRatio!==l&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=l),!n&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),f&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(v=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(h[e.NODE]=!0,h[e.SELECT_BOX]=!0);var T=r.style(),b=r.zoom(),w=s!==void 0?s:b,C=r.pan(),S={x:C.x,y:C.y},k={zoom:b,pan:{x:C.x,y:C.y}},E=e.prevViewport,_=E===void 0||k.zoom!==E.zoom||k.pan.x!==E.pan.x||k.pan.y!==E.pan.y;!_&&!(m&&!g)&&(e.motionBlurPxRatio=1),o&&(S=o),w*=l,S.x*=l,S.y*=l;var M=e.getCachedZSortedEles();function L(K,Q,te,J,ge){var ee=K.globalCompositeOperation;K.globalCompositeOperation="destination-out",e.colorFillStyle(K,255,255,255,e.motionBlurTransparency),K.fillRect(Q,te,J,ge),K.globalCompositeOperation=ee}function P(K,Q){var te,J,ge,ee;!e.clearingMotionBlur&&(K===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||K===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(te={x:C.x*p,y:C.y*p},J=b*p,ge=e.canvasWidth*p,ee=e.canvasHeight*p):(te=S,J=w,ge=e.canvasWidth,ee=e.canvasHeight),K.setTransform(1,0,0,1,0,0),Q==="motionBlur"?L(K,0,0,ge,ee):!n&&(Q===void 0||Q)&&K.clearRect(0,0,ge,ee),i||(K.translate(te.x,te.y),K.scale(J,J)),o&&K.translate(o.x,o.y),s&&K.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var D=e.data.bufferContexts[e.TEXTURE_BUFFER];D.setTransform(1,0,0,1,0,0),D.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:D,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var k=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};k.mpan={x:(0-k.pan.x)/k.zoom,y:(0-k.pan.y)/k.zoom}}h[e.DRAG]=!1,h[e.NODE]=!1;var R=u.contexts[e.NODE],I=e.textureCache.texture,k=e.textureCache.viewport;R.setTransform(1,0,0,1,0,0),f?L(R,0,0,k.width,k.height):R.clearRect(0,0,k.width,k.height);var $=T.core("outside-texture-bg-color").value,O=T.core("outside-texture-bg-opacity").value;e.colorFillStyle(R,$[0],$[1],$[2],O),R.fillRect(0,0,k.width,k.height);var b=r.zoom();P(R,!1),R.clearRect(k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l),R.drawImage(I,k.mpan.x,k.mpan.y,k.width/k.zoom/l,k.height/k.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var N=r.extent(),F=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),z=e.hideEdgesOnViewport&&F,V=[];if(V[e.NODE]=!h[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,V[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),V[e.DRAG]=!h[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,V[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),h[e.NODE]||i||a||V[e.NODE]){var B=f&&!V[e.NODE]&&p!==1,R=n||(B?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),G=f&&!B?"motionBlur":void 0;P(R,G),z?e.drawCachedNodes(R,M.nondrag,l,N):e.drawLayeredElements(R,M.nondrag,l,N),e.debug&&e.drawDebugPoints(R,M.nondrag),!i&&!f&&(h[e.NODE]=!1)}if(!a&&(h[e.DRAG]||i||V[e.DRAG])){var B=f&&!V[e.DRAG]&&p!==1,R=n||(B?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);P(R,f&&!B?"motionBlur":void 0),z?e.drawCachedNodes(R,M.drag,l,N):e.drawCachedElements(R,M.drag,l,N),e.debug&&e.drawDebugPoints(R,M.drag),!i&&!f&&(h[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,P),f&&p!==1){var H=u.contexts[e.NODE],q=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],Z=u.contexts[e.DRAG],Y=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],ie=function(Q,te,J){Q.setTransform(1,0,0,1,0,0),J||!v?Q.clearRect(0,0,e.canvasWidth,e.canvasHeight):L(Q,0,0,e.canvasWidth,e.canvasHeight);var ge=p;Q.drawImage(te,0,0,e.canvasWidth*ge,e.canvasHeight*ge,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||V[e.NODE])&&(ie(H,q,V[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||V[e.DRAG])&&(ie(Z,Y,V[e.DRAG]),h[e.DRAG]=!1)}e.prevViewport=k,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,h[e.NODE]=!0,h[e.DRAG]=!0,e.redraw()},cgt)),n||r.emit("render")};var mT;Js.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,a=n.style(),s=t.drawOnlyNodeLayer,o=t.drawAllLayers,l=i.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!s&&l[r.SELECT_BOX]&&!o){var h=u||i.contexts[r.SELECT_BOX];if(e(h),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var d=r.cy.zoom(),f=a.core("selection-box-border-width").value/d;h.lineWidth=f,h.fillStyle="rgba("+a.core("selection-box-color").value[0]+","+a.core("selection-box-color").value[1]+","+a.core("selection-box-color").value[2]+","+a.core("selection-box-opacity").value+")",h.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),f>0&&(h.strokeStyle="rgba("+a.core("selection-box-border-color").value[0]+","+a.core("selection-box-border-color").value[1]+","+a.core("selection-box-border-color").value[2]+","+a.core("selection-box-opacity").value+")",h.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(i.bgActivePosistion&&!r.hoverData.selecting){var d=r.cy.zoom(),p=i.bgActivePosistion;h.fillStyle="rgba("+a.core("active-bg-color").value[0]+","+a.core("active-bg-color").value[1]+","+a.core("active-bg-color").value[2]+","+a.core("active-bg-opacity").value+")",h.beginPath(),h.arc(p.x,p.y,a.core("active-bg-size").pfValue/d,0,2*Math.PI),h.fill()}var g=r.lastRedrawTime;if(r.showFps&&g){g=Math.round(g);var m=Math.round(1e3/g),y="1 frame = "+g+" ms = "+m+" fps";if(h.setTransform(1,0,0,1,0,0),h.fillStyle="rgba(255, 0, 0, 0.75)",h.strokeStyle="rgba(255, 0, 0, 0.75)",h.font="30px Arial",!mT){var v=h.measureText(y);mT=v.actualBoundingBoxAscent}h.fillText(y,0,mT);var T=60;h.strokeRect(0,mT+10,250,20),h.fillRect(0,mT+10,250*Math.min(m/T,1),20)}o||(l[r.SELECT_BOX]=!1)}};function pte(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function ugt(t,e,r){var n=pte(t,t.VERTEX_SHADER,e),i=pte(t,t.FRAGMENT_SHADER,r),a=t.createProgram();if(t.attachShader(a,n),t.attachShader(a,i),t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS))throw new Error("Could not initialize shaders");return a}function hgt(t,e,r){r===void 0&&(r=e);var n=t.makeOffscreenCanvas(e,r),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function cW(t){var e=t.pixelRatio,r=t.cy.zoom(),n=t.cy.pan();return{zoom:r*e,pan:{x:n.x*e,y:n.y*e}}}function dgt(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function fgt(t,e,r,n,i){var a=n*r+e.x,s=i*r+e.y;return s=Math.round(t.canvasHeight-s),[a,s]}function pgt(t,e){return e.picking?!0:t.pstyle("background-fill").value!=="solid"||t.pstyle("background-image").strValue!=="none"?!1:t.pstyle("border-width").value===0||t.pstyle("border-opacity").value===0?!0:t.pstyle("border-style").value==="solid"}function ggt(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function Zf(t,e,r){var n=t[0]/255,i=t[1]/255,a=t[2]/255,s=e,o=r||new Array(4);return o[0]=n*s,o[1]=i*s,o[2]=a*s,o[3]=s,o}function em(t,e){var r=e||new Array(4);return r[0]=(t>>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function mgt(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function ygt(t,e){var r=t.createTexture();return r.buffer=function(n){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function k2e(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function S2e(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function vgt(t,e,r,n,i,a){switch(e){case t.FLOAT:return new Float32Array(r.buffer,a*n,i);case t.INT:return new Int32Array(r.buffer,a*n,i)}}function bgt(t,e,r,n){var i=k2e(t,e),a=zi(i,2),s=a[0],o=a[1],l=S2e(t,o,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,s,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,s,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function vc(t,e,r,n){var i=k2e(t,r),a=zi(i,3),s=a[0],o=a[1],l=a[2],u=S2e(t,o,e*s),h=s*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),o===t.FLOAT?t.vertexAttribPointer(n,s,o,!1,h,0):o===t.INT&&t.vertexAttribIPointer(n,s,o,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),p=0;p<e;p++)f[p]=vgt(t,o,u,h,s,p);return d.dataArray=u,d.stride=h,d.size=s,d.getView=function(g){return f[g]},d.setPoint=function(g,m,y){var v=f[g];v[0]=m,v[1]=y},d.bufferSubData=function(g){t.bindBuffer(t.ARRAY_BUFFER,d),g?t.bufferSubData(t.ARRAY_BUFFER,0,u,0,g*s):t.bufferSubData(t.ARRAY_BUFFER,0,u)},d}function xgt(t,e,r){for(var n=9,i=new Float32Array(e*n),a=new Array(e),s=0;s<e;s++){var o=s*n*4;a[s]=new Float32Array(i.buffer,o,n)}var l=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferData(t.ARRAY_BUFFER,i.byteLength,t.DYNAMIC_DRAW);for(var u=0;u<3;u++){var h=r+u;t.enableVertexAttribArray(h),t.vertexAttribPointer(h,3,t.FLOAT,!1,36,u*12),t.vertexAttribDivisor(h,1)}return t.bindBuffer(t.ARRAY_BUFFER,null),l.getMatrixView=function(d){return a[d]},l.setData=function(d,f){a[f].set(d,0)},l.bufferSubData=function(){t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferSubData(t.ARRAY_BUFFER,0,i)},l}function Tgt(t){var e=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,e);var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.bindFramebuffer(t.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(n,i){t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,n,i,0,t.RGBA,t.UNSIGNED_BYTE,null)},e}var gte=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function rN(){var t=new gte(9);return gte!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function mte(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function wgt(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],h=e[7],d=e[8],f=r[0],p=r[1],g=r[2],m=r[3],y=r[4],v=r[5],T=r[6],b=r[7],w=r[8];return t[0]=f*n+p*s+g*u,t[1]=f*i+p*o+g*h,t[2]=f*a+p*l+g*d,t[3]=m*n+y*s+v*u,t[4]=m*i+y*o+v*h,t[5]=m*a+y*l+v*d,t[6]=T*n+b*s+w*u,t[7]=T*i+b*o+w*h,t[8]=T*a+b*l+w*d,t}function m3(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],h=e[7],d=e[8],f=r[0],p=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=s,t[4]=o,t[5]=l,t[6]=f*n+p*s+u,t[7]=f*i+p*o+h,t[8]=f*a+p*l+d,t}function yte(t,e,r){var n=e[0],i=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],h=e[7],d=e[8],f=Math.sin(r),p=Math.cos(r);return t[0]=p*n+f*s,t[1]=p*i+f*o,t[2]=p*a+f*l,t[3]=p*s-f*n,t[4]=p*o-f*i,t[5]=p*l-f*a,t[6]=u,t[7]=h,t[8]=d,t}function mP(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Cgt(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}var kgt=(function(){function t(e,r,n,i){_f(this,t),this.debugID=Math.floor(Math.random()*1e4),this.r=e,this.texSize=r,this.texRows=n,this.texHeight=Math.floor(r/n),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=i(e,r,r),this.scratch=i(e,r,this.texHeight,"scratch")}return Rf(t,[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(r){var n=r.w,i=r.h,a=this.texHeight,s=this.texSize,o=a/i,l=n*o,u=i*o;return l>s&&(o=s/n,l=n*o,u=i*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(r,n,i){var a=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),h=u.scale,d=u.texW,f=u.texH,p=function(b,w){if(i&&w){var C=w.context,S=b.x,k=b.row,E=S,_=l*k;C.save(),C.translate(E,_),C.scale(h,h),i(C,n),C.restore()}},g=[null,null],m=function(){p(a.freePointer,a.canvas),g[0]={x:a.freePointer.x,y:a.freePointer.row*l,w:d,h:f},g[1]={x:a.freePointer.x+d,y:a.freePointer.row*l,w:0,h:f},a.freePointer.x+=d,a.freePointer.x==s&&(a.freePointer.x=0,a.freePointer.row++)},y=function(){var b=a.scratch,w=a.canvas;b.clear(),p({x:0,row:0},b);var C=s-a.freePointer.x,S=d-C,k=l;{var E=a.freePointer.x,_=a.freePointer.row*l,M=C;w.context.drawImage(b,0,0,M,k,E,_,M,k),g[0]={x:E,y:_,w:M,h:f}}{var L=C,P=(a.freePointer.row+1)*l,D=S;w&&w.context.drawImage(b,L,0,D,k,0,P,D,k),g[1]={x:0,y:P,w:D,h:f}}a.freePointer.x=S,a.freePointer.row++},v=function(){a.freePointer.x=0,a.freePointer.row++};if(this.freePointer.x+d<=s)m();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(v(),m()):this.enableWrapping?y():(v(),m())}return this.keyToLocation.set(r,g),this.needsBuffer=!0,g}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){if(this.locked)return!1;var n=this.texSize,i=this.texRows,a=this.getScale(r),s=a.texW;return this.freePointer.x+s>n?this.freePointer.row<i-1:!0}},{key:"bufferIfNeeded",value:function(r){this.texture||(this.texture=ygt(r,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])})(),Sgt=(function(){function t(e,r,n,i){_f(this,t),this.r=e,this.texSize=r,this.texRows=n,this.createTextureCanvas=i,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return Rf(t,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var r=this.r,n=this.texSize,i=this.texRows,a=this.createTextureCanvas;return new kgt(r,n,i,a)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var r=this.r,n=this.texSize,i=this.texRows,a=this.createTextureCanvas,s=Math.floor(n/i);this.scratch=a(r,n,s,"scratch")}return this.scratch}},{key:"draw",value:function(r,n,i){var a=this.styleKeyToAtlas.get(r);return a||(a=this.atlases[this.atlases.length-1],(!a||!a.canFit(n))&&(a&&a.lock(),a=this._createAtlas(),this.atlases.push(a)),a.draw(r,n,i),this.styleKeyToAtlas.set(r,a)),a}},{key:"getAtlas",value:function(r){return this.styleKeyToAtlas.get(r)}},{key:"hasAtlas",value:function(r){return this.styleKeyToAtlas.has(r)}},{key:"markKeyForGC",value:function(r){this.markedKeys.add(r)}},{key:"gc",value:function(){var r=this,n=this.markedKeys;if(n.size===0){console.log("nothing to garbage collect");return}var i=[],a=new Map,s=null,o=yo(this.atlases),l;try{var u=function(){var d=l.value,f=d.getKeys(),p=Egt(n,f);if(p.size===0)return i.push(d),f.forEach(function(C){return a.set(C,d)}),1;s||(s=r._createAtlas(),i.push(s));var g=yo(f),m;try{for(g.s();!(m=g.n()).done;){var y=m.value;if(!p.has(y)){var v=d.getOffsets(y),T=zi(v,2),b=T[0],w=T[1];s.canFit({w:b.w+w.w,h:b.h})||(s.lock(),s=r._createAtlas(),i.push(s)),d.canvas&&(r._copyTextureToNewAtlas(y,d,s),a.set(y,s))}}}catch(C){g.e(C)}finally{g.f()}d.dispose()};for(o.s();!(l=o.n()).done;)u()}catch(h){o.e(h)}finally{o.f()}this.atlases=i,this.styleKeyToAtlas=a,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(r,n,i){var a=n.getOffsets(r),s=zi(a,2),o=s[0],l=s[1];if(l.w===0)i.draw(r,o,function(f){f.drawImage(n.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h)});else{var u=this._getScratchCanvas();u.clear(),u.context.drawImage(n.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h),u.context.drawImage(n.canvas,l.x,l.y,l.w,l.h,o.w,0,l.w,l.h);var h=o.w+l.w,d=o.h;i.draw(r,{w:h,h:d},function(f){f.drawImage(u,0,0,h,d,0,0,h,d)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])})();function Egt(t,e){return t.intersection?t.intersection(e):new Set(u_(t).filter(function(r){return e.has(r)}))}var Agt=(function(){function t(e,r){_f(this,t),this.r=e,this.globalOptions=r,this.atlasSize=r.webglTexSize,this.maxAtlasesPerBatch=r.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return Rf(t,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(r,n){var i=this.globalOptions,a=i.webglTexSize,s=i.createTextureCanvas,o=n.texRows,l=this._cacheScratchCanvas(s),u=new Sgt(this.r,a,o,l);this.collections.set(r,u)}},{key:"addRenderType",value:function(r,n){var i=n.collection;if(!this.collections.has(i))throw new Error("invalid atlas collection name '".concat(i,"'"));var a=this.collections.get(i),s=dr({type:r,atlasCollection:a},n);this.renderTypes.set(r,s)}},{key:"getRenderTypeOpts",value:function(r){return this.renderTypes.get(r)}},{key:"getAtlasCollection",value:function(r){return this.collections.get(r)}},{key:"_cacheScratchCanvas",value:function(r){var n=-1,i=-1,a=null;return function(s,o,l,u){return u?((!a||o!=n||l!=i)&&(n=o,i=l,a=r(s,o,l)),a):r(s,o,l)}}},{key:"_key",value:function(r,n){return"".concat(r,"-").concat(n)}},{key:"invalidate",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.forceRedraw,s=a===void 0?!1:a,o=i.filterEle,l=o===void 0?function(){return!0}:o,u=i.filterType,h=u===void 0?function(){return!0}:u,d=!1,f=!1,p=yo(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var y=yo(this.renderTypes.values()),v;try{var T=function(){var w=v.value,C=w.type;if(h(C)){var S=n.collections.get(w.collection),k=w.getKey(m),E=Array.isArray(k)?k:[k];if(s)E.forEach(function(P){return S.markKeyForGC(P)}),f=!0;else{var _=w.getID?w.getID(m):m.id(),M=n._key(C,_),L=n.typeAndIdToKey.get(M);L!==void 0&&!ggt(E,L)&&(d=!0,n.typeAndIdToKey.delete(M),L.forEach(function(P){return S.markKeyForGC(P)}))}}};for(y.s();!(v=y.n()).done;)T()}catch(b){y.e(b)}finally{y.f()}}}}catch(b){p.e(b)}finally{p.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var r=yo(this.collections.values()),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;i.gc()}}catch(a){r.e(a)}finally{r.f()}}},{key:"getOrCreateAtlas",value:function(r,n,i,a){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,u=o.draw(a,i,function(f){s.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),s.drawElement(f,r,i,!0,!0),f.restore()):s.drawElement(f,r,i,!0,!0),l=!0});if(l){var h=s.getID?s.getID(r):r.id(),d=this._key(n,h);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(a):this.typeAndIdToKey.set(d,[a])}return u}},{key:"getAtlasInfo",value:function(r,n){var i=this,a=this.renderTypes.get(n),s=a.getKey(r),o=Array.isArray(s)?s:[s];return o.map(function(l){var u=a.getBoundingBox(r,l),h=i.getOrCreateAtlas(r,n,u,l),d=h.getOffsets(l),f=zi(d,2),p=f[0],g=f[1];return{atlas:h,tex:p,tex1:p,tex2:g,bb:u}})}},{key:"getDebugInfo",value:function(){var r=[],n=yo(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=zi(i.value,2),s=a[0],o=a[1],l=o.getCounts(),u=l.keyCount,h=l.atlasCount;r.push({type:s,keyCount:u,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return r}}])})(),_gt=(function(){function t(e){_f(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Rf(t,[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(r,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(r){return this.batchAtlases.length===this.maxAtlasesPerBatch?this.batchAtlases.includes(r):!0}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}}])})(),Rgt=`
float circleSD(vec2 p, float r) {
return distance(vec2(0), p) - r; // signed distance
}
`,Lgt=`
float rectangleSD(vec2 p, vec2 b) {
vec2 d = abs(p)-b;
return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
}
`,Mgt=`
float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
cr.x = (p.y > 0.0) ? cr.x : cr.y;
vec2 q = abs(p) - b + cr.x;
return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
}
`,Igt=`
float ellipseSD(vec2 p, vec2 ab) {
p = abs( p ); // symmetry
// find root with Newton solver
vec2 q = ab*(p-ab);
float w = (q.x<q.y)? 1.570796327 : 0.0;
for( int i=0; i<5; i++ ) {
vec2 cs = vec2(cos(w),sin(w));
vec2 u = ab*vec2( cs.x,cs.y);
vec2 v = ab*vec2(-cs.y,cs.x);
w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));
}
// compute final point and distance
float d = length(p-ab*vec2(cos(w),sin(w)));
// return signed distance
return (dot(p/ab,p/ab)>1.0) ? d : -d;
}
`,Yw={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},w_={IGNORE:1,USE_BB:2},nN=0,vte=1,bte=2,iN=3,tm=4,i4=5,yT=6,vT=7,Ngt=(function(){function t(e,r,n){_f(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=hgt,this.atlasManager=new Agt(e,n),this.batchManager=new _gt(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Yw.SCREEN),this.pickingProgram=this._createShaderProgram(Yw.PICKING),this.vao=this._createVAO()}return Rf(t,[{key:"addAtlasCollection",value:function(r,n){this.atlasManager.addAtlasCollection(r,n)}},{key:"addTextureAtlasRenderType",value:function(r,n){this.atlasManager.addRenderType(r,n)}},{key:"addSimpleShapeRenderType",value:function(r,n){this.simpleShapeOptions.set(r,n)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.type,a=this.atlasManager;return i?a.invalidate(r,{filterType:function(o){return o===i},forceRedraw:!0}):a.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var n=this.gl,i=`#version 300 es
precision highp float;
uniform mat3 uPanZoomMatrix;
uniform int uAtlasSize;
// instanced
in vec2 aPosition; // a vertex from the unit square
in mat3 aTransform; // used to transform verticies, eg into a bounding box
in int aVertType; // the type of thing we are rendering
// the z-index that is output when using picking mode
in vec4 aIndex;
// For textures
in int aAtlasId; // which shader unit/atlas to use
in vec4 aTex; // x/y/w/h of texture in atlas
// for edges
in vec4 aPointAPointB;
in vec4 aPointCPointD;
in vec2 aLineWidth; // also used for node border width
// simple shapes
in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]
in vec4 aColor; // also used for edges
in vec4 aBorderColor; // aLineWidth is used for border width
// output values passed to the fragment shader
out vec2 vTexCoord;
out vec4 vColor;
out vec2 vPosition;
// flat values are not interpolated
flat out int vAtlasId;
flat out int vVertType;
flat out vec2 vTopRight;
flat out vec2 vBotLeft;
flat out vec4 vCornerRadius;
flat out vec4 vBorderColor;
flat out vec2 vBorderWidth;
flat out vec4 vIndex;
void main(void) {
int vid = gl_VertexID;
vec2 position = aPosition; // TODO make this a vec3, simplifies some code below
if(aVertType == `.concat(nN,`) {
float texX = aTex.x; // texture coordinates
float texY = aTex.y;
float texW = aTex.z;
float texH = aTex.w;
if(vid == 1 || vid == 2 || vid == 4) {
texX += texW;
}
if(vid == 2 || vid == 4 || vid == 5) {
texY += texH;
}
float d = float(uAtlasSize);
vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
}
else if(aVertType == `).concat(tm," || aVertType == ").concat(vT,`
|| aVertType == `).concat(i4," || aVertType == ").concat(yT,`) { // simple shapes
// the bounding box is needed by the fragment shader
vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat
vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat
vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated
// calculations are done in the fragment shader, just pass these along
vColor = aColor;
vCornerRadius = aCornerRadius;
vBorderColor = aBorderColor;
vBorderWidth = aLineWidth;
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
}
else if(aVertType == `).concat(vte,`) {
vec2 source = aPointAPointB.xy;
vec2 target = aPointAPointB.zw;
// adjust the geometry so that the line is centered on the edge
position.y = position.y - 0.5;
// stretch the unit square into a long skinny rectangle
vec2 xBasis = target - source;
vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));
vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;
gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
vColor = aColor;
}
else if(aVertType == `).concat(bte,`) {
vec2 pointA = aPointAPointB.xy;
vec2 pointB = aPointAPointB.zw;
vec2 pointC = aPointCPointD.xy;
vec2 pointD = aPointCPointD.zw;
// adjust the geometry so that the line is centered on the edge
position.y = position.y - 0.5;
vec2 p0, p1, p2, pos;
if(position.x == 0.0) { // The left side of the unit square
p0 = pointA;
p1 = pointB;
p2 = pointC;
pos = position;
} else { // The right side of the unit square, use same approach but flip the geometry upside down
p0 = pointD;
p1 = pointC;
p2 = pointB;
pos = vec2(0.0, -position.y);
}
vec2 p01 = p1 - p0;
vec2 p12 = p2 - p1;
vec2 p21 = p1 - p2;
// Find the normal vector.
vec2 tangent = normalize(normalize(p12) + normalize(p01));
vec2 normal = vec2(-tangent.y, tangent.x);
// Find the vector perpendicular to p0 -> p1.
vec2 p01Norm = normalize(vec2(-p01.y, p01.x));
// Determine the bend direction.
float sigma = sign(dot(p01 + p21, normal));
float width = aLineWidth[0];
if(sign(pos.y) == -sigma) {
// This is an intersecting vertex. Adjust the position so that there's no overlap.
vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
} else {
// This is a non-intersecting vertex. Treat it like a mitre join.
vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);
gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
}
vColor = aColor;
}
else if(aVertType == `).concat(iN,` && vid < 3) {
// massage the first triangle into an edge arrow
if(vid == 0)
position = vec2(-0.15, -0.3);
if(vid == 1)
position = vec2( 0.0, 0.0);
if(vid == 2)
position = vec2( 0.15, -0.3);
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
vColor = aColor;
}
else {
gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space
}
vAtlasId = aAtlasId;
vVertType = aVertType;
vIndex = aIndex;
}
`),a=this.batchManager.getIndexArray(),s=`#version 300 es
precision highp float;
// declare texture unit for each texture atlas in the batch
`.concat(a.map(function(u){return"uniform sampler2D uTexture".concat(u,";")}).join(`
`),`
uniform vec4 uBGColor;
uniform float uZoom;
in vec2 vTexCoord;
in vec4 vColor;
in vec2 vPosition; // model coordinates
flat in int vAtlasId;
flat in vec4 vIndex;
flat in int vVertType;
flat in vec2 vTopRight;
flat in vec2 vBotLeft;
flat in vec4 vCornerRadius;
flat in vec4 vBorderColor;
flat in vec2 vBorderWidth;
out vec4 outColor;
`).concat(Rgt,`
`).concat(Lgt,`
`).concat(Mgt,`
`).concat(Igt,`
vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
return vec4(
top.rgb + (bot.rgb * (1.0 - top.a)),
top.a + (bot.a * (1.0 - top.a))
);
}
vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance
// scale to the zoom level so that borders don't look blurry when zoomed in
// note 1.5 is an aribitrary value chosen because it looks good
return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d)));
}
void main(void) {
if(vVertType == `).concat(nN,`) {
// look up the texel from the texture unit
`).concat(a.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(`
else `),`
}
else if(vVertType == `).concat(iN,`) {
// mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
outColor = blend(vColor, uBGColor);
outColor.a = 1.0; // make opaque, masks out line under arrow
}
else if(vVertType == `).concat(tm,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
}
else if(vVertType == `).concat(tm," || vVertType == ").concat(vT,`
|| vVertType == `).concat(i4," || vVertType == ").concat(yT,`) { // use SDF
float outerBorder = vBorderWidth[0];
float innerBorder = vBorderWidth[1];
float borderPadding = outerBorder * 2.0;
float w = vTopRight.x - vBotLeft.x - borderPadding;
float h = vTopRight.y - vBotLeft.y - borderPadding;
vec2 b = vec2(w/2.0, h/2.0); // half width, half height
vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
float d; // signed distance
if(vVertType == `).concat(tm,`) {
d = rectangleSD(p, b);
} else if(vVertType == `).concat(vT,` && w == h) {
d = circleSD(p, b.x); // faster than ellipse
} else if(vVertType == `).concat(vT,`) {
d = ellipseSD(p, b);
} else {
d = roundRectangleSD(p, b, vCornerRadius.wzyx);
}
// use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling
// we must smooth colors inwards, because we can't change pixels outside the shape's bounding box
if(d > 0.0) {
if(d > outerBorder) {
discard;
} else {
outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);
}
} else {
if(d > innerBorder) {
vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;
vec4 innerBorderColor = blend(vBorderColor, vColor);
outColor = distInterp(innerBorderColor, outerColor, d);
}
else {
vec4 outerColor;
if(innerBorder == 0.0 && outerBorder == 0.0) {
outerColor = vec4(0);
} else if(innerBorder == 0.0) {
outerColor = vBorderColor;
} else {
outerColor = blend(vBorderColor, vColor);
}
outColor = distInterp(vColor, outerColor, d - innerBorder);
}
}
}
else {
outColor = vColor;
}
`).concat(r.picking?`if(outColor.a == 0.0) discard;
else outColor = vIndex;`:"",`
}
`),o=ugt(n,i,s);o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l<this.batchManager.getMaxAtlasesPerBatch();l++)o.uTextures.push(n.getUniformLocation(o,"uTexture".concat(l)));return o}},{key:"_createVAO",value:function(){var r=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=r.length/2;var n=this.maxInstances,i=this.gl,a=this.program,s=i.createVertexArray();return i.bindVertexArray(s),bgt(i,"vec2",a.aPosition,r),this.transformBuffer=xgt(i,n,a.aTransform),this.indexBuffer=vc(i,n,"vec4",a.aIndex),this.vertTypeBuffer=vc(i,n,"int",a.aVertType),this.atlasIdBuffer=vc(i,n,"int",a.aAtlasId),this.texBuffer=vc(i,n,"vec4",a.aTex),this.pointAPointBBuffer=vc(i,n,"vec4",a.aPointAPointB),this.pointCPointDBuffer=vc(i,n,"vec4",a.aPointCPointD),this.lineWidthBuffer=vc(i,n,"vec2",a.aLineWidth),this.colorBuffer=vc(i,n,"vec4",a.aColor),this.cornerRadiusBuffer=vc(i,n,"vec4",a.aCornerRadius),this.borderColorBuffer=vc(i,n,"vec4",a.aBorderColor),i.bindVertexArray(null),s}},{key:"buffers",get:function(){var r=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(n){return Nd(n,"Buffer")}).map(function(n){return r[n]})),this._buffers}},{key:"startFrame",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Yw.SCREEN;this.panZoomMatrix=r,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(r,n){return r.visible()?n&&n.isVisible?n.isVisible(r):!0:!1}},{key:"drawTexture",value:function(r,n,i){var a=this.atlasManager,s=this.batchManager,o=a.getRenderTypeOpts(i);if(this._isVisible(r,o)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(r);if(l===w_.IGNORE)return;if(l==w_.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),h=yo(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,p=f.atlas,g=f.tex1,m=f.tex2;s.canAddToCurrentBatch(p)||this.endBatch();for(var y=s.getAtlasIndexForBatch(p),v=0,T=[[g,!0],[m,!1]];v<T.length;v++){var b=zi(T[v],2),w=b[0],C=b[1];if(w.w!=0){var S=this.instanceCount;this.vertTypeBuffer.getView(S)[0]=nN;var k=this.indexBuffer.getView(S);em(n,k);var E=this.atlasIdBuffer.getView(S);E[0]=y;var _=this.texBuffer.getView(S);_[0]=w.x,_[1]=w.y,_[2]=w.w,_[3]=w.h;var M=this.transformBuffer.getMatrixView(S);this.setTransformMatrix(r,M,o,f,C),this.instanceCount++,C||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(L){h.e(L)}finally{h.f()}}}},{key:"setTransformMatrix",value:function(r,n,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(i.shapeProps&&i.shapeProps.padding&&(o=r.pstyle(i.shapeProps.padding).pfValue),a){var l=a.bb,u=a.tex1,h=a.tex2,d=u.w/(u.w+h.w);s||(d=1-d);var f=this._getAdjustedBB(l,o,s,d);this._applyTransformMatrix(n,f,i,r)}else{var p=i.getBoundingBox(r),g=this._getAdjustedBB(p,o,!0,1);this._applyTransformMatrix(n,g,i,r)}}},{key:"_applyTransformMatrix",value:function(r,n,i,a){var s,o;mte(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),h=u.x,d=u.y;m3(r,r,[h,d]),yte(r,r,l);var f=i.getRotationOffset(a);s=f.x+(n.xOffset||0),o=f.y+(n.yOffset||0)}else s=n.x1,o=n.y1;m3(r,r,[s,o]),mP(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,i,a){var s=r.x1,o=r.y1,l=r.w,u=r.h,h=r.yOffset;n&&(s-=n,o-=n,l+=2*n,u+=2*n);var d=0,f=l*a;return i&&a<1?l=f:!i&&a<1&&(d=l-f,s+=d,l=f),{x1:s,y1:o,w:l,h:u,xOffset:d,yOffset:h}}},{key:"drawPickingRectangle",value:function(r,n,i){var a=this.atlasManager.getRenderTypeOpts(i),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=tm;var o=this.indexBuffer.getView(s);em(n,o);var l=this.colorBuffer.getView(s);Zf([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(r,u,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(r,n,i){var a=this.simpleShapeOptions.get(i);if(this._isVisible(r,a)){var s=a.shapeProps,o=this._getVertTypeForShape(r,s.shape);if(o===void 0||a.isSimple&&!a.isSimple(r,this.renderTarget)){this.drawTexture(r,n,i);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,o===i4||o===yT){var u=a.getBoundingBox(r),h=this._getCornerRadius(r,s.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=h,d[1]=h,d[2]=h,d[3]=h,o===yT&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);em(n,f);var p=this.renderTarget.picking?1:i==="node-body"?r.effectiveOpacity():1,g=this.renderTarget.picking?1:r.pstyle(s.opacity).value*p,m=r.pstyle(s.color).value,y=this.colorBuffer.getView(l);Zf(m,g,y);var v=this.lineWidthBuffer.getView(l);if(v[0]=0,v[1]=0,s.border){var T=r.pstyle("border-width").value;if(T>0){var b=r.pstyle("border-color").value,w=p*r.pstyle("border-opacity").value,C=this.borderColorBuffer.getView(l);Zf(b,w,C);var S=r.pstyle("border-position").value;if(S==="inside")v[0]=0,v[1]=-T;else if(S==="outside")v[0]=T,v[1]=0;else{var k=T/2;v[0]=k,v[1]=-k}}}var E=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,E,a),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(r,n){var i=r.pstyle(n).value;switch(i){case"rectangle":return tm;case"ellipse":return vT;case"roundrectangle":case"round-rectangle":return i4;case"bottom-round-rectangle":return yT;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,s=i.h;if(r.pstyle(n).value==="auto")return uf(a,s);var o=r.pstyle(n).pfValue,l=a/2,u=s/2;return Math.min(o,u,l)}},{key:"drawEdgeArrow",value:function(r,n,i){if(r.visible()){var a=r._private.rscratch,s,o,l;if(i==="source"?(s=a.arrowStartX,o=a.arrowStartY,l=a.srcArrowAngle):(s=a.arrowEndX,o=a.arrowEndY,l=a.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(l)||l==null)){var u=r.pstyle(i+"-arrow-shape").value;if(u!=="none"){var h=r.pstyle(i+"-arrow-color").value,d=r.pstyle("opacity").value,f=r.pstyle("line-opacity").value,p=d*f,g=r.pstyle("width").pfValue,m=r.pstyle("arrow-scale").value,y=this.r.getArrowWidth(g,m),v=this.instanceCount,T=this.transformBuffer.getMatrixView(v);mte(T),m3(T,T,[s,o]),mP(T,T,[y,y]),yte(T,T,l),this.vertTypeBuffer.getView(v)[0]=iN;var b=this.indexBuffer.getView(v);em(n,b);var w=this.colorBuffer.getView(v);Zf(h,p,w),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"drawEdgeLine",value:function(r,n){if(r.visible()){var i=this._getEdgePoints(r);if(i){var a=r.pstyle("opacity").value,s=r.pstyle("line-opacity").value,o=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=a*s;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=vte;var d=this.indexBuffer.getView(h);em(n,d);var f=this.colorBuffer.getView(h);Zf(l,u,f);var p=this.lineWidthBuffer.getView(h);p[0]=o;var g=this.pointAPointBBuffer.getView(h);g[0]=i[0],g[1]=i[1],g[2]=i[2],g[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var m=0;m<i.length-2;m+=2){var y=this.instanceCount;this.vertTypeBuffer.getView(y)[0]=bte;var v=this.indexBuffer.getView(y);em(n,v);var T=this.colorBuffer.getView(y);Zf(l,u,T);var b=this.lineWidthBuffer.getView(y);b[0]=o;var w=i[m-2],C=i[m-1],S=i[m],k=i[m+1],E=i[m+2],_=i[m+3],M=i[m+4],L=i[m+5];m==0&&(w=2*S-E+.001,C=2*k-_+.001),m==i.length-4&&(M=2*E-S+.001,L=2*_-k+.001);var P=this.pointAPointBBuffer.getView(y);P[0]=w,P[1]=C,P[2]=S,P[3]=k;var D=this.pointCPointDBuffer.getView(y);D[0]=E,D[1]=_,D[2]=M,D[3]=L,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(r){var n=r._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(r){var n=r._private.rscratch;if(this._isValidEdge(r)){var i=n.allpts;if(i.length==4)return i;var a=this._getNumSegments(r);return this._getCurveSegmentPoints(i,a)}}},{key:"_getNumSegments",value:function(r){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(r,n){if(r.length==4)return r;for(var i=Array((n+1)*2),a=0;a<=n;a++)if(a==0)i[0]=r[0],i[1]=r[1];else if(a==n)i[a*2]=r[r.length-2],i[a*2+1]=r[r.length-1];else{var s=a/n;this._setCurvePoint(r,s,i,a*2)}return i}},{key:"_setCurvePoint",value:function(r,n,i,a){if(r.length<=2)i[a]=r[0],i[a+1]=r[1];else{for(var s=Array(r.length-2),o=0;o<s.length;o+=2){var l=(1-n)*r[o]+n*r[o+2],u=(1-n)*r[o+1]+n*r[o+3];s[o]=l,s[o+1]=u}return this._setCurvePoint(s,n,i,a)}}},{key:"endBatch",value:function(){var r=this.gl,n=this.vao,i=this.vertexCount,a=this.instanceCount;if(a!==0){var s=this.renderTarget.picking?this.pickingProgram:this.program;r.useProgram(s),r.bindVertexArray(n);var o=yo(this.buffers),l;try{for(o.s();!(l=o.n()).done;){var u=l.value;u.bufferSubData(a)}}catch(g){o.e(g)}finally{o.f()}for(var h=this.batchManager.getAtlases(),d=0;d<h.length;d++)h[d].bufferIfNeeded(r);for(var f=0;f<h.length;f++)r.activeTexture(r.TEXTURE0+f),r.bindTexture(r.TEXTURE_2D,h[f].texture),r.uniform1i(s.uTextures[f],f);r.uniform1f(s.uZoom,dgt(this.r)),r.uniformMatrix3fv(s.uPanZoomMatrix,!1,this.panZoomMatrix),r.uniform1i(s.uAtlasSize,this.batchManager.getAtlasSize());var p=Zf(this.bgColor,1);r.uniform4fv(s.uBGColor,p),r.drawArraysInstanced(r.TRIANGLES,0,i,a),r.bindVertexArray(null),r.bindTexture(r.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:a,atlasCount:h.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var r=this.atlasManager.getDebugInfo(),n=r.reduce(function(s,o){return s+o.atlasCount},0),i=this.batchDebugInfo,a=i.reduce(function(s,o){return s+o.count},0);return{atlasInfo:r,totalAtlases:n,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:i.length,batchInfo:i,totalInstances:a}}}])})(),E2e={};E2e.initWebgl=function(t,e){var r=this,n=r.data.contexts[r.WEBGL];t.bgColor=Dgt(r),t.webglTexSize=Math.min(t.webglTexSize,n.getParameter(n.MAX_TEXTURE_SIZE)),t.webglTexRows=Math.min(t.webglTexRows,54),t.webglTexRowsNodes=Math.min(t.webglTexRowsNodes,54),t.webglBatchSize=Math.min(t.webglBatchSize,16384),t.webglTexPerBatch=Math.min(t.webglTexPerBatch,n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)),r.webglDebug=t.webglDebug,r.webglDebugShowAtlases=t.webglDebugShowAtlases,r.pickingFrameBuffer=Tgt(n),r.pickingFrameBuffer.needsDraw=!0,r.drawing=new Ngt(r,n,t);var i=function(d){return function(f){return r.getTextAngle(f,d)}},a=function(d){return function(f){var p=f.pstyle(d);return p&&p.value}},s=function(d){return function(f){return f.pstyle("".concat(d,"-opacity")).value>0}},o=function(d){var f=d.pstyle("text-events").strValue==="yes";return f?w_.USE_BB:w_.IGNORE},l=function(d){var f=d.position(),p=f.x,g=f.y,m=d.outerWidth(),y=d.outerHeight();return{w:m,h:y,x1:p-m/2,y1:g-y/2}};r.drawing.addAtlasCollection("node",{texRows:t.webglTexRowsNodes}),r.drawing.addAtlasCollection("label",{texRows:t.webglTexRows}),r.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),r.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:pgt,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),r.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),r.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:aN(e.getLabelKey,null),getBoundingBox:sN(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:a("label")}),r.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:aN(e.getSourceLabelKey,"source"),getBoundingBox:sN(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:a("source-label")}),r.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:aN(e.getTargetLabelKey,"target"),getBoundingBox:sN(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=mS(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(h,d){var f=!1;d&&d.length>0&&(f|=r.drawing.invalidate(d)),f&&u()}),Ogt(r)};function Dgt(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return J1e(r)}function A2e(t,e){var r=t._private.rscratch;return Ms(r,"labelWrapCachedLines",e)||[]}var aN=function(e,r){return function(n){var i=e(n),a=A2e(n,r);return a.length>1?a.map(function(s,o){return"".concat(i,"_").concat(o)}):i}},sN=function(e,r){return function(n,i){var a=e(n);if(typeof i=="string"){var s=i.indexOf("_");if(s>0){var o=Number(i.substring(s+1)),l=A2e(n,r),u=a.h/l.length,h=u*o,d=a.y1+h;return{x1:a.x1,w:a.w,y1:d,h:u,yOffset:h}}}return a}};function Ogt(t){{var e=t.render;t.render=function(a){a=a||{};var s=t.cy;t.webgl&&(s.zoom()>b2e?($gt(t),e.call(t,a)):(Pgt(t),R2e(t,a,Yw.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(a){r.call(t,a),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(a,s,o,l){return Wgt(t,a,s)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var i=t.notify;t.notify=function(a,s){i.call(t,a,s),a==="viewport"||a==="bounds"?t.pickingFrameBuffer.needsDraw=!0:a==="background"&&t.drawing.invalidate(s,{type:"node-body"})}}}function $gt(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function Pgt(t){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.canvasWidth,t.canvasHeight),n.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function Bgt(t){var e=t.canvasWidth,r=t.canvasHeight,n=cW(t),i=n.pan,a=n.zoom,s=rN();m3(s,s,[i.x,i.y]),mP(s,s,[a,a]);var o=rN();Cgt(o,e,r);var l=rN();return wgt(l,o,s),l}function _2e(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=cW(t),a=i.pan,s=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(a.x,a.y),e.scale(s,s)}function Fgt(t,e){t.drawSelectionRectangle(e,function(r){return _2e(t,r)})}function zgt(t){var e=t.data.contexts[t.NODE];e.save(),_2e(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function Vgt(t){var e=function(i,a,s){for(var o=i.atlasManager.getAtlasCollection(a),l=t.data.contexts[t.NODE],u=o.atlases,h=0;h<u.length;h++){var d=u[h],f=d.canvas;if(f){var p=f.width,g=f.height,m=p*h,y=f.height*s,v=.4;l.save(),l.scale(v,v),l.drawImage(f,m,y),l.strokeStyle="black",l.rect(m,y,p,g),l.stroke(),l.restore()}}},r=0;e(t.drawing,"node",r++),e(t.drawing,"label",r++)}function Ggt(t,e,r,n,i){var a,s,o,l,u=cW(t),h=u.pan,d=u.zoom;{var f=fgt(t,h,d,e,r),p=zi(f,2),g=p[0],m=p[1],y=6;a=g-y/2,s=m-y/2,o=y,l=y}if(o===0||l===0)return[];var v=t.data.contexts[t.WEBGL];v.bindFramebuffer(v.FRAMEBUFFER,t.pickingFrameBuffer),t.pickingFrameBuffer.needsDraw&&(v.viewport(0,0,v.canvas.width,v.canvas.height),R2e(t,null,Yw.PICKING),t.pickingFrameBuffer.needsDraw=!1);var T=o*l,b=new Uint8Array(T*4);v.readPixels(a,s,o,l,v.RGBA,v.UNSIGNED_BYTE,b),v.bindFramebuffer(v.FRAMEBUFFER,null);for(var w=new Set,C=0;C<T;C++){var S=b.slice(C*4,C*4+4),k=mgt(S)-1;k>=0&&w.add(k)}return w}function Wgt(t,e,r){var n=Ggt(t,e,r),i=t.getCachedZSortedEles(),a,s,o=yo(n),l;try{for(o.s();!(l=o.n()).done;){var u=l.value,h=i[u];if(!a&&h.isNode()&&(a=h),!s&&h.isEdge()&&(s=h),a&&s)break}}catch(d){o.e(d)}finally{o.f()}return[a,s].filter(Boolean)}function oN(t,e,r){var n=t.drawing;e+=1,r.isNode()?(n.drawNode(r,e,"node-underlay"),n.drawNode(r,e,"node-body"),n.drawTexture(r,e,"label"),n.drawNode(r,e,"node-overlay")):(n.drawEdgeLine(r,e),n.drawEdgeArrow(r,e,"source"),n.drawEdgeArrow(r,e,"target"),n.drawTexture(r,e,"label"),n.drawTexture(r,e,"edge-source-label"),n.drawTexture(r,e,"edge-target-label"))}function R2e(t,e,r){var n;t.webglDebug&&(n=performance.now());var i=t.drawing,a=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&Fgt(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var s=t.data.contexts[t.WEBGL];r.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=Bgt(t),l=t.getCachedZSortedEles();if(a=l.length,i.startFrame(o,r),r.screen){for(var u=0;u<l.nondrag.length;u++)oN(t,u,l.nondrag[u]);for(var h=0;h<l.drag.length;h++)oN(t,h,l.drag[h])}else if(r.picking)for(var d=0;d<l.length;d++)oN(t,d,l[d]);i.endFrame(),r.screen&&t.webglDebugShowAtlases&&(zgt(t),Vgt(t)),t.data.canvasNeedsRedraw[t.NODE]=!1,t.data.canvasNeedsRedraw[t.DRAG]=!1}if(t.webglDebug){var f=performance.now(),p=!1,g=Math.ceil(f-n),m=i.getDebugInfo(),y=["".concat(a," elements"),"".concat(m.totalInstances," instances"),"".concat(m.batchCount," batches"),"".concat(m.totalAtlases," atlases"),"".concat(m.wrappedCount," wrapped textures"),"".concat(m.simpleCount," simple shapes")].join(", ");if(p)console.log("WebGL (".concat(r.name,") - time ").concat(g,"ms, ").concat(y));else{console.log("WebGL (".concat(r.name,") - frame time ").concat(g,"ms")),console.log("Totals:"),console.log(" ".concat(y)),console.log("Texture Atlases Used:");var v=m.atlasInfo,T=yo(v),b;try{for(T.s();!(b=T.n()).done;){var w=b.value;console.log(" ".concat(w.type,": ").concat(w.keyCount," keys, ").concat(w.atlasCount," atlases"))}}catch(C){T.e(C)}finally{T.f()}console.log("")}}t.data.gc&&(console.log("Garbage Collect!"),t.data.gc=!1,i.gc())}var If={};If.drawPolygonPath=function(t,e,r,n,i,a){var s=n/2,o=i/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*a[0],r+o*a[1]);for(var l=1;l<a.length/2;l++)t.lineTo(e+s*a[l*2],r+o*a[l*2+1]);t.closePath()};If.drawRoundPolygonPath=function(t,e,r,n,i,a,s){s.forEach(function(o){return c2e(t,o)}),t.closePath()};If.drawRoundRectanglePath=function(t,e,r,n,i,a){var s=n/2,o=i/2,l=a==="auto"?uf(n,i):Math.min(a,o,s);t.beginPath&&t.beginPath(),t.moveTo(e,r-o),t.arcTo(e+s,r-o,e+s,r,l),t.arcTo(e+s,r+o,e,r+o,l),t.arcTo(e-s,r+o,e-s,r,l),t.arcTo(e-s,r-o,e,r-o,l),t.lineTo(e,r-o),t.closePath()};If.drawBottomRoundRectanglePath=function(t,e,r,n,i,a){var s=n/2,o=i/2,l=a==="auto"?uf(n,i):a;t.beginPath&&t.beginPath(),t.moveTo(e,r-o),t.lineTo(e+s,r-o),t.lineTo(e+s,r),t.arcTo(e+s,r+o,e,r+o,l),t.arcTo(e-s,r+o,e-s,r,l),t.lineTo(e-s,r-o),t.lineTo(e,r-o),t.closePath()};If.drawCutRectanglePath=function(t,e,r,n,i,a,s){var o=n/2,l=i/2,u=s==="auto"?jG():s;t.beginPath&&t.beginPath(),t.moveTo(e-o+u,r-l),t.lineTo(e+o-u,r-l),t.lineTo(e+o,r-l+u),t.lineTo(e+o,r+l-u),t.lineTo(e+o-u,r+l),t.lineTo(e-o+u,r+l),t.lineTo(e-o,r+l-u),t.lineTo(e-o,r-l+u),t.closePath()};If.drawBarrelPath=function(t,e,r,n,i){var a=n/2,s=i/2,o=e-a,l=e+a,u=r-s,h=r+s,d=rP(n,i),f=d.widthOffset,p=d.heightOffset,g=d.ctrlPtOffsetPct*f;t.beginPath&&t.beginPath(),t.moveTo(o,u+p),t.lineTo(o,h-p),t.quadraticCurveTo(o+g,h,o+f,h),t.lineTo(l-f,h),t.quadraticCurveTo(l-g,h,l,h-p),t.lineTo(l,u+p),t.quadraticCurveTo(l-g,u,l-f,u),t.lineTo(o+f,u),t.quadraticCurveTo(o+g,u,o,u+p),t.closePath()};var xte=Math.sin(0),Tte=Math.cos(0),yP={},vP={},L2e=Math.PI/40;for(var rm=0*Math.PI;rm<2*Math.PI;rm+=L2e)yP[rm]=Math.sin(rm),vP[rm]=Math.cos(rm);If.drawEllipsePath=function(t,e,r,n,i){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,r,n/2,i/2,0,0,2*Math.PI);else for(var a,s,o=n/2,l=i/2,u=0*Math.PI;u<2*Math.PI;u+=L2e)a=e-o*yP[u]*xte+o*vP[u]*Tte,s=r+l*vP[u]*xte+l*yP[u]*Tte,u===0?t.moveTo(a,s):t.lineTo(a,s);t.closePath()};var wS={};wS.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]};wS.bufferCanvasImage=function(t){var e=this.cy,r=e.mutableElements(),n=r.boundingBox(),i=this.findContainerClientCoords(),a=t.full?Math.ceil(n.w):i[2],s=t.full?Math.ceil(n.h):i[3],o=Dt(t.maxWidth)||Dt(t.maxHeight),l=this.getPixelRatio(),u=1;if(t.scale!==void 0)a*=t.scale,s*=t.scale,u=t.scale;else if(o){var h=1/0,d=1/0;Dt(t.maxWidth)&&(h=u*t.maxWidth/a),Dt(t.maxHeight)&&(d=u*t.maxHeight/s),u=Math.min(h,d),a*=u,s*=u}o||(a*=l,s*=l,u*=l);var f=document.createElement("canvas");f.width=a,f.height=s,f.style.width=a+"px",f.style.height=s+"px";var p=f.getContext("2d");if(a>0&&s>0){p.clearRect(0,0,a,s),p.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(t.full)p.translate(-n.x1*u,-n.y1*u),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(n.x1*u,n.y1*u);else{var m=e.pan(),y={x:m.x*u,y:m.y*u};u*=e.zoom(),p.translate(y.x,y.y),p.scale(u,u),this.drawElements(p,g),p.scale(1/u,1/u),p.translate(-y.x,-y.y)}t.bg&&(p.globalCompositeOperation="destination-over",p.fillStyle=t.bg,p.rect(0,0,a,s),p.fill())}return f};function Hgt(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a<r.length;a++)i[a]=r.charCodeAt(a);return new Blob([n],{type:e})}function wte(t){var e=t.indexOf(",");return t.substr(e+1)}function M2e(t,e,r){var n=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new Lx(function(i,a){try{e.toBlob(function(s){s!=null?i(s):a(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(s){a(s)}});case"blob":return Hgt(wte(n()),r);case"base64":return wte(n());case"base64uri":default:return n()}}wS.png=function(t){return M2e(t,this.bufferCanvasImage(t),"image/png")};wS.jpg=function(t){return M2e(t,this.bufferCanvasImage(t),"image/jpeg")};var I2e={};I2e.nodeShapeImpl=function(t,e,r,n,i,a,s,o){switch(t){case"ellipse":return this.drawEllipsePath(e,r,n,i,a);case"polygon":return this.drawPolygonPath(e,r,n,i,a,s);case"round-polygon":return this.drawRoundPolygonPath(e,r,n,i,a,s,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,n,i,a,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,n,i,a,s,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,n,i,a,o);case"barrel":return this.drawBarrelPath(e,r,n,i,a)}};var qgt=N2e,zr=N2e.prototype;zr.CANVAS_LAYERS=3;zr.SELECT_BOX=0;zr.DRAG=1;zr.NODE=2;zr.WEBGL=3;zr.CANVAS_TYPES=["2d","2d","2d","webgl2"];zr.BUFFER_COUNT=3;zr.TEXTURE_BUFFER=0;zr.MOTIONBLUR_BUFFER_NODE=1;zr.MOTIONBLUR_BUFFER_DRAG=2;function N2e(t){var e=this,r=e.cy.window(),n=r.document;t.webgl&&(zr.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(zr.CANVAS_LAYERS),contexts:new Array(zr.CANVAS_LAYERS),canvasNeedsRedraw:new Array(zr.CANVAS_LAYERS),bufferCanvases:new Array(zr.BUFFER_COUNT),bufferContexts:new Array(zr.CANVAS_LAYERS)};var i="-webkit-tap-highlight-color",a="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var s=e.data.canvasContainer.style;e.data.canvasContainer.style[i]=a,s.position="relative",s.zIndex="0",s.overflow="hidden";var o=t.cy.container();o.appendChild(e.data.canvasContainer),o.style[i]=a;var l={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};$ut()&&(l["-ms-touch-action"]="none",l["touch-action"]="none");for(var u=0;u<zr.CANVAS_LAYERS;u++){var h=e.data.canvases[u]=n.createElement("canvas"),d=zr.CANVAS_TYPES[u];e.data.contexts[u]=h.getContext(d),e.data.contexts[u]||oi("Could not create canvas of type "+d),Object.keys(l).forEach(function(K){h.style[K]=l[K]}),h.style.position="absolute",h.setAttribute("data-id","layer"+u),h.style.zIndex=String(zr.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(h),e.data.canvasNeedsRedraw[u]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[zr.NODE].setAttribute("data-id","layer"+zr.NODE+"-node"),e.data.canvases[zr.SELECT_BOX].setAttribute("data-id","layer"+zr.SELECT_BOX+"-selectbox"),e.data.canvases[zr.DRAG].setAttribute("data-id","layer"+zr.DRAG+"-drag"),e.data.canvases[zr.WEBGL]&&e.data.canvases[zr.WEBGL].setAttribute("data-id","layer"+zr.WEBGL+"-webgl");for(var u=0;u<zr.BUFFER_COUNT;u++)e.data.bufferCanvases[u]=n.createElement("canvas"),e.data.bufferContexts[u]=e.data.bufferCanvases[u].getContext("2d"),e.data.bufferCanvases[u].style.position="absolute",e.data.bufferCanvases[u].setAttribute("data-id","buffer"+u),e.data.bufferCanvases[u].style.zIndex=String(-u-1),e.data.bufferCanvases[u].style.visibility="hidden";e.pathsEnabled=!0;var f=Us(),p=function(Q){return{x:(Q.x1+Q.x2)/2,y:(Q.y1+Q.y2)/2}},g=function(Q){return{x:-Q.w/2,y:-Q.h/2}},m=function(Q){var te=Q[0]._private,J=te.oldBackgroundTimestamp===te.backgroundTimestamp;return!J},y=function(Q){return Q[0]._private.nodeKey},v=function(Q){return Q[0]._private.labelStyleKey},T=function(Q){return Q[0]._private.sourceLabelStyleKey},b=function(Q){return Q[0]._private.targetLabelStyleKey},w=function(Q,te,J,ge,ee){return e.drawElement(Q,te,J,!1,!1,ee)},C=function(Q,te,J,ge,ee){return e.drawElementText(Q,te,J,ge,"main",ee)},S=function(Q,te,J,ge,ee){return e.drawElementText(Q,te,J,ge,"source",ee)},k=function(Q,te,J,ge,ee){return e.drawElementText(Q,te,J,ge,"target",ee)},E=function(Q){return Q.boundingBox(),Q[0]._private.bodyBounds},_=function(Q){return Q.boundingBox(),Q[0]._private.labelBounds.main||f},M=function(Q){return Q.boundingBox(),Q[0]._private.labelBounds.source||f},L=function(Q){return Q.boundingBox(),Q[0]._private.labelBounds.target||f},P=function(Q,te){return te},D=function(Q){return p(E(Q))},R=function(Q,te,J){var ge=Q?Q+"-":"";return{x:te.x+J.pstyle(ge+"text-margin-x").pfValue,y:te.y+J.pstyle(ge+"text-margin-y").pfValue}},I=function(Q,te,J){var ge=Q[0]._private.rscratch;return{x:ge[te],y:ge[J]}},$=function(Q){return R("",I(Q,"labelX","labelY"),Q)},O=function(Q){return R("source",I(Q,"sourceLabelX","sourceLabelY"),Q)},N=function(Q){return R("target",I(Q,"targetLabelX","targetLabelY"),Q)},F=function(Q){return g(E(Q))},z=function(Q){return g(M(Q))},V=function(Q){return g(L(Q))},B=function(Q){var te=_(Q),J=g(_(Q));if(Q.isNode()){switch(Ub(Q.pstyle("text-halign").value)){case"left":J.x=-te.w-(te.leftPad||0);break;case"right":J.x=-(te.rightPad||0);break}switch(Yb(Q.pstyle("text-valign").value)){case"top":J.y=-te.h-(te.topPad||0);break;case"bottom":J.y=-(te.botPad||0);break}}return J},G=e.data.eleTxrCache=new tw(e,{getKey:y,doesEleInvalidateKey:m,drawElement:w,getBoundingBox:E,getRotationPoint:D,getRotationOffset:F,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),H=e.data.lblTxrCache=new tw(e,{getKey:v,drawElement:C,getBoundingBox:_,getRotationPoint:$,getRotationOffset:B,isVisible:P}),q=e.data.slbTxrCache=new tw(e,{getKey:T,drawElement:S,getBoundingBox:M,getRotationPoint:O,getRotationOffset:z,isVisible:P}),Z=e.data.tlbTxrCache=new tw(e,{getKey:b,drawElement:k,getBoundingBox:L,getRotationPoint:N,getRotationOffset:V,isVisible:P}),Y=e.data.lyrTxrCache=new x2e(e);e.onUpdateEleCalcs(function(Q,te){G.invalidateElements(te),H.invalidateElements(te),q.invalidateElements(te),Z.invalidateElements(te),Y.invalidateElements(te);for(var J=0;J<te.length;J++){var ge=te[J]._private;ge.oldBackgroundTimestamp=ge.backgroundTimestamp}});var ie=function(Q){for(var te=0;te<Q.length;te++)Y.enqueueElementRefinement(Q[te].ele)};G.onDequeue(ie),H.onDequeue(ie),q.onDequeue(ie),Z.onDequeue(ie),t.webgl&&e.initWebgl(t,{getStyleKey:y,getLabelKey:v,getSourceLabelKey:T,getTargetLabelKey:b,drawElement:w,drawLabel:C,drawSourceLabel:S,drawTargetLabel:k,getElementBox:E,getLabelBox:_,getSourceLabelBox:M,getTargetLabelBox:L,getElementRotationPoint:D,getElementRotationOffset:F,getLabelRotationPoint:$,getSourceLabelRotationPoint:O,getTargetLabelRotationPoint:N,getLabelRotationOffset:B,getSourceLabelRotationOffset:z,getTargetLabelRotationOffset:V})}zr.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[zr.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[zr.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[zr.SELECT_BOX]=e;break;case"gc":r.data.gc=!0;break}};var Ugt=typeof Path2D<"u";zr.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t};zr.usePaths=function(){return Ugt&&this.pathsEnabled};zr.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)};zr.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled};zr.makeOffscreenCanvas=function(t,e){var r;if((typeof OffscreenCanvas>"u"?"undefined":ca(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),i=n.document;r=i.createElement("canvas"),r.width=t,r.height=e}return r};[T2e,fu,qh,lW,gg,Mf,Js,E2e,If,wS,I2e].forEach(function(t){dr(zr,t)});var Ygt=[{name:"null",impl:s2e},{name:"base",impl:y2e},{name:"canvas",impl:qgt}],Xgt=[{type:"layout",extensions:y0t},{type:"renderer",extensions:Ygt}],D2e={},O2e={};function $2e(t,e,r){var n=r,i=function(E){Cn("Can not register `"+e+"` for `"+t+"` since `"+E+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(ok.prototype[e])return i(e);ok.prototype[e]=r}else if(t==="collection"){if(Za.prototype[e])return i(e);Za.prototype[e]=r}else if(t==="layout"){for(var a=function(E){this.options=E,r.call(this,E),ln(this._private)||(this._private={}),this._private.cy=E.cy,this._private.listeners=[],this.createEmitter()},s=a.prototype=Object.create(r.prototype),o=[],l=0;l<o.length;l++){var u=o[l];s[u]=s[u]||function(){return this}}s.start&&!s.run?s.run=function(){return this.start(),this}:!s.start&&s.run&&(s.start=function(){return this.run(),this});var h=r.prototype.stop;s.stop=function(){var k=this.options;if(k&&k.animate){var E=this.animations;if(E)for(var _=0;_<E.length;_++)E[_].stop()}return h?h.call(this):this.emit("layoutstop"),this},s.destroy||(s.destroy=function(){return this}),s.cy=function(){return this._private.cy};var d=function(E){return E._private.cy},f={addEventFields:function(E,_){_.layout=E,_.cy=d(E),_.target=E},bubble:function(){return!0},parent:function(E){return d(E)}};dr(s,{createEmitter:function(){return this._private.emitter=new dL(f,this),this},emitter:function(){return this._private.emitter},on:function(E,_){return this.emitter().on(E,_),this},one:function(E,_){return this.emitter().one(E,_),this},once:function(E,_){return this.emitter().one(E,_),this},removeListener:function(E,_){return this.emitter().removeListener(E,_),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(E,_){return this.emitter().emit(E,_),this}}),Tn.eventAliasesOn(s),n=a}else if(t==="renderer"&&e!=="null"&&e!=="base"){var p=P2e("renderer","base"),g=p.prototype,m=r,y=r.prototype,v=function(){p.apply(this,arguments),m.apply(this,arguments)},T=v.prototype;for(var b in g){var w=g[b],C=y[b]!=null;if(C)return i(b);T[b]=w}for(var S in y)T[S]=y[S];g.clientFunctions.forEach(function(k){T[k]=T[k]||function(){oi("Renderer does not implement `renderer."+k+"()` on its prototype")}}),n=v}else if(t==="__proto__"||t==="constructor"||t==="prototype")return oi(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return eve({map:D2e,keys:[t,e],value:n})}function P2e(t,e){return tve({map:D2e,keys:[t,e]})}function jgt(t,e,r,n,i){return eve({map:O2e,keys:[t,e,r,n],value:i})}function Kgt(t,e,r,n){return tve({map:O2e,keys:[t,e,r,n]})}var bP=function(){if(arguments.length===2)return P2e.apply(null,arguments);if(arguments.length===3)return $2e.apply(null,arguments);if(arguments.length===4)return Kgt.apply(null,arguments);if(arguments.length===5)return jgt.apply(null,arguments);oi("Invalid extension access syntax")};ok.prototype.extension=bP;Xgt.forEach(function(t){t.extensions.forEach(function(e){$2e(t.type,e.name,e.impl)})});var C_=function(){if(!(this instanceof C_))return new C_;this.length=0},H0=C_.prototype;H0.instanceString=function(){return"stylesheet"};H0.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this};H0.css=function(t,e){var r=this.length-1;if(or(t))this[r].properties.push({name:t,value:e});else if(ln(t))for(var n=t,i=Object.keys(n),a=0;a<i.length;a++){var s=i[a],o=n[s];if(o!=null){var l=Sa.properties[s]||Sa.properties[rL(s)];if(l!=null){var u=l.name,h=o;this[r].properties.push({name:u,value:h})}}}return this};H0.style=H0.css;H0.generateStyle=function(t){var e=new Sa(t);return this.appendToStyle(e)};H0.appendToStyle=function(t){for(var e=0;e<this.length;e++){var r=this[e],n=r.selector,i=r.properties;t.selector(n);for(var a=0;a<i.length;a++){var s=i[a];t.css(s.name,s.value)}}return t};var Zgt="3.34.0",eu=function(e){if(e===void 0&&(e={}),ln(e))return new ok(e);if(or(e))return bP.apply(bP,arguments)};eu.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(eu),t.apply(null,e),this};eu.warnings=function(t){return lve(t)};eu.version=Zgt;eu.stylesheet=eu.Stylesheet=C_;var y3={exports:{}},v3={exports:{}},b3={exports:{}},Qgt=b3.exports,Cte;function Jgt(){return Cte||(Cte=1,(function(t,e){(function(n,i){t.exports=i()})(Qgt,function(){return(function(r){var n={};function i(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=n,i.i=function(a){return a},i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{configurable:!1,enumerable:!0,get:o})},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=26)})([(function(r,n,i){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1e3,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,r.exports=a}),(function(r,n,i){var a=i(2),s=i(8),o=i(9);function l(h,d,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(a.prototype);for(var u in a)l[u]=a[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(h){if(this.source===h)return this.target;if(this.target===h)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(h,d){for(var f=this.getOtherEnd(h),p=d.getGraphManager().getRoot();;){if(f.getOwner()==d)return f;if(f.getOwner()==p)break;f=f.getOwner().getParent()}return null},l.prototype.updateLength=function(){var h=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),h),this.isOverlapingSourceAndTarget||(this.lengthX=h[0]-h[2],this.lengthY=h[1]-h[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l}),(function(r,n,i){function a(s){this.vGraphObject=s}r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(13),l=i(0),u=i(16),h=i(4);function d(p,g,m,y){m==null&&y==null&&(y=g),a.call(this,y),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=y,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new o(g.x,g.y,m.width,m.height):this.rect=new o}d.prototype=Object.create(a.prototype);for(var f in a)d[f]=a[f];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(p){this.rect.width=p},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(p){this.rect.height=p},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(p,g){this.rect.x=p.x,this.rect.y=p.y,this.rect.width=g.width,this.rect.height=g.height},d.prototype.setCenter=function(p,g){this.rect.x=p-this.rect.width/2,this.rect.y=g-this.rect.height/2},d.prototype.setLocation=function(p,g){this.rect.x=p,this.rect.y=g},d.prototype.moveBy=function(p,g){this.rect.x+=p,this.rect.y+=g},d.prototype.getEdgeListToNode=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(y.target==p){if(y.source!=m)throw"Incorrect edge source!";g.push(y)}}),g},d.prototype.getEdgesBetween=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(!(y.source==m||y.target==m))throw"Incorrect edge source and/or target";(y.target==p||y.source==p)&&g.push(y)}),g},d.prototype.getNeighborsList=function(){var p=new Set,g=this;return g.edges.forEach(function(m){if(m.source==g)p.add(m.target);else{if(m.target!=g)throw"Incorrect incidency!";p.add(m.source)}}),p},d.prototype.withChildren=function(){var p=new Set,g,m;if(p.add(this),this.child!=null)for(var y=this.child.getNodes(),v=0;v<y.length;v++)g=y[v],m=g.withChildren(),m.forEach(function(T){p.add(T)});return p},d.prototype.getNoOfChildren=function(){var p=0,g;if(this.child==null)p=1;else for(var m=this.child.getNodes(),y=0;y<m.length;y++)g=m[y],p+=g.getNoOfChildren();return p==0&&(p=1),p},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},d.prototype.scatter=function(){var p,g,m=-l.INITIAL_WORLD_BOUNDARY,y=l.INITIAL_WORLD_BOUNDARY;p=l.WORLD_CENTER_X+u.nextDouble()*(y-m)+m;var v=-l.INITIAL_WORLD_BOUNDARY,T=l.INITIAL_WORLD_BOUNDARY;g=l.WORLD_CENTER_Y+u.nextDouble()*(T-v)+v,this.rect.x=p,this.rect.y=g},d.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var p=this.getChild();if(p.updateBounds(!0),this.rect.x=p.getLeft(),this.rect.y=p.getTop(),this.setWidth(p.getRight()-p.getLeft()),this.setHeight(p.getBottom()-p.getTop()),l.NODE_DIMENSIONS_INCLUDE_LABELS){var g=p.getRight()-p.getLeft(),m=p.getBottom()-p.getTop();this.labelWidth>g&&(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)),this.labelHeight>m&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-m)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-m),this.setHeight(this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(6),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,T){a.call(this,T),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,T){if(v==null&&T==null){var b=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}else{var w=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(v.owner==T.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=T.owner?null:(w.source=v,w.target=T,w.isInterGraph=!1,this.getEdges().push(w),v.edges.push(w),T!=v&&T.edges.push(w),w)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=v.edges.slice(),b,w=T.length,C=0;C<w;C++)b=T[C],b.isInterGraph?this.graphManager.remove(b):b.source.owner.remove(b);var S=this.nodes.indexOf(v);if(S==-1)throw"Node not in owner node list!";this.nodes.splice(S,1)}else if(y instanceof h){var b=y;if(b==null)throw"Edge is null!";if(!(b.source!=null&&b.target!=null))throw"Source and/or target is null!";if(!(b.source.owner!=null&&b.target.owner!=null&&b.source.owner==this&&b.target.owner==this))throw"Source and/or target owner is invalid!";var k=b.source.edges.indexOf(b),E=b.target.edges.indexOf(b);if(!(k>-1&&E>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(k,1),b.target!=b.source&&b.target.edges.splice(E,1);var S=b.source.owner.getEdges().indexOf(b);if(S==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(S,1)}},g.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,v=s.MAX_VALUE,T,b,w,C=this.getNodes(),S=C.length,k=0;k<S;k++){var E=C[k];T=E.getTop(),b=E.getLeft(),y>T&&(y=T),v>b&&(v=b)}return y==s.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?w=C[0].getParent().paddingLeft:w=this.margin,this.left=v-w,this.top=y-w,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,C,S,k,E,_,M=this.nodes,L=M.length,P=0;P<L;P++){var D=M[P];y&&D.child!=null&&D.updateBounds(),C=D.getLeft(),S=D.getRight(),k=D.getTop(),E=D.getBottom(),v>C&&(v=C),T<S&&(T=S),b>k&&(b=k),w<E&&(w=E)}var R=new d(v,b,T-v,w-b);v==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),M[0].getParent().paddingLeft!=null?_=M[0].getParent().paddingLeft:_=this.margin,this.left=R.x-_,this.right=R.x+R.width+_,this.top=R.y-_,this.bottom=R.y+R.height+_},g.calculateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,C,S,k,E,_=y.length,M=0;M<_;M++){var L=y[M];C=L.getLeft(),S=L.getRight(),k=L.getTop(),E=L.getBottom(),v>C&&(v=C),T<S&&(T=S),b>k&&(b=k),w<E&&(w=E)}var P=new d(v,b,T-v,w-b);return P},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var y=0,v=this.nodes,T=v.length,b=0;b<T;b++){var w=v[b];y+=w.calcEstimatedSize()}return y==0?this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=y/Math.sqrt(this.nodes.length),this.estimatedSize},g.prototype.updateConnected=function(){var y=this;if(this.nodes.length==0){this.isConnected=!0;return}var v=new p,T=new Set,b=this.nodes[0],w,C,S=b.withChildren();for(S.forEach(function(P){v.push(P),T.add(P)});v.length!==0;){b=v.shift(),w=b.getEdges();for(var k=w.length,E=0;E<k;E++){var _=w[E];if(C=_.getOtherEndInGraph(b,this),C!=null&&!T.has(C)){var M=C.withChildren();M.forEach(function(P){v.push(P),T.add(P)})}}}if(this.isConnected=!1,T.size>=this.nodes.length){var L=0;T.forEach(function(P){P.owner==y&&L++}),L==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var a,s=i(1);function o(l){a=i(5),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p<f;p++)d=h[p],u.remove(d);var g=[];g=g.concat(u.getNodes());var m;f=g.length;for(var p=0;p<f;p++)m=g[p],u.remove(m);u==this.rootGraph&&this.setRootGraph(null);var y=this.graphs.indexOf(u);this.graphs.splice(y,1),u.parent=null}else if(l instanceof s){if(d=l,d==null)throw"Edge is null!";if(!d.isInterGraph)throw"Not an inter-graph edge!";if(!(d.source!=null&&d.target!=null))throw"Source and/or target is null!";if(!(d.source.edges.indexOf(d)!=-1&&d.target.edges.indexOf(d)!=-1))throw"Source and/or target doesn't know this edge!";var y=d.source.edges.indexOf(d);if(d.source.edges.splice(y,1),y=d.target.edges.indexOf(d),d.target.edges.splice(y,1),!(d.source.owner!=null&&d.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(d.source.owner.getGraphManager().edges.indexOf(d)==-1)throw"Not in owner graph manager's edge list!";var y=d.source.owner.getGraphManager().edges.indexOf(d);d.source.owner.getGraphManager().edges.splice(y,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(this.allNodes==null){for(var l=[],u=this.getGraphs(),h=u.length,d=0;d<h;d++)l=l.concat(u[d].getNodes());this.allNodes=l}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){var l=[],u=this.getGraphs();u.length;for(var h=0;h<u.length;h++)l=l.concat(u[h].getEdges());l=l.concat(this.edges),this.allEdges=l}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(l){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=l},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(l){if(l.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=l,l.parent==null&&(l.parent=this.layout.newNode("Root node"))},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(l,u){if(!(l!=null&&u!=null))throw"assert failed";if(l==u)return!0;var h=l.getOwner(),d;do{if(d=h.getParent(),d==null)break;if(d==u)return!0;if(h=d.getOwner(),h==null)break}while(!0);h=u.getOwner();do{if(d=h.getParent(),d==null)break;if(d==l)return!0;if(h=d.getOwner(),h==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){for(var l,u,h,d,f,p=this.getAllEdges(),g=p.length,m=0;m<g;m++){if(l=p[m],u=l.source,h=l.target,l.lca=null,l.sourceInLca=u,l.targetInLca=h,u==h){l.lca=u.getOwner();continue}for(d=u.getOwner();l.lca==null;){for(l.targetInLca=h,f=h.getOwner();l.lca==null;){if(f==d){l.lca=f;break}if(f==this.rootGraph)break;if(l.lca!=null)throw"assert failed";l.targetInLca=f.getParent(),f=l.targetInLca.getOwner()}if(d==this.rootGraph)break;l.lca==null&&(l.sourceInLca=d.getParent(),d=l.sourceInLca.getOwner())}if(l.lca==null)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(l,u){if(l==u)return l.getOwner();var h=l.getOwner();do{if(h==null)break;var d=u.getOwner();do{if(d==null)break;if(d==h)return d;d=d.getParent().getOwner()}while(!0);h=h.getParent().getOwner()}while(!0);return h},o.prototype.calcInclusionTreeDepths=function(l,u){l==null&&u==null&&(l=this.rootGraph,u=1);for(var h,d=l.getNodes(),f=d.length,p=0;p<f;p++)h=d[p],h.inclusionTreeDepth=u,h.child!=null&&this.calcInclusionTreeDepths(h.child,u+1)},o.prototype.includesInvalidEdge=function(){for(var l,u=this.edges.length,h=0;h<u;h++)if(l=this.edges[h],this.isOneAncestorOfOther(l.source,l.target))return!0;return!1},r.exports=o}),(function(r,n,i){var a=i(0);function s(){}for(var o in a)s[o]=a[o];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=s}),(function(r,n,i){var a=i(12);function s(){}s.calcSeparationAmount=function(o,l,u,h){if(!o.intersects(l))throw"assert failed";var d=new Array(2);this.decideDirectionsForOverlappingNodes(o,l,d),u[0]=Math.min(o.getRight(),l.getRight())-Math.max(o.x,l.x),u[1]=Math.min(o.getBottom(),l.getBottom())-Math.max(o.y,l.y),o.getX()<=l.getX()&&o.getRight()>=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]<g?g=u[0]:p=u[1],u[0]=-1*d[0]*(g/2+h),u[1]=-1*d[1]*(p/2+h)},s.decideDirectionsForOverlappingNodes=function(o,l,u){o.getCenterX()<l.getCenterX()?u[0]=-1:u[0]=1,o.getCenterY()<l.getCenterY()?u[1]=-1:u[1]=1},s.getIntersection2=function(o,l,u){var h=o.getCenterX(),d=o.getCenterY(),f=l.getCenterX(),p=l.getCenterY();if(o.intersects(l))return u[0]=h,u[1]=d,u[2]=f,u[3]=p,!0;var g=o.getX(),m=o.getY(),y=o.getRight(),v=o.getX(),T=o.getBottom(),b=o.getRight(),w=o.getWidthHalf(),C=o.getHeightHalf(),S=l.getX(),k=l.getY(),E=l.getRight(),_=l.getX(),M=l.getBottom(),L=l.getRight(),P=l.getWidthHalf(),D=l.getHeightHalf(),R=!1,I=!1;if(h===f){if(d>p)return u[0]=h,u[1]=m,u[2]=f,u[3]=M,!1;if(d<p)return u[0]=h,u[1]=T,u[2]=f,u[3]=k,!1}else if(d===p){if(h>f)return u[0]=g,u[1]=d,u[2]=E,u[3]=p,!1;if(h<f)return u[0]=y,u[1]=d,u[2]=S,u[3]=p,!1}else{var $=o.height/o.width,O=l.height/l.width,N=(p-d)/(f-h),F=void 0,z=void 0,V=void 0,B=void 0,G=void 0,H=void 0;if(-$===N?h>f?(u[0]=v,u[1]=T,R=!0):(u[0]=y,u[1]=m,R=!0):$===N&&(h>f?(u[0]=g,u[1]=m,R=!0):(u[0]=b,u[1]=T,R=!0)),-O===N?f>h?(u[2]=_,u[3]=M,I=!0):(u[2]=E,u[3]=k,I=!0):O===N&&(f>h?(u[2]=S,u[3]=k,I=!0):(u[2]=L,u[3]=M,I=!0)),R&&I)return!1;if(h>f?d>p?(F=this.getCardinalDirection($,N,4),z=this.getCardinalDirection(O,N,2)):(F=this.getCardinalDirection(-$,N,3),z=this.getCardinalDirection(-O,N,1)):d>p?(F=this.getCardinalDirection(-$,N,1),z=this.getCardinalDirection(-O,N,3)):(F=this.getCardinalDirection($,N,2),z=this.getCardinalDirection(O,N,4)),!R)switch(F){case 1:B=m,V=h+-C/N,u[0]=V,u[1]=B;break;case 2:V=b,B=d+w*N,u[0]=V,u[1]=B;break;case 3:B=T,V=h+C/N,u[0]=V,u[1]=B;break;case 4:V=v,B=d+-w*N,u[0]=V,u[1]=B;break}if(!I)switch(z){case 1:H=k,G=f+-D/N,u[2]=G,u[3]=H;break;case 2:G=L,H=p+P*N,u[2]=G,u[3]=H;break;case 3:H=M,G=f+D/N,u[2]=G,u[3]=H;break;case 4:G=_,H=p+-P*N,u[2]=G,u[3]=H;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,T=h.y,b=void 0,w=void 0,C=void 0,S=void 0,k=void 0,E=void 0,_=void 0,M=void 0,L=void 0;return C=g-f,k=d-p,_=p*f-d*g,S=T-y,E=m-v,M=v*y-m*T,L=C*E-S*k,L===0?null:(b=(k*M-E*_)/L,w=(S*_-C*M)/L,new a(b,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u<o?d+=Math.PI:h<l&&(d+=this.TWO_PI)):h<l?d=this.ONE_AND_HALF_PI:d=this.HALF_PI,d},s.doIntersect=function(o,l,u,h){var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,T=h.y,b=(p-d)*(T-y)-(v-m)*(g-f);if(b===0)return!1;var w=((T-y)*(v-d)+(m-v)*(T-f))/b,C=((f-g)*(v-d)+(p-d)*(T-f))/b;return 0<w&&w<1&&0<C&&C<1},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,r.exports=s}),(function(r,n,i){function a(){}a.sign=function(s){return s>0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g<p.length;g++){var m=p[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(f,m.key,m)}}return function(f,p,g){return p&&d(f.prototype,p),g&&d(f,g),f}})();function s(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}var o=function(f){return{value:f,next:null,prev:null}},l=function(f,p,g,m){return f!==null?f.next=p:m.head=p,g!==null?g.prev=p:m.tail=p,p.prev=f,p.next=g,m.length++,p},u=function(f,p){var g=f.prev,m=f.next;return g!==null?g.next=m:p.head=m,m!==null?m.prev=g:p.tail=g,f.prev=f.next=null,p.length--,f},h=(function(){function d(f){var p=this;s(this,d),this.length=0,this.head=null,this.tail=null,f!=null&&f.forEach(function(g){return p.push(g)})}return a(d,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(p,g){return l(g.prev,o(p),g,this)}},{key:"insertAfter",value:function(p,g){return l(g,o(p),g.next,this)}},{key:"insertNodeBefore",value:function(p,g){return l(g.prev,p,g,this)}},{key:"insertNodeAfter",value:function(p,g){return l(g,p,g.next,this)}},{key:"push",value:function(p){return l(this.tail,o(p),null,this)}},{key:"unshift",value:function(p){return l(null,o(p),this.head,this)}},{key:"remove",value:function(p){return u(p,this)}},{key:"pop",value:function(){return u(this.tail,this).value}},{key:"popNode",value:function(){return u(this.tail,this)}},{key:"shift",value:function(){return u(this.head,this).value}},{key:"shiftNode",value:function(){return u(this.head,this)}},{key:"get_object_at",value:function(p){if(p<=this.length()){for(var g=1,m=this.head;g<p;)m=m.next,g++;return m.value}}},{key:"set_object_at",value:function(p,g){if(p<=this.length()){for(var m=1,y=this.head;m<p;)y=y.next,m++;y.value=g}}}]),d})();r.exports=h}),(function(r,n,i){function a(s,o,l){this.x=null,this.y=null,s==null&&o==null&&l==null?(this.x=0,this.y=0):typeof s=="number"&&typeof o=="number"&&l==null?(this.x=s,this.y=o):s.constructor.name=="Point"&&o==null&&l==null&&(l=s,this.x=l.x,this.y=l.y)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.getLocation=function(){return new a(this.x,this.y)},a.prototype.setLocation=function(s,o,l){s.constructor.name=="Point"&&o==null&&l==null?(l=s,this.setLocation(l.x,l.y)):typeof s=="number"&&typeof o=="number"&&l==null&&(parseInt(s)==s&&parseInt(o)==o?this.move(s,o):(this.x=Math.floor(s+.5),this.y=Math.floor(o+.5)))},a.prototype.move=function(s,o){this.x=s,this.y=o},a.prototype.translate=function(s,o){this.x+=s,this.y+=o},a.prototype.equals=function(s){if(s.constructor.name=="Point"){var o=s;return this.x==o.x&&this.y==o.y}return this==s},a.prototype.toString=function(){return new a().constructor.name+"[x="+this.x+",y="+this.y+"]"},r.exports=a}),(function(r,n,i){function a(s,o,l,u){this.x=0,this.y=0,this.width=0,this.height=0,s!=null&&o!=null&&l!=null&&u!=null&&(this.x=s,this.y=o,this.width=l,this.height=u)}a.prototype.getX=function(){return this.x},a.prototype.setX=function(s){this.x=s},a.prototype.getY=function(){return this.y},a.prototype.setY=function(s){this.y=s},a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(s){this.width=s},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(s){this.height=s},a.prototype.getRight=function(){return this.x+this.width},a.prototype.getBottom=function(){return this.y+this.height},a.prototype.intersects=function(s){return!(this.getRight()<s.x||this.getBottom()<s.y||s.getRight()<this.x||s.getBottom()<this.y)},a.prototype.getCenterX=function(){return this.x+this.width/2},a.prototype.getMinX=function(){return this.getX()},a.prototype.getMaxX=function(){return this.getX()+this.width},a.prototype.getCenterY=function(){return this.y+this.height/2},a.prototype.getMinY=function(){return this.getY()},a.prototype.getMaxY=function(){return this.getY()+this.height},a.prototype.getWidthHalf=function(){return this.width/2},a.prototype.getHeightHalf=function(){return this.height/2},r.exports=a}),(function(r,n,i){var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function s(){}s.lastID=0,s.createID=function(o){return s.isPrimitive(o)?o:(o.uniqueID!=null||(o.uniqueID=s.getString(),s.lastID++),o.uniqueID)},s.getString=function(o){return o==null&&(o=s.lastID),"Object#"+o},s.isPrimitive=function(o){var l=typeof o>"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y<m.length;y++)v[y]=m[y];return v}else return Array.from(m)}var s=i(0),o=i(6),l=i(3),u=i(1),h=i(5),d=i(4),f=i(17),p=i(27);function g(m){p.call(this),this.layoutQuality=s.QUALITY,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=s.DEFAULT_INCREMENTAL,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,m!=null&&(this.isRemoteUse=m)}g.RANDOM_SEED=1,g.prototype=Object.create(p.prototype),g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},g.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},g.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},g.prototype.newGraphManager=function(){var m=new o(this);return this.graphManager=m,m},g.prototype.newGraph=function(m){return new h(null,this.graphManager,m)},g.prototype.newNode=function(m){return new l(this.graphManager,m)},g.prototype.newEdge=function(m){return new u(null,null,m)},g.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},g.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var m;return this.checkLayoutSuccess()?m=!1:m=this.layout(),s.ANIMATE==="during"?!1:(m&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,m)},g.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},g.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var m=this.graphManager.getAllEdges(),y=0;y<m.length;y++)m[y];for(var v=this.graphManager.getRoot().getNodes(),y=0;y<v.length;y++)v[y];this.update(this.graphManager.getRoot())}},g.prototype.update=function(m){if(m==null)this.update2();else if(m instanceof l){var y=m;if(y.getChild()!=null)for(var v=y.getChild().getNodes(),T=0;T<v.length;T++)update(v[T]);if(y.vGraphObject!=null){var b=y.vGraphObject;b.update(y)}}else if(m instanceof u){var w=m;if(w.vGraphObject!=null){var C=w.vGraphObject;C.update(w)}}else if(m instanceof h){var S=m;if(S.vGraphObject!=null){var k=S.vGraphObject;k.update(S)}}},g.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=s.QUALITY,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=s.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},g.prototype.transform=function(m){if(m==null)this.transform(new d(0,0));else{var y=new f,v=this.graphManager.getRoot().updateLeftTop();if(v!=null){y.setWorldOrgX(m.x),y.setWorldOrgY(m.y),y.setDeviceOrgX(v.x),y.setDeviceOrgY(v.y);for(var T=this.getAllNodes(),b,w=0;w<T.length;w++)b=T[w],b.transform(y)}}},g.prototype.positionNodesRandomly=function(m){if(m==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var y,v,T=m.getNodes(),b=0;b<T.length;b++)y=T[b],v=y.getChild(),v==null||v.getNodes().length==0?y.scatter():(this.positionNodesRandomly(v),y.updateBounds())},g.prototype.getFlatForest=function(){for(var m=[],y=!0,v=this.graphManager.getRoot().getNodes(),T=!0,b=0;b<v.length;b++)v[b].getChild()!=null&&(T=!1);if(!T)return m;var w=new Set,C=[],S=new Map,k=[];for(k=k.concat(v);k.length>0&&y;){for(C.push(k[0]);C.length>0&&y;){var E=C[0];C.splice(0,1),w.add(E);for(var _=E.getEdges(),b=0;b<_.length;b++){var M=_[b].getOtherEnd(E);if(S.get(E)!=M)if(!w.has(M))C.push(M),S.set(M,E);else{y=!1;break}}}if(!y)m=[];else{var L=[].concat(a(w));m.push(L);for(var b=0;b<L.length;b++){var P=L[b],D=k.indexOf(P);D>-1&&k.splice(D,1)}w=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,T=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b<m.bendpoints.length;b++){var w=this.newNode(null);w.setRect(new Point(0,0),new Dimension(1,1)),T.add(w);var C=this.newEdge(null);this.graphManager.add(C,v,w),y.add(w),v=w}var C=this.newEdge(null);return this.graphManager.add(C,v,m.target),this.edgeToDummyNodes.set(m,y),m.isInterGraph()?this.graphManager.remove(m):T.remove(m),y},g.prototype.createBendpointsFromDummyNodes=function(){var m=[];m=m.concat(this.graphManager.getAllEdges()),m=[].concat(a(this.edgeToDummyNodes.keys())).concat(m);for(var y=0;y<m.length;y++){var v=m[y];if(v.bendpoints.length>0){for(var T=this.edgeToDummyNodes.get(v),b=0;b<T.length;b++){var w=T[b],C=new d(w.getCenterX(),w.getCenterY()),S=v.bendpoints.get(b);S.x=C.x,S.y=C.y,w.getOwner().remove(w)}this.graphManager.add(v,v.source,v.target)}}},g.transform=function(m,y,v,T){if(v!=null&&T!=null){var b=y;if(m<=50){var w=y/v;b-=(y-w)/50*(50-m)}else{var C=y*T;b+=(C-y)/50*(m-50)}return b}else{var S,k;return m<=50?(S=9*y/500,k=y/10):(S=9*y/50,k=-8*y),S*m+k}},g.findCenterOfTree=function(m){var y=[];y=y.concat(m);var v=[],T=new Map,b=!1,w=null;(y.length==1||y.length==2)&&(b=!0,w=y[0]);for(var C=0;C<y.length;C++){var S=y[C],k=S.getNeighborsList().size;T.set(S,S.getNeighborsList().size),k==1&&v.push(S)}var E=[];for(E=E.concat(v);!b;){var _=[];_=_.concat(E),E=[];for(var C=0;C<y.length;C++){var S=y[C],M=y.indexOf(S);M>=0&&y.splice(M,1);var L=S.getNeighborsList();L.forEach(function(R){if(v.indexOf(R)<0){var I=T.get(R),$=I-1;$==1&&E.push(R),T.set(R,$)}})}v=v.concat(E),(y.length==1||y.length==2)&&(b=!0,w=y[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(4);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);g<p.length;g++)m[g]=p[g];return m}else return Array.from(p)}var s=i(15),o=i(7),l=i(0),u=i(8),h=i(9);function d(){s.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.springConstant=o.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=o.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}d.prototype=Object.create(s.prototype);for(var f in s)d[f]=s[f];d.prototype.initParameters=function(){s.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},d.prototype.calcIdealEdgeLengths=function(){for(var p,g,m,y,v,T,b=this.getGraphManager().getAllEdges(),w=0;w<b.length;w++)p=b[w],p.idealLength=this.idealEdgeLength,p.isInterGraph&&(m=p.getSource(),y=p.getTarget(),v=p.getSourceInLca().getEstimatedSize(),T=p.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(p.idealLength+=v+T-2*l.SIMPLE_NODE_SIZE),g=p.getLca().getInclusionTreeDepth(),p.idealLength+=o.DEFAULT_EDGE_LENGTH*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(m.getInclusionTreeDepth()+y.getInclusionTreeDepth()-2*g))},d.prototype.initSpringEmbedder=function(){var p=this.getAllNodes().length;this.incremental?(p>o.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m<p.length;m++)g=p[m],this.calcSpringForce(g,g.idealLength)},d.prototype.calcRepulsionForces=function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,T,b=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;m<b.length;m++)v=b[m],this.calculateRepulsionForceOfANode(v,w,p,g),w.add(v);else for(m=0;m<b.length;m++)for(v=b[m],y=m+1;y<b.length;y++)T=b[y],v.getOwner()==T.getOwner()&&this.calcRepulsionForce(v,T)},d.prototype.calcGravitationalForces=function(){for(var p,g=this.getAllNodesToApplyGravitation(),m=0;m<g.length;m++)p=g[m],this.calcGravitationalForce(p)},d.prototype.moveNodes=function(){for(var p=this.getAllNodes(),g,m=0;m<p.length;m++)g=p[m],g.move()},d.prototype.calcSpringForce=function(p,g){var m=p.getSource(),y=p.getTarget(),v,T,b,w;if(this.uniformLeafNodeSizes&&m.getChild()==null&&y.getChild()==null)p.updateLengthSimple();else if(p.updateLength(),p.isOverlapingSourceAndTarget)return;v=p.getLength(),v!=0&&(T=this.springConstant*(v-g),b=T*(p.lengthX/v),w=T*(p.lengthY/v),m.springForceX+=b,m.springForceY+=w,y.springForceX-=b,y.springForceY-=w)},d.prototype.calcRepulsionForce=function(p,g){var m=p.getRect(),y=g.getRect(),v=new Array(2),T=new Array(4),b,w,C,S,k,E,_;if(m.intersects(y)){u.calcSeparationAmount(m,y,v,o.DEFAULT_EDGE_LENGTH/2),E=2*v[0],_=2*v[1];var M=p.noOfChildren*g.noOfChildren/(p.noOfChildren+g.noOfChildren);p.repulsionForceX-=M*E,p.repulsionForceY-=M*_,g.repulsionForceX+=M*E,g.repulsionForceY+=M*_}else this.uniformLeafNodeSizes&&p.getChild()==null&&g.getChild()==null?(b=y.getCenterX()-m.getCenterX(),w=y.getCenterY()-m.getCenterY()):(u.getIntersection(m,y,T),b=T[2]-T[0],w=T[3]-T[1]),Math.abs(b)<o.MIN_REPULSION_DIST&&(b=h.sign(b)*o.MIN_REPULSION_DIST),Math.abs(w)<o.MIN_REPULSION_DIST&&(w=h.sign(w)*o.MIN_REPULSION_DIST),C=b*b+w*w,S=Math.sqrt(C),k=this.repulsionConstant*p.noOfChildren*g.noOfChildren/C,E=k*b/S,_=k*w/S,p.repulsionForceX-=E,p.repulsionForceY-=_,g.repulsionForceX+=E,g.repulsionForceY+=_},d.prototype.calcGravitationalForce=function(p){var g,m,y,v,T,b,w,C;g=p.getOwner(),m=(g.getRight()+g.getLeft())/2,y=(g.getTop()+g.getBottom())/2,v=p.getCenterX()-m,T=p.getCenterY()-y,b=Math.abs(v)+p.getWidth()/2,w=Math.abs(T)+p.getHeight()/2,p.getOwner()==this.graphManager.getRoot()?(C=g.getEstimatedSize()*this.gravityRangeFactor,(b>C||w>C)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*T)):(C=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>C||w>C)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,p||g},d.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},d.prototype.calcNoOfChildrenForAllNodes=function(){for(var p,g=this.graphManager.getAllNodes(),m=0;m<g.length;m++)p=g[m],p.noOfChildren=p.getNoOfChildren()},d.prototype.calcGrid=function(p){var g=0,m=0;g=parseInt(Math.ceil((p.getRight()-p.getLeft())/this.repulsionRange)),m=parseInt(Math.ceil((p.getBottom()-p.getTop())/this.repulsionRange));for(var y=new Array(g),v=0;v<g;v++)y[v]=new Array(m);for(var v=0;v<g;v++)for(var T=0;T<m;T++)y[v][T]=new Array;return y},d.prototype.addNodeToGrid=function(p,g,m){var y=0,v=0,T=0,b=0;y=parseInt(Math.floor((p.getRect().x-g)/this.repulsionRange)),v=parseInt(Math.floor((p.getRect().width+p.getRect().x-g)/this.repulsionRange)),T=parseInt(Math.floor((p.getRect().y-m)/this.repulsionRange)),b=parseInt(Math.floor((p.getRect().height+p.getRect().y-m)/this.repulsionRange));for(var w=y;w<=v;w++)for(var C=T;C<=b;C++)this.grid[w][C].push(p),p.setGridCoordinates(y,v,T,b)},d.prototype.updateGrid=function(){var p,g,m=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),p=0;p<m.length;p++)g=m[p],this.addNodeToGrid(g,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},d.prototype.calculateRepulsionForceOfANode=function(p,g,m,y){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&m||y){var v=new Set;p.surrounding=new Array;for(var T,b=this.grid,w=p.startX-1;w<p.finishX+2;w++)for(var C=p.startY-1;C<p.finishY+2;C++)if(!(w<0||C<0||w>=b.length||C>=b[0].length)){for(var S=0;S<b[w][C].length;S++)if(T=b[w][C][S],!(p.getOwner()!=T.getOwner()||p==T)&&!g.has(T)&&!v.has(T)){var k=Math.abs(p.getCenterX()-T.getCenterX())-(p.getWidth()/2+T.getWidth()/2),E=Math.abs(p.getCenterY()-T.getCenterY())-(p.getHeight()/2+T.getHeight()/2);k<=this.repulsionRange&&E<=this.repulsionRange&&v.add(T)}}p.surrounding=[].concat(a(v))}for(w=0;w<p.surrounding.length;w++)this.calcRepulsionForce(p,p.surrounding[w])},d.prototype.calcRepulsionRange=function(){return 0},r.exports=d}),(function(r,n,i){var a=i(1),s=i(7);function o(u,h,d){a.call(this,u,h,d),this.idealLength=s.DEFAULT_EDGE_LENGTH}o.prototype=Object.create(a.prototype);for(var l in a)o[l]=a[l];r.exports=o}),(function(r,n,i){var a=i(3);function s(l,u,h,d){a.call(this,l,u,h,d),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}s.prototype=Object.create(a.prototype);for(var o in a)s[o]=a[o];s.prototype.setGridCoordinates=function(l,u,h,d){this.startX=l,this.finishX=u,this.startY=h,this.finishY=d},r.exports=s}),(function(r,n,i){function a(s,o){this.width=0,this.height=0,s!==null&&o!==null&&(this.height=o,this.width=s)}a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(s){this.width=s},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(s){this.height=s},r.exports=a}),(function(r,n,i){var a=i(14);function s(){this.map={},this.keys=[]}s.prototype.put=function(o,l){var u=a.createID(o);this.contains(u)||(this.map[u]=l,this.keys.push(o))},s.prototype.contains=function(o){return a.createID(o),this.map[o]!=null},s.prototype.get=function(o){var l=a.createID(o);return this.map[l]},s.prototype.keySet=function(){return this.keys},r.exports=s}),(function(r,n,i){var a=i(14);function s(){this.set={}}s.prototype.add=function(o){var l=a.createID(o);this.contains(l)||(this.set[l]=o)},s.prototype.remove=function(o){delete this.set[a.createID(o)]},s.prototype.clear=function(){this.set={}},s.prototype.contains=function(o){return this.set[a.createID(o)]==o},s.prototype.isEmpty=function(){return this.size()===0},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAllTo=function(o){for(var l=Object.keys(this.set),u=l.length,h=0;h<u;h++)o.push(this.set[l[h]])},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAll=function(o){for(var l=o.length,u=0;u<l;u++){var h=o[u];this.add(h)}},r.exports=s}),(function(r,n,i){var a=(function(){function u(h,d){for(var f=0;f<d.length;f++){var p=d[f];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(h,p.key,p)}}return function(h,d,f){return d&&u(h.prototype,d),f&&u(h,f),h}})();function s(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}var o=i(11),l=(function(){function u(h,d){s(this,u),(d!==null||d!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var f=void 0;h instanceof o?f=h.size():f=h.length,this._quicksort(h,0,f-1)}return a(u,[{key:"_quicksort",value:function(d,f,p){if(f<p){var g=this._partition(d,f,p);this._quicksort(d,f,g),this._quicksort(d,g+1,p)}}},{key:"_partition",value:function(d,f,p){for(var g=this._get(d,f),m=f,y=p;;){for(;this.compareFunction(g,this._get(d,y));)y--;for(;this.compareFunction(this._get(d,m),g);)m++;if(m<y)this._swap(d,m,y),m++,y--;else return y}}},{key:"_get",value:function(d,f){return d instanceof o?d.get_object_at(f):d[f]}},{key:"_set",value:function(d,f,p){d instanceof o?d.set_object_at(f,p):d[f]=p}},{key:"_swap",value:function(d,f,p){var g=this._get(d,f);this._set(d,f,this._get(d,p)),this._set(d,p,g)}},{key:"_defaultCompareFunction",value:function(d,f){return f>d}}]),u})();r.exports=l}),(function(r,n,i){var a=(function(){function l(u,h){for(var d=0;d<h.length;d++){var f=h[d];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(u,f.key,f)}}return function(u,h,d){return h&&l(u.prototype,h),d&&l(u,d),u}})();function s(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var o=(function(){function l(u,h){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g<this.iMax;g++){this.grid[g]=new Array(this.jMax);for(var m=0;m<this.jMax;m++)this.grid[g][m]=0}this.tracebackGrid=new Array(this.iMax);for(var y=0;y<this.iMax;y++){this.tracebackGrid[y]=new Array(this.jMax);for(var v=0;v<this.jMax;v++)this.tracebackGrid[y][v]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return a(l,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var h=1;h<this.jMax;h++)this.grid[0][h]=this.grid[0][h-1]+this.gap_penalty,this.tracebackGrid[0][h]=[!1,!1,!0];for(var d=1;d<this.iMax;d++)this.grid[d][0]=this.grid[d-1][0]+this.gap_penalty,this.tracebackGrid[d][0]=[!1,!0,!1];for(var f=1;f<this.iMax;f++)for(var p=1;p<this.jMax;p++){var g=void 0;this.sequence1[f-1]===this.sequence2[p-1]?g=this.grid[f-1][p-1]+this.match_score:g=this.grid[f-1][p-1]+this.mismatch_penalty;var m=this.grid[f-1][p]+this.gap_penalty,y=this.grid[f][p-1]+this.gap_penalty,v=[g,m,y],T=this.arrayAllMaxIndexes(v);this.grid[f][p]=v[T[0]],this.tracebackGrid[f][p]=[T.includes(0),T.includes(1),T.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var h=[];for(h.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});h[0];){var d=h[0],f=this.tracebackGrid[d.pos[0]][d.pos[1]];f[0]&&h.push({pos:[d.pos[0]-1,d.pos[1]-1],seq1:this.sequence1[d.pos[0]-1]+d.seq1,seq2:this.sequence2[d.pos[1]-1]+d.seq2}),f[1]&&h.push({pos:[d.pos[0]-1,d.pos[1]],seq1:this.sequence1[d.pos[0]-1]+d.seq1,seq2:"-"+d.seq2}),f[2]&&h.push({pos:[d.pos[0],d.pos[1]-1],seq1:"-"+d.seq1,seq2:this.sequence2[d.pos[1]-1]+d.seq2}),d.pos[0]===0&&d.pos[1]===0&&this.alignments.push({sequence1:d.seq1,sequence2:d.seq2}),h.shift()}return this.alignments}},{key:"getAllIndexes",value:function(h,d){for(var f=[],p=-1;(p=h.indexOf(d,p+1))!==-1;)f.push(p);return f}},{key:"arrayAllMaxIndexes",value:function(h){return this.getAllIndexes(h,Math.max.apply(null,h))}}]),l})();r.exports=o}),(function(r,n,i){var a=function(){};a.FDLayout=i(18),a.FDLayoutConstants=i(7),a.FDLayoutEdge=i(19),a.FDLayoutNode=i(20),a.DimensionD=i(21),a.HashMap=i(22),a.HashSet=i(23),a.IGeometry=i(8),a.IMath=i(9),a.Integer=i(10),a.Point=i(12),a.PointD=i(4),a.RandomSeed=i(16),a.RectangleD=i(13),a.Transform=i(17),a.UniqueIDGeneretor=i(14),a.Quicksort=i(24),a.LinkedList=i(11),a.LGraphObject=i(2),a.LGraph=i(5),a.LEdge=i(1),a.LGraphManager=i(6),a.LNode=i(3),a.Layout=i(15),a.LayoutConstants=i(0),a.NeedlemanWunsch=i(25),r.exports=a}),(function(r,n,i){function a(){this.listeners=[]}var s=a.prototype;s.addListener=function(o,l){this.listeners.push({event:o,callback:l})},s.removeListener=function(o,l){for(var u=this.listeners.length;u>=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;u<this.listeners.length;u++){var h=this.listeners[u];o===h.event&&h.callback(l)}},r.exports=a})])})})(b3)),b3.exports}var emt=v3.exports,kte;function tmt(){return kte||(kte=1,(function(t,e){(function(n,i){t.exports=i(Jgt())})(emt,function(r){return(function(n){var i={};function a(s){if(i[s])return i[s].exports;var o=i[s]={i:s,l:!1,exports:{}};return n[s].call(o.exports,o,o.exports,a),o.l=!0,o.exports}return a.m=n,a.c=i,a.i=function(s){return s},a.d=function(s,o,l){a.o(s,o)||Object.defineProperty(s,o,{configurable:!1,enumerable:!0,get:l})},a.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return a.d(o,"a",o),o},a.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},a.p="",a(a.s=7)})([(function(n,i){n.exports=r}),(function(n,i,a){var s=a(0).FDLayoutConstants;function o(){}for(var l in s)o[l]=s[l];o.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,o.DEFAULT_RADIAL_SEPARATION=s.DEFAULT_EDGE_LENGTH,o.DEFAULT_COMPONENT_SEPERATION=60,o.TILE=!0,o.TILING_PADDING_VERTICAL=10,o.TILING_PADDING_HORIZONTAL=10,o.TREE_REDUCTION_ON_INCREMENTAL=!1,n.exports=o}),(function(n,i,a){var s=a(0).FDLayoutEdge;function o(u,h,d){s.call(this,u,h,d)}o.prototype=Object.create(s.prototype);for(var l in s)o[l]=s[l];n.exports=o}),(function(n,i,a){var s=a(0).LGraph;function o(u,h,d){s.call(this,u,h,d)}o.prototype=Object.create(s.prototype);for(var l in s)o[l]=s[l];n.exports=o}),(function(n,i,a){var s=a(0).LGraphManager;function o(u){s.call(this,u)}o.prototype=Object.create(s.prototype);for(var l in s)o[l]=s[l];n.exports=o}),(function(n,i,a){var s=a(0).FDLayoutNode,o=a(0).IMath;function l(h,d,f,p){s.call(this,h,d,f,p)}l.prototype=Object.create(s.prototype);for(var u in s)l[u]=s[u];l.prototype.move=function(){var h=this.graphManager.getLayout();this.displacementX=h.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=h.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*o.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),h.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},l.prototype.propogateDisplacementToChildren=function(h,d){for(var f=this.getChild().getNodes(),p,g=0;g<f.length;g++)p=f[g],p.getChild()==null?(p.moveBy(h,d),p.displacementX+=h,p.displacementY+=d):p.propogateDisplacementToChildren(h,d)},l.prototype.setPred1=function(h){this.pred1=h},l.prototype.getPred1=function(){return pred1},l.prototype.getPred2=function(){return pred2},l.prototype.setNext=function(h){this.next=h},l.prototype.getNext=function(){return next},l.prototype.setProcessed=function(h){this.processed=h},l.prototype.isProcessed=function(){return processed},n.exports=l}),(function(n,i,a){var s=a(0).FDLayout,o=a(4),l=a(3),u=a(5),h=a(2),d=a(1),f=a(0).FDLayoutConstants,p=a(0).LayoutConstants,g=a(0).Point,m=a(0).PointD,y=a(0).Layout,v=a(0).Integer,T=a(0).IGeometry,b=a(0).LGraph,w=a(0).Transform;function C(){s.call(this),this.toBeTiled={}}C.prototype=Object.create(s.prototype);for(var S in s)C[S]=s[S];C.prototype.newGraphManager=function(){var k=new o(this);return this.graphManager=k,k},C.prototype.newGraph=function(k){return new l(null,this.graphManager,k)},C.prototype.newNode=function(k){return new u(this.graphManager,k)},C.prototype.newEdge=function(k){return new h(null,null,k)},C.prototype.initParameters=function(){s.prototype.initParameters.call(this,arguments),this.isSubLayout||(d.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=d.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=d.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=f.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=f.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=f.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=f.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=f.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/f.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=f.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},C.prototype.layout=function(){var k=p.DEFAULT_CREATE_BENDS_AS_NEEDED;return k&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},C.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(d.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),_=this.nodesWithGravity.filter(function(P){return E.has(P)});this.graphManager.setAllNodesToApplyGravitation(_)}}else{var k=this.getFlatForest();if(k.length>0)this.positionNodesRadially(k);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),_=this.nodesWithGravity.filter(function(M){return E.has(M)});this.graphManager.setAllNodesToApplyGravitation(_),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},C.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var k=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(L){return k.has(L)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var _=!this.isTreeGrowing&&!this.isGrowthFinished,M=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(_,M),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},C.prototype.getPositionsData=function(){for(var k=this.graphManager.getAllNodes(),E={},_=0;_<k.length;_++){var M=k[_].rect,L=k[_].id;E[L]={id:L,x:M.getCenterX(),y:M.getCenterY(),w:M.width,h:M.height}}return E},C.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var k=!1;if(f.ANIMATE==="during")this.emit("layoutstarted");else{for(;!k;)k=this.tick();this.graphManager.updateBounds()}},C.prototype.calculateNodesToApplyGravitationTo=function(){var k=[],E,_=this.graphManager.getGraphs(),M=_.length,L;for(L=0;L<M;L++)E=_[L],E.updateConnected(),E.isConnected||(k=k.concat(E.getNodes()));return k},C.prototype.createBendpoints=function(){var k=[];k=k.concat(this.graphManager.getAllEdges());var E=new Set,_;for(_=0;_<k.length;_++){var M=k[_];if(!E.has(M)){var L=M.getSource(),P=M.getTarget();if(L==P)M.getBendpoints().push(new m),M.getBendpoints().push(new m),this.createDummyNodesForBendpoints(M),E.add(M);else{var D=[];if(D=D.concat(L.getEdgeListToNode(P)),D=D.concat(P.getEdgeListToNode(L)),!E.has(D[0])){if(D.length>1){var R;for(R=0;R<D.length;R++){var I=D[R];I.getBendpoints().push(new m),this.createDummyNodesForBendpoints(I)}}D.forEach(function($){E.add($)})}}}if(E.size==k.length)break}},C.prototype.positionNodesRadially=function(k){for(var E=new g(0,0),_=Math.ceil(Math.sqrt(k.length)),M=0,L=0,P=0,D=new m(0,0),R=0;R<k.length;R++){R%_==0&&(P=0,L=M,R!=0&&(L+=d.DEFAULT_COMPONENT_SEPERATION),M=0);var I=k[R],$=y.findCenterOfTree(I);E.x=P,E.y=L,D=C.radialLayout(I,$,E),D.y>M&&(M=Math.floor(D.y)),P=Math.floor(D.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(p.WORLD_CENTER_X-D.x/2,p.WORLD_CENTER_Y-D.y/2))},C.radialLayout=function(k,E,_){var M=Math.max(this.maxDiagonalInTree(k),d.DEFAULT_RADIAL_SEPARATION);C.branchRadialLayout(E,null,0,359,0,M);var L=b.calculateBounds(k),P=new w;P.setDeviceOrgX(L.getMinX()),P.setDeviceOrgY(L.getMinY()),P.setWorldOrgX(_.x),P.setWorldOrgY(_.y);for(var D=0;D<k.length;D++){var R=k[D];R.transform(P)}var I=new m(L.getMaxX(),L.getMaxY());return P.inverseTransformPoint(I)},C.branchRadialLayout=function(k,E,_,M,L,P){var D=(M-_+1)/2;D<0&&(D+=180);var R=(D+_)%360,I=R*T.TWO_PI/360,$=L*Math.cos(I),O=L*Math.sin(I);k.setCenter($,O);var N=[];N=N.concat(k.getEdges());var F=N.length;E!=null&&F--;for(var z=0,V=N.length,B,G=k.getEdgesBetween(E);G.length>1;){var H=G[0];G.splice(0,1);var q=N.indexOf(H);q>=0&&N.splice(q,1),V--,F--}E!=null?B=(N.indexOf(G[0])+1)%V:B=0;for(var Z=Math.abs(M-_)/F,Y=B;z!=F;Y=++Y%V){var ie=N[Y].getOtherEnd(k);if(ie!=E){var K=(_+z*Z)%360,Q=(K+Z)%360;C.branchRadialLayout(ie,k,K,Q,L+P,P),z++}}},C.maxDiagonalInTree=function(k){for(var E=v.MIN_VALUE,_=0;_<k.length;_++){var M=k[_],L=M.getDiagonal();L>E&&(E=L)}return E},C.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},C.prototype.groupZeroDegreeMembers=function(){var k=this,E={};this.memberGroups={},this.idToDummyNode={};for(var _=[],M=this.graphManager.getAllNodes(),L=0;L<M.length;L++){var P=M[L],D=P.getParent();this.getNodeDegreeWithChildren(P)===0&&(D.id==null||!this.getToBeTiled(D))&&_.push(P)}for(var L=0;L<_.length;L++){var P=_[L],R=P.getParent().id;typeof E[R]>"u"&&(E[R]=[]),E[R]=E[R].concat(P)}Object.keys(E).forEach(function(I){if(E[I].length>1){var $="DummyCompound_"+I;k.memberGroups[$]=E[I];var O=E[I][0].getParent(),N=new u(k.graphManager);N.id=$,N.paddingLeft=O.paddingLeft||0,N.paddingRight=O.paddingRight||0,N.paddingBottom=O.paddingBottom||0,N.paddingTop=O.paddingTop||0,k.idToDummyNode[$]=N;var F=k.getGraphManager().add(k.newGraph(),N),z=O.getChild();z.add(N);for(var V=0;V<E[I].length;V++){var B=E[I][V];z.remove(B),F.add(B)}}})},C.prototype.clearCompounds=function(){var k={},E={};this.performDFSOnCompounds();for(var _=0;_<this.compoundOrder.length;_++)E[this.compoundOrder[_].id]=this.compoundOrder[_],k[this.compoundOrder[_].id]=[].concat(this.compoundOrder[_].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[_].getChild()),this.compoundOrder[_].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(k,E)},C.prototype.clearZeroDegreeMembers=function(){var k=this,E=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(_){var M=k.idToDummyNode[_];E[_]=k.tileNodes(k.memberGroups[_],M.paddingLeft+M.paddingRight),M.rect.width=E[_].width,M.rect.height=E[_].height})},C.prototype.repopulateCompounds=function(){for(var k=this.compoundOrder.length-1;k>=0;k--){var E=this.compoundOrder[k],_=E.id,M=E.paddingLeft,L=E.paddingTop;this.adjustLocations(this.tiledMemberPack[_],E.rect.x,E.rect.y,M,L)}},C.prototype.repopulateZeroDegreeMembers=function(){var k=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(_){var M=k.idToDummyNode[_],L=M.paddingLeft,P=M.paddingTop;k.adjustLocations(E[_],M.rect.x,M.rect.y,L,P)})},C.prototype.getToBeTiled=function(k){var E=k.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var _=k.getChild();if(_==null)return this.toBeTiled[E]=!1,!1;for(var M=_.getNodes(),L=0;L<M.length;L++){var P=M[L];if(this.getNodeDegree(P)>0)return this.toBeTiled[E]=!1,!1;if(P.getChild()==null){this.toBeTiled[P.id]=!1;continue}if(!this.getToBeTiled(P))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},C.prototype.getNodeDegree=function(k){k.id;for(var E=k.getEdges(),_=0,M=0;M<E.length;M++){var L=E[M];L.getSource().id!==L.getTarget().id&&(_=_+1)}return _},C.prototype.getNodeDegreeWithChildren=function(k){var E=this.getNodeDegree(k);if(k.getChild()==null)return E;for(var _=k.getChild().getNodes(),M=0;M<_.length;M++){var L=_[M];E+=this.getNodeDegreeWithChildren(L)}return E},C.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},C.prototype.fillCompexOrderByDFS=function(k){for(var E=0;E<k.length;E++){var _=k[E];_.getChild()!=null&&this.fillCompexOrderByDFS(_.getChild().getNodes()),this.getToBeTiled(_)&&this.compoundOrder.push(_)}},C.prototype.adjustLocations=function(k,E,_,M,L){E+=M,_+=L;for(var P=E,D=0;D<k.rows.length;D++){var R=k.rows[D];E=P;for(var I=0,$=0;$<R.length;$++){var O=R[$];O.rect.x=E,O.rect.y=_,E+=O.rect.width+k.horizontalPadding,O.rect.height>I&&(I=O.rect.height)}_+=I+k.verticalPadding}},C.prototype.tileCompoundMembers=function(k,E){var _=this;this.tiledMemberPack=[],Object.keys(k).forEach(function(M){var L=E[M];_.tiledMemberPack[M]=_.tileNodes(k[M],L.paddingLeft+L.paddingRight),L.rect.width=_.tiledMemberPack[M].width,L.rect.height=_.tiledMemberPack[M].height})},C.prototype.tileNodes=function(k,E){var _=d.TILING_PADDING_VERTICAL,M=d.TILING_PADDING_HORIZONTAL,L={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:_,horizontalPadding:M};k.sort(function(R,I){return R.rect.width*R.rect.height>I.rect.width*I.rect.height?-1:R.rect.width*R.rect.height<I.rect.width*I.rect.height?1:0});for(var P=0;P<k.length;P++){var D=k[P];L.rows.length==0?this.insertNodeToRow(L,D,0,E):this.canAddHorizontal(L,D.rect.width,D.rect.height)?this.insertNodeToRow(L,D,this.getShortestRowIndex(L),E):this.insertNodeToRow(L,D,L.rows.length,E),this.shiftToLastRow(L)}return L},C.prototype.insertNodeToRow=function(k,E,_,M){var L=M;if(_==k.rows.length){var P=[];k.rows.push(P),k.rowWidth.push(L),k.rowHeight.push(0)}var D=k.rowWidth[_]+E.rect.width;k.rows[_].length>0&&(D+=k.horizontalPadding),k.rowWidth[_]=D,k.width<D&&(k.width=D);var R=E.rect.height;_>0&&(R+=k.verticalPadding);var I=0;R>k.rowHeight[_]&&(I=k.rowHeight[_],k.rowHeight[_]=R,I=k.rowHeight[_]-I),k.height+=I,k.rows[_].push(E)},C.prototype.getShortestRowIndex=function(k){for(var E=-1,_=Number.MAX_VALUE,M=0;M<k.rows.length;M++)k.rowWidth[M]<_&&(E=M,_=k.rowWidth[M]);return E},C.prototype.getLongestRowIndex=function(k){for(var E=-1,_=Number.MIN_VALUE,M=0;M<k.rows.length;M++)k.rowWidth[M]>_&&(E=M,_=k.rowWidth[M]);return E},C.prototype.canAddHorizontal=function(k,E,_){var M=this.getShortestRowIndex(k);if(M<0)return!0;var L=k.rowWidth[M];if(L+k.horizontalPadding+E<=k.width)return!0;var P=0;k.rowHeight[M]<_&&M>0&&(P=_+k.verticalPadding-k.rowHeight[M]);var D;k.width-L>=E+k.horizontalPadding?D=(k.height+P)/(L+E+k.horizontalPadding):D=(k.height+P)/k.width,P=_+k.verticalPadding;var R;return k.width<E?R=(k.height+P)/E:R=(k.height+P)/k.width,R<1&&(R=1/R),D<1&&(D=1/D),D<R},C.prototype.shiftToLastRow=function(k){var E=this.getLongestRowIndex(k),_=k.rowWidth.length-1,M=k.rows[E],L=M[M.length-1],P=L.width+k.horizontalPadding;if(k.width-k.rowWidth[_]>P&&E!=_){M.splice(-1,1),k.rows[_].push(L),k.rowWidth[E]=k.rowWidth[E]-P,k.rowWidth[_]=k.rowWidth[_]+P,k.width=k.rowWidth[instance.getLongestRowIndex(k)];for(var D=Number.MIN_VALUE,R=0;R<M.length;R++)M[R].height>D&&(D=M[R].height);E>0&&(D+=k.verticalPadding);var I=k.rowHeight[E]+k.rowHeight[_];k.rowHeight[E]=D,k.rowHeight[_]<L.height+k.verticalPadding&&(k.rowHeight[_]=L.height+k.verticalPadding);var $=k.rowHeight[E]+k.rowHeight[_];k.height+=$-I,this.shiftToLastRow(k)}},C.prototype.tilingPreLayout=function(){d.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},C.prototype.tilingPostLayout=function(){d.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},C.prototype.reduceTrees=function(){for(var k=[],E=!0,_;E;){var M=this.graphManager.getAllNodes(),L=[];E=!1;for(var P=0;P<M.length;P++)_=M[P],_.getEdges().length==1&&!_.getEdges()[0].isInterGraph&&_.getChild()==null&&(L.push([_,_.getEdges()[0],_.getOwner()]),E=!0);if(E==!0){for(var D=[],R=0;R<L.length;R++)L[R][0].getEdges().length==1&&(D.push(L[R]),L[R][0].getOwner().remove(L[R][0]));k.push(D),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=k},C.prototype.growTree=function(k){for(var E=k.length,_=k[E-1],M,L=0;L<_.length;L++)M=_[L],this.findPlaceforPrunedNode(M),M[2].add(M[0]),M[2].add(M[1],M[1].source,M[1].target);k.splice(k.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},C.prototype.findPlaceforPrunedNode=function(k){var E,_,M=k[0];M==k[1].source?_=k[1].target:_=k[1].source;var L=_.startX,P=_.finishX,D=_.startY,R=_.finishY,I=0,$=0,O=0,N=0,F=[I,O,$,N];if(D>0)for(var z=L;z<=P;z++)F[0]+=this.grid[z][D-1].length+this.grid[z][D].length-1;if(P<this.grid.length-1)for(var z=D;z<=R;z++)F[1]+=this.grid[P+1][z].length+this.grid[P][z].length-1;if(R<this.grid[0].length-1)for(var z=L;z<=P;z++)F[2]+=this.grid[z][R+1].length+this.grid[z][R].length-1;if(L>0)for(var z=D;z<=R;z++)F[3]+=this.grid[L-1][z].length+this.grid[L][z].length-1;for(var V=v.MAX_VALUE,B,G,H=0;H<F.length;H++)F[H]<V?(V=F[H],B=1,G=H):F[H]==V&&B++;if(B==3&&V==0)F[0]==0&&F[1]==0&&F[2]==0?E=1:F[0]==0&&F[1]==0&&F[3]==0?E=0:F[0]==0&&F[2]==0&&F[3]==0?E=3:F[1]==0&&F[2]==0&&F[3]==0&&(E=2);else if(B==2&&V==0){var q=Math.floor(Math.random()*2);F[0]==0&&F[1]==0?q==0?E=0:E=1:F[0]==0&&F[2]==0?q==0?E=0:E=2:F[0]==0&&F[3]==0?q==0?E=0:E=3:F[1]==0&&F[2]==0?q==0?E=1:E=2:F[1]==0&&F[3]==0?q==0?E=1:E=3:q==0?E=2:E=3}else if(B==4&&V==0){var q=Math.floor(Math.random()*4);E=q}else E=G;E==0?M.setCenter(_.getCenterX(),_.getCenterY()-_.getHeight()/2-f.DEFAULT_EDGE_LENGTH-M.getHeight()/2):E==1?M.setCenter(_.getCenterX()+_.getWidth()/2+f.DEFAULT_EDGE_LENGTH+M.getWidth()/2,_.getCenterY()):E==2?M.setCenter(_.getCenterX(),_.getCenterY()+_.getHeight()/2+f.DEFAULT_EDGE_LENGTH+M.getHeight()/2):M.setCenter(_.getCenterX()-_.getWidth()/2-f.DEFAULT_EDGE_LENGTH-M.getWidth()/2,_.getCenterY())},n.exports=C}),(function(n,i,a){var s={};s.layoutBase=a(0),s.CoSEConstants=a(1),s.CoSEEdge=a(2),s.CoSEGraph=a(3),s.CoSEGraphManager=a(4),s.CoSELayout=a(6),s.CoSENode=a(5),n.exports=s})])})})(v3)),v3.exports}var rmt=y3.exports,Ste;function nmt(){return Ste||(Ste=1,(function(t,e){(function(n,i){t.exports=i(tmt())})(rmt,function(r){return(function(n){var i={};function a(s){if(i[s])return i[s].exports;var o=i[s]={i:s,l:!1,exports:{}};return n[s].call(o.exports,o,o.exports,a),o.l=!0,o.exports}return a.m=n,a.c=i,a.i=function(s){return s},a.d=function(s,o,l){a.o(s,o)||Object.defineProperty(s,o,{configurable:!1,enumerable:!0,get:l})},a.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return a.d(o,"a",o),o},a.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},a.p="",a(a.s=1)})([(function(n,i){n.exports=r}),(function(n,i,a){var s=a(0).layoutBase.LayoutConstants,o=a(0).layoutBase.FDLayoutConstants,l=a(0).CoSEConstants,u=a(0).CoSELayout,h=a(0).CoSENode,d=a(0).layoutBase.PointD,f=a(0).layoutBase.DimensionD,p={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function g(T,b){var w={};for(var C in T)w[C]=T[C];for(var C in b)w[C]=b[C];return w}function m(T){this.options=g(p,T),y(this.options)}var y=function(b){b.nodeRepulsion!=null&&(l.DEFAULT_REPULSION_STRENGTH=o.DEFAULT_REPULSION_STRENGTH=b.nodeRepulsion),b.idealEdgeLength!=null&&(l.DEFAULT_EDGE_LENGTH=o.DEFAULT_EDGE_LENGTH=b.idealEdgeLength),b.edgeElasticity!=null&&(l.DEFAULT_SPRING_STRENGTH=o.DEFAULT_SPRING_STRENGTH=b.edgeElasticity),b.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=b.nestingFactor),b.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=o.DEFAULT_GRAVITY_STRENGTH=b.gravity),b.numIter!=null&&(l.MAX_ITERATIONS=o.MAX_ITERATIONS=b.numIter),b.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=o.DEFAULT_GRAVITY_RANGE_FACTOR=b.gravityRange),b.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=b.gravityCompound),b.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=b.gravityRangeCompound),b.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=o.DEFAULT_COOLING_FACTOR_INCREMENTAL=b.initialEnergyOnIncremental),b.quality=="draft"?s.QUALITY=0:b.quality=="proof"?s.QUALITY=2:s.QUALITY=1,l.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=s.NODE_DIMENSIONS_INCLUDE_LABELS=b.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=s.DEFAULT_INCREMENTAL=!b.randomize,l.ANIMATE=o.ANIMATE=s.ANIMATE=b.animate,l.TILE=b.tile,l.TILING_PADDING_VERTICAL=typeof b.tilingPaddingVertical=="function"?b.tilingPaddingVertical.call():b.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof b.tilingPaddingHorizontal=="function"?b.tilingPaddingHorizontal.call():b.tilingPaddingHorizontal};m.prototype.run=function(){var T,b,w=this.options;this.idToLNode={};var C=this.layout=new u,S=this;S.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var k=C.newGraphManager();this.gm=k;var E=this.options.eles.nodes(),_=this.options.eles.edges();this.root=k.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(E),C);for(var M=0;M<_.length;M++){var L=_[M],P=this.idToLNode[L.data("source")],D=this.idToLNode[L.data("target")];if(P!==D&&P.getEdgesBetween(D).length==0){var R=k.add(C.newEdge(),P,D);R.id=L.id()}}var I=function(N,F){typeof N=="number"&&(N=F);var z=N.data("id"),V=S.idToLNode[z];return{x:V.getRect().getCenterX(),y:V.getRect().getCenterY()}},$=function O(){for(var N=function(){w.fit&&w.cy.fit(w.eles,w.padding),T||(T=!0,S.cy.one("layoutready",w.ready),S.cy.trigger({type:"layoutready",layout:S}))},F=S.options.refresh,z,V=0;V<F&&!z;V++)z=S.stopped||S.layout.tick();if(z){C.checkLayoutSuccess()&&!C.isSubLayout&&C.doPostLayout(),C.tilingPostLayout&&C.tilingPostLayout(),C.isLayoutFinished=!0,S.options.eles.nodes().positions(I),N(),S.cy.one("layoutstop",S.options.stop),S.cy.trigger({type:"layoutstop",layout:S}),b&&cancelAnimationFrame(b),T=!1;return}var B=S.layout.getPositionsData();w.eles.nodes().positions(function(G,H){if(typeof G=="number"&&(G=H),!G.isParent()){for(var q=G.id(),Z=B[q],Y=G;Z==null&&(Z=B[Y.data("parent")]||B["DummyCompound_"+Y.data("parent")],B[q]=Z,Y=Y.parent()[0],Y!=null););return Z!=null?{x:Z.x,y:Z.y}:{x:G.position("x"),y:G.position("y")}}}),N(),b=requestAnimationFrame(O)};return C.addListener("layoutstarted",function(){S.options.animate==="during"&&(b=requestAnimationFrame($))}),C.runLayout(),this.options.animate!=="during"&&(S.options.eles.nodes().not(":parent").layoutPositions(S,S.options,I),T=!1),this},m.prototype.getTopMostNodes=function(T){for(var b={},w=0;w<T.length;w++)b[T[w].id()]=!0;var C=T.filter(function(S,k){typeof S=="number"&&(S=k);for(var E=S.parent()[0];E!=null;){if(b[E.id()])return!1;E=E.parent()[0]}return!0});return C},m.prototype.processChildrenList=function(T,b,w){for(var C=b.length,S=0;S<C;S++){var k=b[S],E=k.children(),_,M=k.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(k.outerWidth()!=null&&k.outerHeight()!=null?_=T.add(new h(w.graphManager,new d(k.position("x")-M.w/2,k.position("y")-M.h/2),new f(parseFloat(M.w),parseFloat(M.h)))):_=T.add(new h(this.graphManager)),_.id=k.data("id"),_.paddingLeft=parseInt(k.css("padding")),_.paddingTop=parseInt(k.css("padding")),_.paddingRight=parseInt(k.css("padding")),_.paddingBottom=parseInt(k.css("padding")),this.options.nodeDimensionsIncludeLabels&&k.isParent()){var L=k.boundingBox({includeLabels:!0,includeNodes:!1}).w,P=k.boundingBox({includeLabels:!0,includeNodes:!1}).h,D=k.css("text-halign");_.labelWidth=L,_.labelHeight=P,_.labelPos=D}if(this.idToLNode[k.data("id")]=_,isNaN(_.rect.x)&&(_.rect.x=0),isNaN(_.rect.y)&&(_.rect.y=0),E!=null&&E.length>0){var R;R=w.getGraphManager().add(w.newGraph(),_),this.processChildrenList(R,E,w)}}},m.prototype.stop=function(){return this.stopped=!0,this};var v=function(b){b("layout","cose-bilkent",m)};typeof cytoscape<"u"&&v(cytoscape),n.exports=v})])})})(y3)),y3.exports}var imt=nmt();const amt=eg(imt);eu.use(amt);function B2e(t,e){t.forEach(r=>{const n={id:r.id,labelText:r.label,height:r.height,width:r.width,padding:r.padding??0};Object.keys(r).forEach(i=>{["id","label","height","width","padding","x","y"].includes(i)||(n[i]=r[i])}),e.add({group:"nodes",data:n,position:{x:r.x??0,y:r.y??0}})})}x(B2e,"addNodes");function F2e(t,e){t.forEach(r=>{const n={id:r.id,source:r.start,target:r.end};Object.keys(r).forEach(i=>{["id","start","end"].includes(i)||(n[i]=r[i])}),e.add({group:"edges",data:n})})}x(F2e,"addEdges");function z2e(t){return new Promise(e=>{const r=ut("body").append("div").attr("id","cy").attr("style","display:none"),n=eu({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),B2e(t.nodes,n),F2e(t.edges,n),n.nodes().forEach(function(a){a.layoutDimensions=()=>{const s=a.data();return{w:s.width,h:s.height}}});const i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(i).run(),n.ready(a=>{le.info("Cytoscape ready",a),e(n)})})}x(z2e,"createCytoscapeInstance");function V2e(t){return t.nodes().map(e=>{const r=e.data(),n=e.position(),i={id:r.id,x:n.x,y:n.y};return Object.keys(r).forEach(a=>{a!=="id"&&(i[a]=r[a])}),i})}x(V2e,"extractPositionedNodes");function G2e(t){return t.edges().map(e=>{const r=e.data(),n=e._private.rscratch,i={id:r.id,source:r.source,target:r.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(r).forEach(a=>{["id","source","target"].includes(a)||(i[a]=r[a])}),i})}x(G2e,"extractPositionedEdges");async function W2e(t,e){le.debug("Starting cose-bilkent layout algorithm");try{H2e(t);const r=await z2e(t),n=V2e(r),i=G2e(r);return le.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw le.error("Error in cose-bilkent layout algorithm:",r),r}}x(W2e,"executeCoseBilkentLayout");function H2e(t){if(!t)throw new Error("Layout data is required");if(!t.config)throw new Error("Configuration is required in layout data");if(!t.rootNode)throw new Error("Root node is required");if(!t.nodes||!Array.isArray(t.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(t.edges))throw new Error("Edges array is required in layout data");return!0}x(H2e,"validateLayoutData");var smt=x(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:a,insertNode:s,log:o,positionEdgeLabel:l},{algorithm:u})=>{const h={},d={},f=e.select("g");a(f,t.markers,t.type,t.diagramId);const p=f.insert("g").attr("class","subgraphs"),g=f.insert("g").attr("class","edgePaths"),m=f.insert("g").attr("class","edgeLabels"),y=f.insert("g").attr("class","nodes");o.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(t.nodes.map(async b=>{if(b.isGroup){const w={...b};d[b.id]=w,h[b.id]=w,await r(p,b)}else{const w={...b};h[b.id]=w;const C=await s(y,b,{config:t.config,dir:t.direction||"TB"}),S=C.node().getBBox();w.width=S.width,w.height=S.height,w.domId=C,o.debug(`Node ${b.id} dimensions: ${S.width}x${S.height}`)}})),o.debug("Running cose-bilkent layout algorithm");const v={...t,nodes:t.nodes.map(b=>{const w=h[b.id];return{...b,width:w.width,height:w.height}})},T=await W2e(v,t.config);o.debug("Positioning nodes based on layout results"),T.nodes.forEach(b=>{const w=h[b.id];w!=null&&w.domId&&(w.domId.attr("transform",`translate(${b.x}, ${b.y})`),w.x=b.x,w.y=b.y,o.debug(`Positioned node ${w.id} at center (${b.x}, ${b.y})`))}),T.edges.forEach(b=>{const w=t.edges.find(C=>C.id===b.id);w&&(w.points=[{x:b.startX,y:b.startY},{x:b.midX,y:b.midY},{x:b.endX,y:b.endY}])}),o.debug("Inserting and positioning edges"),await Promise.all(t.edges.map(async b=>{await i(m,b);const w=h[b.start??""],C=h[b.end??""];if(w&&C){const S=T.edges.find(k=>k.id===b.id);if(S){o.debug("APA01 positionedEdge",S);const k={...b},E=n(g,k,d,t.type,w,C,t.diagramId);l(k,E)}else{const k={...b,points:[{x:w.x||0,y:w.y||0},{x:C.x||0,y:C.y||0}]},E=n(g,k,d,t.type,w,C,t.diagramId);l(k,E)}}})),o.debug("Cose-bilkent rendering completed")},"render"),omt=smt;const lmt=Object.freeze(Object.defineProperty({__proto__:null,render:omt},Symbol.toStringTag,{value:"Module"}));var xL=x((t,e)=>{const r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),e.attrs!==void 0)for(const n in e.attrs)r.attr(n,e.attrs[n]);return e.class&&r.attr("class",e.class),r},"drawRect"),q2e=x((t,e)=>{const r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};xL(t,r).lower()},"drawBackgroundRect"),cmt=x((t,e)=>{const r=e.text.replace(gx," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),uW=x((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=ig.sanitizeUrl(n);i.attr("xlink:href",a)},"drawImage"),hW=x((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=ig.sanitizeUrl(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),Yo=x(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),dW=x(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),fW=x(()=>{let t=ut(".mermaidTooltip");return t.empty()&&(t=ut("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip"),k_=(function(){var t=x(function(ve,Ce,Ve,se){for(Ve=Ve||{},se=ve.length;se--;Ve[ve[se]]=Ce);return Ve},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],s=[1,63],o=[1,64],l=[1,65],u=[1,66],h=[1,67],d=[1,68],f=[1,69],p=[1,29],g=[1,30],m=[1,31],y=[1,32],v=[1,33],T=[1,34],b=[1,35],w=[1,36],C=[1,37],S=[1,38],k=[1,39],E=[1,40],_=[1,41],M=[1,42],L=[1,43],P=[1,44],D=[1,45],R=[1,46],I=[1,47],$=[1,48],O=[1,50],N=[1,51],F=[1,52],z=[1,53],V=[1,54],B=[1,55],G=[1,56],H=[1,57],q=[1,58],Z=[1,59],Y=[1,60],ie=[14,42],K=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Q=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],te=[1,82],J=[1,83],ge=[1,84],ee=[1,85],Re=[12,14,42],Ie=[12,14,33,42],Be=[12,14,33,42,76,77,79,80],ce=[12,33],oe=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],be={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:x(function(Ce,Ve,se,de,Te,ae,he){var W=ae.length-1;switch(Te){case 3:de.setDirection("TB");break;case 4:de.setDirection("BT");break;case 5:de.setDirection("RL");break;case 6:de.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:de.setC4Type(ae[W-3]);break;case 19:de.setTitle(ae[W].substring(6)),this.$=ae[W].substring(6);break;case 20:de.setAccDescription(ae[W].substring(15)),this.$=ae[W].substring(15);break;case 21:this.$=ae[W].trim(),de.setTitle(this.$);break;case 22:case 23:this.$=ae[W].trim(),de.setAccDescription(this.$);break;case 28:ae[W].splice(2,0,"ENTERPRISE"),de.addPersonOrSystemBoundary(...ae[W]),this.$=ae[W];break;case 29:ae[W].splice(2,0,"SYSTEM"),de.addPersonOrSystemBoundary(...ae[W]),this.$=ae[W];break;case 30:de.addPersonOrSystemBoundary(...ae[W]),this.$=ae[W];break;case 31:ae[W].splice(2,0,"CONTAINER"),de.addContainerBoundary(...ae[W]),this.$=ae[W];break;case 32:de.addDeploymentNode("node",...ae[W]),this.$=ae[W];break;case 33:de.addDeploymentNode("nodeL",...ae[W]),this.$=ae[W];break;case 34:de.addDeploymentNode("nodeR",...ae[W]),this.$=ae[W];break;case 35:de.popBoundaryParseStack();break;case 39:de.addPersonOrSystem("person",...ae[W]),this.$=ae[W];break;case 40:de.addPersonOrSystem("external_person",...ae[W]),this.$=ae[W];break;case 41:de.addPersonOrSystem("system",...ae[W]),this.$=ae[W];break;case 42:de.addPersonOrSystem("system_db",...ae[W]),this.$=ae[W];break;case 43:de.addPersonOrSystem("system_queue",...ae[W]),this.$=ae[W];break;case 44:de.addPersonOrSystem("external_system",...ae[W]),this.$=ae[W];break;case 45:de.addPersonOrSystem("external_system_db",...ae[W]),this.$=ae[W];break;case 46:de.addPersonOrSystem("external_system_queue",...ae[W]),this.$=ae[W];break;case 47:de.addContainer("container",...ae[W]),this.$=ae[W];break;case 48:de.addContainer("container_db",...ae[W]),this.$=ae[W];break;case 49:de.addContainer("container_queue",...ae[W]),this.$=ae[W];break;case 50:de.addContainer("external_container",...ae[W]),this.$=ae[W];break;case 51:de.addContainer("external_container_db",...ae[W]),this.$=ae[W];break;case 52:de.addContainer("external_container_queue",...ae[W]),this.$=ae[W];break;case 53:de.addComponent("component",...ae[W]),this.$=ae[W];break;case 54:de.addComponent("component_db",...ae[W]),this.$=ae[W];break;case 55:de.addComponent("component_queue",...ae[W]),this.$=ae[W];break;case 56:de.addComponent("external_component",...ae[W]),this.$=ae[W];break;case 57:de.addComponent("external_component_db",...ae[W]),this.$=ae[W];break;case 58:de.addComponent("external_component_queue",...ae[W]),this.$=ae[W];break;case 60:de.addRel("rel",...ae[W]),this.$=ae[W];break;case 61:de.addRel("birel",...ae[W]),this.$=ae[W];break;case 62:de.addRel("rel_u",...ae[W]),this.$=ae[W];break;case 63:de.addRel("rel_d",...ae[W]),this.$=ae[W];break;case 64:de.addRel("rel_l",...ae[W]),this.$=ae[W];break;case 65:de.addRel("rel_r",...ae[W]),this.$=ae[W];break;case 66:de.addRel("rel_b",...ae[W]),this.$=ae[W];break;case 67:ae[W].splice(0,1),de.addRel("rel",...ae[W]),this.$=ae[W];break;case 68:de.updateElStyle("update_el_style",...ae[W]),this.$=ae[W];break;case 69:de.updateRelStyle("update_rel_style",...ae[W]),this.$=ae[W];break;case 70:de.updateLayoutConfig("update_layout_config",...ae[W]),this.$=ae[W];break;case 71:this.$=[ae[W]];break;case 72:ae[W].unshift(ae[W-1]),this.$=ae[W];break;case 73:case 75:this.$=ae[W].trim();break;case 74:let ne={};ne[ae[W-1].trim()]=ae[W].trim(),this.$=ne;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y},{14:[1,74]},t(ie,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y}),t(ie,[2,14]),t(K,[2,16],{12:[1,76]}),t(ie,[2,36],{12:[1,77]}),t(Q,[2,19]),t(Q,[2,20]),{25:[1,78]},{27:[1,79]},t(Q,[2,23]),{35:80,75:81,76:te,77:J,79:ge,80:ee},{35:86,75:81,76:te,77:J,79:ge,80:ee},{35:87,75:81,76:te,77:J,79:ge,80:ee},{35:88,75:81,76:te,77:J,79:ge,80:ee},{35:89,75:81,76:te,77:J,79:ge,80:ee},{35:90,75:81,76:te,77:J,79:ge,80:ee},{35:91,75:81,76:te,77:J,79:ge,80:ee},{35:92,75:81,76:te,77:J,79:ge,80:ee},{35:93,75:81,76:te,77:J,79:ge,80:ee},{35:94,75:81,76:te,77:J,79:ge,80:ee},{35:95,75:81,76:te,77:J,79:ge,80:ee},{35:96,75:81,76:te,77:J,79:ge,80:ee},{35:97,75:81,76:te,77:J,79:ge,80:ee},{35:98,75:81,76:te,77:J,79:ge,80:ee},{35:99,75:81,76:te,77:J,79:ge,80:ee},{35:100,75:81,76:te,77:J,79:ge,80:ee},{35:101,75:81,76:te,77:J,79:ge,80:ee},{35:102,75:81,76:te,77:J,79:ge,80:ee},{35:103,75:81,76:te,77:J,79:ge,80:ee},{35:104,75:81,76:te,77:J,79:ge,80:ee},t(Re,[2,59]),{35:105,75:81,76:te,77:J,79:ge,80:ee},{35:106,75:81,76:te,77:J,79:ge,80:ee},{35:107,75:81,76:te,77:J,79:ge,80:ee},{35:108,75:81,76:te,77:J,79:ge,80:ee},{35:109,75:81,76:te,77:J,79:ge,80:ee},{35:110,75:81,76:te,77:J,79:ge,80:ee},{35:111,75:81,76:te,77:J,79:ge,80:ee},{35:112,75:81,76:te,77:J,79:ge,80:ee},{35:113,75:81,76:te,77:J,79:ge,80:ee},{35:114,75:81,76:te,77:J,79:ge,80:ee},{35:115,75:81,76:te,77:J,79:ge,80:ee},{20:116,29:49,30:61,32:62,34:s,36:o,37:l,38:u,39:h,40:d,41:f,43:23,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y},{12:[1,118],33:[1,117]},{35:119,75:81,76:te,77:J,79:ge,80:ee},{35:120,75:81,76:te,77:J,79:ge,80:ee},{35:121,75:81,76:te,77:J,79:ge,80:ee},{35:122,75:81,76:te,77:J,79:ge,80:ee},{35:123,75:81,76:te,77:J,79:ge,80:ee},{35:124,75:81,76:te,77:J,79:ge,80:ee},{35:125,75:81,76:te,77:J,79:ge,80:ee},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(ie,[2,15]),t(K,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(ie,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:a,34:s,36:o,37:l,38:u,39:h,40:d,41:f,44:p,45:g,46:m,47:y,48:v,49:T,50:b,51:w,52:C,53:S,54:k,55:E,56:_,57:M,58:L,59:P,60:D,61:R,62:I,63:$,64:O,65:N,66:F,67:z,68:V,69:B,70:G,71:H,72:q,73:Z,74:Y}),t(Q,[2,21]),t(Q,[2,22]),t(Re,[2,39]),t(Ie,[2,71],{75:81,35:132,76:te,77:J,79:ge,80:ee}),t(Be,[2,73]),{78:[1,133]},t(Be,[2,75]),t(Be,[2,76]),t(Re,[2,40]),t(Re,[2,41]),t(Re,[2,42]),t(Re,[2,43]),t(Re,[2,44]),t(Re,[2,45]),t(Re,[2,46]),t(Re,[2,47]),t(Re,[2,48]),t(Re,[2,49]),t(Re,[2,50]),t(Re,[2,51]),t(Re,[2,52]),t(Re,[2,53]),t(Re,[2,54]),t(Re,[2,55]),t(Re,[2,56]),t(Re,[2,57]),t(Re,[2,58]),t(Re,[2,60]),t(Re,[2,61]),t(Re,[2,62]),t(Re,[2,63]),t(Re,[2,64]),t(Re,[2,65]),t(Re,[2,66]),t(Re,[2,67]),t(Re,[2,68]),t(Re,[2,69]),t(Re,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(ce,[2,28]),t(ce,[2,29]),t(ce,[2,30]),t(ce,[2,31]),t(ce,[2,32]),t(ce,[2,33]),t(ce,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(K,[2,18]),t(ie,[2,38]),t(Ie,[2,72]),t(Be,[2,74]),t(Re,[2,24]),t(Re,[2,35]),t(oe,[2,25]),t(oe,[2,26],{12:[1,138]}),t(oe,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:x(function(Ce,Ve){if(Ve.recoverable)this.trace(Ce);else{var se=new Error(Ce);throw se.hash=Ve,se}},"parseError"),parse:x(function(Ce){var Ve=this,se=[0],de=[],Te=[null],ae=[],he=this.table,W="",ne=0,j=0,ue=2,X=1,Oe=ae.slice.call(arguments,1),xe=Object.create(this.lexer),Ge={yy:{}};for(var _e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_e)&&(Ge.yy[_e]=this.yy[_e]);xe.setInput(Ce,Ge.yy),Ge.yy.lexer=xe,Ge.yy.parser=this,typeof xe.yylloc>"u"&&(xe.yylloc={});var $e=xe.yylloc;ae.push($e);var Me=xe.options&&xe.options.ranges;typeof Ge.yy.parseError=="function"?this.parseError=Ge.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function He(pe){se.length=se.length-2*pe,Te.length=Te.length-pe,ae.length=ae.length-pe}x(He,"popStack");function De(){var pe;return pe=de.pop()||xe.lex()||X,typeof pe!="number"&&(pe instanceof Array&&(de=pe,pe=de.pop()),pe=Ve.symbols_[pe]||pe),pe}x(De,"lex");for(var Ke,Ae,at,Ee,pt={},ht,rt,Et,vt;;){if(Ae=se[se.length-1],this.defaultActions[Ae]?at=this.defaultActions[Ae]:((Ke===null||typeof Ke>"u")&&(Ke=De()),at=he[Ae]&&he[Ae][Ke]),typeof at>"u"||!at.length||!at[0]){var ot="";vt=[];for(ht in he[Ae])this.terminals_[ht]&&ht>ue&&vt.push("'"+this.terminals_[ht]+"'");xe.showPosition?ot="Parse error on line "+(ne+1)+`:
`+xe.showPosition()+`
Expecting `+vt.join(", ")+", got '"+(this.terminals_[Ke]||Ke)+"'":ot="Parse error on line "+(ne+1)+": Unexpected "+(Ke==X?"end of input":"'"+(this.terminals_[Ke]||Ke)+"'"),this.parseError(ot,{text:xe.match,token:this.terminals_[Ke]||Ke,line:xe.yylineno,loc:$e,expected:vt})}if(at[0]instanceof Array&&at.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ae+", token: "+Ke);switch(at[0]){case 1:se.push(Ke),Te.push(xe.yytext),ae.push(xe.yylloc),se.push(at[1]),Ke=null,j=xe.yyleng,W=xe.yytext,ne=xe.yylineno,$e=xe.yylloc;break;case 2:if(rt=this.productions_[at[1]][1],pt.$=Te[Te.length-rt],pt._$={first_line:ae[ae.length-(rt||1)].first_line,last_line:ae[ae.length-1].last_line,first_column:ae[ae.length-(rt||1)].first_column,last_column:ae[ae.length-1].last_column},Me&&(pt._$.range=[ae[ae.length-(rt||1)].range[0],ae[ae.length-1].range[1]]),Ee=this.performAction.apply(pt,[W,j,ne,Ge.yy,at[1],Te,ae].concat(Oe)),typeof Ee<"u")return Ee;rt&&(se=se.slice(0,-1*rt*2),Te=Te.slice(0,-1*rt),ae=ae.slice(0,-1*rt)),se.push(this.productions_[at[1]][0]),Te.push(pt.$),ae.push(pt._$),Et=he[se[se.length-2]][se[se.length-1]],se.push(Et);break;case 3:return!0}}return!0},"parse")},fe=(function(){var ve={EOF:1,parseError:x(function(Ve,se){if(this.yy.parser)this.yy.parser.parseError(Ve,se);else throw new Error(Ve)},"parseError"),setInput:x(function(Ce,Ve){return this.yy=Ve||this.yy||{},this._input=Ce,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Ce=this._input[0];this.yytext+=Ce,this.yyleng++,this.offset++,this.match+=Ce,this.matched+=Ce;var Ve=Ce.match(/(?:\r\n?|\n).*/g);return Ve?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Ce},"input"),unput:x(function(Ce){var Ve=Ce.length,se=Ce.split(/(?:\r\n?|\n)/g);this._input=Ce+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ve),this.offset-=Ve;var de=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),se.length-1&&(this.yylineno-=se.length-1);var Te=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:se?(se.length===de.length?this.yylloc.first_column:0)+de[de.length-se.length].length-se[0].length:this.yylloc.first_column-Ve},this.options.ranges&&(this.yylloc.range=[Te[0],Te[0]+this.yyleng-Ve]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Ce){this.unput(this.match.slice(Ce))},"less"),pastInput:x(function(){var Ce=this.matched.substr(0,this.matched.length-this.match.length);return(Ce.length>20?"...":"")+Ce.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Ce=this.match;return Ce.length<20&&(Ce+=this._input.substr(0,20-Ce.length)),(Ce.substr(0,20)+(Ce.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Ce=this.pastInput(),Ve=new Array(Ce.length+1).join("-");return Ce+this.upcomingInput()+`
`+Ve+"^"},"showPosition"),test_match:x(function(Ce,Ve){var se,de,Te;if(this.options.backtrack_lexer&&(Te={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Te.yylloc.range=this.yylloc.range.slice(0))),de=Ce[0].match(/(?:\r\n?|\n).*/g),de&&(this.yylineno+=de.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:de?de[de.length-1].length-de[de.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Ce[0].length},this.yytext+=Ce[0],this.match+=Ce[0],this.matches=Ce,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Ce[0].length),this.matched+=Ce[0],se=this.performAction.call(this,this.yy,this,Ve,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),se)return se;if(this._backtrack){for(var ae in Te)this[ae]=Te[ae];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ce,Ve,se,de;this._more||(this.yytext="",this.match="");for(var Te=this._currentRules(),ae=0;ae<Te.length;ae++)if(se=this._input.match(this.rules[Te[ae]]),se&&(!Ve||se[0].length>Ve[0].length)){if(Ve=se,de=ae,this.options.backtrack_lexer){if(Ce=this.test_match(se,Te[ae]),Ce!==!1)return Ce;if(this._backtrack){Ve=!1;continue}else return!1}else if(!this.options.flex)break}return Ve?(Ce=this.test_match(Ve,Te[de]),Ce!==!1?Ce:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Ve=this.next();return Ve||this.lex()},"lex"),begin:x(function(Ve){this.conditionStack.push(Ve)},"begin"),popState:x(function(){var Ve=this.conditionStack.length-1;return Ve>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Ve){return Ve=this.conditionStack.length-1-Math.abs(Ve||0),Ve>=0?this.conditionStack[Ve]:"INITIAL"},"topState"),pushState:x(function(Ve){this.begin(Ve)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(Ve,se,de,Te){switch(de){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return ve})();be.lexer=fe;function Pe(){this.yy={}}return x(Pe,"Parser"),Pe.prototype=be,be.Parser=Pe,new Pe})();k_.parser=k_;var umt=k_,lc=[],Ud=[""],Vs="global",ec="",tu=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],ck=[],pW="",gW=!1,S_=4,E_=2,U2e,hmt=x(function(){return U2e},"getC4Type"),dmt=x(function(t){U2e=Wr(t,Fe())},"setC4Type"),fmt=x(function(t,e,r,n,i,a,s,o,l){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let u={};const h=ck.find(d=>d.from===e&&d.to===r);if(h?u=h:ck.push(u),u.type=t,u.from=e,u.to=r,u.label={text:n},i==null)u.techn={text:""};else if(typeof i=="object"){let[d,f]=Object.entries(i)[0];u[d]={text:f}}else u.techn={text:i};if(a==null)u.descr={text:""};else if(typeof a=="object"){let[d,f]=Object.entries(a)[0];u[d]={text:f}}else u.descr={text:a};if(typeof s=="object"){let[d,f]=Object.entries(s)[0];u[d]=f}else u.sprite=s;if(typeof o=="object"){let[d,f]=Object.entries(o)[0];u[d]=f}else u.tags=o;if(typeof l=="object"){let[d,f]=Object.entries(l)[0];u[d]=f}else u.link=l;u.wrap=Nf()},"addRel"),pmt=x(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let o={};const l=lc.find(u=>u.alias===e);if(l&&e===l.alias?o=l:(o.alias=e,lc.push(o)),r==null?o.label={text:""}:o.label={text:r},n==null)o.descr={text:""};else if(typeof n=="object"){let[u,h]=Object.entries(n)[0];o[u]={text:h}}else o.descr={text:n};if(typeof i=="object"){let[u,h]=Object.entries(i)[0];o[u]=h}else o.sprite=i;if(typeof a=="object"){let[u,h]=Object.entries(a)[0];o[u]=h}else o.tags=a;if(typeof s=="object"){let[u,h]=Object.entries(s)[0];o[u]=h}else o.link=s;o.typeC4Shape={text:t},o.parentBoundary=Vs,o.wrap=Nf()},"addPersonOrSystem"),gmt=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=lc.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,lc.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=Nf(),l.typeC4Shape={text:t},l.parentBoundary=Vs},"addContainer"),mmt=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=lc.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,lc.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.techn={text:""};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.techn={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof a=="object"){let[h,d]=Object.entries(a)[0];l[h]=d}else l.sprite=a;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.wrap=Nf(),l.typeC4Shape={text:t},l.parentBoundary=Vs},"addComponent"),ymt=x(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=tu.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,tu.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"system"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=Vs,a.wrap=Nf(),ec=Vs,Vs=t,Ud.push(ec)},"addPersonOrSystemBoundary"),vmt=x(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const s=tu.find(o=>o.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,tu.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"container"};else if(typeof r=="object"){let[o,l]=Object.entries(r)[0];a[o]={text:l}}else a.type={text:r};if(typeof n=="object"){let[o,l]=Object.entries(n)[0];a[o]=l}else a.tags=n;if(typeof i=="object"){let[o,l]=Object.entries(i)[0];a[o]=l}else a.link=i;a.parentBoundary=Vs,a.wrap=Nf(),ec=Vs,Vs=t,Ud.push(ec)},"addContainerBoundary"),bmt=x(function(t,e,r,n,i,a,s,o){if(e===null||r===null)return;let l={};const u=tu.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,tu.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.type={text:"node"};else if(typeof n=="object"){let[h,d]=Object.entries(n)[0];l[h]={text:d}}else l.type={text:n};if(i==null)l.descr={text:""};else if(typeof i=="object"){let[h,d]=Object.entries(i)[0];l[h]={text:d}}else l.descr={text:i};if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.tags=s;if(typeof o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.link=o;l.nodeType=t,l.parentBoundary=Vs,l.wrap=Nf(),ec=Vs,Vs=e,Ud.push(ec)},"addDeploymentNode"),xmt=x(function(){Vs=ec,Ud.pop(),ec=Ud.pop(),Ud.push(ec)},"popBoundaryParseStack"),Tmt=x(function(t,e,r,n,i,a,s,o,l,u,h){let d=lc.find(f=>f.alias===e);if(!(d===void 0&&(d=tu.find(f=>f.alias===e),d===void 0))){if(r!=null)if(typeof r=="object"){let[f,p]=Object.entries(r)[0];d[f]=p}else d.bgColor=r;if(n!=null)if(typeof n=="object"){let[f,p]=Object.entries(n)[0];d[f]=p}else d.fontColor=n;if(i!=null)if(typeof i=="object"){let[f,p]=Object.entries(i)[0];d[f]=p}else d.borderColor=i;if(a!=null)if(typeof a=="object"){let[f,p]=Object.entries(a)[0];d[f]=p}else d.shadowing=a;if(s!=null)if(typeof s=="object"){let[f,p]=Object.entries(s)[0];d[f]=p}else d.shape=s;if(o!=null)if(typeof o=="object"){let[f,p]=Object.entries(o)[0];d[f]=p}else d.sprite=o;if(l!=null)if(typeof l=="object"){let[f,p]=Object.entries(l)[0];d[f]=p}else d.techn=l;if(u!=null)if(typeof u=="object"){let[f,p]=Object.entries(u)[0];d[f]=p}else d.legendText=u;if(h!=null)if(typeof h=="object"){let[f,p]=Object.entries(h)[0];d[f]=p}else d.legendSprite=h}},"updateElStyle"),wmt=x(function(t,e,r,n,i,a,s){const o=ck.find(l=>l.from===e&&l.to===r);if(o!==void 0){if(n!=null)if(typeof n=="object"){let[l,u]=Object.entries(n)[0];o[l]=u}else o.textColor=n;if(i!=null)if(typeof i=="object"){let[l,u]=Object.entries(i)[0];o[l]=u}else o.lineColor=i;if(a!=null)if(typeof a=="object"){let[l,u]=Object.entries(a)[0];o[l]=parseInt(u)}else o.offsetX=parseInt(a);if(s!=null)if(typeof s=="object"){let[l,u]=Object.entries(s)[0];o[l]=parseInt(u)}else o.offsetY=parseInt(s)}},"updateRelStyle"),Cmt=x(function(t,e,r){let n=S_,i=E_;if(typeof e=="object"){const a=Object.values(e)[0];n=parseInt(a)}else n=parseInt(e);if(typeof r=="object"){const a=Object.values(r)[0];i=parseInt(a)}else i=parseInt(r);n>=1&&(S_=n),i>=1&&(E_=i)},"updateLayoutConfig"),kmt=x(function(){return S_},"getC4ShapeInRow"),Smt=x(function(){return E_},"getC4BoundaryInRow"),Emt=x(function(){return Vs},"getCurrentBoundaryParse"),Amt=x(function(){return ec},"getParentBoundaryParse"),Y2e=x(function(t){return t==null?lc:lc.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),_mt=x(function(t){return lc.find(e=>e.alias===t)},"getC4Shape"),Rmt=x(function(t){return Object.keys(Y2e(t))},"getC4ShapeKeys"),X2e=x(function(t){return t==null?tu:tu.filter(e=>e.parentBoundary===t)},"getBoundaries"),Lmt=X2e,Mmt=x(function(){return ck},"getRels"),Imt=x(function(){return pW},"getTitle"),Nmt=x(function(t){gW=t},"setWrap"),Nf=x(function(){return gW},"autoWrap"),Dmt=x(function(){lc=[],tu=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],ec="",Vs="global",Ud=[""],ck=[],Ud=[""],pW="",gW=!1,S_=4,E_=2},"clear"),Omt={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},$mt={FILLED:0,OPEN:1},Pmt={LEFTOF:0,RIGHTOF:1,OVER:2},Bmt=x(function(t){pW=Wr(t,Fe())},"setTitle"),xP={addPersonOrSystem:pmt,addPersonOrSystemBoundary:ymt,addContainer:gmt,addContainerBoundary:vmt,addComponent:mmt,addDeploymentNode:bmt,popBoundaryParseStack:xmt,addRel:fmt,updateElStyle:Tmt,updateRelStyle:wmt,updateLayoutConfig:Cmt,autoWrap:Nf,setWrap:Nmt,getC4ShapeArray:Y2e,getC4Shape:_mt,getC4ShapeKeys:Rmt,getBoundaries:X2e,getBoundarys:Lmt,getCurrentBoundaryParse:Emt,getParentBoundaryParse:Amt,getRels:Mmt,getTitle:Imt,getC4Type:hmt,getC4ShapeInRow:kmt,getC4BoundaryInRow:Smt,setAccTitle:Hn,getAccTitle:ni,getAccDescription:ai,setAccDescription:ii,getConfig:x(()=>Fe().c4,"getConfig"),clear:Dmt,LINETYPE:Omt,ARROWTYPE:$mt,PLACEMENT:Pmt,setTitle:Bmt,setC4Type:dmt},mW=x(function(t,e){return xL(t,e)},"drawRect"),j2e=x(function(t,e,r,n,i,a){const s=t.append("image");s.attr("width",e),s.attr("height",r),s.attr("x",n),s.attr("y",i);let o=a.startsWith("data:image/png;base64")?a:ig.sanitizeUrl(a);s.attr("xlink:href",o)},"drawImage"),Fmt=x((t,e,r,n)=>{const i=t.append("g");let a=0;for(let s of e){let o=s.textColor?s.textColor:"#444444",l=s.lineColor?s.lineColor:"#444444",u=s.offsetX?parseInt(s.offsetX):0,h=s.offsetY?parseInt(s.offsetY):0,d="";if(a===0){let p=i.append("line");p.attr("x1",s.startPoint.x),p.attr("y1",s.startPoint.y),p.attr("x2",s.endPoint.x),p.attr("y2",s.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",l),p.style("fill","none"),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)"),a=-1}else{let p=i.append("path");p.attr("fill","none").attr("stroke-width","1").attr("stroke",l).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",s.startPoint.x).replaceAll("starty",s.startPoint.y).replaceAll("controlx",s.startPoint.x+(s.endPoint.x-s.startPoint.x)/2-(s.endPoint.x-s.startPoint.x)/4).replaceAll("controly",s.startPoint.y+(s.endPoint.y-s.startPoint.y)/2).replaceAll("stopx",s.endPoint.x).replaceAll("stopy",s.endPoint.y)),s.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(s.type==="birel"||s.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)")}let f=r.messageFont();rh(r)(s.label.text,i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+h,s.label.width,s.label.height,{fill:o},f),s.techn&&s.techn.text!==""&&(f=r.messageFont(),rh(r)("["+s.techn.text+"]",i,Math.min(s.startPoint.x,s.endPoint.x)+Math.abs(s.endPoint.x-s.startPoint.x)/2+u,Math.min(s.startPoint.y,s.endPoint.y)+Math.abs(s.endPoint.y-s.startPoint.y)/2+r.messageFontSize+5+h,Math.max(s.label.width,s.techn.width),s.techn.height,{fill:o,"font-style":"italic"},f))}},"drawRels"),zmt=x(function(t,e,r){const n=t.append("g");let i=e.bgColor?e.bgColor:"none",a=e.borderColor?e.borderColor:"#444444",s=e.fontColor?e.fontColor:"black",o={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(o={"stroke-width":1});let l={x:e.x,y:e.y,fill:i,stroke:a,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};mW(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=s,rh(r)(e.label.text,n,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},u),e.type&&e.type.text!==""&&(u=r.boundaryFont(),u.fontColor=s,rh(r)(e.type.text,n,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},u)),e.descr&&e.descr.text!==""&&(u=r.boundaryFont(),u.fontSize=u.fontSize-2,u.fontColor=s,rh(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),Vmt=x(function(t,e,r){var d;let n=e.bgColor?e.bgColor:r[e.typeC4Shape.text+"_bg_color"],i=e.borderColor?e.borderColor:r[e.typeC4Shape.text+"_border_color"],a=e.fontColor?e.fontColor:"#FFFFFF",s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(e.typeC4Shape.text){case"person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const o=t.append("g");o.attr("class","person-man");const l=Yo();switch(e.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":l.x=e.x,l.y=e.y,l.fill=n,l.width=e.width,l.height=e.height,l.stroke=i,l.rx=2.5,l.ry=2.5,l.attrs={"stroke-width":.5},mW(o,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2).replaceAll("height",e.height)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("half",e.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":o.append("path").attr("fill",n).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",e.x).replaceAll("starty",e.y).replaceAll("width",e.width).replaceAll("half",e.height/2)),o.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",e.x+e.width).replaceAll("starty",e.y).replaceAll("half",e.height/2));break}let u=jmt(r,e.typeC4Shape.text);switch(o.append("text").attr("fill",a).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",e.typeC4Shape.width).attr("x",e.x+e.width/2-e.typeC4Shape.width/2).attr("y",e.y+e.typeC4Shape.Y).text("<<"+e.typeC4Shape.text+">>"),e.typeC4Shape.text){case"person":case"external_person":j2e(o,48,48,e.x+e.width/2-24,e.y+e.image.Y,s);break}let h=r[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=a,rh(r)(e.label.text,o,e.x,e.y+e.label.Y,e.width,e.height,{fill:a},h),h=r[e.typeC4Shape.text+"Font"](),h.fontColor=a,e.techn&&((d=e.techn)==null?void 0:d.text)!==""?rh(r)(e.techn.text,o,e.x,e.y+e.techn.Y,e.width,e.height,{fill:a,"font-style":"italic"},h):e.type&&e.type.text!==""&&rh(r)(e.type.text,o,e.x,e.y+e.type.Y,e.width,e.height,{fill:a,"font-style":"italic"},h),e.descr&&e.descr.text!==""&&(h=r.personFont(),h.fontColor=a,rh(r)(e.descr.text,o,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height},"drawC4Shape"),Gmt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),Wmt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),Hmt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),qmt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead"),Umt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),Ymt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),Xmt=x(function(t,e){const n=t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);n.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),n.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),jmt=x((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),rh=(function(){function t(i,a,s,o,l,u,h){const d=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("text-anchor","middle").text(i);n(d,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split(At.lineBreakRegex);for(let y=0;y<m.length;y++){const v=y*f-f*(m.length-1)/2,T=a.append("text").attr("x",s+l/2).attr("y",o).style("text-anchor","middle").attr("dominant-baseline","middle").style("font-size",f).style("font-weight",g).style("font-family",p);T.append("tspan").attr("dy",v).text(m[y]).attr("alignment-baseline","mathematical"),n(T,h)}}x(e,"byTspan");function r(i,a,s,o,l,u,h,d){const f=a.append("switch"),g=f.append("foreignObject").attr("x",s).attr("y",o).attr("width",l).attr("height",u).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");g.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),e(i,f,s,o,l,u,h,d),n(g,h)}x(r,"byFo");function n(i,a){for(const s in a)a.hasOwnProperty(s)&&i.attr(s,a[s])}return x(n,"_setTextAttrs"),function(i){return i.textPlacement==="fo"?r:i.textPlacement==="old"?t:e}})(),Ic={drawRect:mW,drawBoundary:zmt,drawC4Shape:Vmt,drawRels:Fmt,drawImage:j2e,insertArrowHead:qmt,insertArrowEnd:Umt,insertArrowFilledHead:Ymt,insertArrowCrossHead:Xmt,insertDatabaseIcon:Gmt,insertComputerIcon:Wmt,insertClockIcon:Hmt},A_=0,__=0,K2e=4,TP=2;k_.yy=xP;var Jt={},qy,Z2e=(qy=class{constructor(e){this.name="",this.data={},this.data.startx=void 0,this.data.stopx=void 0,this.data.starty=void 0,this.data.stopy=void 0,this.data.widthLimit=void 0,this.nextData={},this.nextData.startx=void 0,this.nextData.stopx=void 0,this.nextData.starty=void 0,this.nextData.stopy=void 0,this.nextData.cnt=0,wP(e.db.getConfig())}setData(e,r,n,i){this.nextData.startx=this.data.startx=e,this.nextData.stopx=this.data.stopx=r,this.nextData.starty=this.data.starty=n,this.nextData.stopy=this.data.stopy=i}updateVal(e,r,n,i){e[r]===void 0?e[r]=n:e[r]=i(n,e[r])}insert(e){this.nextData.cnt=this.nextData.cnt+1;let r=this.nextData.startx===this.nextData.stopx?this.nextData.stopx+e.margin:this.nextData.stopx+e.margin*2,n=r+e.width,i=this.nextData.starty+e.margin*2,a=i+e.height;(r>=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>K2e)&&(r=this.nextData.startx+e.margin+Jt.nextLinePaddingX,i=this.nextData.stopy+e.margin*2,this.nextData.stopx=n=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=a=i+e.height,this.nextData.cnt=1),e.x=r,e.y=i,this.updateVal(this.data,"startx",r,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",a,Math.max),this.updateVal(this.nextData,"startx",r,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",a,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},wP(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},x(qy,"Bounds"),qy),wP=x(function(t){Wi(Jt,t),t.fontFamily&&(Jt.personFontFamily=Jt.systemFontFamily=Jt.messageFontFamily=t.fontFamily),t.fontSize&&(Jt.personFontSize=Jt.systemFontSize=Jt.messageFontSize=t.fontSize),t.fontWeight&&(Jt.personFontWeight=Jt.systemFontWeight=Jt.messageFontWeight=t.fontWeight)},"setConf"),bT=x((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),x3=x(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),Kmt=x(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function gl(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=Fw(e[t].text,i,n),e[t].textLines=e[t].text.split(At.lineBreakRegex).length,e[t].width=i,e[t].height=RA(e[t].text,n);else{let a=e[t].text.split(At.lineBreakRegex);e[t].textLines=a.length;let s=0;e[t].height=0,e[t].width=0;for(const o of a)e[t].width=Math.max(zs(o,n),e[t].width),s=RA(o,n),e[t].height=e[t].height+s}}x(gl,"calcC4ShapeTextWH");var Q2e=x(function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=Jt.c4ShapeMargin-35;let n=e.wrap&&Jt.wrap,i=x3(Jt);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=zs(e.label.text,i);gl("label",e,n,i,a),Ic.drawBoundary(t,e,Jt)},"drawBoundary"),J2e=x(function(t,e,r,n){let i=0;for(const a of n){i=0;const s=r[a];let o=bT(Jt,s.typeC4Shape.text);switch(o.fontSize=o.fontSize-2,s.typeC4Shape.width=zs("«"+s.typeC4Shape.text+"»",o),s.typeC4Shape.height=o.fontSize+2,s.typeC4Shape.Y=Jt.c4ShapePadding,i=s.typeC4Shape.Y+s.typeC4Shape.height-4,s.image={width:0,height:0,Y:0},s.typeC4Shape.text){case"person":case"external_person":s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height;break}s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height);let l=s.wrap&&Jt.wrap,u=Jt.width-Jt.c4ShapePadding*2,h=bT(Jt,s.typeC4Shape.text);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",gl("label",s,l,h,u),s.label.Y=i+8,i=s.label.Y+s.label.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";let p=bT(Jt,s.typeC4Shape.text);gl("type",s,l,p,u),s.type.Y=i+5,i=s.type.Y+s.type.height}else if(s.techn&&s.techn.text!==""){s.techn.text="["+s.techn.text+"]";let p=bT(Jt,s.techn.text);gl("techn",s,l,p,u),s.techn.Y=i+5,i=s.techn.Y+s.techn.height}let d=i,f=s.label.width;if(s.descr&&s.descr.text!==""){let p=bT(Jt,s.typeC4Shape.text);gl("descr",s,l,p,u),s.descr.Y=i+20,i=s.descr.Y+s.descr.height,f=Math.max(s.label.width,s.descr.width),d=i-s.descr.textLines*5}f=f+Jt.c4ShapePadding,s.width=Math.max(s.width||Jt.width,f,Jt.width),s.height=Math.max(s.height||Jt.height,d,Jt.height),s.margin=s.margin||Jt.c4ShapeMargin,t.insert(s),Ic.drawC4Shape(e,s,Jt)}t.bumpLastMargin(Jt.c4ShapeMargin)},"drawC4ShapeArray"),Uy,el=(Uy=class{constructor(e,r){this.x=e,this.y=r}},x(Uy,"Point"),Uy),Ete=x(function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,s=r+t.width/2,o=n+t.height/2,l=Math.abs(r-i),u=Math.abs(n-a),h=u/l,d=t.height/t.width,f=null;return n==a&&r<i?f=new el(r+t.width,o):n==a&&r>i?f=new el(r,o):r==i&&n<a?f=new el(s,n+t.height):r==i&&n>a&&(f=new el(s,n)),r>i&&n<a?d>=h?f=new el(r,o+h*t.width/2):f=new el(s-l/u*t.height/2,n+t.height):r<i&&n<a?d>=h?f=new el(r+t.width,o+h*t.width/2):f=new el(s+l/u*t.height/2,n+t.height):r<i&&n>a?d>=h?f=new el(r+t.width,o-h*t.width/2):f=new el(s+t.height/2*l/u,n):r>i&&n>a&&(d>=h?f=new el(r,o-t.width/2*h):f=new el(s-t.height/2*l/u,n)),f},"getIntersectPoint"),Zmt=x(function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=Ete(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=Ete(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),Qmt=x(function(t,e,r,n,i){let a=0;for(let s of e){a=a+1;let o=s.wrap&&Jt.wrap,l=Kmt(Jt);n.db.getC4Type()==="C4Dynamic"&&(s.label.text=a+": "+s.label.text);let h=zs(s.label.text,l);gl("label",s,o,l,h),s.techn&&s.techn.text!==""&&(h=zs(s.techn.text,l),gl("techn",s,o,l,h)),s.descr&&s.descr.text!==""&&(h=zs(s.descr.text,l),gl("descr",s,o,l,h));let d=r(s.from),f=r(s.to),p=Zmt(d,f);s.startPoint=p.startPoint,s.endPoint=p.endPoint}Ic.drawRels(t,e,Jt,i)},"drawRels");function yW(t,e,r,n,i){let a=new Z2e(i);a.data.widthLimit=r.data.widthLimit/Math.min(TP,n.length);for(let[s,o]of n.entries()){let l=0;o.image={width:0,height:0,Y:0},o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=l,l=o.image.Y+o.image.height);let u=o.wrap&&Jt.wrap,h=x3(Jt);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",gl("label",o,u,h,a.data.widthLimit),o.label.Y=l+8,l=o.label.Y+o.label.height,o.type&&o.type.text!==""){o.type.text="["+o.type.text+"]";let g=x3(Jt);gl("type",o,u,g,a.data.widthLimit),o.type.Y=l+5,l=o.type.Y+o.type.height}if(o.descr&&o.descr.text!==""){let g=x3(Jt);g.fontSize=g.fontSize-2,gl("descr",o,u,g,a.data.widthLimit),o.descr.Y=l+20,l=o.descr.Y+o.descr.height}if(s==0||s%TP===0){let g=r.data.startx+Jt.diagramMarginX,m=r.data.stopy+Jt.diagramMarginY+l;a.setData(g,g,m,m)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+Jt.diagramMarginX:a.data.startx,m=a.data.starty;a.setData(g,g,m,m)}a.name=o.alias;let d=i.db.getC4ShapeArray(o.alias),f=i.db.getC4ShapeKeys(o.alias);f.length>0&&J2e(a,t,d,f),e=o.alias;let p=i.db.getBoundaries(e);p.length>0&&yW(t,e,a,p,i),o.alias!=="global"&&Q2e(t,o,a),r.data.stopy=Math.max(a.data.stopy+Jt.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+Jt.c4ShapeMargin,r.data.stopx),A_=Math.max(A_,r.data.stopx),__=Math.max(__,r.data.stopy)}}x(yW,"drawInsideBoundary");var Jmt=x(function(t,e,r,n){Jt=Fe().c4;const i=Fe().securityLevel;let a;i==="sandbox"&&(a=ut("#i"+e));const s=ut(i==="sandbox"?a.nodes()[0].contentDocument.body:"body");let o=n.db;n.db.setWrap(Jt.wrap),K2e=o.getC4ShapeInRow(),TP=o.getC4BoundaryInRow(),le.debug(`C:${JSON.stringify(Jt,null,2)}`);const l=i==="sandbox"?s.select(`[id="${e}"]`):ut(`[id="${e}"]`);Ic.insertComputerIcon(l,e),Ic.insertDatabaseIcon(l,e),Ic.insertClockIcon(l,e);let u=new Z2e(n);u.setData(Jt.diagramMarginX,Jt.diagramMarginX,Jt.diagramMarginY,Jt.diagramMarginY),u.data.widthLimit=screen.availWidth,A_=Jt.diagramMarginX,__=Jt.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");yW(l,"",u,d,n),Ic.insertArrowHead(l,e),Ic.insertArrowEnd(l,e),Ic.insertArrowCrossHead(l,e),Ic.insertArrowFilledHead(l,e),Qmt(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=A_,u.data.stopy=__;const f=u.data;let g=f.stopy-f.starty+2*Jt.diagramMarginY;const y=f.stopx-f.startx+2*Jt.diagramMarginX;h&&l.append("text").text(h).attr("x",(f.stopx-f.startx)/2-4*Jt.diagramMarginX).attr("y",f.starty+Jt.diagramMarginY),Ai(l,g,y,Jt.useMaxWidth);const v=h?60:0;l.attr("viewBox",f.startx-Jt.diagramMarginX+" -"+(Jt.diagramMarginY+v)+" "+y+" "+(g+v)),le.debug("models:",f)},"draw"),Ate={drawPersonOrSystemArray:J2e,drawBoundary:Q2e,setConf:wP,draw:Jmt},eyt=x(t=>`.person {
stroke: ${t.personBorder};
fill: ${t.personBkg};
}
`,"getStyles"),tyt=eyt,ryt={parser:umt,db:xP,renderer:Ate,styles:tyt,init:x(({c4:t,wrap:e})=>{Ate.setConf(t),xP.setWrap(e)},"init")};const nyt=Object.freeze(Object.defineProperty({__proto__:null,diagram:ryt},Symbol.toStringTag,{value:"Module"}));var CS=x(()=>`
/* Font Awesome icon styling - consolidated */
.label-icon {
display: inline-block;
height: 1em;
overflow: visible;
vertical-align: -0.125em;
}
.node .label-icon path {
fill: currentColor;
stroke: revert;
stroke-width: revert;
}
`,"getIconStyles"),Ox=x((t,e)=>{let r;return e==="sandbox"&&(r=ut("#i"+t)),ut(e==="sandbox"?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement"),mg=x((t,e,r,n)=>{t.attr("class",r);const{width:i,height:a,x:s,y:o}=iyt(t,e);Ai(t,a,i,n);const l=ayt(s,o,i,a,e);t.attr("viewBox",l),le.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),iyt=x((t,e)=>{var n;const r=((n=t.node())==null?void 0:n.getBBox())||{width:0,height:0,x:0,y:0};return{width:r.width+e*2,height:r.height+e*2,x:r.x,y:r.y}},"calculateDimensionsWithPadding"),ayt=x((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),syt="flowchart-",Yy,oyt=(Yy=class{constructor(){this.vertexCounter=0,this.config=Fe(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Hn,this.setAccDescription=ii,this.setDiagramTitle=ti,this.getAccTitle=ni,this.getAccDescription=ai,this.getDiagramTitle=Yn,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(e){return At.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,n,i,a,s,o={},l){var p,g;if(!e||e.trim().length===0)return;let u;if(l!==void 0){let m;l.includes(`
`)?m=l+`
`:m=`{
`+l+`
}`,u=dR(m,{schema:hR})}const h=this.edges.find(m=>m.id===e);if(h){const m=u;(m==null?void 0:m.animate)!==void 0&&(h.animate=m.animate),(m==null?void 0:m.animation)!==void 0&&(h.animation=m.animation),(m==null?void 0:m.curve)!==void 0&&(h.interpolate=m.curve);return}let d,f=this.vertices.get(e);if(f===void 0&&(r===void 0&&n===void 0&&i!==void 0&&i!==null&&le.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:syt+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,r!==void 0?(this.config=Fe(),d=this.sanitizeText(r.text.trim()),f.labelType=r.type,d.startsWith('"')&&d.endsWith('"')&&(d=d.substring(1,d.length-1)),f.text=d):f.text===void 0&&(f.text=e),n!==void 0&&(f.type=n),i!=null&&i.forEach(m=>{f.styles.push(m)}),a!=null&&a.forEach(m=>{f.classes.push(m)}),s!==void 0&&(f.dir=s),f.props===void 0?f.props=o:o!==void 0&&Object.assign(f.props,o),u!==void 0){if(u.shape){if(u.shape!==u.shape.toLowerCase()||u.shape.includes("_"))throw new Error(`No such shape: ${u.shape}. Shape names should be lowercase.`);if(!Ppe(u.shape))throw new Error(`No such shape: ${u.shape}.`);f.type=u==null?void 0:u.shape}u!=null&&u.label&&(f.text=u==null?void 0:u.label,f.labelType=this.sanitizeNodeLabelType(u==null?void 0:u.labelType)),u!=null&&u.icon&&(f.icon=u==null?void 0:u.icon,!((p=u.label)!=null&&p.trim())&&f.text===e&&(f.text="")),u!=null&&u.form&&(f.form=u==null?void 0:u.form),u!=null&&u.pos&&(f.pos=u==null?void 0:u.pos),u!=null&&u.img&&(f.img=u==null?void 0:u.img,!((g=u.label)!=null&&g.trim())&&f.text===e&&(f.text="")),u!=null&&u.constraint&&(f.constraint=u.constraint),u.w&&(f.assetWidth=Number(u.w)),u.h&&(f.assetHeight=Number(u.h))}}addSingleLink(e,r,n,i){const o={start:e,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};le.info("abc78 Got edge...",o);const l=n.text;if(l!==void 0&&(o.text=this.sanitizeText(l.text.trim()),o.text.startsWith('"')&&o.text.endsWith('"')&&(o.text=o.text.substring(1,o.text.length-1)),o.labelType=this.sanitizeNodeLabelType(l.type)),n!==void 0&&(o.type=n.type,o.stroke=n.stroke,o.length=n.length>10?10:n.length),i&&!this.edges.some(u=>u.id===i))o.id=i,o.isUserDefinedId=!0;else{const u=this.edges.filter(h=>h.start===o.start&&h.end===o.end);u.length===0?o.id=dy(o.start,o.end,{counter:0,prefix:"L"}):o.id=dy(o.start,o.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))le.info("Pushing edge..."),this.edges.push(o);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
Initialize mermaid with maxEdges set to a higher number to allow more edges.
You cannot set this config via configuration inside the diagram as it is a secure config.
You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,r,n){const i=this.isLinkData(n)?n.id.replace("@",""):void 0;le.info("addLink",e,r,i);for(const a of e)for(const s of r){const o=a===e[e.length-1],l=s===r[0];o&&l?this.addSingleLink(a,s,n,i):this.addSingleLink(a,s,n,void 0)}}updateLinkInterpolate(e,r){e.forEach(n=>{n==="default"?this.edges.defaultInterpolate=r:this.edges[n].interpolate=r})}updateLink(e,r){e.forEach(n=>{var i,a,s,o,l,u;if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);n==="default"?this.edges.defaultStyle=r:(this.edges[n].style=r,(((a=(i=this.edges[n])==null?void 0:i.style)==null?void 0:a.length)??0)>0&&!((o=(s=this.edges[n])==null?void 0:s.style)!=null&&o.some(h=>h==null?void 0:h.startsWith("fill")))&&((u=(l=this.edges[n])==null?void 0:l.style)==null||u.push("fill:none")))})}addClass(e,r){const n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(i=>{let a=this.classes.get(i);a===void 0&&(a={id:i,styles:[],textStyles:[]},this.classes.set(i,a)),n!=null&&n.forEach(s=>{if(/color/.exec(s)){const o=s.replace("fill","bgFill");a.textStyles.push(o)}a.styles.push(s)})})}setDirection(e){this.direction=e.trim(),/.*</.exec(this.direction)&&(this.direction="RL"),/.*\^/.exec(this.direction)&&(this.direction="BT"),/.*>/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,r){for(const n of e.split(",")){const i=this.vertices.get(n);i&&i.classes.push(r);const a=this.edges.find(o=>o.id===n);a&&a.classes.push(r);const s=this.subGraphLookup.get(n);s&&s.classes.push(r)}}setTooltip(e,r){if(r!==void 0){r=this.sanitizeText(r);for(const n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}}setClickFun(e,r,n){if(Fe().securityLevel!=="loose"||r===void 0)return;let i=[];if(typeof n=="string"){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let s=0;s<i.length;s++){let o=i[s].trim();o.startsWith('"')&&o.endsWith('"')&&(o=o.substr(1,o.length-2)),i[s]=o}}i.length===0&&i.push(e);const a=this.vertices.get(e);a&&(a.haveCallback=!0,this.funs.push(()=>{const s=this.lookUpDomId(e),o=document.querySelector(`[id="${s}"]`);o!==null&&o.addEventListener("click",()=>{yr.runFunc(r,...i)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const a=this.vertices.get(i);a!==void 0&&(a.link=yr.formatUrl(r,this.config),a.linkTarget=n)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFun(i,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirection(){var e;return(e=this.direction)==null?void 0:e.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const r=fW();ut(e).select("svg").selectAll("g.node").on("mouseover",a=>{var u;const s=ut(a.currentTarget),o=s.attr("title");if(o===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(s.attr("title")).style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(ph.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),ut(a.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=Fe(),On()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n){let i=e.text.trim(),a=n.text;e===n&&/\s/.exec(n.text)&&(i=void 0);const o=x(g=>{const m={boolean:{},number:{},string:{}},y=[];let v;return{nodeList:g.filter(function(b){const w=typeof b;return b.stmt&&b.stmt==="dir"?(v=b.value,!1):b.trim()===""?!1:w in m?m[w].hasOwnProperty(b)?!1:m[w][b]=!0:y.includes(b)?!1:y.push(b)}),dir:v}},"uniq")(r.flat()),l=o.nodeList,u=o.dir,h=u!==void 0,d=Fe().flowchart??{},f=u??(d.inheritDir?this.getDirection()??Fe().direction??void 0:void 0);if(this.version==="gen-1")for(let g=0;g<l.length;g++)l[g]=this.lookUpDomId(l[g]);i=i??"subGraph"+this.subCount,a=a||"",a=this.sanitizeText(a),this.subCount=this.subCount+1;const p={id:i,nodes:l,title:a.trim(),classes:[],dir:f,hasExplicitDir:h,labelType:this.sanitizeNodeLabelType(n==null?void 0:n.type)};return le.info("Adding",p.id,p.nodes,p.dir),p.nodes=this.makeUniq(p,this.subGraphs).nodes,this.subGraphs.push(p),this.subGraphLookup.set(i,p),i}getPosForId(e){for(const[r,n]of this.subGraphs.entries())if(n.id===e)return r;return-1}indexNodes2(e,r){const n=this.subGraphs[r].nodes;if(this.secCount=this.secCount+1,this.secCount>2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let i=0,a=1;for(;i<n.length;){const s=this.getPosForId(n[i]);if(s>=0){const o=this.indexNodes2(e,s);if(o.result)return{result:!0,count:a+o.count};a=a+o.count}i=i+1}return{result:!1,count:a}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let r=e.trim(),n="arrow_open";switch(r[0]){case"<":n="arrow_point",r=r.slice(1);break;case"x":n="arrow_cross",r=r.slice(1);break;case"o":n="arrow_circle",r=r.slice(1);break}let i="normal";return r.includes("=")&&(i="thick"),r.includes(".")&&(i="dotted"),{type:n,stroke:i}}countChar(e,r){const n=r.length;let i=0;for(let a=0;a<n;++a)r[a]===e&&++i;return i}destructEndLink(e){const r=e.trim();let n=r.slice(0,-1),i="arrow_open";switch(r.slice(-1)){case"x":i="arrow_cross",r.startsWith("x")&&(i="double_"+i,n=n.slice(1));break;case">":i="arrow_point",r.startsWith("<")&&(i="double_"+i,n=n.slice(1));break;case"o":i="arrow_circle",r.startsWith("o")&&(i="double_"+i,n=n.slice(1));break}let a="normal",s=n.length-1;n.startsWith("=")&&(a="thick"),n.startsWith("~")&&(a="invisible");const o=this.countChar(".",n);return o&&(a="dotted",s=o),{type:i,stroke:a,length:s}}destructLink(e,r){const n=this.destructEndLink(e);let i;if(r){if(i=this.destructStartLink(r),i.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if(i.type==="arrow_open")i.type=n.type;else{if(i.type!==n.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return i.type==="double_arrow"&&(i.type="double_arrow_point"),i.length=n.length,i}return n}exists(e,r){for(const n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){const n=[];return e.nodes.forEach((i,a)=>{this.exists(r,i)||n.push(e.nodes[a])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find(n=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,i,a,s){var h;const o=n.get(e.id),l=i.get(e.id)??!1,u=this.findNode(r,e.id);if(u)u.cssStyles=e.styles,u.cssCompiledStyles=this.getCompiledStyles(e.classes),u.cssClasses=e.classes.join(" ");else{const d={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:o,padding:((h=a.flowchart)==null?void 0:h.padding)||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:s,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};l?r.push({...d,isGroup:!0,shape:"rect"}):r.push({...d,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}getData(){const e=Fe(),r=[],n=[],i=this.getSubGraphs(),a=new Map,s=new Map;for(let u=i.length-1;u>=0;u--){const h=i[u];h.nodes.length>0&&s.set(h.id,!0);for(const d of h.nodes)a.set(d,h.id)}for(let u=i.length-1;u>=0;u--){const h=i[u];r.push({id:h.id,label:h.title,labelStyle:"",labelType:h.labelType,parentId:a.get(h.id),padding:8,cssCompiledStyles:this.getCompiledStyles(h.classes),cssClasses:h.classes.join(" "),shape:"rect",dir:h.dir==="TD"?"TB":h.dir,explicitDir:h.hasExplicitDir,isGroup:!0,look:e.look})}this.getVertices().forEach(u=>{this.addNodeFromVertex(u,r,a,s,e,e.look||"classic")});const l=this.getEdges();return l.forEach((u,h)=>{var m;const{arrowTypeStart:d,arrowTypeEnd:f}=this.destructEdgeType(u.type),p=[...l.defaultStyle??[]];u.style&&p.push(...u.style);const g={id:dy(u.start,u.end,{counter:h,prefix:"L"},u.id),isUserDefinedId:u.isUserDefinedId,start:u.start,end:u.end,type:u.type??"normal",label:u.text,labelType:u.labelType,labelpos:"c",thickness:u.stroke,minlen:u.length,classes:(u==null?void 0:u.stroke)==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":d,arrowTypeEnd:(u==null?void 0:u.stroke)==="invisible"||(u==null?void 0:u.type)==="arrow_open"?"none":f,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(u.classes),labelStyle:p,style:p,pattern:u.stroke,look:e.look,animate:u.animate,animation:u.animation,curve:u.interpolate||this.edges.defaultInterpolate||((m=e.flowchart)==null?void 0:m.curve)};n.push(g)}),{nodes:r,edges:n,other:{},config:e}}defaultConfig(){return ice.flowchart}},x(Yy,"FlowDB"),Yy),lyt=x(function(t,e){return e.db.getClasses()},"getClasses"),cyt=x(async function(t,e,r,n,i){var f;le.info("REF0:"),le.info("Drawing state diagram (v2)",e);const{securityLevel:a,flowchart:s,layout:o}=Fe();n.db.setDiagramId(e),le.debug("Before getData: ");const l=n.db.getData();le.debug("Data: ",l);const u=Ox(e,a),h=n.db.getDirection();l.type=n.type,l.layoutAlgorithm=nS(o),l.layoutAlgorithm==="dagre"&&o==="elk"&&le.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),l.direction=h,l.nodeSpacing=(s==null?void 0:s.nodeSpacing)||50,l.rankSpacing=(s==null?void 0:s.rankSpacing)||50,l.markers=["point","circle","cross"],l.diagramId=e,le.debug("REF1:",l),await xx(l,u,i);const d=((f=l.config.flowchart)==null?void 0:f.diagramPadding)??8;yr.insertTitle(u,"flowchartTitleText",(s==null?void 0:s.titleTopMargin)||0,n.db.getDiagramTitle()),mg(u,d,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),uyt={getClasses:lyt,draw:cyt},CP=(function(){var t=x(function(Or,yt,it,xt){for(it=it||{},xt=Or.length;xt--;it[Or[xt]]=yt);return it},"o"),e=[1,4],r=[1,3],n=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],a=[2,2],s=[1,13],o=[1,14],l=[1,15],u=[1,16],h=[1,23],d=[1,25],f=[1,26],p=[1,27],g=[1,50],m=[1,49],y=[1,29],v=[1,30],T=[1,31],b=[1,32],w=[1,33],C=[1,45],S=[1,47],k=[1,43],E=[1,48],_=[1,44],M=[1,51],L=[1,46],P=[1,52],D=[1,53],R=[1,34],I=[1,35],$=[1,36],O=[1,37],N=[1,38],F=[1,58],z=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],V=[1,62],B=[1,61],G=[1,63],H=[8,9,11,75,77,78],q=[1,79],Z=[1,92],Y=[1,97],ie=[1,96],K=[1,93],Q=[1,89],te=[1,95],J=[1,91],ge=[1,98],ee=[1,94],Re=[1,99],Ie=[1,90],Be=[8,9,10,11,40,75,77,78],ce=[8,9,10,11,40,46,75,77,78],oe=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],be=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],fe=[44,60,89,102,105,106,109,111,114,115,116],Pe=[1,122],ve=[1,123],Ce=[1,125],Ve=[1,124],se=[44,60,62,74,89,102,105,106,109,111,114,115,116],de=[1,134],Te=[1,148],ae=[1,149],he=[1,150],W=[1,151],ne=[1,136],j=[1,138],ue=[1,142],X=[1,143],Oe=[1,144],xe=[1,145],Ge=[1,146],_e=[1,147],$e=[1,152],Me=[1,153],He=[1,132],De=[1,133],Ke=[1,140],Ae=[1,135],at=[1,139],Ee=[1,137],pt=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],ht=[1,155],rt=[1,157],Et=[8,9,11],vt=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],ot=[1,177],pe=[1,173],Ct=[1,174],lt=[1,178],st=[1,175],mt=[1,176],_r=[77,116,119],Se=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],Ue=[10,106],tt=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],kt=[1,248],Nt=[1,246],sr=[1,250],Qt=[1,244],vr=[1,245],nr=[1,247],Rr=[1,249],Zt=[1,251],gr=[1,269],Dr=[8,9,11,106],Qe=[8,9,10,11,60,84,105,106,109,110,111,112],ct={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:x(function(yt,it,xt,nt,Ht,ke,rn){var Ne=ke.length-1;switch(Ht){case 2:this.$=[];break;case 3:(!Array.isArray(ke[Ne])||ke[Ne].length>0)&&ke[Ne-1].push(ke[Ne]),this.$=ke[Ne-1];break;case 4:case 183:this.$=ke[Ne];break;case 11:nt.setDirection("TB"),this.$="TB";break;case 12:nt.setDirection(ke[Ne-1]),this.$=ke[Ne-1];break;case 27:this.$=ke[Ne-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=nt.addSubGraph(ke[Ne-6],ke[Ne-1],ke[Ne-4]);break;case 34:this.$=nt.addSubGraph(ke[Ne-3],ke[Ne-1],ke[Ne-3]);break;case 35:this.$=nt.addSubGraph(void 0,ke[Ne-1],void 0);break;case 37:this.$=ke[Ne].trim(),nt.setAccTitle(this.$);break;case 38:case 39:this.$=ke[Ne].trim(),nt.setAccDescription(this.$);break;case 43:this.$=ke[Ne-1]+ke[Ne];break;case 44:this.$=ke[Ne];break;case 45:nt.addVertex(ke[Ne-1][ke[Ne-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,ke[Ne]),nt.addLink(ke[Ne-3].stmt,ke[Ne-1],ke[Ne-2]),this.$={stmt:ke[Ne-1],nodes:ke[Ne-1].concat(ke[Ne-3].nodes)};break;case 46:nt.addLink(ke[Ne-2].stmt,ke[Ne],ke[Ne-1]),this.$={stmt:ke[Ne],nodes:ke[Ne].concat(ke[Ne-2].nodes)};break;case 47:nt.addLink(ke[Ne-3].stmt,ke[Ne-1],ke[Ne-2]),this.$={stmt:ke[Ne-1],nodes:ke[Ne-1].concat(ke[Ne-3].nodes)};break;case 48:this.$={stmt:ke[Ne-1],nodes:ke[Ne-1]};break;case 49:nt.addVertex(ke[Ne-1][ke[Ne-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,ke[Ne]),this.$={stmt:ke[Ne-1],nodes:ke[Ne-1],shapeData:ke[Ne]};break;case 50:this.$={stmt:ke[Ne],nodes:ke[Ne]};break;case 51:this.$=[ke[Ne]];break;case 52:nt.addVertex(ke[Ne-5][ke[Ne-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,ke[Ne-4]),this.$=ke[Ne-5].concat(ke[Ne]);break;case 53:this.$=ke[Ne-4].concat(ke[Ne]);break;case 54:this.$=ke[Ne];break;case 55:this.$=ke[Ne-2],nt.setClass(ke[Ne-2],ke[Ne]);break;case 56:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"square");break;case 57:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"doublecircle");break;case 58:this.$=ke[Ne-5],nt.addVertex(ke[Ne-5],ke[Ne-2],"circle");break;case 59:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"ellipse");break;case 60:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"stadium");break;case 61:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"subroutine");break;case 62:this.$=ke[Ne-7],nt.addVertex(ke[Ne-7],ke[Ne-1],"rect",void 0,void 0,void 0,Object.fromEntries([[ke[Ne-5],ke[Ne-3]]]));break;case 63:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"cylinder");break;case 64:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"round");break;case 65:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"diamond");break;case 66:this.$=ke[Ne-5],nt.addVertex(ke[Ne-5],ke[Ne-2],"hexagon");break;case 67:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"odd");break;case 68:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"trapezoid");break;case 69:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"inv_trapezoid");break;case 70:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"lean_right");break;case 71:this.$=ke[Ne-3],nt.addVertex(ke[Ne-3],ke[Ne-1],"lean_left");break;case 72:this.$=ke[Ne],nt.addVertex(ke[Ne]);break;case 73:ke[Ne-1].text=ke[Ne],this.$=ke[Ne-1];break;case 74:case 75:ke[Ne-2].text=ke[Ne-1],this.$=ke[Ne-2];break;case 76:this.$=ke[Ne];break;case 77:var Mr=nt.destructLink(ke[Ne],ke[Ne-2]);this.$={type:Mr.type,stroke:Mr.stroke,length:Mr.length,text:ke[Ne-1]};break;case 78:var Mr=nt.destructLink(ke[Ne],ke[Ne-2]);this.$={type:Mr.type,stroke:Mr.stroke,length:Mr.length,text:ke[Ne-1],id:ke[Ne-3]};break;case 79:this.$={text:ke[Ne],type:"text"};break;case 80:this.$={text:ke[Ne-1].text+""+ke[Ne],type:ke[Ne-1].type};break;case 81:this.$={text:ke[Ne],type:"string"};break;case 82:this.$={text:ke[Ne],type:"markdown"};break;case 83:var Mr=nt.destructLink(ke[Ne]);this.$={type:Mr.type,stroke:Mr.stroke,length:Mr.length};break;case 84:var Mr=nt.destructLink(ke[Ne]);this.$={type:Mr.type,stroke:Mr.stroke,length:Mr.length,id:ke[Ne-1]};break;case 85:this.$=ke[Ne-1];break;case 86:this.$={text:ke[Ne],type:"text"};break;case 87:this.$={text:ke[Ne-1].text+""+ke[Ne],type:ke[Ne-1].type};break;case 88:this.$={text:ke[Ne],type:"string"};break;case 89:case 104:this.$={text:ke[Ne],type:"markdown"};break;case 101:this.$={text:ke[Ne],type:"text"};break;case 102:this.$={text:ke[Ne-1].text+""+ke[Ne],type:ke[Ne-1].type};break;case 103:this.$={text:ke[Ne],type:"text"};break;case 105:this.$=ke[Ne-4],nt.addClass(ke[Ne-2],ke[Ne]);break;case 106:this.$=ke[Ne-4],nt.setClass(ke[Ne-2],ke[Ne]);break;case 107:case 115:this.$=ke[Ne-1],nt.setClickEvent(ke[Ne-1],ke[Ne]);break;case 108:case 116:this.$=ke[Ne-3],nt.setClickEvent(ke[Ne-3],ke[Ne-2]),nt.setTooltip(ke[Ne-3],ke[Ne]);break;case 109:this.$=ke[Ne-2],nt.setClickEvent(ke[Ne-2],ke[Ne-1],ke[Ne]);break;case 110:this.$=ke[Ne-4],nt.setClickEvent(ke[Ne-4],ke[Ne-3],ke[Ne-2]),nt.setTooltip(ke[Ne-4],ke[Ne]);break;case 111:this.$=ke[Ne-2],nt.setLink(ke[Ne-2],ke[Ne]);break;case 112:this.$=ke[Ne-4],nt.setLink(ke[Ne-4],ke[Ne-2]),nt.setTooltip(ke[Ne-4],ke[Ne]);break;case 113:this.$=ke[Ne-4],nt.setLink(ke[Ne-4],ke[Ne-2],ke[Ne]);break;case 114:this.$=ke[Ne-6],nt.setLink(ke[Ne-6],ke[Ne-4],ke[Ne]),nt.setTooltip(ke[Ne-6],ke[Ne-2]);break;case 117:this.$=ke[Ne-1],nt.setLink(ke[Ne-1],ke[Ne]);break;case 118:this.$=ke[Ne-3],nt.setLink(ke[Ne-3],ke[Ne-2]),nt.setTooltip(ke[Ne-3],ke[Ne]);break;case 119:this.$=ke[Ne-3],nt.setLink(ke[Ne-3],ke[Ne-2],ke[Ne]);break;case 120:this.$=ke[Ne-5],nt.setLink(ke[Ne-5],ke[Ne-4],ke[Ne]),nt.setTooltip(ke[Ne-5],ke[Ne-2]);break;case 121:this.$=ke[Ne-4],nt.addVertex(ke[Ne-2],void 0,void 0,ke[Ne]);break;case 122:this.$=ke[Ne-4],nt.updateLink([ke[Ne-2]],ke[Ne]);break;case 123:this.$=ke[Ne-4],nt.updateLink(ke[Ne-2],ke[Ne]);break;case 124:this.$=ke[Ne-8],nt.updateLinkInterpolate([ke[Ne-6]],ke[Ne-2]),nt.updateLink([ke[Ne-6]],ke[Ne]);break;case 125:this.$=ke[Ne-8],nt.updateLinkInterpolate(ke[Ne-6],ke[Ne-2]),nt.updateLink(ke[Ne-6],ke[Ne]);break;case 126:this.$=ke[Ne-6],nt.updateLinkInterpolate([ke[Ne-4]],ke[Ne]);break;case 127:this.$=ke[Ne-6],nt.updateLinkInterpolate(ke[Ne-4],ke[Ne]);break;case 128:case 130:this.$=[ke[Ne]];break;case 129:case 131:ke[Ne-2].push(ke[Ne]),this.$=ke[Ne-2];break;case 133:this.$=ke[Ne-1]+ke[Ne];break;case 181:this.$=ke[Ne];break;case 182:this.$=ke[Ne-1]+""+ke[Ne];break;case 184:this.$=ke[Ne-1]+""+ke[Ne];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:e,10:r,12:n},{1:[3]},t(i,a,{5:6}),{4:7,9:e,10:r,12:n},{4:8,9:e,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:w,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D,121:R,122:I,123:$,124:O,125:N},t(i,[2,9]),t(i,[2,10]),t(i,[2,11]),{8:[1,55],9:[1,56],10:F,15:54,18:57},t(z,[2,3]),t(z,[2,4]),t(z,[2,5]),t(z,[2,6]),t(z,[2,7]),t(z,[2,8]),{8:V,9:B,11:G,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:V,9:B,11:G,21:68},{8:V,9:B,11:G,21:69},{8:V,9:B,11:G,21:70},{8:V,9:B,11:G,21:71},{8:V,9:B,11:G,21:72},{8:V,9:B,10:[1,73],11:G,21:74},t(z,[2,36]),{35:[1,75]},{37:[1,76]},t(z,[2,39]),t(H,[2,50],{18:77,39:78,10:F,40:q}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:Z,44:Y,60:ie,80:[1,87],89:K,95:[1,84],97:[1,85],101:86,105:Q,106:te,109:J,111:ge,114:ee,115:Re,116:Ie,120:88},t(z,[2,185]),t(z,[2,186]),t(z,[2,187]),t(z,[2,188]),t(z,[2,189]),t(Be,[2,51]),t(Be,[2,54],{46:[1,100]}),t(ce,[2,72],{113:113,29:[1,101],44:g,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:m,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:C,102:S,105:k,106:E,109:_,111:M,114:L,115:P,116:D}),t(oe,[2,181]),t(oe,[2,142]),t(oe,[2,143]),t(oe,[2,144]),t(oe,[2,145]),t(oe,[2,146]),t(oe,[2,147]),t(oe,[2,148]),t(oe,[2,149]),t(oe,[2,150]),t(oe,[2,151]),t(oe,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,114]},t(be,[2,26],{18:115,10:F}),t(z,[2,27]),{42:116,43:39,44:g,45:40,47:41,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},t(z,[2,40]),t(z,[2,41]),t(z,[2,42]),t(fe,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Pe,81:ve,116:Ce,119:Ve},{75:[1,126],77:[1,127]},t(se,[2,83]),t(z,[2,28]),t(z,[2,29]),t(z,[2,30]),t(z,[2,31]),t(z,[2,32]),{10:de,12:Te,14:ae,27:he,28:128,32:W,44:ne,60:j,75:ue,80:[1,130],81:[1,131],83:141,84:X,85:Oe,86:xe,87:Ge,88:_e,89:$e,90:Me,91:129,105:He,109:De,111:Ke,114:Ae,115:at,116:Ee},t(pt,a,{5:154}),t(z,[2,37]),t(z,[2,38]),t(H,[2,48],{44:ht}),t(H,[2,49],{18:156,10:F,40:rt}),t(Be,[2,44]),{44:g,47:158,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},{44:g,47:163,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},t(Et,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(Et,[2,115],{120:168,10:[1,167],14:Z,44:Y,60:ie,89:K,105:Q,106:te,109:J,111:ge,114:ee,115:Re,116:Ie}),t(Et,[2,117],{10:[1,169]}),t(vt,[2,183]),t(vt,[2,170]),t(vt,[2,171]),t(vt,[2,172]),t(vt,[2,173]),t(vt,[2,174]),t(vt,[2,175]),t(vt,[2,176]),t(vt,[2,177]),t(vt,[2,178]),t(vt,[2,179]),t(vt,[2,180]),{44:g,47:170,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},{30:171,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:179,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:181,50:[1,180],67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:182,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:183,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:184,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{109:[1,185]},{30:186,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:187,65:[1,188],67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:189,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:190,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{30:191,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},t(oe,[2,182]),t(i,[2,20]),t(be,[2,25]),t(H,[2,46],{39:192,18:193,10:F,40:q}),t(fe,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{77:[1,197],79:198,116:Ce,119:Ve},t(_r,[2,79]),t(_r,[2,81]),t(_r,[2,82]),t(_r,[2,168]),t(_r,[2,169]),{76:199,79:121,80:Pe,81:ve,116:Ce,119:Ve},t(se,[2,84]),{8:V,9:B,10:de,11:G,12:Te,14:ae,21:201,27:he,29:[1,200],32:W,44:ne,60:j,75:ue,83:141,84:X,85:Oe,86:xe,87:Ge,88:_e,89:$e,90:Me,91:202,105:He,109:De,111:Ke,114:Ae,115:at,116:Ee},t(Se,[2,101]),t(Se,[2,103]),t(Se,[2,104]),t(Se,[2,157]),t(Se,[2,158]),t(Se,[2,159]),t(Se,[2,160]),t(Se,[2,161]),t(Se,[2,162]),t(Se,[2,163]),t(Se,[2,164]),t(Se,[2,165]),t(Se,[2,166]),t(Se,[2,167]),t(Se,[2,90]),t(Se,[2,91]),t(Se,[2,92]),t(Se,[2,93]),t(Se,[2,94]),t(Se,[2,95]),t(Se,[2,96]),t(Se,[2,97]),t(Se,[2,98]),t(Se,[2,99]),t(Se,[2,100]),{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,203],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:w,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D,121:R,122:I,123:$,124:O,125:N},{10:F,18:204},{44:[1,205]},t(Be,[2,43]),{10:[1,206],44:g,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:113,114:L,115:P,116:D},{10:[1,207]},{10:[1,208],106:[1,209]},t(Ue,[2,128]),{10:[1,210],44:g,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:113,114:L,115:P,116:D},{10:[1,211],44:g,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:113,114:L,115:P,116:D},{80:[1,212]},t(Et,[2,109],{10:[1,213]}),t(Et,[2,111],{10:[1,214]}),{80:[1,215]},t(vt,[2,184]),{80:[1,216],98:[1,217]},t(Be,[2,55],{113:113,44:g,60:m,89:C,102:S,105:k,106:E,109:_,111:M,114:L,115:P,116:D}),{31:[1,218],67:ot,82:219,116:lt,117:st,118:mt},t(tt,[2,86]),t(tt,[2,88]),t(tt,[2,89]),t(tt,[2,153]),t(tt,[2,154]),t(tt,[2,155]),t(tt,[2,156]),{49:[1,220],67:ot,82:219,116:lt,117:st,118:mt},{30:221,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{51:[1,222],67:ot,82:219,116:lt,117:st,118:mt},{53:[1,223],67:ot,82:219,116:lt,117:st,118:mt},{55:[1,224],67:ot,82:219,116:lt,117:st,118:mt},{57:[1,225],67:ot,82:219,116:lt,117:st,118:mt},{60:[1,226]},{64:[1,227],67:ot,82:219,116:lt,117:st,118:mt},{66:[1,228],67:ot,82:219,116:lt,117:st,118:mt},{30:229,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},{31:[1,230],67:ot,82:219,116:lt,117:st,118:mt},{67:ot,69:[1,231],71:[1,232],82:219,116:lt,117:st,118:mt},{67:ot,69:[1,234],71:[1,233],82:219,116:lt,117:st,118:mt},t(H,[2,45],{18:156,10:F,40:rt}),t(H,[2,47],{44:ht}),t(fe,[2,75]),t(fe,[2,74]),{62:[1,235],67:ot,82:219,116:lt,117:st,118:mt},t(fe,[2,77]),t(_r,[2,80]),{77:[1,236],79:198,116:Ce,119:Ve},{30:237,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},t(pt,a,{5:238}),t(Se,[2,102]),t(z,[2,35]),{43:239,44:g,45:40,47:41,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},{10:F,18:240},{10:kt,60:Nt,84:sr,92:241,105:Qt,107:242,108:243,109:vr,110:nr,111:Rr,112:Zt},{10:kt,60:Nt,84:sr,92:252,104:[1,253],105:Qt,107:242,108:243,109:vr,110:nr,111:Rr,112:Zt},{10:kt,60:Nt,84:sr,92:254,104:[1,255],105:Qt,107:242,108:243,109:vr,110:nr,111:Rr,112:Zt},{105:[1,256]},{10:kt,60:Nt,84:sr,92:257,105:Qt,107:242,108:243,109:vr,110:nr,111:Rr,112:Zt},{44:g,47:258,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},t(Et,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(Et,[2,116]),t(Et,[2,118],{10:[1,262]}),t(Et,[2,119]),t(ce,[2,56]),t(tt,[2,87]),t(ce,[2,57]),{51:[1,263],67:ot,82:219,116:lt,117:st,118:mt},t(ce,[2,64]),t(ce,[2,59]),t(ce,[2,60]),t(ce,[2,61]),{109:[1,264]},t(ce,[2,63]),t(ce,[2,65]),{66:[1,265],67:ot,82:219,116:lt,117:st,118:mt},t(ce,[2,67]),t(ce,[2,68]),t(ce,[2,70]),t(ce,[2,69]),t(ce,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(fe,[2,78]),{31:[1,266],67:ot,82:219,116:lt,117:st,118:mt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,267],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:w,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D,121:R,122:I,123:$,124:O,125:N},t(Be,[2,53]),{43:268,44:g,45:40,47:41,60:m,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D},t(Et,[2,121],{106:gr}),t(Dr,[2,130],{108:270,10:kt,60:Nt,84:sr,105:Qt,109:vr,110:nr,111:Rr,112:Zt}),t(Qe,[2,132]),t(Qe,[2,134]),t(Qe,[2,135]),t(Qe,[2,136]),t(Qe,[2,137]),t(Qe,[2,138]),t(Qe,[2,139]),t(Qe,[2,140]),t(Qe,[2,141]),t(Et,[2,122],{106:gr}),{10:[1,271]},t(Et,[2,123],{106:gr}),{10:[1,272]},t(Ue,[2,129]),t(Et,[2,105],{106:gr}),t(Et,[2,106],{113:113,44:g,60:m,89:C,102:S,105:k,106:E,109:_,111:M,114:L,115:P,116:D}),t(Et,[2,110]),t(Et,[2,112],{10:[1,273]}),t(Et,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:V,9:B,11:G,21:278},t(z,[2,34]),t(Be,[2,52]),{10:kt,60:Nt,84:sr,105:Qt,107:279,108:243,109:vr,110:nr,111:Rr,112:Zt},t(Qe,[2,133]),{14:Z,44:Y,60:ie,89:K,101:280,105:Q,106:te,109:J,111:ge,114:ee,115:Re,116:Ie,120:88},{14:Z,44:Y,60:ie,89:K,101:281,105:Q,106:te,109:J,111:ge,114:ee,115:Re,116:Ie,120:88},{98:[1,282]},t(Et,[2,120]),t(ce,[2,58]),{30:283,67:ot,80:pe,81:Ct,82:172,116:lt,117:st,118:mt},t(ce,[2,66]),t(pt,a,{5:284}),t(Dr,[2,131],{108:270,10:kt,60:Nt,84:sr,105:Qt,109:vr,110:nr,111:Rr,112:Zt}),t(Et,[2,126],{120:168,10:[1,285],14:Z,44:Y,60:ie,89:K,105:Q,106:te,109:J,111:ge,114:ee,115:Re,116:Ie}),t(Et,[2,127],{120:168,10:[1,286],14:Z,44:Y,60:ie,89:K,105:Q,106:te,109:J,111:ge,114:ee,115:Re,116:Ie}),t(Et,[2,114]),{31:[1,287],67:ot,82:219,116:lt,117:st,118:mt},{6:11,7:12,8:s,9:o,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:h,32:[1,288],33:24,34:d,36:f,38:p,42:28,43:39,44:g,45:40,47:41,60:m,84:y,85:v,86:T,87:b,88:w,89:C,102:S,105:k,106:E,109:_,111:M,113:42,114:L,115:P,116:D,121:R,122:I,123:$,124:O,125:N},{10:kt,60:Nt,84:sr,92:289,105:Qt,107:242,108:243,109:vr,110:nr,111:Rr,112:Zt},{10:kt,60:Nt,84:sr,92:290,105:Qt,107:242,108:243,109:vr,110:nr,111:Rr,112:Zt},t(ce,[2,62]),t(z,[2,33]),t(Et,[2,124],{106:gr}),t(Et,[2,125],{106:gr})],defaultActions:{},parseError:x(function(yt,it){if(it.recoverable)this.trace(yt);else{var xt=new Error(yt);throw xt.hash=it,xt}},"parseError"),parse:x(function(yt){var it=this,xt=[0],nt=[],Ht=[null],ke=[],rn=this.table,Ne="",Mr=0,nn=0,Bi=2,Qr=1,bn=ke.slice.call(arguments,1),Yr=Object.create(this.lexer),Da={yy:{}};for(var gc in this.yy)Object.prototype.hasOwnProperty.call(this.yy,gc)&&(Da.yy[gc]=this.yy[gc]);Yr.setInput(yt,Da.yy),Da.yy.lexer=Yr,Da.yy.parser=this,typeof Yr.yylloc>"u"&&(Yr.yylloc={});var xu=Yr.yylloc;ke.push(xu);var Vf=Yr.options&&Yr.options.ranges;typeof Da.yy.parseError=="function"?this.parseError=Da.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Tu(_n){xt.length=xt.length-2*_n,Ht.length=Ht.length-_n,ke.length=ke.length-_n}x(Tu,"popStack");function wu(){var _n;return _n=nt.pop()||Yr.lex()||Qr,typeof _n!="number"&&(_n instanceof Array&&(nt=_n,_n=nt.pop()),_n=it.symbols_[_n]||_n),_n}x(wu,"lex");for(var wt,Le,je,dt,Ft={},er,ur,gn,An;;){if(Le=xt[xt.length-1],this.defaultActions[Le]?je=this.defaultActions[Le]:((wt===null||typeof wt>"u")&&(wt=wu()),je=rn[Le]&&rn[Le][wt]),typeof je>"u"||!je.length||!je[0]){var da="";An=[];for(er in rn[Le])this.terminals_[er]&&er>Bi&&An.push("'"+this.terminals_[er]+"'");Yr.showPosition?da="Parse error on line "+(Mr+1)+`:
`+Yr.showPosition()+`
Expecting `+An.join(", ")+", got '"+(this.terminals_[wt]||wt)+"'":da="Parse error on line "+(Mr+1)+": Unexpected "+(wt==Qr?"end of input":"'"+(this.terminals_[wt]||wt)+"'"),this.parseError(da,{text:Yr.match,token:this.terminals_[wt]||wt,line:Yr.yylineno,loc:xu,expected:An})}if(je[0]instanceof Array&&je.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Le+", token: "+wt);switch(je[0]){case 1:xt.push(wt),Ht.push(Yr.yytext),ke.push(Yr.yylloc),xt.push(je[1]),wt=null,nn=Yr.yyleng,Ne=Yr.yytext,Mr=Yr.yylineno,xu=Yr.yylloc;break;case 2:if(ur=this.productions_[je[1]][1],Ft.$=Ht[Ht.length-ur],Ft._$={first_line:ke[ke.length-(ur||1)].first_line,last_line:ke[ke.length-1].last_line,first_column:ke[ke.length-(ur||1)].first_column,last_column:ke[ke.length-1].last_column},Vf&&(Ft._$.range=[ke[ke.length-(ur||1)].range[0],ke[ke.length-1].range[1]]),dt=this.performAction.apply(Ft,[Ne,nn,Mr,Da.yy,je[1],Ht,ke].concat(bn)),typeof dt<"u")return dt;ur&&(xt=xt.slice(0,-1*ur*2),Ht=Ht.slice(0,-1*ur),ke=ke.slice(0,-1*ur)),xt.push(this.productions_[je[1]][0]),Ht.push(Ft.$),ke.push(Ft._$),gn=rn[xt[xt.length-2]][xt[xt.length-1]],xt.push(gn);break;case 3:return!0}}return!0},"parse")},It=(function(){var Or={EOF:1,parseError:x(function(it,xt){if(this.yy.parser)this.yy.parser.parseError(it,xt);else throw new Error(it)},"parseError"),setInput:x(function(yt,it){return this.yy=it||this.yy||{},this._input=yt,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var yt=this._input[0];this.yytext+=yt,this.yyleng++,this.offset++,this.match+=yt,this.matched+=yt;var it=yt.match(/(?:\r\n?|\n).*/g);return it?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),yt},"input"),unput:x(function(yt){var it=yt.length,xt=yt.split(/(?:\r\n?|\n)/g);this._input=yt+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-it),this.offset-=it;var nt=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),xt.length-1&&(this.yylineno-=xt.length-1);var Ht=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:xt?(xt.length===nt.length?this.yylloc.first_column:0)+nt[nt.length-xt.length].length-xt[0].length:this.yylloc.first_column-it},this.options.ranges&&(this.yylloc.range=[Ht[0],Ht[0]+this.yyleng-it]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(yt){this.unput(this.match.slice(yt))},"less"),pastInput:x(function(){var yt=this.matched.substr(0,this.matched.length-this.match.length);return(yt.length>20?"...":"")+yt.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var yt=this.match;return yt.length<20&&(yt+=this._input.substr(0,20-yt.length)),(yt.substr(0,20)+(yt.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var yt=this.pastInput(),it=new Array(yt.length+1).join("-");return yt+this.upcomingInput()+`
`+it+"^"},"showPosition"),test_match:x(function(yt,it){var xt,nt,Ht;if(this.options.backtrack_lexer&&(Ht={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Ht.yylloc.range=this.yylloc.range.slice(0))),nt=yt[0].match(/(?:\r\n?|\n).*/g),nt&&(this.yylineno+=nt.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:nt?nt[nt.length-1].length-nt[nt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+yt[0].length},this.yytext+=yt[0],this.match+=yt[0],this.matches=yt,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(yt[0].length),this.matched+=yt[0],xt=this.performAction.call(this,this.yy,this,it,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),xt)return xt;if(this._backtrack){for(var ke in Ht)this[ke]=Ht[ke];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var yt,it,xt,nt;this._more||(this.yytext="",this.match="");for(var Ht=this._currentRules(),ke=0;ke<Ht.length;ke++)if(xt=this._input.match(this.rules[Ht[ke]]),xt&&(!it||xt[0].length>it[0].length)){if(it=xt,nt=ke,this.options.backtrack_lexer){if(yt=this.test_match(xt,Ht[ke]),yt!==!1)return yt;if(this._backtrack){it=!1;continue}else return!1}else if(!this.options.flex)break}return it?(yt=this.test_match(it,Ht[nt]),yt!==!1?yt:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var it=this.next();return it||this.lex()},"lex"),begin:x(function(it){this.conditionStack.push(it)},"begin"),popState:x(function(){var it=this.conditionStack.length-1;return it>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(it){return it=this.conditionStack.length-1-Math.abs(it||0),it>=0?this.conditionStack[it]:"INITIAL"},"topState"),pushState:x(function(it){this.begin(it)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(it,xt,nt,Ht){switch(nt){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),xt.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const ke=/\n\s*/g;return xt.yytext=xt.yytext.replace(ke,"<br/>"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return it.lex.firstGraph()&&this.begin("dir"),12;case 36:return it.lex.firstGraph()&&this.begin("dir"),12;case 37:return it.lex.firstGraph()&&this.begin("dir"),12;case 38:return it.lex.firstGraph()&&this.begin("dir"),12;case 39:return 27;case 40:return 32;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return 98;case 45:return this.popState(),13;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return this.popState(),14;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:return 111;case 64:return 46;case 65:return 60;case 66:return 44;case 67:return 8;case 68:return 106;case 69:return 115;case 70:return this.popState(),77;case 71:return this.pushState("edgeText"),75;case 72:return 119;case 73:return this.popState(),77;case 74:return this.pushState("thickEdgeText"),75;case 75:return 119;case 76:return this.popState(),77;case 77:return this.pushState("dottedEdgeText"),75;case 78:return 119;case 79:return 77;case 80:return this.popState(),53;case 81:return"TEXT";case 82:return this.pushState("ellipseText"),52;case 83:return this.popState(),55;case 84:return this.pushState("text"),54;case 85:return this.popState(),57;case 86:return this.pushState("text"),56;case 87:return 58;case 88:return this.pushState("text"),67;case 89:return this.popState(),64;case 90:return this.pushState("text"),63;case 91:return this.popState(),49;case 92:return this.pushState("text"),48;case 93:return this.popState(),69;case 94:return this.popState(),71;case 95:return 117;case 96:return this.pushState("trapText"),68;case 97:return this.pushState("trapText"),70;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return"SEP";case 102:return 89;case 103:return 115;case 104:return 111;case 105:return 44;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;case 110:return this.pushState("text"),62;case 111:return this.popState(),51;case 112:return this.pushState("text"),50;case 113:return this.popState(),31;case 114:return this.pushState("text"),29;case 115:return this.popState(),66;case 116:return this.pushState("text"),65;case 117:return"TEXT";case 118:return"QUOTE";case 119:return 9;case 120:return 10;case 121:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeData:{rules:[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackargs:{rules:[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackname:{rules:[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},href:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},click:{rules:[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dottedEdgeText:{rules:[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},thickEdgeText:{rules:[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},edgeText:{rules:[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},trapText:{rules:[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],inclusive:!1},ellipseText:{rules:[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},text:{rules:[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],inclusive:!1},vertex:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr:{rules:[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_title:{rules:[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},md_string:{rules:[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},string:{rules:[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],inclusive:!0}}};return Or})();ct.lexer=It;function cr(){this.yy={}}return x(cr,"Parser"),cr.prototype=ct,ct.Parser=cr,new cr})();CP.parser=CP;var ebe=CP,tbe=Object.assign({},ebe);tbe.parse=t=>{const e=t.replace(/}\s*\n/g,`}
`);return ebe.parse(e)};var hyt=tbe,dyt=x((t,e)=>{const r=wz,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return jl(n,i,a,e)},"fade"),fyt=x(t=>`.label {
font-family: ${t.fontFamily};
color: ${t.nodeTextColor||t.textColor};
}
.cluster-label text {
fill: ${t.titleColor};
}
.cluster-label span {
color: ${t.titleColor};
}
.cluster-label span p {
background-color: transparent;
}
.label text,span {
fill: ${t.nodeTextColor||t.textColor};
color: ${t.nodeTextColor||t.textColor};
}
.node rect,
.node circle,
.node ellipse,
.node polygon,
.node path {
fill: ${t.mainBkg};
stroke: ${t.nodeBorder};
stroke-width: ${t.strokeWidth??1}px;
}
.rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {
text-anchor: middle;
}
.node .katex path {
fill: #000;
stroke: #000;
stroke-width: 1px;
}
.rough-node .label,.node .label, .image-shape .label, .icon-shape .label {
text-align: center;
}
.node.clickable {
cursor: pointer;
}
.root .anchor path {
fill: ${t.lineColor} !important;
stroke-width: 0;
stroke: ${t.lineColor};
}
.arrowheadPath {
fill: ${t.arrowheadColor};
}
.edgePath .path {
stroke: ${t.lineColor};
stroke-width: ${t.strokeWidth??2}px;
}
.flowchart-link {
stroke: ${t.lineColor};
fill: none;
}
.edgeLabel {
background-color: ${t.edgeLabelBackground};
p {
background-color: ${t.edgeLabelBackground};
}
rect {
opacity: 0.5;
background-color: ${t.edgeLabelBackground};
fill: ${t.edgeLabelBackground};
}
text-align: center;
}
/* For html labels only */
.labelBkg {
background-color: ${dyt(t.edgeLabelBackground,.5)};
// background-color:
}
.cluster rect {
fill: ${t.clusterBkg};
stroke: ${t.clusterBorder};
stroke-width: 1px;
}
.cluster text {
fill: ${t.titleColor};
}
.cluster span {
color: ${t.titleColor};
}
/* .cluster div {
color: ${t.titleColor};
} */
div.mermaidTooltip {
position: absolute;
text-align: center;
max-width: 200px;
padding: 2px;
font-family: ${t.fontFamily};
font-size: 12px;
background: ${t.tertiaryColor};
border: 1px solid ${t.border2};
border-radius: 2px;
pointer-events: none;
z-index: 100;
}
.flowchartTitleText {
text-anchor: middle;
font-size: 18px;
fill: ${t.textColor};
}
rect.text {
fill: none;
stroke-width: 0;
}
.icon-shape, .image-shape {
background-color: ${t.edgeLabelBackground};
p {
background-color: ${t.edgeLabelBackground};
padding: 2px;
}
.label rect {
opacity: 0.5;
background-color: ${t.edgeLabelBackground};
fill: ${t.edgeLabelBackground};
}
text-align: center;
}
${CS()}
`,"getStyles"),rbe=fyt,vW=x(({defaultLayout:t,styles:e=rbe}={})=>({parser:hyt,get db(){return new oyt},renderer:uyt,styles:e,init:x(r=>{r.flowchart||(r.flowchart={});const n=Zle().layout??t??r.layout;n&&jD({layout:n}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,jD({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),pyt=vW();const bW=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:vW,diagram:pyt},Symbol.toStringTag,{value:"Module"}));var gyt=x(t=>`${rbe(t)}
.swimlane.cluster rect {
stroke: ${t.clusterBorder} !important;
}
[data-look="neo"].cluster rect {
filter: none;
}
`,"getStyles"),myt=gyt,yyt=vW({defaultLayout:"swimlane",styles:myt});const vyt=Object.freeze(Object.defineProperty({__proto__:null,diagram:yyt},Symbol.toStringTag,{value:"Module"}));var kP=(function(){var t=x(function(Re,Ie,Be,ce){for(Be=Be||{},ce=Re.length;ce--;Be[Re[ce]]=Ie);return Be},"o"),e=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],r=[1,10],n=[1,11],i=[1,12],a=[1,13],s=[1,23],o=[1,24],l=[1,25],u=[1,26],h=[1,27],d=[1,19],f=[1,28],p=[1,29],g=[1,20],m=[1,18],y=[1,21],v=[1,22],T=[1,36],b=[1,37],w=[1,38],C=[1,39],S=[1,40],k=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],E=[1,45],_=[1,46],M=[1,55],L=[40,48,50,51,52,71,72],P=[1,66],D=[1,64],R=[1,61],I=[1,65],$=[1,67],O=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],N=[66,67,68,69,70],F=[1,85],z=[1,84],V=[1,82],B=[1,83],G=[6,10,42,47],H=[6,10,13,41,42,47,48,49],q=[1,93],Z=[1,92],Y=[1,91],ie=[19,58],K=[1,102],Q=[1,101],te=[19,58,61,63],J={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:x(function(Ie,Be,ce,oe,be,fe,Pe){var ve=fe.length-1;switch(be){case 1:break;case 2:this.$=[];break;case 3:fe[ve-1].push(fe[ve]),this.$=fe[ve-1];break;case 4:case 5:this.$=fe[ve];break;case 6:case 7:this.$=[];break;case 8:oe.addEntity(fe[ve-4]),oe.addEntity(fe[ve-2]),oe.addRelationship(fe[ve-4],fe[ve],fe[ve-2],fe[ve-3]);break;case 9:oe.addEntity(fe[ve-8]),oe.addEntity(fe[ve-4]),oe.addRelationship(fe[ve-8],fe[ve],fe[ve-4],fe[ve-5]),oe.setClass([fe[ve-8]],fe[ve-6]),oe.setClass([fe[ve-4]],fe[ve-2]);break;case 10:oe.addEntity(fe[ve-6]),oe.addEntity(fe[ve-2]),oe.addRelationship(fe[ve-6],fe[ve],fe[ve-2],fe[ve-3]),oe.setClass([fe[ve-6]],fe[ve-4]);break;case 11:oe.addEntity(fe[ve-6]),oe.addEntity(fe[ve-4]),oe.addRelationship(fe[ve-6],fe[ve],fe[ve-4],fe[ve-5]),oe.setClass([fe[ve-4]],fe[ve-2]);break;case 12:oe.addEntity(fe[ve-3]),oe.addAttributes(fe[ve-3],fe[ve-1]);break;case 13:oe.addEntity(fe[ve-5]),oe.addAttributes(fe[ve-5],fe[ve-1]),oe.setClass([fe[ve-5]],fe[ve-3]);break;case 14:oe.addEntity(fe[ve-2]);break;case 15:oe.addEntity(fe[ve-4]),oe.setClass([fe[ve-4]],fe[ve-2]);break;case 16:oe.addEntity(fe[ve]);break;case 17:oe.addEntity(fe[ve-2]),oe.setClass([fe[ve-2]],fe[ve]);break;case 18:oe.addEntity(fe[ve-6],fe[ve-4]),oe.addAttributes(fe[ve-6],fe[ve-1]);break;case 19:oe.addEntity(fe[ve-8],fe[ve-6]),oe.addAttributes(fe[ve-8],fe[ve-1]),oe.setClass([fe[ve-8]],fe[ve-3]);break;case 20:oe.addEntity(fe[ve-5],fe[ve-3]);break;case 21:oe.addEntity(fe[ve-7],fe[ve-5]),oe.setClass([fe[ve-7]],fe[ve-2]);break;case 22:oe.addEntity(fe[ve-3],fe[ve-1]);break;case 23:oe.addEntity(fe[ve-5],fe[ve-3]),oe.setClass([fe[ve-5]],fe[ve]);break;case 24:case 25:this.$=fe[ve].trim(),oe.setAccTitle(this.$);break;case 26:case 27:this.$=fe[ve].trim(),oe.setAccDescription(this.$);break;case 32:oe.setDirection("TB");break;case 33:oe.setDirection("BT");break;case 34:oe.setDirection("RL");break;case 35:oe.setDirection("LR");break;case 36:this.$=fe[ve-3],oe.addClass(fe[ve-2],fe[ve-1]);break;case 37:case 38:case 59:case 68:this.$=[fe[ve]];break;case 39:case 40:this.$=fe[ve-2].concat([fe[ve]]);break;case 41:this.$=fe[ve-2],oe.setClass(fe[ve-1],fe[ve]);break;case 42:this.$=fe[ve-3],oe.addCssStyles(fe[ve-2],fe[ve-1]);break;case 43:this.$=[fe[ve]];break;case 44:fe[ve-2].push(fe[ve]),this.$=fe[ve-2];break;case 46:this.$=fe[ve-1]+fe[ve];break;case 54:case 80:case 81:this.$=fe[ve].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=fe[ve];break;case 60:fe[ve].push(fe[ve-1]),this.$=fe[ve];break;case 61:this.$={type:fe[ve-1],name:fe[ve]};break;case 62:this.$={type:fe[ve-2],name:fe[ve-1],keys:fe[ve]};break;case 63:this.$={type:fe[ve-2],name:fe[ve-1],comment:fe[ve]};break;case 64:this.$={type:fe[ve-3],name:fe[ve-2],keys:fe[ve-1],comment:fe[ve]};break;case 65:case 67:case 70:this.$=fe[ve];break;case 66:this.$=fe[ve-1]+fe[ve];break;case 69:fe[ve-2].push(fe[ve]),this.$=fe[ve-2];break;case 71:this.$=fe[ve].replace(/"/g,"");break;case 72:this.$={cardA:fe[ve],relType:fe[ve-1],cardB:fe[ve-2]};break;case 73:this.$=oe.Cardinality.ZERO_OR_ONE;break;case 74:this.$=oe.Cardinality.ZERO_OR_MORE;break;case 75:this.$=oe.Cardinality.ONE_OR_MORE;break;case 76:this.$=oe.Cardinality.ONLY_ONE;break;case 77:this.$=oe.Cardinality.MD_PARENT;break;case 78:this.$=oe.Identification.NON_IDENTIFYING;break;case 79:this.$=oe.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:30,11:9,22:r,24:n,26:i,28:a,29:14,30:15,31:16,32:17,33:s,34:o,35:l,36:u,37:h,40:d,43:f,44:p,48:g,50:m,51:y,52:v},t(e,[2,5]),t(e,[2,6]),t(e,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:T,67:b,68:w,69:C,70:S}),{23:[1,41]},{25:[1,42]},{27:[1,43]},t(e,[2,27]),t(e,[2,28]),t(e,[2,29]),t(e,[2,30]),t(e,[2,31]),t(k,[2,54]),t(k,[2,55]),t(k,[2,56]),t(k,[2,57]),t(k,[2,58]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:44,40:E,41:_},{16:47,40:E,41:_},{16:48,40:E,41:_},t(e,[2,4]),{11:49,40:d,48:g,50:m,51:y,52:v},{16:50,40:E,41:_},{18:51,19:[1,52],53:53,54:54,58:M},{11:56,40:d,48:g,50:m,51:y,52:v},{65:57,71:[1,58],72:[1,59]},t(L,[2,73]),t(L,[2,74]),t(L,[2,75]),t(L,[2,76]),t(L,[2,77]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),{13:P,38:60,41:D,42:R,45:62,46:63,48:I,49:$},t(O,[2,37]),t(O,[2,38]),{16:68,40:E,41:_,42:R},{13:P,38:69,41:D,42:R,45:62,46:63,48:I,49:$},{13:[1,70],15:[1,71]},t(e,[2,17],{64:35,12:72,17:[1,73],42:R,66:T,67:b,68:w,69:C,70:S}),{19:[1,74]},t(e,[2,14]),{18:75,19:[2,59],53:53,54:54,58:M},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:T,67:b,68:w,69:C,70:S},t(N,[2,78]),t(N,[2,79]),{6:F,10:z,39:81,42:V,47:B},{40:[1,86],41:[1,87]},t(G,[2,43],{46:88,13:P,41:D,48:I,49:$}),t(H,[2,45]),t(H,[2,50]),t(H,[2,51]),t(H,[2,52]),t(H,[2,53]),t(e,[2,41],{42:R}),{6:F,10:z,39:89,42:V,47:B},{14:90,40:q,50:Z,73:Y},{16:94,40:E,41:_},{11:95,40:d,48:g,50:m,51:y,52:v},{18:96,19:[1,97],53:53,54:54,58:M},t(e,[2,12]),{19:[2,60]},t(ie,[2,61],{56:98,57:99,60:100,62:K,63:Q}),t([19,58,62,63],[2,67]),{58:[2,66]},t(e,[2,22],{15:[1,104],17:[1,103]}),t([40,48,50,51,52],[2,72]),t(e,[2,36]),{13:P,41:D,45:105,46:63,48:I,49:$},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(O,[2,39]),t(O,[2,40]),t(H,[2,46]),t(e,[2,42]),t(e,[2,8]),t(e,[2,80]),t(e,[2,81]),t(e,[2,82]),{13:[1,106],42:R},{13:[1,108],15:[1,107]},{19:[1,109]},t(e,[2,15]),t(ie,[2,62],{57:110,61:[1,111],63:Q}),t(ie,[2,63]),t(te,[2,68]),t(ie,[2,71]),t(te,[2,70]),{18:112,19:[1,113],53:53,54:54,58:M},{16:114,40:E,41:_},t(G,[2,44],{46:88,13:P,41:D,48:I,49:$}),{14:115,40:q,50:Z,73:Y},{16:116,40:E,41:_},{14:117,40:q,50:Z,73:Y},t(e,[2,13]),t(ie,[2,64]),{60:118,62:K},{19:[1,119]},t(e,[2,20]),t(e,[2,23],{17:[1,120],42:R}),t(e,[2,11]),{13:[1,121],42:R},t(e,[2,10]),t(te,[2,69]),t(e,[2,18]),{18:122,19:[1,123],53:53,54:54,58:M},{14:124,40:q,50:Z,73:Y},{19:[1,125]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:x(function(Ie,Be){if(Be.recoverable)this.trace(Ie);else{var ce=new Error(Ie);throw ce.hash=Be,ce}},"parseError"),parse:x(function(Ie){var Be=this,ce=[0],oe=[],be=[null],fe=[],Pe=this.table,ve="",Ce=0,Ve=0,se=2,de=1,Te=fe.slice.call(arguments,1),ae=Object.create(this.lexer),he={yy:{}};for(var W in this.yy)Object.prototype.hasOwnProperty.call(this.yy,W)&&(he.yy[W]=this.yy[W]);ae.setInput(Ie,he.yy),he.yy.lexer=ae,he.yy.parser=this,typeof ae.yylloc>"u"&&(ae.yylloc={});var ne=ae.yylloc;fe.push(ne);var j=ae.options&&ae.options.ranges;typeof he.yy.parseError=="function"?this.parseError=he.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(at){ce.length=ce.length-2*at,be.length=be.length-at,fe.length=fe.length-at}x(ue,"popStack");function X(){var at;return at=oe.pop()||ae.lex()||de,typeof at!="number"&&(at instanceof Array&&(oe=at,at=oe.pop()),at=Be.symbols_[at]||at),at}x(X,"lex");for(var Oe,xe,Ge,_e,$e={},Me,He,De,Ke;;){if(xe=ce[ce.length-1],this.defaultActions[xe]?Ge=this.defaultActions[xe]:((Oe===null||typeof Oe>"u")&&(Oe=X()),Ge=Pe[xe]&&Pe[xe][Oe]),typeof Ge>"u"||!Ge.length||!Ge[0]){var Ae="";Ke=[];for(Me in Pe[xe])this.terminals_[Me]&&Me>se&&Ke.push("'"+this.terminals_[Me]+"'");ae.showPosition?Ae="Parse error on line "+(Ce+1)+`:
`+ae.showPosition()+`
Expecting `+Ke.join(", ")+", got '"+(this.terminals_[Oe]||Oe)+"'":Ae="Parse error on line "+(Ce+1)+": Unexpected "+(Oe==de?"end of input":"'"+(this.terminals_[Oe]||Oe)+"'"),this.parseError(Ae,{text:ae.match,token:this.terminals_[Oe]||Oe,line:ae.yylineno,loc:ne,expected:Ke})}if(Ge[0]instanceof Array&&Ge.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xe+", token: "+Oe);switch(Ge[0]){case 1:ce.push(Oe),be.push(ae.yytext),fe.push(ae.yylloc),ce.push(Ge[1]),Oe=null,Ve=ae.yyleng,ve=ae.yytext,Ce=ae.yylineno,ne=ae.yylloc;break;case 2:if(He=this.productions_[Ge[1]][1],$e.$=be[be.length-He],$e._$={first_line:fe[fe.length-(He||1)].first_line,last_line:fe[fe.length-1].last_line,first_column:fe[fe.length-(He||1)].first_column,last_column:fe[fe.length-1].last_column},j&&($e._$.range=[fe[fe.length-(He||1)].range[0],fe[fe.length-1].range[1]]),_e=this.performAction.apply($e,[ve,Ve,Ce,he.yy,Ge[1],be,fe].concat(Te)),typeof _e<"u")return _e;He&&(ce=ce.slice(0,-1*He*2),be=be.slice(0,-1*He),fe=fe.slice(0,-1*He)),ce.push(this.productions_[Ge[1]][0]),be.push($e.$),fe.push($e._$),De=Pe[ce[ce.length-2]][ce[ce.length-1]],ce.push(De);break;case 3:return!0}}return!0},"parse")},ge=(function(){var Re={EOF:1,parseError:x(function(Be,ce){if(this.yy.parser)this.yy.parser.parseError(Be,ce);else throw new Error(Be)},"parseError"),setInput:x(function(Ie,Be){return this.yy=Be||this.yy||{},this._input=Ie,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Ie=this._input[0];this.yytext+=Ie,this.yyleng++,this.offset++,this.match+=Ie,this.matched+=Ie;var Be=Ie.match(/(?:\r\n?|\n).*/g);return Be?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Ie},"input"),unput:x(function(Ie){var Be=Ie.length,ce=Ie.split(/(?:\r\n?|\n)/g);this._input=Ie+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Be),this.offset-=Be;var oe=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),ce.length-1&&(this.yylineno-=ce.length-1);var be=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:ce?(ce.length===oe.length?this.yylloc.first_column:0)+oe[oe.length-ce.length].length-ce[0].length:this.yylloc.first_column-Be},this.options.ranges&&(this.yylloc.range=[be[0],be[0]+this.yyleng-Be]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Ie){this.unput(this.match.slice(Ie))},"less"),pastInput:x(function(){var Ie=this.matched.substr(0,this.matched.length-this.match.length);return(Ie.length>20?"...":"")+Ie.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Ie=this.match;return Ie.length<20&&(Ie+=this._input.substr(0,20-Ie.length)),(Ie.substr(0,20)+(Ie.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Ie=this.pastInput(),Be=new Array(Ie.length+1).join("-");return Ie+this.upcomingInput()+`
`+Be+"^"},"showPosition"),test_match:x(function(Ie,Be){var ce,oe,be;if(this.options.backtrack_lexer&&(be={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(be.yylloc.range=this.yylloc.range.slice(0))),oe=Ie[0].match(/(?:\r\n?|\n).*/g),oe&&(this.yylineno+=oe.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:oe?oe[oe.length-1].length-oe[oe.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Ie[0].length},this.yytext+=Ie[0],this.match+=Ie[0],this.matches=Ie,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Ie[0].length),this.matched+=Ie[0],ce=this.performAction.call(this,this.yy,this,Be,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ce)return ce;if(this._backtrack){for(var fe in be)this[fe]=be[fe];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Ie,Be,ce,oe;this._more||(this.yytext="",this.match="");for(var be=this._currentRules(),fe=0;fe<be.length;fe++)if(ce=this._input.match(this.rules[be[fe]]),ce&&(!Be||ce[0].length>Be[0].length)){if(Be=ce,oe=fe,this.options.backtrack_lexer){if(Ie=this.test_match(ce,be[fe]),Ie!==!1)return Ie;if(this._backtrack){Be=!1;continue}else return!1}else if(!this.options.flex)break}return Be?(Ie=this.test_match(Be,be[oe]),Ie!==!1?Ie:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Be=this.next();return Be||this.lex()},"lex"),begin:x(function(Be){this.conditionStack.push(Be)},"begin"),popState:x(function(){var Be=this.conditionStack.length-1;return Be>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Be){return Be=this.conditionStack.length-1-Math.abs(Be||0),Be>=0?this.conditionStack[Be]:"INITIAL"},"topState"),pushState:x(function(Be){this.begin(Be)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(Be,ce,oe,be){switch(oe){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 73;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 62;case 25:return 58;case 26:return 58;case 27:this.begin("block_bq");break;case 28:return 58;case 29:this.popState();break;case 30:return 63;case 31:break;case 32:return this.popState(),19;case 33:return ce.yytext[0];case 34:return 20;case 35:return 21;case 36:return this.begin("style"),44;case 37:return this.popState(),10;case 38:break;case 39:return 13;case 40:return 42;case 41:return 49;case 42:return this.begin("style"),37;case 43:return 43;case 44:return 66;case 45:return 68;case 46:return 68;case 47:return 68;case 48:return 66;case 49:return 66;case 50:return 67;case 51:return 67;case 52:return 67;case 53:return 67;case 54:return 67;case 55:return 68;case 56:return 67;case 57:return 68;case 58:return 69;case 59:return 69;case 60:return 51;case 61:return 69;case 62:return 69;case 63:return 69;case 64:return 52;case 65:return 48;case 66:return 69;case 67:return 66;case 68:return 67;case 69:return 68;case 70:return 70;case 71:return 71;case 72:return 72;case 73:return 72;case 74:return 71;case 75:return 71;case 76:return 71;case 77:return 41;case 78:return 47;case 79:return 40;case 80:return ce.yytext[0];case 81:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[37,38,39,40,41,77,78],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[28,29],inclusive:!1},block:{rules:[23,24,25,26,27,30,31,32,33],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,34,35,36,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81],inclusive:!0}}};return Re})();J.lexer=ge;function ee(){this.yy={}}return x(ee,"Parser"),ee.prototype=J,J.Parser=ee,new ee})();kP.parser=kP;var byt=kP,Xy,xyt=(Xy=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Hn,this.getAccTitle=ni,this.setAccDescription=ii,this.getAccDescription=ai,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.getConfig=x(()=>Fe().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(e,r=""){var n;return this.entities.has(e)?!((n=this.entities.get(e))!=null&&n.alias)&&r&&(this.entities.get(e).alias=r,le.info(`Add alias '${r}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:r,shape:"erBox",look:Fe().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),le.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,r){const n=this.addEntity(e);let i;for(i=r.length-1;i>=0;i--)r[i].keys||(r[i].keys=[]),r[i].comment||(r[i].comment=""),n.attributes.push(r[i]),le.debug("Added attribute ",r[i].name)}addRelationship(e,r,n,i){const a=this.entities.get(e),s=this.entities.get(n);if(!a||!s)return;const o={entityA:a.id,roleA:r,entityB:s.id,relSpec:i};this.relationships.push(o),le.debug("Added new relationship :",o)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let r=[];for(const n of e){const i=this.classes.get(n);i!=null&&i.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i!=null&&i.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}addCssStyles(e,r){for(const n of e){const i=this.entities.get(n);if(!r||!i)return;for(const a of r)i.cssStyles.push(a)}}addClass(e,r){e.forEach(n=>{let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)})})}setClass(e,r){for(const n of e){const i=this.entities.get(n);if(i)for(const a of r)i.cssClasses+=" "+a}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],On()}getData(){const e=[],r=[],n=Fe();let i=0;for(const s of this.entities.keys()){const o=this.entities.get(s);o&&(o.cssCompiledStyles=this.getCompiledStyles(o.cssClasses.split(" ")),o.colorIndex=i++,e.push(o))}let a=0;for(const s of this.relationships){const o={id:dy(s.entityA,s.entityB,{prefix:"id",counter:a++}),type:"normal",curve:"basis",start:s.entityA,end:s.entityB,label:s.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:s.relSpec.cardB.toLowerCase(),arrowTypeEnd:s.relSpec.cardA.toLowerCase(),pattern:s.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:n.look,labelType:"markdown"};r.push(o)}return{nodes:e,edges:r,other:{},config:n,direction:"TB"}}},x(Xy,"ErDB"),Xy),nbe={};Z6(nbe,{draw:()=>Tyt});var Tyt=x(async function(t,e,r,n){le.info("REF0:"),le.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:a,layout:s}=Fe(),o=n.db.getData(),l=Ox(e,i);o.type=n.type,o.layoutAlgorithm=nS(s),o.config.flowchart.nodeSpacing=(a==null?void 0:a.nodeSpacing)||140,o.config.flowchart.rankSpacing=(a==null?void 0:a.rankSpacing)||80,o.direction=n.db.getDirection();const{config:u}=o,{look:h}=u;h==="neo"?o.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:o.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],o.diagramId=e,await xx(o,l),o.layoutAlgorithm==="elk"&&l.select(".edges").lower();const d=l.selectAll('[id*="-background"]');Array.from(d).length>0&&d.each(function(){const p=ut(this),m=p.attr("id").replace("-background",""),y=l.select(`#${CSS.escape(m)}`);if(!y.empty()){const v=y.attr("transform");p.attr("transform",v)}});const f=8;yr.insertTitle(l,"erDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),mg(l,f,"erDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),_te=x((t,e)=>{const r=wz,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return jl(n,i,a,e)},"fade"),T3=new Set(["redux-color","redux-dark-color"]),wyt=x(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!T3.has(e))return"";const a=(n==null?void 0:n.length)>0;let s="";for(let o=0;o<t.THEME_COLOR_LIMIT;o++)s+=`
[data-look="${r}"][data-color-id="color-${o}"].node path {
stroke: ${i[o]};
${a?`fill: ${n[o]};`:""}
}
[data-look="${r}"][data-color-id="color-${o}"].node rect {
stroke: ${i[o]};
${a?`fill: ${n[o]};`:""}
}
`;return s},"genColor"),Cyt=x(t=>{const{look:e,theme:r,erEdgeLabelBackground:n,strokeWidth:i}=t;return`
${wyt(t)}
.entityBox {
fill: ${t.mainBkg};
stroke: ${t.nodeBorder};
}
.relationshipLabelBox {
fill: ${t.tertiaryColor};
opacity: 0.7;
background-color: ${t.tertiaryColor};
rect {
opacity: 0.5;
}
}
.labelBkg {
background-color: ${T3.has(r)&&n?n:_te(t.tertiaryColor,.5)};
}
.edgeLabel {
background-color: ${T3.has(r)&&n?n:t.edgeLabelBackground};
}
.edgeLabel .label rect {
fill: ${T3.has(r)&&n?n:t.edgeLabelBackground};
}
.edgeLabel .label text {
fill: ${t.textColor};
}
.edgeLabel .label {
fill: ${t.nodeBorder};
font-size: 14px;
}
.label {
font-family: ${t.fontFamily};
color: ${t.nodeTextColor||t.textColor};
}
.edge-pattern-dashed {
stroke-dasharray: 8,8;
}
.node rect,
.node circle,
.node ellipse,
.node polygon
{
fill: ${t.mainBkg};
stroke: ${t.nodeBorder};
stroke-width: ${e==="neo"?i:"1px"};
}
.relationshipLine {
stroke: ${t.lineColor};
stroke-width: ${e==="neo"?i:"1px"};
fill: none;
}
.marker {
fill: none !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
[data-look=neo].labelBkg {
background-color: ${_te(t.tertiaryColor,.5)};
}
`},"getStyles"),kyt=Cyt,Syt={parser:byt,get db(){return new xyt},renderer:nbe,styles:kyt};const Eyt=Object.freeze(Object.defineProperty({__proto__:null,diagram:Syt},Symbol.toStringTag,{value:"Module"}));var jy,xW=(jy=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},x(jy,"ImperativeState"),jy);function eo(t,e){var r,n,i;t.accDescr&&((r=e.setAccDescription)==null||r.call(e,t.accDescr)),t.accTitle&&((n=e.setAccTitle)==null||n.call(e,t.accTitle)),t.title&&((i=e.setDiagramTitle)==null||i.call(e,t.title))}x(eo,"populateCommonDb");var Ayt=Object.create,kS=Object.defineProperty,_yt=Object.getOwnPropertyDescriptor,TW=Object.getOwnPropertyNames,Ryt=Object.getPrototypeOf,Lyt=Object.prototype.hasOwnProperty,A=(t,e)=>kS(t,"name",{value:e,configurable:!0}),Myt=(t,e)=>function(){return t&&(e=(0,t[TW(t)[0]])(t=0)),e},Nr=(t,e)=>function(){return e||(0,t[TW(t)[0]])((e={exports:{}}).exports,e),e.exports},Df=(t,e)=>{for(var r in e)kS(t,r,{get:e[r],enumerable:!0})},wW=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of TW(e))!Lyt.call(t,i)&&i!==r&&kS(t,i,{get:()=>e[i],enumerable:!(n=_yt(e,i))||n.enumerable});return t},TL=(t,e,r)=>(wW(t,e,"default"),r),CW=(t,e,r)=>(r=t!=null?Ayt(Ryt(t)):{},wW(kS(r,"default",{value:t,enumerable:!0}),t)),kW=t=>wW(kS({},"__esModule",{value:!0}),t),wL={};Df(wL,{AnnotatedTextEdit:()=>Fu,ChangeAnnotation:()=>dp,ChangeAnnotationIdentifier:()=>Ba,CodeAction:()=>i9,CodeActionContext:()=>n9,CodeActionKind:()=>r9,CodeActionTriggerKind:()=>lw,CodeDescription:()=>DP,CodeLens:()=>a9,Color:()=>C3,ColorInformation:()=>_P,ColorPresentation:()=>RP,Command:()=>hp,CompletionItem:()=>HP,CompletionItemKind:()=>BP,CompletionItemLabelDetails:()=>WP,CompletionItemTag:()=>zP,CompletionList:()=>qP,CreateFile:()=>wm,DeleteFile:()=>km,Diagnostic:()=>iw,DiagnosticRelatedInformation:()=>k3,DiagnosticSeverity:()=>IP,DiagnosticTag:()=>NP,DocumentHighlight:()=>KP,DocumentHighlightKind:()=>jP,DocumentLink:()=>o9,DocumentSymbol:()=>t9,DocumentUri:()=>SP,EOL:()=>abe,FoldingRange:()=>MP,FoldingRangeKind:()=>LP,FormattingOptions:()=>s9,Hover:()=>UP,InlayHint:()=>m9,InlayHintKind:()=>A3,InlayHintLabelPart:()=>_3,InlineCompletionContext:()=>w9,InlineCompletionItem:()=>v9,InlineCompletionList:()=>b9,InlineCompletionTriggerKind:()=>x9,InlineValueContext:()=>g9,InlineValueEvaluatableExpression:()=>p9,InlineValueText:()=>d9,InlineValueVariableLookup:()=>f9,InsertReplaceEdit:()=>VP,InsertTextFormat:()=>FP,InsertTextMode:()=>GP,Location:()=>nw,LocationLink:()=>AP,MarkedString:()=>ow,MarkupContent:()=>Sm,MarkupKind:()=>E3,OptionalVersionedTextDocumentIdentifier:()=>sw,ParameterInformation:()=>YP,Position:()=>mn,Range:()=>jr,RenameFile:()=>Cm,SelectedCompletionInfo:()=>T9,SelectionRange:()=>l9,SemanticTokenModifiers:()=>u9,SemanticTokenTypes:()=>c9,SemanticTokens:()=>h9,SignatureInformation:()=>XP,StringValue:()=>y9,SymbolInformation:()=>JP,SymbolKind:()=>ZP,SymbolTag:()=>QP,TextDocument:()=>k9,TextDocumentEdit:()=>aw,TextDocumentIdentifier:()=>OP,TextDocumentItem:()=>PP,TextEdit:()=>kc,URI:()=>w3,VersionedTextDocumentIdentifier:()=>$P,WorkspaceChange:()=>ibe,WorkspaceEdit:()=>S3,WorkspaceFolder:()=>C9,WorkspaceSymbol:()=>e9,integer:()=>EP,uinteger:()=>rw});var SP,w3,EP,rw,mn,jr,nw,AP,C3,_P,RP,LP,MP,k3,IP,NP,DP,iw,hp,kc,dp,Ba,Fu,aw,wm,Cm,km,S3,xT,lN,ibe,OP,$P,sw,PP,E3,Sm,BP,FP,zP,VP,GP,WP,HP,qP,ow,UP,YP,XP,jP,KP,ZP,QP,JP,e9,t9,r9,lw,n9,i9,a9,s9,o9,l9,c9,u9,h9,d9,f9,p9,g9,A3,_3,m9,y9,v9,b9,x9,T9,w9,C9,abe,k9,Rte,Ze,SS=Myt({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(i){function a(s){return typeof s=="string"}A(a,"is"),i.is=a})(SP||(SP={})),(function(i){function a(s){return typeof s=="string"}A(a,"is"),i.is=a})(w3||(w3={})),(function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}A(a,"is"),i.is=a})(EP||(EP={})),(function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function a(s){return typeof s=="number"&&i.MIN_VALUE<=s&&s<=i.MAX_VALUE}A(a,"is"),i.is=a})(rw||(rw={})),(function(i){function a(o,l){return o===Number.MAX_VALUE&&(o=rw.MAX_VALUE),l===Number.MAX_VALUE&&(l=rw.MAX_VALUE),{line:o,character:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.objectLiteral(l)&&Ze.uinteger(l.line)&&Ze.uinteger(l.character)}A(s,"is"),i.is=s})(mn||(mn={})),(function(i){function a(o,l,u,h){if(Ze.uinteger(o)&&Ze.uinteger(l)&&Ze.uinteger(u)&&Ze.uinteger(h))return{start:mn.create(o,l),end:mn.create(u,h)};if(mn.is(o)&&mn.is(l))return{start:o,end:l};throw new Error(`Range#create called with invalid arguments[${o}, ${l}, ${u}, ${h}]`)}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.objectLiteral(l)&&mn.is(l.start)&&mn.is(l.end)}A(s,"is"),i.is=s})(jr||(jr={})),(function(i){function a(o,l){return{uri:o,range:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.objectLiteral(l)&&jr.is(l.range)&&(Ze.string(l.uri)||Ze.undefined(l.uri))}A(s,"is"),i.is=s})(nw||(nw={})),(function(i){function a(o,l,u,h){return{targetUri:o,targetRange:l,targetSelectionRange:u,originSelectionRange:h}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.objectLiteral(l)&&jr.is(l.targetRange)&&Ze.string(l.targetUri)&&jr.is(l.targetSelectionRange)&&(jr.is(l.originSelectionRange)||Ze.undefined(l.originSelectionRange))}A(s,"is"),i.is=s})(AP||(AP={})),(function(i){function a(o,l,u,h){return{red:o,green:l,blue:u,alpha:h}}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&Ze.numberRange(l.red,0,1)&&Ze.numberRange(l.green,0,1)&&Ze.numberRange(l.blue,0,1)&&Ze.numberRange(l.alpha,0,1)}A(s,"is"),i.is=s})(C3||(C3={})),(function(i){function a(o,l){return{range:o,color:l}}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&jr.is(l.range)&&C3.is(l.color)}A(s,"is"),i.is=s})(_P||(_P={})),(function(i){function a(o,l,u){return{label:o,textEdit:l,additionalTextEdits:u}}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&Ze.string(l.label)&&(Ze.undefined(l.textEdit)||kc.is(l))&&(Ze.undefined(l.additionalTextEdits)||Ze.typedArray(l.additionalTextEdits,kc.is))}A(s,"is"),i.is=s})(RP||(RP={})),(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(LP||(LP={})),(function(i){function a(o,l,u,h,d,f){const p={startLine:o,endLine:l};return Ze.defined(u)&&(p.startCharacter=u),Ze.defined(h)&&(p.endCharacter=h),Ze.defined(d)&&(p.kind=d),Ze.defined(f)&&(p.collapsedText=f),p}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&Ze.uinteger(l.startLine)&&Ze.uinteger(l.startLine)&&(Ze.undefined(l.startCharacter)||Ze.uinteger(l.startCharacter))&&(Ze.undefined(l.endCharacter)||Ze.uinteger(l.endCharacter))&&(Ze.undefined(l.kind)||Ze.string(l.kind))}A(s,"is"),i.is=s})(MP||(MP={})),(function(i){function a(o,l){return{location:o,message:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&nw.is(l.location)&&Ze.string(l.message)}A(s,"is"),i.is=s})(k3||(k3={})),(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(IP||(IP={})),(function(i){i.Unnecessary=1,i.Deprecated=2})(NP||(NP={})),(function(i){function a(s){const o=s;return Ze.objectLiteral(o)&&Ze.string(o.href)}A(a,"is"),i.is=a})(DP||(DP={})),(function(i){function a(o,l,u,h,d,f){let p={range:o,message:l};return Ze.defined(u)&&(p.severity=u),Ze.defined(h)&&(p.code=h),Ze.defined(d)&&(p.source=d),Ze.defined(f)&&(p.relatedInformation=f),p}A(a,"create"),i.create=a;function s(o){var l;let u=o;return Ze.defined(u)&&jr.is(u.range)&&Ze.string(u.message)&&(Ze.number(u.severity)||Ze.undefined(u.severity))&&(Ze.integer(u.code)||Ze.string(u.code)||Ze.undefined(u.code))&&(Ze.undefined(u.codeDescription)||Ze.string((l=u.codeDescription)===null||l===void 0?void 0:l.href))&&(Ze.string(u.source)||Ze.undefined(u.source))&&(Ze.undefined(u.relatedInformation)||Ze.typedArray(u.relatedInformation,k3.is))}A(s,"is"),i.is=s})(iw||(iw={})),(function(i){function a(o,l,...u){let h={title:o,command:l};return Ze.defined(u)&&u.length>0&&(h.arguments=u),h}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.string(l.title)&&Ze.string(l.command)}A(s,"is"),i.is=s})(hp||(hp={})),(function(i){function a(u,h){return{range:u,newText:h}}A(a,"replace"),i.replace=a;function s(u,h){return{range:{start:u,end:u},newText:h}}A(s,"insert"),i.insert=s;function o(u){return{range:u,newText:""}}A(o,"del"),i.del=o;function l(u){const h=u;return Ze.objectLiteral(h)&&Ze.string(h.newText)&&jr.is(h.range)}A(l,"is"),i.is=l})(kc||(kc={})),(function(i){function a(o,l,u){const h={label:o};return l!==void 0&&(h.needsConfirmation=l),u!==void 0&&(h.description=u),h}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&Ze.string(l.label)&&(Ze.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(Ze.string(l.description)||l.description===void 0)}A(s,"is"),i.is=s})(dp||(dp={})),(function(i){function a(s){const o=s;return Ze.string(o)}A(a,"is"),i.is=a})(Ba||(Ba={})),(function(i){function a(u,h,d){return{range:u,newText:h,annotationId:d}}A(a,"replace"),i.replace=a;function s(u,h,d){return{range:{start:u,end:u},newText:h,annotationId:d}}A(s,"insert"),i.insert=s;function o(u,h){return{range:u,newText:"",annotationId:h}}A(o,"del"),i.del=o;function l(u){const h=u;return kc.is(h)&&(dp.is(h.annotationId)||Ba.is(h.annotationId))}A(l,"is"),i.is=l})(Fu||(Fu={})),(function(i){function a(o,l){return{textDocument:o,edits:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&sw.is(l.textDocument)&&Array.isArray(l.edits)}A(s,"is"),i.is=s})(aw||(aw={})),(function(i){function a(o,l,u){let h={kind:"create",uri:o};return l!==void 0&&(l.overwrite!==void 0||l.ignoreIfExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}A(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="create"&&Ze.string(l.uri)&&(l.options===void 0||(l.options.overwrite===void 0||Ze.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||Ze.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||Ba.is(l.annotationId))}A(s,"is"),i.is=s})(wm||(wm={})),(function(i){function a(o,l,u,h){let d={kind:"rename",oldUri:o,newUri:l};return u!==void 0&&(u.overwrite!==void 0||u.ignoreIfExists!==void 0)&&(d.options=u),h!==void 0&&(d.annotationId=h),d}A(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="rename"&&Ze.string(l.oldUri)&&Ze.string(l.newUri)&&(l.options===void 0||(l.options.overwrite===void 0||Ze.boolean(l.options.overwrite))&&(l.options.ignoreIfExists===void 0||Ze.boolean(l.options.ignoreIfExists)))&&(l.annotationId===void 0||Ba.is(l.annotationId))}A(s,"is"),i.is=s})(Cm||(Cm={})),(function(i){function a(o,l,u){let h={kind:"delete",uri:o};return l!==void 0&&(l.recursive!==void 0||l.ignoreIfNotExists!==void 0)&&(h.options=l),u!==void 0&&(h.annotationId=u),h}A(a,"create"),i.create=a;function s(o){let l=o;return l&&l.kind==="delete"&&Ze.string(l.uri)&&(l.options===void 0||(l.options.recursive===void 0||Ze.boolean(l.options.recursive))&&(l.options.ignoreIfNotExists===void 0||Ze.boolean(l.options.ignoreIfNotExists)))&&(l.annotationId===void 0||Ba.is(l.annotationId))}A(s,"is"),i.is=s})(km||(km={})),(function(i){function a(s){let o=s;return o&&(o.changes!==void 0||o.documentChanges!==void 0)&&(o.documentChanges===void 0||o.documentChanges.every(l=>Ze.string(l.kind)?wm.is(l)||Cm.is(l)||km.is(l):aw.is(l)))}A(a,"is"),i.is=a})(S3||(S3={})),xT=(t=class{constructor(a,s){this.edits=a,this.changeAnnotations=s}insert(a,s,o){let l,u;if(o===void 0?l=kc.insert(a,s):Ba.is(o)?(u=o,l=Fu.insert(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=Fu.insert(a,s,u)),this.edits.push(l),u!==void 0)return u}replace(a,s,o){let l,u;if(o===void 0?l=kc.replace(a,s):Ba.is(o)?(u=o,l=Fu.replace(a,s,o)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(o),l=Fu.replace(a,s,u)),this.edits.push(l),u!==void 0)return u}delete(a,s){let o,l;if(s===void 0?o=kc.del(a):Ba.is(s)?(l=s,o=Fu.del(a,s)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(s),o=Fu.del(a,l)),this.edits.push(o),l!==void 0)return l}add(a){this.edits.push(a)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(a){if(a===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},A(t,"TextEditChangeImpl"),t),lN=(e=class{constructor(a){this._annotations=a===void 0?Object.create(null):a,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(a,s){let o;if(Ba.is(a)?o=a:(o=this.nextId(),s=a),this._annotations[o]!==void 0)throw new Error(`Id ${o} is already in use.`);if(s===void 0)throw new Error(`No annotation provided for id ${o}`);return this._annotations[o]=s,this._size++,o}nextId(){return this._counter++,this._counter.toString()}},A(e,"ChangeAnnotations"),e),ibe=(r=class{constructor(a){this._textEditChanges=Object.create(null),a!==void 0?(this._workspaceEdit=a,a.documentChanges?(this._changeAnnotations=new lN(a.changeAnnotations),a.changeAnnotations=this._changeAnnotations.all(),a.documentChanges.forEach(s=>{if(aw.is(s)){const o=new xT(s.edits,this._changeAnnotations);this._textEditChanges[s.textDocument.uri]=o}})):a.changes&&Object.keys(a.changes).forEach(s=>{const o=new xT(a.changes[s]);this._textEditChanges[s]=o})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(a){if(sw.is(a)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const s={uri:a.uri,version:a.version};let o=this._textEditChanges[s.uri];if(!o){const l=[],u={textDocument:s,edits:l};this._workspaceEdit.documentChanges.push(u),o=new xT(l,this._changeAnnotations),this._textEditChanges[s.uri]=o}return o}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let s=this._textEditChanges[a];if(!s){let o=[];this._workspaceEdit.changes[a]=o,s=new xT(o),this._textEditChanges[a]=s}return s}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new lN,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;dp.is(s)||Ba.is(s)?l=s:o=s;let u,h;if(l===void 0?u=wm.create(a,o):(h=Ba.is(l)?l:this._changeAnnotations.manage(l),u=wm.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}renameFile(a,s,o,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let u;dp.is(o)||Ba.is(o)?u=o:l=o;let h,d;if(u===void 0?h=Cm.create(a,s,l):(d=Ba.is(u)?u:this._changeAnnotations.manage(u),h=Cm.create(a,s,l,d)),this._workspaceEdit.documentChanges.push(h),d!==void 0)return d}deleteFile(a,s,o){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;dp.is(s)||Ba.is(s)?l=s:o=s;let u,h;if(l===void 0?u=km.create(a,o):(h=Ba.is(l)?l:this._changeAnnotations.manage(l),u=km.create(a,o,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}},A(r,"WorkspaceChange"),r),(function(i){function a(o){return{uri:o}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.string(l.uri)}A(s,"is"),i.is=s})(OP||(OP={})),(function(i){function a(o,l){return{uri:o,version:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.string(l.uri)&&Ze.integer(l.version)}A(s,"is"),i.is=s})($P||($P={})),(function(i){function a(o,l){return{uri:o,version:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.string(l.uri)&&(l.version===null||Ze.integer(l.version))}A(s,"is"),i.is=s})(sw||(sw={})),(function(i){function a(o,l,u,h){return{uri:o,languageId:l,version:u,text:h}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.string(l.uri)&&Ze.string(l.languageId)&&Ze.integer(l.version)&&Ze.string(l.text)}A(s,"is"),i.is=s})(PP||(PP={})),(function(i){i.PlainText="plaintext",i.Markdown="markdown";function a(s){const o=s;return o===i.PlainText||o===i.Markdown}A(a,"is"),i.is=a})(E3||(E3={})),(function(i){function a(s){const o=s;return Ze.objectLiteral(s)&&E3.is(o.kind)&&Ze.string(o.value)}A(a,"is"),i.is=a})(Sm||(Sm={})),(function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25})(BP||(BP={})),(function(i){i.PlainText=1,i.Snippet=2})(FP||(FP={})),(function(i){i.Deprecated=1})(zP||(zP={})),(function(i){function a(o,l,u){return{newText:o,insert:l,replace:u}}A(a,"create"),i.create=a;function s(o){const l=o;return l&&Ze.string(l.newText)&&jr.is(l.insert)&&jr.is(l.replace)}A(s,"is"),i.is=s})(VP||(VP={})),(function(i){i.asIs=1,i.adjustIndentation=2})(GP||(GP={})),(function(i){function a(s){const o=s;return o&&(Ze.string(o.detail)||o.detail===void 0)&&(Ze.string(o.description)||o.description===void 0)}A(a,"is"),i.is=a})(WP||(WP={})),(function(i){function a(s){return{label:s}}A(a,"create"),i.create=a})(HP||(HP={})),(function(i){function a(s,o){return{items:s||[],isIncomplete:!!o}}A(a,"create"),i.create=a})(qP||(qP={})),(function(i){function a(o){return o.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}A(a,"fromPlainText"),i.fromPlainText=a;function s(o){const l=o;return Ze.string(l)||Ze.objectLiteral(l)&&Ze.string(l.language)&&Ze.string(l.value)}A(s,"is"),i.is=s})(ow||(ow={})),(function(i){function a(s){let o=s;return!!o&&Ze.objectLiteral(o)&&(Sm.is(o.contents)||ow.is(o.contents)||Ze.typedArray(o.contents,ow.is))&&(s.range===void 0||jr.is(s.range))}A(a,"is"),i.is=a})(UP||(UP={})),(function(i){function a(s,o){return o?{label:s,documentation:o}:{label:s}}A(a,"create"),i.create=a})(YP||(YP={})),(function(i){function a(s,o,...l){let u={label:s};return Ze.defined(o)&&(u.documentation=o),Ze.defined(l)?u.parameters=l:u.parameters=[],u}A(a,"create"),i.create=a})(XP||(XP={})),(function(i){i.Text=1,i.Read=2,i.Write=3})(jP||(jP={})),(function(i){function a(s,o){let l={range:s};return Ze.number(o)&&(l.kind=o),l}A(a,"create"),i.create=a})(KP||(KP={})),(function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26})(ZP||(ZP={})),(function(i){i.Deprecated=1})(QP||(QP={})),(function(i){function a(s,o,l,u,h){let d={name:s,kind:o,location:{uri:u,range:l}};return h&&(d.containerName=h),d}A(a,"create"),i.create=a})(JP||(JP={})),(function(i){function a(s,o,l,u){return u!==void 0?{name:s,kind:o,location:{uri:l,range:u}}:{name:s,kind:o,location:{uri:l}}}A(a,"create"),i.create=a})(e9||(e9={})),(function(i){function a(o,l,u,h,d,f){let p={name:o,detail:l,kind:u,range:h,selectionRange:d};return f!==void 0&&(p.children=f),p}A(a,"create"),i.create=a;function s(o){let l=o;return l&&Ze.string(l.name)&&Ze.number(l.kind)&&jr.is(l.range)&&jr.is(l.selectionRange)&&(l.detail===void 0||Ze.string(l.detail))&&(l.deprecated===void 0||Ze.boolean(l.deprecated))&&(l.children===void 0||Array.isArray(l.children))&&(l.tags===void 0||Array.isArray(l.tags))}A(s,"is"),i.is=s})(t9||(t9={})),(function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"})(r9||(r9={})),(function(i){i.Invoked=1,i.Automatic=2})(lw||(lw={})),(function(i){function a(o,l,u){let h={diagnostics:o};return l!=null&&(h.only=l),u!=null&&(h.triggerKind=u),h}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.typedArray(l.diagnostics,iw.is)&&(l.only===void 0||Ze.typedArray(l.only,Ze.string))&&(l.triggerKind===void 0||l.triggerKind===lw.Invoked||l.triggerKind===lw.Automatic)}A(s,"is"),i.is=s})(n9||(n9={})),(function(i){function a(o,l,u){let h={title:o},d=!0;return typeof l=="string"?(d=!1,h.kind=l):hp.is(l)?h.command=l:h.edit=l,d&&u!==void 0&&(h.kind=u),h}A(a,"create"),i.create=a;function s(o){let l=o;return l&&Ze.string(l.title)&&(l.diagnostics===void 0||Ze.typedArray(l.diagnostics,iw.is))&&(l.kind===void 0||Ze.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||hp.is(l.command))&&(l.isPreferred===void 0||Ze.boolean(l.isPreferred))&&(l.edit===void 0||S3.is(l.edit))}A(s,"is"),i.is=s})(i9||(i9={})),(function(i){function a(o,l){let u={range:o};return Ze.defined(l)&&(u.data=l),u}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&jr.is(l.range)&&(Ze.undefined(l.command)||hp.is(l.command))}A(s,"is"),i.is=s})(a9||(a9={})),(function(i){function a(o,l){return{tabSize:o,insertSpaces:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&Ze.uinteger(l.tabSize)&&Ze.boolean(l.insertSpaces)}A(s,"is"),i.is=s})(s9||(s9={})),(function(i){function a(o,l,u){return{range:o,target:l,data:u}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.defined(l)&&jr.is(l.range)&&(Ze.undefined(l.target)||Ze.string(l.target))}A(s,"is"),i.is=s})(o9||(o9={})),(function(i){function a(o,l){return{range:o,parent:l}}A(a,"create"),i.create=a;function s(o){let l=o;return Ze.objectLiteral(l)&&jr.is(l.range)&&(l.parent===void 0||i.is(l.parent))}A(s,"is"),i.is=s})(l9||(l9={})),(function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"})(c9||(c9={})),(function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"})(u9||(u9={})),(function(i){function a(s){const o=s;return Ze.objectLiteral(o)&&(o.resultId===void 0||typeof o.resultId=="string")&&Array.isArray(o.data)&&(o.data.length===0||typeof o.data[0]=="number")}A(a,"is"),i.is=a})(h9||(h9={})),(function(i){function a(o,l){return{range:o,text:l}}A(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&jr.is(l.range)&&Ze.string(l.text)}A(s,"is"),i.is=s})(d9||(d9={})),(function(i){function a(o,l,u){return{range:o,variableName:l,caseSensitiveLookup:u}}A(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&jr.is(l.range)&&Ze.boolean(l.caseSensitiveLookup)&&(Ze.string(l.variableName)||l.variableName===void 0)}A(s,"is"),i.is=s})(f9||(f9={})),(function(i){function a(o,l){return{range:o,expression:l}}A(a,"create"),i.create=a;function s(o){const l=o;return l!=null&&jr.is(l.range)&&(Ze.string(l.expression)||l.expression===void 0)}A(s,"is"),i.is=s})(p9||(p9={})),(function(i){function a(o,l){return{frameId:o,stoppedLocation:l}}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.defined(l)&&jr.is(o.stoppedLocation)}A(s,"is"),i.is=s})(g9||(g9={})),(function(i){i.Type=1,i.Parameter=2;function a(s){return s===1||s===2}A(a,"is"),i.is=a})(A3||(A3={})),(function(i){function a(o){return{value:o}}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&(l.tooltip===void 0||Ze.string(l.tooltip)||Sm.is(l.tooltip))&&(l.location===void 0||nw.is(l.location))&&(l.command===void 0||hp.is(l.command))}A(s,"is"),i.is=s})(_3||(_3={})),(function(i){function a(o,l,u){const h={position:o,label:l};return u!==void 0&&(h.kind=u),h}A(a,"create"),i.create=a;function s(o){const l=o;return Ze.objectLiteral(l)&&mn.is(l.position)&&(Ze.string(l.label)||Ze.typedArray(l.label,_3.is))&&(l.kind===void 0||A3.is(l.kind))&&l.textEdits===void 0||Ze.typedArray(l.textEdits,kc.is)&&(l.tooltip===void 0||Ze.string(l.tooltip)||Sm.is(l.tooltip))&&(l.paddingLeft===void 0||Ze.boolean(l.paddingLeft))&&(l.paddingRight===void 0||Ze.boolean(l.paddingRight))}A(s,"is"),i.is=s})(m9||(m9={})),(function(i){function a(s){return{kind:"snippet",value:s}}A(a,"createSnippet"),i.createSnippet=a})(y9||(y9={})),(function(i){function a(s,o,l,u){return{insertText:s,filterText:o,range:l,command:u}}A(a,"create"),i.create=a})(v9||(v9={})),(function(i){function a(s){return{items:s}}A(a,"create"),i.create=a})(b9||(b9={})),(function(i){i.Invoked=0,i.Automatic=1})(x9||(x9={})),(function(i){function a(s,o){return{range:s,text:o}}A(a,"create"),i.create=a})(T9||(T9={})),(function(i){function a(s,o){return{triggerKind:s,selectedCompletionInfo:o}}A(a,"create"),i.create=a})(w9||(w9={})),(function(i){function a(s){const o=s;return Ze.objectLiteral(o)&&w3.is(o.uri)&&Ze.string(o.name)}A(a,"is"),i.is=a})(C9||(C9={})),abe=[`
`,`\r
`,"\r"],(function(i){function a(u,h,d,f){return new Rte(u,h,d,f)}A(a,"create"),i.create=a;function s(u){let h=u;return!!(Ze.defined(h)&&Ze.string(h.uri)&&(Ze.undefined(h.languageId)||Ze.string(h.languageId))&&Ze.uinteger(h.lineCount)&&Ze.func(h.getText)&&Ze.func(h.positionAt)&&Ze.func(h.offsetAt))}A(s,"is"),i.is=s;function o(u,h){let d=u.getText(),f=l(h,(g,m)=>{let y=g.range.start.line-m.range.start.line;return y===0?g.range.start.character-m.range.start.character:y}),p=d.length;for(let g=f.length-1;g>=0;g--){let m=f[g],y=u.offsetAt(m.range.start),v=u.offsetAt(m.range.end);if(v<=p)d=d.substring(0,y)+m.newText+d.substring(v,d.length);else throw new Error("Overlapping edit");p=y}return d}A(o,"applyEdits"),i.applyEdits=o;function l(u,h){if(u.length<=1)return u;const d=u.length/2|0,f=u.slice(0,d),p=u.slice(d);l(f,h),l(p,h);let g=0,m=0,y=0;for(;g<f.length&&m<p.length;)h(f[g],p[m])<=0?u[y++]=f[g++]:u[y++]=p[m++];for(;g<f.length;)u[y++]=f[g++];for(;m<p.length;)u[y++]=p[m++];return u}A(l,"mergeSort")})(k9||(k9={})),Rte=(n=class{constructor(a,s,o,l){this._uri=a,this._languageId=s,this._version=o,this._content=l,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(a){if(a){let s=this.offsetAt(a.start),o=this.offsetAt(a.end);return this._content.substring(s,o)}return this._content}update(a,s){this._content=a.text,this._version=s,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let a=[],s=this._content,o=!0;for(let l=0;l<s.length;l++){o&&(a.push(l),o=!1);let u=s.charAt(l);o=u==="\r"||u===`
`,u==="\r"&&l+1<s.length&&s.charAt(l+1)===`
`&&l++}o&&s.length>0&&a.push(s.length),this._lineOffsets=a}return this._lineOffsets}positionAt(a){a=Math.max(Math.min(a,this._content.length),0);let s=this.getLineOffsets(),o=0,l=s.length;if(l===0)return mn.create(0,a);for(;o<l;){let h=Math.floor((o+l)/2);s[h]>a?l=h:o=h+1}let u=o-1;return mn.create(u,a-s[u])}offsetAt(a){let s=this.getLineOffsets();if(a.line>=s.length)return this._content.length;if(a.line<0)return 0;let o=s[a.line],l=a.line+1<s.length?s[a.line+1]:this._content.length;return Math.max(Math.min(o+a.character,l),o)}get lineCount(){return this.getLineOffsets().length}},A(n,"FullTextDocument"),n),(function(i){const a=Object.prototype.toString;function s(v){return typeof v<"u"}A(s,"defined"),i.defined=s;function o(v){return typeof v>"u"}A(o,"undefined"),i.undefined=o;function l(v){return v===!0||v===!1}A(l,"boolean"),i.boolean=l;function u(v){return a.call(v)==="[object String]"}A(u,"string"),i.string=u;function h(v){return a.call(v)==="[object Number]"}A(h,"number"),i.number=h;function d(v,T,b){return a.call(v)==="[object Number]"&&T<=v&&v<=b}A(d,"numberRange"),i.numberRange=d;function f(v){return a.call(v)==="[object Number]"&&-2147483648<=v&&v<=2147483647}A(f,"integer"),i.integer=f;function p(v){return a.call(v)==="[object Number]"&&0<=v&&v<=2147483647}A(p,"uinteger"),i.uinteger=p;function g(v){return a.call(v)==="[object Function]"}A(g,"func"),i.func=g;function m(v){return v!==null&&typeof v=="object"}A(m,"objectLiteral"),i.objectLiteral=m;function y(v,T){return Array.isArray(v)&&v.every(T)}A(y,"typedArray"),i.typedArray=y})(Ze||(Ze={}))}}),yg=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e;function r(){if(e===void 0)throw new Error("No runtime abstraction layer installed");return e}A(r,"RAL"),(function(n){function i(a){if(a===void 0)throw new Error("No runtime abstraction layer provided");e=a}A(i,"install"),n.install=i})(r||(r={})),t.default=r}}),ES=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(l){return l===!0||l===!1}A(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}A(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}A(n,"number"),t.number=n;function i(l){return l instanceof Error}A(i,"error"),t.error=i;function a(l){return typeof l=="function"}A(a,"func"),t.func=a;function s(l){return Array.isArray(l)}A(s,"array"),t.array=s;function o(l){return s(l)&&l.every(u=>r(u))}A(o,"stringArray"),t.stringArray=o}}),$x=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var a,s;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e=yg(),r;(function(o){const l={dispose(){}};o.None=function(){return l}})(r||(t.Event=r={}));var n=(a=class{add(l,u=null,h){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(l),this._contexts.push(u),Array.isArray(h)&&h.push({dispose:A(()=>this.remove(l,u),"dispose")})}remove(l,u=null){if(!this._callbacks)return;let h=!1;for(let d=0,f=this._callbacks.length;d<f;d++)if(this._callbacks[d]===l)if(this._contexts[d]===u){this._callbacks.splice(d,1),this._contexts.splice(d,1);return}else h=!0;if(h)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...l){if(!this._callbacks)return[];const u=[],h=this._callbacks.slice(0),d=this._contexts.slice(0);for(let f=0,p=h.length;f<p;f++)try{u.push(h[f].apply(d[f],l))}catch(g){(0,e.default)().console.error(g)}return u}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},A(a,"CallbackList"),a),i=(s=class{constructor(l){this._options=l}get event(){return this._event||(this._event=(l,u,h)=>{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(l,u);const d={dispose:A(()=>{this._callbacks&&(this._callbacks.remove(l,u),d.dispose=s._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(h)&&h.push(d),d}),this._event}fire(l){this._callbacks&&this._callbacks.invoke.call(this._callbacks,l)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}},A(s,"Emitter"),s);t.Emitter=i,i._noop=function(){}}}),CL=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){var l,u;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var e=yg(),r=ES(),n=$x(),i;(function(h){h.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),h.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function d(f){const p=f;return p&&(p===h.None||p===h.Cancelled||r.boolean(p.isCancellationRequested)&&!!p.onCancellationRequested)}A(d,"is"),h.is=d})(i||(t.CancellationToken=i={}));var a=Object.freeze(function(h,d){const f=(0,e.default)().timer.setTimeout(h.bind(d),0);return{dispose(){f.dispose()}}}),s=(l=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?a:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},A(l,"MutableToken"),l),o=(u=class{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=i.None}},A(u,"CancellationTokenSource"),u);t.CancellationTokenSource=o}}),sbe=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var D,R,I,$,O,N,F,z,V,B,G,H,q,Z,Y,ie,K,Q,te,J,ge,ee,Re,Ie,Be;Object.defineProperty(t,"__esModule",{value:!0}),t.Message=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType=t.RequestType0=t.AbstractMessageSignature=t.ParameterStructures=t.ResponseError=t.ErrorCodes=void 0;var e=ES(),r;(function(ce){ce.ParseError=-32700,ce.InvalidRequest=-32600,ce.MethodNotFound=-32601,ce.InvalidParams=-32602,ce.InternalError=-32603,ce.jsonrpcReservedErrorRangeStart=-32099,ce.serverErrorStart=-32099,ce.MessageWriteError=-32099,ce.MessageReadError=-32098,ce.PendingResponseRejected=-32097,ce.ConnectionInactive=-32096,ce.ServerNotInitialized=-32002,ce.UnknownErrorCode=-32001,ce.jsonrpcReservedErrorRangeEnd=-32e3,ce.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=(D=class extends Error{constructor(oe,be,fe){super(be),this.code=e.number(oe)?oe:r.UnknownErrorCode,this.data=fe,Object.setPrototypeOf(this,D.prototype)}toJson(){const oe={code:this.code,message:this.message};return this.data!==void 0&&(oe.data=this.data),oe}},A(D,"ResponseError"),D);t.ResponseError=n;var i=(R=class{constructor(oe){this.kind=oe}static is(oe){return oe===R.auto||oe===R.byName||oe===R.byPosition}toString(){return this.kind}},A(R,"ParameterStructures"),R);t.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");var a=(I=class{constructor(oe,be){this.method=oe,this.numberOfParams=be}get parameterStructures(){return i.auto}},A(I,"AbstractMessageSignature"),I);t.AbstractMessageSignature=a;var s=($=class extends a{constructor(oe){super(oe,0)}},A($,"RequestType0"),$);t.RequestType0=s;var o=(O=class extends a{constructor(oe,be=i.auto){super(oe,1),this._parameterStructures=be}get parameterStructures(){return this._parameterStructures}},A(O,"RequestType"),O);t.RequestType=o;var l=(N=class extends a{constructor(oe,be=i.auto){super(oe,1),this._parameterStructures=be}get parameterStructures(){return this._parameterStructures}},A(N,"RequestType1"),N);t.RequestType1=l;var u=(F=class extends a{constructor(oe){super(oe,2)}},A(F,"RequestType2"),F);t.RequestType2=u;var h=(z=class extends a{constructor(oe){super(oe,3)}},A(z,"RequestType3"),z);t.RequestType3=h;var d=(V=class extends a{constructor(oe){super(oe,4)}},A(V,"RequestType4"),V);t.RequestType4=d;var f=(B=class extends a{constructor(oe){super(oe,5)}},A(B,"RequestType5"),B);t.RequestType5=f;var p=(G=class extends a{constructor(oe){super(oe,6)}},A(G,"RequestType6"),G);t.RequestType6=p;var g=(H=class extends a{constructor(oe){super(oe,7)}},A(H,"RequestType7"),H);t.RequestType7=g;var m=(q=class extends a{constructor(oe){super(oe,8)}},A(q,"RequestType8"),q);t.RequestType8=m;var y=(Z=class extends a{constructor(oe){super(oe,9)}},A(Z,"RequestType9"),Z);t.RequestType9=y;var v=(Y=class extends a{constructor(oe,be=i.auto){super(oe,1),this._parameterStructures=be}get parameterStructures(){return this._parameterStructures}},A(Y,"NotificationType"),Y);t.NotificationType=v;var T=(ie=class extends a{constructor(oe){super(oe,0)}},A(ie,"NotificationType0"),ie);t.NotificationType0=T;var b=(K=class extends a{constructor(oe,be=i.auto){super(oe,1),this._parameterStructures=be}get parameterStructures(){return this._parameterStructures}},A(K,"NotificationType1"),K);t.NotificationType1=b;var w=(Q=class extends a{constructor(oe){super(oe,2)}},A(Q,"NotificationType2"),Q);t.NotificationType2=w;var C=(te=class extends a{constructor(oe){super(oe,3)}},A(te,"NotificationType3"),te);t.NotificationType3=C;var S=(J=class extends a{constructor(oe){super(oe,4)}},A(J,"NotificationType4"),J);t.NotificationType4=S;var k=(ge=class extends a{constructor(oe){super(oe,5)}},A(ge,"NotificationType5"),ge);t.NotificationType5=k;var E=(ee=class extends a{constructor(oe){super(oe,6)}},A(ee,"NotificationType6"),ee);t.NotificationType6=E;var _=(Re=class extends a{constructor(oe){super(oe,7)}},A(Re,"NotificationType7"),Re);t.NotificationType7=_;var M=(Ie=class extends a{constructor(oe){super(oe,8)}},A(Ie,"NotificationType8"),Ie);t.NotificationType8=M;var L=(Be=class extends a{constructor(oe){super(oe,9)}},A(Be,"NotificationType9"),Be);t.NotificationType9=L;var P;(function(ce){function oe(Pe){const ve=Pe;return ve&&e.string(ve.method)&&(e.string(ve.id)||e.number(ve.id))}A(oe,"isRequest"),ce.isRequest=oe;function be(Pe){const ve=Pe;return ve&&e.string(ve.method)&&Pe.id===void 0}A(be,"isNotification"),ce.isNotification=be;function fe(Pe){const ve=Pe;return ve&&(ve.result!==void 0||!!ve.error)&&(e.string(ve.id)||e.number(ve.id)||ve.id===null)}A(fe,"isResponse"),ce.isResponse=fe})(P||(t.Message=P={}))}}),obe=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(t){var a,s;var e;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0;var r;(function(o){o.None=0,o.First=1,o.AsOld=o.First,o.Last=2,o.AsNew=o.Last})(r||(t.Touch=r={}));var n=(a=class{constructor(){this[e]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var l;return(l=this._head)==null?void 0:l.value}get last(){var l;return(l=this._tail)==null?void 0:l.value}has(l){return this._map.has(l)}get(l,u=r.None){const h=this._map.get(l);if(h)return u!==r.None&&this.touch(h,u),h.value}set(l,u,h=r.None){let d=this._map.get(l);if(d)d.value=u,h!==r.None&&this.touch(d,h);else{switch(d={key:l,value:u,next:void 0,previous:void 0},h){case r.None:this.addItemLast(d);break;case r.First:this.addItemFirst(d);break;case r.Last:this.addItemLast(d);break;default:this.addItemLast(d);break}this._map.set(l,d),this._size++}return this}delete(l){return!!this.remove(l)}remove(l){const u=this._map.get(l);if(u)return this._map.delete(l),this.removeItem(u),this._size--,u.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const l=this._head;return this._map.delete(l.key),this.removeItem(l),this._size--,l.value}forEach(l,u){const h=this._state;let d=this._head;for(;d;){if(u?l.bind(u)(d.value,d.key,this):l(d.value,d.key,this),this._state!==h)throw new Error("LinkedMap got modified during iteration.");d=d.next}}keys(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:A(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.key,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}values(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:A(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:u.value,done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}entries(){const l=this._state;let u=this._head;const h={[Symbol.iterator]:()=>h,next:A(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(u){const d={value:[u.key,u.value],done:!1};return u=u.next,d}else return{value:void 0,done:!0}},"next")};return h}[(e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(l){if(l>=this.size)return;if(l===0){this.clear();return}let u=this._head,h=this.size;for(;u&&h>l;)this._map.delete(u.key),u=u.next,h--;this._head=u,this._size=h,u&&(u.previous=void 0),this._state++}addItemFirst(l){if(!this._head&&!this._tail)this._tail=l;else if(this._head)l.next=this._head,this._head.previous=l;else throw new Error("Invalid list");this._head=l,this._state++}addItemLast(l){if(!this._head&&!this._tail)this._head=l;else if(this._tail)l.previous=this._tail,this._tail.next=l;else throw new Error("Invalid list");this._tail=l,this._state++}removeItem(l){if(l===this._head&&l===this._tail)this._head=void 0,this._tail=void 0;else if(l===this._head){if(!l.next)throw new Error("Invalid list");l.next.previous=void 0,this._head=l.next}else if(l===this._tail){if(!l.previous)throw new Error("Invalid list");l.previous.next=void 0,this._tail=l.previous}else{const u=l.next,h=l.previous;if(!u||!h)throw new Error("Invalid list");u.previous=h,h.next=u}l.next=void 0,l.previous=void 0,this._state++}touch(l,u){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(u!==r.First&&u!==r.Last)){if(u===r.First){if(l===this._head)return;const h=l.next,d=l.previous;l===this._tail?(d.next=void 0,this._tail=d):(h.previous=d,d.next=h),l.previous=void 0,l.next=this._head,this._head.previous=l,this._head=l,this._state++}else if(u===r.Last){if(l===this._tail)return;const h=l.next,d=l.previous;l===this._head?(h.previous=void 0,this._head=h):(h.previous=d,d.next=h),l.next=void 0,l.previous=this._tail,this._tail.next=l,this._tail=l,this._state++}}}toJSON(){const l=[];return this.forEach((u,h)=>{l.push([h,u])}),l}fromJSON(l){this.clear();for(const[u,h]of l)this.set(u,h)}},A(a,"LinkedMap"),a);t.LinkedMap=n;var i=(s=class extends n{constructor(l,u=1){super(),this._limit=l,this._ratio=Math.min(Math.max(0,u),1)}get limit(){return this._limit}set limit(l){this._limit=l,this.checkTrim()}get ratio(){return this._ratio}set ratio(l){this._ratio=Math.min(Math.max(0,l),1),this.checkTrim()}get(l,u=r.AsNew){return super.get(l,u)}peek(l){return super.get(l,r.None)}set(l,u){return super.set(l,u,r.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}},A(s,"LRUCache"),s);t.LRUCache=i}}),Iyt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0;var e;(function(r){function n(i){return{dispose:i}}A(n,"create"),r.create=n})(e||(t.Disposable=e={}))}}),Nyt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(t){var o,l,u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=void 0;var e=CL(),r;(function(d){d.Continue=0,d.Cancelled=1})(r||(r={}));var n=(o=class{constructor(){this.buffers=new Map}enableCancellation(f){if(f.id===null)return;const p=new SharedArrayBuffer(4),g=new Int32Array(p,0,1);g[0]=r.Continue,this.buffers.set(f.id,p),f.$cancellationData=p}async sendCancellation(f,p){const g=this.buffers.get(p);if(g===void 0)return;const m=new Int32Array(g,0,1);Atomics.store(m,0,r.Cancelled)}cleanup(f){this.buffers.delete(f)}dispose(){this.buffers.clear()}},A(o,"SharedArraySenderStrategy"),o);t.SharedArraySenderStrategy=n;var i=(l=class{constructor(f){this.data=new Int32Array(f,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},A(l,"SharedArrayBufferCancellationToken"),l),a=(u=class{constructor(f){this.token=new i(f)}cancel(){}dispose(){}},A(u,"SharedArrayBufferCancellationTokenSource"),u),s=(h=class{constructor(){this.kind="request"}createCancellationTokenSource(f){const p=f.$cancellationData;return p===void 0?new e.CancellationTokenSource:new a(p)}},A(h,"SharedArrayReceiverStrategy"),h);t.SharedArrayReceiverStrategy=s}}),lbe=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;var e=yg(),r=(n=class{constructor(a=1){if(a<=0)throw new Error("Capacity must be greater than 0");this._capacity=a,this._active=0,this._waiting=[]}lock(a){return new Promise((s,o)=>{this._waiting.push({thunk:a,resolve:s,reject:o}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,e.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const a=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const s=a.thunk();s instanceof Promise?s.then(o=>{this._active--,a.resolve(o),this.runNext()},o=>{this._active--,a.reject(o),this.runNext()}):(this._active--,a.resolve(s),this.runNext())}catch(s){this._active--,a.reject(s),this.runNext()}}},A(n,"Semaphore"),n);t.Semaphore=r}}),Dyt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(t){var u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;var e=yg(),r=ES(),n=$x(),i=lbe(),a;(function(d){function f(p){let g=p;return g&&r.func(g.listen)&&r.func(g.dispose)&&r.func(g.onError)&&r.func(g.onClose)&&r.func(g.onPartialMessage)}A(f,"is"),d.is=f})(a||(t.MessageReader=a={}));var s=(u=class{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f){this.errorEmitter.fire(this.asError(f))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(f){this.partialMessageEmitter.fire(f)}asError(f){return f instanceof Error?f:new Error(`Reader received error. Reason: ${r.string(f.message)?f.message:"unknown"}`)}},A(u,"AbstractMessageReader"),u);t.AbstractMessageReader=s;var o;(function(d){function f(p){let g,m;const y=new Map;let v;const T=new Map;if(p===void 0||typeof p=="string")g=p??"utf-8";else{if(g=p.charset??"utf-8",p.contentDecoder!==void 0&&(m=p.contentDecoder,y.set(m.name,m)),p.contentDecoders!==void 0)for(const b of p.contentDecoders)y.set(b.name,b);if(p.contentTypeDecoder!==void 0&&(v=p.contentTypeDecoder,T.set(v.name,v)),p.contentTypeDecoders!==void 0)for(const b of p.contentTypeDecoders)T.set(b.name,b)}return v===void 0&&(v=(0,e.default)().applicationJson.decoder,T.set(v.name,v)),{charset:g,contentDecoder:m,contentDecoders:y,contentTypeDecoder:v,contentTypeDecoders:T}}A(f,"fromOptions"),d.fromOptions=f})(o||(o={}));var l=(h=class extends s{constructor(f,p){super(),this.readable=f,this.options=o.fromOptions(p),this.buffer=(0,e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(f){this._partialMessageTimeout=f}get partialMessageTimeout(){return this._partialMessageTimeout}listen(f){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=f;const p=this.readable.onData(g=>{this.onData(g)});return this.readable.onError(g=>this.fireError(g)),this.readable.onClose(()=>this.fireClose()),p}onData(f){try{for(this.buffer.append(f);;){if(this.nextMessageLength===-1){const g=this.buffer.tryReadHeaders(!0);if(!g)return;const m=g.get("content-length");if(!m){this.fireError(new Error(`Header must provide a Content-Length property.
${JSON.stringify(Object.fromEntries(g))}`));return}const y=parseInt(m);if(isNaN(y)){this.fireError(new Error(`Content-Length value must be a number. Got ${m}`));return}this.nextMessageLength=y}const p=this.buffer.tryReadBody(this.nextMessageLength);if(p===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const g=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(p):p,m=await this.options.contentTypeDecoder.decode(g,this.options);this.callback(m)}).catch(g=>{this.fireError(g)})}}catch(p){this.fireError(p)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,e.default)().timer.setTimeout((f,p)=>{this.partialMessageTimer=void 0,f===this.messageToken&&(this.firePartialMessage({messageToken:f,waitingTime:p}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},A(h,"ReadableStreamMessageReader"),h);t.ReadableStreamMessageReader=l}}),Oyt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(t){var d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;var e=yg(),r=ES(),n=lbe(),i=$x(),a="Content-Length: ",s=`\r
`,o;(function(p){function g(m){let y=m;return y&&r.func(y.dispose)&&r.func(y.onClose)&&r.func(y.onError)&&r.func(y.write)}A(g,"is"),p.is=g})(o||(t.MessageWriter=o={}));var l=(d=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(g,m,y){this.errorEmitter.fire([this.asError(g),m,y])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(g){return g instanceof Error?g:new Error(`Writer received error. Reason: ${r.string(g.message)?g.message:"unknown"}`)}},A(d,"AbstractMessageWriter"),d);t.AbstractMessageWriter=l;var u;(function(p){function g(m){return m===void 0||typeof m=="string"?{charset:m??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:m.charset??"utf-8",contentEncoder:m.contentEncoder,contentTypeEncoder:m.contentTypeEncoder??(0,e.default)().applicationJson.encoder}}A(g,"fromOptions"),p.fromOptions=g})(u||(u={}));var h=(f=class extends l{constructor(g,m){super(),this.writable=g,this.options=u.fromOptions(m),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(y=>this.fireError(y)),this.writable.onClose(()=>this.fireClose())}async write(g){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(g,this.options).then(y=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(y):y).then(y=>{const v=[];return v.push(a,y.byteLength.toString(),s),v.push(s),this.doWrite(g,v,y)},y=>{throw this.fireError(y),y}))}async doWrite(g,m,y){try{return await this.writable.write(m.join(""),"ascii"),this.writable.write(y)}catch(v){return this.handleError(v,g),Promise.reject(v)}}handleError(g,m){this.errorCount++,this.fireError(g,m,this.errorCount)}end(){this.writable.end()}},A(f,"WriteableStreamMessageWriter"),f);t.WriteableStreamMessageWriter=h}}),$yt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(t){var a;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0;var e=13,r=10,n=`\r
`,i=(a=class{constructor(o="utf-8"){this._encoding=o,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(o){const l=typeof o=="string"?this.fromString(o,this._encoding):o;this._chunks.push(l),this._totalLength+=l.byteLength}tryReadHeaders(o=!1){if(this._chunks.length===0)return;let l=0,u=0,h=0,d=0;e:for(;u<this._chunks.length;){const m=this._chunks[u];for(h=0;h<m.length;){switch(m[h]){case e:switch(l){case 0:l=1;break;case 2:l=3;break;default:l=0}break;case r:switch(l){case 1:l=2;break;case 3:l=4,h++;break e;default:l=0}break;default:l=0}h++}d+=m.byteLength,u++}if(l!==4)return;const f=this._read(d+h),p=new Map,g=this.toString(f,"ascii").split(n);if(g.length<2)return p;for(let m=0;m<g.length-2;m++){const y=g[m],v=y.indexOf(":");if(v===-1)throw new Error(`Message header must separate key and value using ':'
${y}`);const T=y.substr(0,v),b=y.substr(v+1).trim();p.set(o?T.toLowerCase():T,b)}return p}tryReadBody(o){if(!(this._totalLength<o))return this._read(o)}get numberOfBytes(){return this._totalLength}_read(o){if(o===0)return this.emptyBuffer();if(o>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===o){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=o,this.asNative(d)}if(this._chunks[0].byteLength>o){const d=this._chunks[0],f=this.asNative(d,o);return this._chunks[0]=d.slice(o),this._totalLength-=o,f}const l=this.allocNative(o);let u=0,h=0;for(;o>0;){const d=this._chunks[h];if(d.byteLength>o){const f=d.slice(0,o);l.set(f,u),u+=o,this._chunks[h]=d.slice(o),this._totalLength-=o,o-=o}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,o-=d.byteLength}return l}},A(a,"AbstractMessageBuffer"),a);t.AbstractMessageBuffer=i}}),Pyt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var D,R;Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;var e=yg(),r=ES(),n=sbe(),i=obe(),a=$x(),s=CL(),o;(function(I){I.type=new n.NotificationType("$/cancelRequest")})(o||(o={}));var l;(function(I){function $(O){return typeof O=="string"||typeof O=="number"}A($,"is"),I.is=$})(l||(t.ProgressToken=l={}));var u;(function(I){I.type=new n.NotificationType("$/progress")})(u||(u={}));var h=(D=class{constructor(){}},A(D,"ProgressType"),D);t.ProgressType=h;var d;(function(I){function $(O){return r.func(O)}A($,"is"),I.is=$})(d||(d={})),t.NullLogger=Object.freeze({error:A(()=>{},"error"),warn:A(()=>{},"warn"),info:A(()=>{},"info"),log:A(()=>{},"log")});var f;(function(I){I[I.Off=0]="Off",I[I.Messages=1]="Messages",I[I.Compact=2]="Compact",I[I.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(I){I.Off="off",I.Messages="messages",I.Compact="compact",I.Verbose="verbose"})(p||(t.TraceValues=p={})),(function(I){function $(N){if(!r.string(N))return I.Off;switch(N=N.toLowerCase(),N){case"off":return I.Off;case"messages":return I.Messages;case"compact":return I.Compact;case"verbose":return I.Verbose;default:return I.Off}}A($,"fromString"),I.fromString=$;function O(N){switch(N){case I.Off:return"off";case I.Messages:return"messages";case I.Compact:return"compact";case I.Verbose:return"verbose";default:return"off"}}A(O,"toString"),I.toString=O})(f||(t.Trace=f={}));var g;(function(I){I.Text="text",I.JSON="json"})(g||(t.TraceFormat=g={})),(function(I){function $(O){return r.string(O)?(O=O.toLowerCase(),O==="json"?I.JSON:I.Text):I.Text}A($,"fromString"),I.fromString=$})(g||(t.TraceFormat=g={}));var m;(function(I){I.type=new n.NotificationType("$/setTrace")})(m||(t.SetTraceNotification=m={}));var y;(function(I){I.type=new n.NotificationType("$/logTrace")})(y||(t.LogTraceNotification=y={}));var v;(function(I){I[I.Closed=1]="Closed",I[I.Disposed=2]="Disposed",I[I.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));var T=(R=class extends Error{constructor($,O){super(O),this.code=$,Object.setPrototypeOf(this,R.prototype)}},A(R,"ConnectionError"),R);t.ConnectionError=T;var b;(function(I){function $(O){const N=O;return N&&r.func(N.cancelUndispatched)}A($,"is"),I.is=$})(b||(t.ConnectionStrategy=b={}));var w;(function(I){function $(O){const N=O;return N&&(N.kind===void 0||N.kind==="id")&&r.func(N.createCancellationTokenSource)&&(N.dispose===void 0||r.func(N.dispose))}A($,"is"),I.is=$})(w||(t.IdCancellationReceiverStrategy=w={}));var C;(function(I){function $(O){const N=O;return N&&N.kind==="request"&&r.func(N.createCancellationTokenSource)&&(N.dispose===void 0||r.func(N.dispose))}A($,"is"),I.is=$})(C||(t.RequestCancellationReceiverStrategy=C={}));var S;(function(I){I.Message=Object.freeze({createCancellationTokenSource(O){return new s.CancellationTokenSource}});function $(O){return w.is(O)||C.is(O)}A($,"is"),I.is=$})(S||(t.CancellationReceiverStrategy=S={}));var k;(function(I){I.Message=Object.freeze({sendCancellation(O,N){return O.sendNotification(o.type,{id:N})},cleanup(O){}});function $(O){const N=O;return N&&r.func(N.sendCancellation)&&r.func(N.cleanup)}A($,"is"),I.is=$})(k||(t.CancellationSenderStrategy=k={}));var E;(function(I){I.Message=Object.freeze({receiver:S.Message,sender:k.Message});function $(O){const N=O;return N&&S.is(N.receiver)&&k.is(N.sender)}A($,"is"),I.is=$})(E||(t.CancellationStrategy=E={}));var _;(function(I){function $(O){const N=O;return N&&r.func(N.handleMessage)}A($,"is"),I.is=$})(_||(t.MessageStrategy=_={}));var M;(function(I){function $(O){const N=O;return N&&(E.is(N.cancellationStrategy)||b.is(N.connectionStrategy)||_.is(N.messageStrategy))}A($,"is"),I.is=$})(M||(t.ConnectionOptions=M={}));var L;(function(I){I[I.New=1]="New",I[I.Listening=2]="Listening",I[I.Closed=3]="Closed",I[I.Disposed=4]="Disposed"})(L||(L={}));function P(I,$,O,N){const F=O!==void 0?O:t.NullLogger;let z=0,V=0,B=0;const G="2.0";let H;const q=new Map;let Z;const Y=new Map,ie=new Map;let K,Q=new i.LinkedMap,te=new Map,J=new Set,ge=new Map,ee=f.Off,Re=g.Text,Ie,Be=L.New;const ce=new a.Emitter,oe=new a.Emitter,be=new a.Emitter,fe=new a.Emitter,Pe=new a.Emitter,ve=N&&N.cancellationStrategy?N.cancellationStrategy:E.Message;function Ce(Se){if(Se===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Se.toString()}A(Ce,"createRequestQueueKey");function Ve(Se){return Se===null?"res-unknown-"+(++B).toString():"res-"+Se.toString()}A(Ve,"createResponseQueueKey");function se(){return"not-"+(++V).toString()}A(se,"createNotificationQueueKey");function de(Se,Ue){n.Message.isRequest(Ue)?Se.set(Ce(Ue.id),Ue):n.Message.isResponse(Ue)?Se.set(Ve(Ue.id),Ue):Se.set(se(),Ue)}A(de,"addMessageToQueue");function Te(Se){}A(Te,"cancelUndispatched");function ae(){return Be===L.Listening}A(ae,"isListening");function he(){return Be===L.Closed}A(he,"isClosed");function W(){return Be===L.Disposed}A(W,"isDisposed");function ne(){(Be===L.New||Be===L.Listening)&&(Be=L.Closed,oe.fire(void 0))}A(ne,"closeHandler");function j(Se){ce.fire([Se,void 0,void 0])}A(j,"readErrorHandler");function ue(Se){ce.fire(Se)}A(ue,"writeErrorHandler"),I.onClose(ne),I.onError(j),$.onClose(ne),$.onError(ue);function X(){K||Q.size===0||(K=(0,e.default)().timer.setImmediate(()=>{K=void 0,xe()}))}A(X,"triggerMessageQueue");function Oe(Se){n.Message.isRequest(Se)?_e(Se):n.Message.isNotification(Se)?Me(Se):n.Message.isResponse(Se)?$e(Se):He(Se)}A(Oe,"handleMessage");function xe(){if(Q.size===0)return;const Se=Q.shift();try{const Ue=N==null?void 0:N.messageStrategy;_.is(Ue)?Ue.handleMessage(Se,Oe):Oe(Se)}finally{X()}}A(xe,"processMessageQueue");const Ge=A(Se=>{try{if(n.Message.isNotification(Se)&&Se.method===o.type.method){const Ue=Se.params.id,tt=Ce(Ue),kt=Q.get(tt);if(n.Message.isRequest(kt)){const sr=N==null?void 0:N.connectionStrategy,Qt=sr&&sr.cancelUndispatched?sr.cancelUndispatched(kt,Te):void 0;if(Qt&&(Qt.error!==void 0||Qt.result!==void 0)){Q.delete(tt),ge.delete(Ue),Qt.id=kt.id,at(Qt,Se.method,Date.now()),$.write(Qt).catch(()=>F.error("Sending response for canceled message failed."));return}}const Nt=ge.get(Ue);if(Nt!==void 0){Nt.cancel(),pt(Se);return}else J.add(Ue)}de(Q,Se)}finally{X()}},"callback");function _e(Se){if(W())return;function Ue(nr,Rr,Zt){const gr={jsonrpc:G,id:Se.id};nr instanceof n.ResponseError?gr.error=nr.toJson():gr.result=nr===void 0?null:nr,at(gr,Rr,Zt),$.write(gr).catch(()=>F.error("Sending response failed."))}A(Ue,"reply");function tt(nr,Rr,Zt){const gr={jsonrpc:G,id:Se.id,error:nr.toJson()};at(gr,Rr,Zt),$.write(gr).catch(()=>F.error("Sending response failed."))}A(tt,"replyError");function kt(nr,Rr,Zt){nr===void 0&&(nr=null);const gr={jsonrpc:G,id:Se.id,result:nr};at(gr,Rr,Zt),$.write(gr).catch(()=>F.error("Sending response failed."))}A(kt,"replySuccess"),Ee(Se);const Nt=q.get(Se.method);let sr,Qt;Nt&&(sr=Nt.type,Qt=Nt.handler);const vr=Date.now();if(Qt||H){const nr=Se.id??String(Date.now()),Rr=w.is(ve.receiver)?ve.receiver.createCancellationTokenSource(nr):ve.receiver.createCancellationTokenSource(Se);Se.id!==null&&J.has(Se.id)&&Rr.cancel(),Se.id!==null&&ge.set(nr,Rr);try{let Zt;if(Qt)if(Se.params===void 0){if(sr!==void 0&&sr.numberOfParams!==0){tt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Se.method} defines ${sr.numberOfParams} params but received none.`),Se.method,vr);return}Zt=Qt(Rr.token)}else if(Array.isArray(Se.params)){if(sr!==void 0&&sr.parameterStructures===n.ParameterStructures.byName){tt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Se.method} defines parameters by name but received parameters by position`),Se.method,vr);return}Zt=Qt(...Se.params,Rr.token)}else{if(sr!==void 0&&sr.parameterStructures===n.ParameterStructures.byPosition){tt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Se.method} defines parameters by position but received parameters by name`),Se.method,vr);return}Zt=Qt(Se.params,Rr.token)}else H&&(Zt=H(Se.method,Se.params,Rr.token));const gr=Zt;Zt?gr.then?gr.then(Dr=>{ge.delete(nr),Ue(Dr,Se.method,vr)},Dr=>{ge.delete(nr),Dr instanceof n.ResponseError?tt(Dr,Se.method,vr):Dr&&r.string(Dr.message)?tt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Se.method} failed with message: ${Dr.message}`),Se.method,vr):tt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Se.method} failed unexpectedly without providing any details.`),Se.method,vr)}):(ge.delete(nr),Ue(Zt,Se.method,vr)):(ge.delete(nr),kt(Zt,Se.method,vr))}catch(Zt){ge.delete(nr),Zt instanceof n.ResponseError?Ue(Zt,Se.method,vr):Zt&&r.string(Zt.message)?tt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Se.method} failed with message: ${Zt.message}`),Se.method,vr):tt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Se.method} failed unexpectedly without providing any details.`),Se.method,vr)}}else tt(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${Se.method}`),Se.method,vr)}A(_e,"handleRequest");function $e(Se){if(!W())if(Se.id===null)Se.error?F.error(`Received response message without id: Error is:
${JSON.stringify(Se.error,void 0,4)}`):F.error("Received response message without id. No further error information provided.");else{const Ue=Se.id,tt=te.get(Ue);if(ht(Se,tt),tt!==void 0){te.delete(Ue);try{if(Se.error){const kt=Se.error;tt.reject(new n.ResponseError(kt.code,kt.message,kt.data))}else if(Se.result!==void 0)tt.resolve(Se.result);else throw new Error("Should never happen.")}catch(kt){kt.message?F.error(`Response handler '${tt.method}' failed with message: ${kt.message}`):F.error(`Response handler '${tt.method}' failed unexpectedly.`)}}}}A($e,"handleResponse");function Me(Se){if(W())return;let Ue,tt;if(Se.method===o.type.method){const kt=Se.params.id;J.delete(kt),pt(Se);return}else{const kt=Y.get(Se.method);kt&&(tt=kt.handler,Ue=kt.type)}if(tt||Z)try{if(pt(Se),tt)if(Se.params===void 0)Ue!==void 0&&Ue.numberOfParams!==0&&Ue.parameterStructures!==n.ParameterStructures.byName&&F.error(`Notification ${Se.method} defines ${Ue.numberOfParams} params but received none.`),tt();else if(Array.isArray(Se.params)){const kt=Se.params;Se.method===u.type.method&&kt.length===2&&l.is(kt[0])?tt({token:kt[0],value:kt[1]}):(Ue!==void 0&&(Ue.parameterStructures===n.ParameterStructures.byName&&F.error(`Notification ${Se.method} defines parameters by name but received parameters by position`),Ue.numberOfParams!==Se.params.length&&F.error(`Notification ${Se.method} defines ${Ue.numberOfParams} params but received ${kt.length} arguments`)),tt(...kt))}else Ue!==void 0&&Ue.parameterStructures===n.ParameterStructures.byPosition&&F.error(`Notification ${Se.method} defines parameters by position but received parameters by name`),tt(Se.params);else Z&&Z(Se.method,Se.params)}catch(kt){kt.message?F.error(`Notification handler '${Se.method}' failed with message: ${kt.message}`):F.error(`Notification handler '${Se.method}' failed unexpectedly.`)}else be.fire(Se)}A(Me,"handleNotification");function He(Se){if(!Se){F.error("Received empty message.");return}F.error(`Received message which is neither a response nor a notification message:
${JSON.stringify(Se,null,4)}`);const Ue=Se;if(r.string(Ue.id)||r.number(Ue.id)){const tt=Ue.id,kt=te.get(tt);kt&&kt.reject(new Error("The received response has neither a result nor an error property."))}}A(He,"handleInvalidMessage");function De(Se){if(Se!=null)switch(ee){case f.Verbose:return JSON.stringify(Se,null,4);case f.Compact:return JSON.stringify(Se);default:return}}A(De,"stringifyTrace");function Ke(Se){if(!(ee===f.Off||!Ie))if(Re===g.Text){let Ue;(ee===f.Verbose||ee===f.Compact)&&Se.params&&(Ue=`Params: ${De(Se.params)}
`),Ie.log(`Sending request '${Se.method} - (${Se.id})'.`,Ue)}else rt("send-request",Se)}A(Ke,"traceSendingRequest");function Ae(Se){if(!(ee===f.Off||!Ie))if(Re===g.Text){let Ue;(ee===f.Verbose||ee===f.Compact)&&(Se.params?Ue=`Params: ${De(Se.params)}
`:Ue=`No parameters provided.
`),Ie.log(`Sending notification '${Se.method}'.`,Ue)}else rt("send-notification",Se)}A(Ae,"traceSendingNotification");function at(Se,Ue,tt){if(!(ee===f.Off||!Ie))if(Re===g.Text){let kt;(ee===f.Verbose||ee===f.Compact)&&(Se.error&&Se.error.data?kt=`Error data: ${De(Se.error.data)}
`:Se.result?kt=`Result: ${De(Se.result)}
`:Se.error===void 0&&(kt=`No result returned.
`)),Ie.log(`Sending response '${Ue} - (${Se.id})'. Processing request took ${Date.now()-tt}ms`,kt)}else rt("send-response",Se)}A(at,"traceSendingResponse");function Ee(Se){if(!(ee===f.Off||!Ie))if(Re===g.Text){let Ue;(ee===f.Verbose||ee===f.Compact)&&Se.params&&(Ue=`Params: ${De(Se.params)}
`),Ie.log(`Received request '${Se.method} - (${Se.id})'.`,Ue)}else rt("receive-request",Se)}A(Ee,"traceReceivedRequest");function pt(Se){if(!(ee===f.Off||!Ie||Se.method===y.type.method))if(Re===g.Text){let Ue;(ee===f.Verbose||ee===f.Compact)&&(Se.params?Ue=`Params: ${De(Se.params)}
`:Ue=`No parameters provided.
`),Ie.log(`Received notification '${Se.method}'.`,Ue)}else rt("receive-notification",Se)}A(pt,"traceReceivedNotification");function ht(Se,Ue){if(!(ee===f.Off||!Ie))if(Re===g.Text){let tt;if((ee===f.Verbose||ee===f.Compact)&&(Se.error&&Se.error.data?tt=`Error data: ${De(Se.error.data)}
`:Se.result?tt=`Result: ${De(Se.result)}
`:Se.error===void 0&&(tt=`No result returned.
`)),Ue){const kt=Se.error?` Request failed: ${Se.error.message} (${Se.error.code}).`:"";Ie.log(`Received response '${Ue.method} - (${Se.id})' in ${Date.now()-Ue.timerStart}ms.${kt}`,tt)}else Ie.log(`Received response ${Se.id} without active response promise.`,tt)}else rt("receive-response",Se)}A(ht,"traceReceivedResponse");function rt(Se,Ue){if(!Ie||ee===f.Off)return;const tt={isLSPMessage:!0,type:Se,message:Ue,timestamp:Date.now()};Ie.log(tt)}A(rt,"logLSPMessage");function Et(){if(he())throw new T(v.Closed,"Connection is closed.");if(W())throw new T(v.Disposed,"Connection is disposed.")}A(Et,"throwIfClosedOrDisposed");function vt(){if(ae())throw new T(v.AlreadyListening,"Connection is already listening")}A(vt,"throwIfListening");function ot(){if(!ae())throw new Error("Call listen() first.")}A(ot,"throwIfNotListening");function pe(Se){return Se===void 0?null:Se}A(pe,"undefinedToNull");function Ct(Se){if(Se!==null)return Se}A(Ct,"nullToUndefined");function lt(Se){return Se!=null&&!Array.isArray(Se)&&typeof Se=="object"}A(lt,"isNamedParam");function st(Se,Ue){switch(Se){case n.ParameterStructures.auto:return lt(Ue)?Ct(Ue):[pe(Ue)];case n.ParameterStructures.byName:if(!lt(Ue))throw new Error("Received parameters by name but param is not an object literal.");return Ct(Ue);case n.ParameterStructures.byPosition:return[pe(Ue)];default:throw new Error(`Unknown parameter structure ${Se.toString()}`)}}A(st,"computeSingleParam");function mt(Se,Ue){let tt;const kt=Se.numberOfParams;switch(kt){case 0:tt=void 0;break;case 1:tt=st(Se.parameterStructures,Ue[0]);break;default:tt=[];for(let Nt=0;Nt<Ue.length&&Nt<kt;Nt++)tt.push(pe(Ue[Nt]));if(Ue.length<kt)for(let Nt=Ue.length;Nt<kt;Nt++)tt.push(null);break}return tt}A(mt,"computeMessageParams");const _r={sendNotification:A((Se,...Ue)=>{Et();let tt,kt;if(r.string(Se)){tt=Se;const sr=Ue[0];let Qt=0,vr=n.ParameterStructures.auto;n.ParameterStructures.is(sr)&&(Qt=1,vr=sr);let nr=Ue.length;const Rr=nr-Qt;switch(Rr){case 0:kt=void 0;break;case 1:kt=st(vr,Ue[Qt]);break;default:if(vr===n.ParameterStructures.byName)throw new Error(`Received ${Rr} parameters for 'by Name' notification parameter structure.`);kt=Ue.slice(Qt,nr).map(Zt=>pe(Zt));break}}else{const sr=Ue;tt=Se.method,kt=mt(Se,sr)}const Nt={jsonrpc:G,method:tt,params:kt};return Ae(Nt),$.write(Nt).catch(sr=>{throw F.error("Sending notification failed."),sr})},"sendNotification"),onNotification:A((Se,Ue)=>{Et();let tt;return r.func(Se)?Z=Se:Ue&&(r.string(Se)?(tt=Se,Y.set(Se,{type:void 0,handler:Ue})):(tt=Se.method,Y.set(Se.method,{type:Se,handler:Ue}))),{dispose:A(()=>{tt!==void 0?Y.delete(tt):Z=void 0},"dispose")}},"onNotification"),onProgress:A((Se,Ue,tt)=>{if(ie.has(Ue))throw new Error(`Progress handler for token ${Ue} already registered`);return ie.set(Ue,tt),{dispose:A(()=>{ie.delete(Ue)},"dispose")}},"onProgress"),sendProgress:A((Se,Ue,tt)=>_r.sendNotification(u.type,{token:Ue,value:tt}),"sendProgress"),onUnhandledProgress:fe.event,sendRequest:A((Se,...Ue)=>{Et(),ot();let tt,kt,Nt;if(r.string(Se)){tt=Se;const nr=Ue[0],Rr=Ue[Ue.length-1];let Zt=0,gr=n.ParameterStructures.auto;n.ParameterStructures.is(nr)&&(Zt=1,gr=nr);let Dr=Ue.length;s.CancellationToken.is(Rr)&&(Dr=Dr-1,Nt=Rr);const Qe=Dr-Zt;switch(Qe){case 0:kt=void 0;break;case 1:kt=st(gr,Ue[Zt]);break;default:if(gr===n.ParameterStructures.byName)throw new Error(`Received ${Qe} parameters for 'by Name' request parameter structure.`);kt=Ue.slice(Zt,Dr).map(ct=>pe(ct));break}}else{const nr=Ue;tt=Se.method,kt=mt(Se,nr);const Rr=Se.numberOfParams;Nt=s.CancellationToken.is(nr[Rr])?nr[Rr]:void 0}const sr=z++;let Qt;Nt&&(Qt=Nt.onCancellationRequested(()=>{const nr=ve.sender.sendCancellation(_r,sr);return nr===void 0?(F.log(`Received no promise from cancellation strategy when cancelling id ${sr}`),Promise.resolve()):nr.catch(()=>{F.log(`Sending cancellation messages for id ${sr} failed`)})}));const vr={jsonrpc:G,id:sr,method:tt,params:kt};return Ke(vr),typeof ve.sender.enableCancellation=="function"&&ve.sender.enableCancellation(vr),new Promise(async(nr,Rr)=>{const Zt=A(Qe=>{nr(Qe),ve.sender.cleanup(sr),Qt==null||Qt.dispose()},"resolveWithCleanup"),gr=A(Qe=>{Rr(Qe),ve.sender.cleanup(sr),Qt==null||Qt.dispose()},"rejectWithCleanup"),Dr={method:tt,timerStart:Date.now(),resolve:Zt,reject:gr};try{await $.write(vr),te.set(sr,Dr)}catch(Qe){throw F.error("Sending request failed."),Dr.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,Qe.message?Qe.message:"Unknown reason")),Qe}})},"sendRequest"),onRequest:A((Se,Ue)=>{Et();let tt=null;return d.is(Se)?(tt=void 0,H=Se):r.string(Se)?(tt=null,Ue!==void 0&&(tt=Se,q.set(Se,{handler:Ue,type:void 0}))):Ue!==void 0&&(tt=Se.method,q.set(Se.method,{type:Se,handler:Ue})),{dispose:A(()=>{tt!==null&&(tt!==void 0?q.delete(tt):H=void 0)},"dispose")}},"onRequest"),hasPendingResponse:A(()=>te.size>0,"hasPendingResponse"),trace:A(async(Se,Ue,tt)=>{let kt=!1,Nt=g.Text;tt!==void 0&&(r.boolean(tt)?kt=tt:(kt=tt.sendNotification||!1,Nt=tt.traceFormat||g.Text)),ee=Se,Re=Nt,ee===f.Off?Ie=void 0:Ie=Ue,kt&&!he()&&!W()&&await _r.sendNotification(m.type,{value:f.toString(Se)})},"trace"),onError:ce.event,onClose:oe.event,onUnhandledNotification:be.event,onDispose:Pe.event,end:A(()=>{$.end()},"end"),dispose:A(()=>{if(W())return;Be=L.Disposed,Pe.fire(void 0);const Se=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const Ue of te.values())Ue.reject(Se);te=new Map,ge=new Map,J=new Set,Q=new i.LinkedMap,r.func($.dispose)&&$.dispose(),r.func(I.dispose)&&I.dispose()},"dispose"),listen:A(()=>{Et(),vt(),Be=L.Listening,I.listen(Ge)},"listen"),inspect:A(()=>{(0,e.default)().console.log("inspect")},"inspect")};return _r.onNotification(y.type,Se=>{if(ee===f.Off||!Ie)return;const Ue=ee===f.Verbose||ee===f.Compact;Ie.log(Se.message,Ue?Se.verbose:void 0)}),_r.onNotification(u.type,Se=>{const Ue=ie.get(Se.token);Ue?Ue(Se.value):fe.fire(Se)}),_r}A(P,"createMessageConnection"),t.createMessageConnection=P}}),S9=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;var e=sbe();Object.defineProperty(t,"Message",{enumerable:!0,get:A(function(){return e.Message},"get")}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:A(function(){return e.RequestType},"get")}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:A(function(){return e.RequestType0},"get")}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:A(function(){return e.RequestType1},"get")}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:A(function(){return e.RequestType2},"get")}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:A(function(){return e.RequestType3},"get")}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:A(function(){return e.RequestType4},"get")}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:A(function(){return e.RequestType5},"get")}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:A(function(){return e.RequestType6},"get")}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:A(function(){return e.RequestType7},"get")}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:A(function(){return e.RequestType8},"get")}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:A(function(){return e.RequestType9},"get")}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:A(function(){return e.ResponseError},"get")}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:A(function(){return e.ErrorCodes},"get")}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:A(function(){return e.NotificationType},"get")}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:A(function(){return e.NotificationType0},"get")}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:A(function(){return e.NotificationType1},"get")}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:A(function(){return e.NotificationType2},"get")}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:A(function(){return e.NotificationType3},"get")}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:A(function(){return e.NotificationType4},"get")}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:A(function(){return e.NotificationType5},"get")}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:A(function(){return e.NotificationType6},"get")}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:A(function(){return e.NotificationType7},"get")}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:A(function(){return e.NotificationType8},"get")}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:A(function(){return e.NotificationType9},"get")}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:A(function(){return e.ParameterStructures},"get")});var r=obe();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:A(function(){return r.LinkedMap},"get")}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:A(function(){return r.LRUCache},"get")}),Object.defineProperty(t,"Touch",{enumerable:!0,get:A(function(){return r.Touch},"get")});var n=Iyt();Object.defineProperty(t,"Disposable",{enumerable:!0,get:A(function(){return n.Disposable},"get")});var i=$x();Object.defineProperty(t,"Event",{enumerable:!0,get:A(function(){return i.Event},"get")}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:A(function(){return i.Emitter},"get")});var a=CL();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:A(function(){return a.CancellationTokenSource},"get")}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:A(function(){return a.CancellationToken},"get")});var s=Nyt();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:A(function(){return s.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:A(function(){return s.SharedArrayReceiverStrategy},"get")});var o=Dyt();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:A(function(){return o.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:A(function(){return o.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:A(function(){return o.ReadableStreamMessageReader},"get")});var l=Oyt();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:A(function(){return l.MessageWriter},"get")}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:A(function(){return l.AbstractMessageWriter},"get")}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:A(function(){return l.WriteableStreamMessageWriter},"get")});var u=$yt();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:A(function(){return u.AbstractMessageBuffer},"get")});var h=Pyt();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:A(function(){return h.ConnectionStrategy},"get")}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:A(function(){return h.ConnectionOptions},"get")}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:A(function(){return h.NullLogger},"get")}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:A(function(){return h.createMessageConnection},"get")}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:A(function(){return h.ProgressToken},"get")}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:A(function(){return h.ProgressType},"get")}),Object.defineProperty(t,"Trace",{enumerable:!0,get:A(function(){return h.Trace},"get")}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:A(function(){return h.TraceValues},"get")}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:A(function(){return h.TraceFormat},"get")}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:A(function(){return h.SetTraceNotification},"get")}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:A(function(){return h.LogTraceNotification},"get")}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:A(function(){return h.ConnectionErrors},"get")}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:A(function(){return h.ConnectionError},"get")}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:A(function(){return h.CancellationReceiverStrategy},"get")}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:A(function(){return h.CancellationSenderStrategy},"get")}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:A(function(){return h.CancellationStrategy},"get")}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:A(function(){return h.MessageStrategy},"get")});var d=yg();t.RAL=d.default}}),Byt=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(t){var l,u,h;Object.defineProperty(t,"__esModule",{value:!0});var e=S9(),r=(l=class extends e.AbstractMessageBuffer{constructor(f="utf-8"){super(f),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return l.emptyBuffer}fromString(f,p){return new TextEncoder().encode(f)}toString(f,p){return p==="ascii"?this.asciiDecoder.decode(f):new TextDecoder(p).decode(f)}asNative(f,p){return p===void 0?f:f.slice(0,p)}allocNative(f){return new Uint8Array(f)}},A(l,"MessageBuffer"),l);r.emptyBuffer=new Uint8Array(0);var n=(u=class{constructor(f){this.socket=f,this._onData=new e.Emitter,this._messageListener=p=>{p.data.arrayBuffer().then(m=>{this._onData.fire(new Uint8Array(m))},()=>{(0,e.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}onData(f){return this._onData.event(f)}},A(u,"ReadableStreamWrapper"),u),i=(h=class{constructor(f){this.socket=f}onClose(f){return this.socket.addEventListener("close",f),e.Disposable.create(()=>this.socket.removeEventListener("close",f))}onError(f){return this.socket.addEventListener("error",f),e.Disposable.create(()=>this.socket.removeEventListener("error",f))}onEnd(f){return this.socket.addEventListener("end",f),e.Disposable.create(()=>this.socket.removeEventListener("end",f))}write(f,p){if(typeof f=="string"){if(p!==void 0&&p!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${p}`);this.socket.send(f)}else this.socket.send(f);return Promise.resolve()}end(){this.socket.close()}},A(h,"WritableStreamWrapper"),h),a=new TextEncoder,s=Object.freeze({messageBuffer:Object.freeze({create:A(d=>new r(d),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:A((d,f)=>{if(f.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${f.charset}`);return Promise.resolve(a.encode(JSON.stringify(d,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:A((d,f)=>{if(!(d instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(f.charset).decode(d)))},"decode")})}),stream:Object.freeze({asReadableStream:A(d=>new n(d),"asReadableStream"),asWritableStream:A(d=>new i(d),"asWritableStream")}),console,timer:Object.freeze({setTimeout(d,f,...p){const g=setTimeout(d,f,...p);return{dispose:A(()=>clearTimeout(g),"dispose")}},setImmediate(d,...f){const p=setTimeout(d,0,...f);return{dispose:A(()=>clearTimeout(p),"dispose")}},setInterval(d,f,...p){const g=setInterval(d,f,...p);return{dispose:A(()=>clearInterval(g),"dispose")}}})});function o(){return s}A(o,"RIL"),(function(d){function f(){e.RAL.install(s)}A(f,"install"),d.install=f})(o||(o={})),t.default=o}}),Px=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(t){var l,u;var e=t&&t.__createBinding||(Object.create?(function(h,d,f,p){p===void 0&&(p=f);var g=Object.getOwnPropertyDescriptor(d,f);(!g||("get"in g?!d.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:A(function(){return d[f]},"get")}),Object.defineProperty(h,p,g)}):(function(h,d,f,p){p===void 0&&(p=f),h[p]=d[f]})),r=t&&t.__exportStar||function(h,d){for(var f in h)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&e(d,h,f)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0;var n=Byt();n.default.install();var i=S9();r(S9(),t);var a=(l=class extends i.AbstractMessageReader{constructor(d){super(),this._onData=new i.Emitter,this._messageListener=f=>{this._onData.fire(f.data)},d.addEventListener("error",f=>this.fireError(f)),d.onmessage=this._messageListener}listen(d){return this._onData.event(d)}},A(l,"BrowserMessageReader"),l);t.BrowserMessageReader=a;var s=(u=class extends i.AbstractMessageWriter{constructor(d){super(),this.port=d,this.errorCount=0,d.addEventListener("error",f=>this.fireError(f))}write(d){try{return this.port.postMessage(d),Promise.resolve()}catch(f){return this.handleError(f,d),Promise.reject(f)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){}},A(u,"BrowserMessageWriter"),u);t.BrowserMessageWriter=s;function o(h,d,f,p){return f===void 0&&(f=i.NullLogger),i.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,i.createMessageConnection)(h,d,f,p)}A(o,"createMessageConnection"),t.createMessageConnection=o}}),Lte=Nr({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=Px()}}),mi=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(t){var l,u,h,d,f;Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=t.MessageDirection=void 0;var e=Px(),r;(function(p){p.clientToServer="clientToServer",p.serverToClient="serverToClient",p.both="both"})(r||(t.MessageDirection=r={}));var n=(l=class{constructor(g){this.method=g}},A(l,"RegistrationType"),l);t.RegistrationType=n;var i=(u=class extends e.RequestType0{constructor(g){super(g)}},A(u,"ProtocolRequestType0"),u);t.ProtocolRequestType0=i;var a=(h=class extends e.RequestType{constructor(g){super(g,e.ParameterStructures.byName)}},A(h,"ProtocolRequestType"),h);t.ProtocolRequestType=a;var s=(d=class extends e.NotificationType0{constructor(g){super(g)}},A(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=s;var o=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},A(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=o}}),SW=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.objectLiteral=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0;function e(h){return h===!0||h===!1}A(e,"boolean"),t.boolean=e;function r(h){return typeof h=="string"||h instanceof String}A(r,"string"),t.string=r;function n(h){return typeof h=="number"||h instanceof Number}A(n,"number"),t.number=n;function i(h){return h instanceof Error}A(i,"error"),t.error=i;function a(h){return typeof h=="function"}A(a,"func"),t.func=a;function s(h){return Array.isArray(h)}A(s,"array"),t.array=s;function o(h){return s(h)&&h.every(d=>r(d))}A(o,"stringArray"),t.stringArray=o;function l(h,d){return Array.isArray(h)&&h.every(d)}A(l,"typedArray"),t.typedArray=l;function u(h){return h!==null&&typeof h=="object"}A(u,"objectLiteral"),t.objectLiteral=u}}),Fyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationRequest=void 0;var e=mi(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),zyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeDefinitionRequest=void 0;var e=mi(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),Vyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;var e=mi(),r;(function(i){i.method="workspace/workspaceFolders",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(r||(t.WorkspaceFoldersRequest=r={}));var n;(function(i){i.method="workspace/didChangeWorkspaceFolders",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolNotificationType(i.method)})(n||(t.DidChangeWorkspaceFoldersNotification=n={}))}}),Gyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;var e=mi(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),Wyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPresentationRequest=t.DocumentColorRequest=void 0;var e=mi(),r;(function(i){i.method="textDocument/documentColor",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.DocumentColorRequest=r={}));var n;(function(i){i.method="textDocument/colorPresentation",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(n||(t.ColorPresentationRequest=n={}))}}),Hyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=void 0;var e=mi(),r;(function(i){i.method="textDocument/foldingRange",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.FoldingRangeRequest=r={}));var n;(function(i){i.method="workspace/foldingRange/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.FoldingRangeRefreshRequest=n={}))}}),qyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarationRequest=void 0;var e=mi(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),Uyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRangeRequest=void 0;var e=mi(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),Yyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=void 0;var e=Px(),r=mi(),n;(function(s){s.type=new e.ProgressType;function o(l){return l===s.type}A(o,"is"),s.is=o})(n||(t.WorkDoneProgress=n={}));var i;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=r.MessageDirection.serverToClient,s.type=new r.ProtocolRequestType(s.method)})(i||(t.WorkDoneProgressCreateRequest=i={}));var a;(function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolNotificationType(s.method)})(a||(t.WorkDoneProgressCancelNotification=a={}))}}),Xyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.CallHierarchyPrepareRequest=void 0;var e=mi(),r;(function(a){a.method="textDocument/prepareCallHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.CallHierarchyPrepareRequest=r={}));var n;(function(a){a.method="callHierarchy/incomingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.CallHierarchyIncomingCallsRequest=n={}));var i;(function(a){a.method="callHierarchy/outgoingCalls",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.CallHierarchyOutgoingCallsRequest=i={}))}}),jyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.SemanticTokensRegistrationType=t.TokenFormat=void 0;var e=mi(),r;(function(l){l.Relative="relative"})(r||(t.TokenFormat=r={}));var n;(function(l){l.method="textDocument/semanticTokens",l.type=new e.RegistrationType(l.method)})(n||(t.SemanticTokensRegistrationType=n={}));var i;(function(l){l.method="textDocument/semanticTokens/full",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(i||(t.SemanticTokensRequest=i={}));var a;(function(l){l.method="textDocument/semanticTokens/full/delta",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(a||(t.SemanticTokensDeltaRequest=a={}));var s;(function(l){l.method="textDocument/semanticTokens/range",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(s||(t.SemanticTokensRangeRequest=s={}));var o;(function(l){l.method="workspace/semanticTokens/refresh",l.messageDirection=e.MessageDirection.serverToClient,l.type=new e.ProtocolRequestType0(l.method)})(o||(t.SemanticTokensRefreshRequest=o={}))}}),Kyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentRequest=void 0;var e=mi(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),Zyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeRequest=void 0;var e=mi(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),Qyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.DidRenameFilesNotification=t.WillRenameFilesRequest=t.DidCreateFilesNotification=t.WillCreateFilesRequest=t.FileOperationPatternKind=void 0;var e=mi(),r;(function(u){u.file="file",u.folder="folder"})(r||(t.FileOperationPatternKind=r={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(n||(t.WillCreateFilesRequest=n={}));var i;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(i||(t.DidCreateFilesNotification=i={}));var a;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(a||(t.WillRenameFilesRequest=a={}));var s;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(s||(t.DidRenameFilesNotification=s={}));var o;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(o||(t.DidDeleteFilesNotification=o={}));var l;(function(u){u.method="workspace/willDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(l||(t.WillDeleteFilesRequest=l={}))}}),Jyt=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=void 0;var e=mi(),r;(function(a){a.document="document",a.project="project",a.group="group",a.scheme="scheme",a.global="global"})(r||(t.UniquenessLevel=r={}));var n;(function(a){a.$import="import",a.$export="export",a.local="local"})(n||(t.MonikerKind=n={}));var i;(function(a){a.method="textDocument/moniker",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.MonikerRequest=i={}))}}),e1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHierarchySubtypesRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchyPrepareRequest=void 0;var e=mi(),r;(function(a){a.method="textDocument/prepareTypeHierarchy",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.TypeHierarchyPrepareRequest=r={}));var n;(function(a){a.method="typeHierarchy/supertypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.TypeHierarchySupertypesRequest=n={}));var i;(function(a){a.method="typeHierarchy/subtypes",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(i||(t.TypeHierarchySubtypesRequest=i={}))}}),t1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlineValueRefreshRequest=t.InlineValueRequest=void 0;var e=mi(),r;(function(i){i.method="textDocument/inlineValue",i.messageDirection=e.MessageDirection.clientToServer,i.type=new e.ProtocolRequestType(i.method)})(r||(t.InlineValueRequest=r={}));var n;(function(i){i.method="workspace/inlineValue/refresh",i.messageDirection=e.MessageDirection.serverToClient,i.type=new e.ProtocolRequestType0(i.method)})(n||(t.InlineValueRefreshRequest=n={}))}}),r1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=void 0;var e=mi(),r;(function(a){a.method="textDocument/inlayHint",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(r||(t.InlayHintRequest=r={}));var n;(function(a){a.method="inlayHint/resolve",a.messageDirection=e.MessageDirection.clientToServer,a.type=new e.ProtocolRequestType(a.method)})(n||(t.InlayHintResolveRequest=n={}));var i;(function(a){a.method="workspace/inlayHint/refresh",a.messageDirection=e.MessageDirection.serverToClient,a.type=new e.ProtocolRequestType0(a.method)})(i||(t.InlayHintRefreshRequest=i={}))}}),n1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=void 0;var e=Px(),r=SW(),n=mi(),i;(function(u){function h(d){const f=d;return f&&r.boolean(f.retriggerRequest)}A(h,"is"),u.is=h})(i||(t.DiagnosticServerCancellationData=i={}));var a;(function(u){u.Full="full",u.Unchanged="unchanged"})(a||(t.DocumentDiagnosticReportKind=a={}));var s;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(s||(t.DocumentDiagnosticRequest=s={}));var o;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(o||(t.WorkspaceDiagnosticRequest=o={}));var l;(function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)})(l||(t.DiagnosticRefreshRequest=l={}))}}),i1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=void 0;var e=(SS(),kW(wL)),r=SW(),n=mi(),i;(function(g){g.Markup=1,g.Code=2;function m(y){return y===1||y===2}A(m,"is"),g.is=m})(i||(t.NotebookCellKind=i={}));var a;(function(g){function m(T,b){const w={executionOrder:T};return(b===!0||b===!1)&&(w.success=b),w}A(m,"create"),g.create=m;function y(T){const b=T;return r.objectLiteral(b)&&e.uinteger.is(b.executionOrder)&&(b.success===void 0||r.boolean(b.success))}A(y,"is"),g.is=y;function v(T,b){return T===b?!0:T==null||b===null||b===void 0?!1:T.executionOrder===b.executionOrder&&T.success===b.success}A(v,"equals"),g.equals=v})(a||(t.ExecutionSummary=a={}));var s;(function(g){function m(b,w){return{kind:b,document:w}}A(m,"create"),g.create=m;function y(b){const w=b;return r.objectLiteral(w)&&i.is(w.kind)&&e.DocumentUri.is(w.document)&&(w.metadata===void 0||r.objectLiteral(w.metadata))}A(y,"is"),g.is=y;function v(b,w){const C=new Set;return b.document!==w.document&&C.add("document"),b.kind!==w.kind&&C.add("kind"),b.executionSummary!==w.executionSummary&&C.add("executionSummary"),(b.metadata!==void 0||w.metadata!==void 0)&&!T(b.metadata,w.metadata)&&C.add("metadata"),(b.executionSummary!==void 0||w.executionSummary!==void 0)&&!a.equals(b.executionSummary,w.executionSummary)&&C.add("executionSummary"),C}A(v,"diff"),g.diff=v;function T(b,w){if(b===w)return!0;if(b==null||w===null||w===void 0||typeof b!=typeof w||typeof b!="object")return!1;const C=Array.isArray(b),S=Array.isArray(w);if(C!==S)return!1;if(C&&S){if(b.length!==w.length)return!1;for(let k=0;k<b.length;k++)if(!T(b[k],w[k]))return!1}if(r.objectLiteral(b)&&r.objectLiteral(w)){const k=Object.keys(b),E=Object.keys(w);if(k.length!==E.length||(k.sort(),E.sort(),!T(k,E)))return!1;for(let _=0;_<k.length;_++){const M=k[_];if(!T(b[M],w[M]))return!1}}return!0}A(T,"equalsMetadata")})(s||(t.NotebookCell=s={}));var o;(function(g){function m(v,T,b,w){return{uri:v,notebookType:T,version:b,cells:w}}A(m,"create"),g.create=m;function y(v){const T=v;return r.objectLiteral(T)&&r.string(T.uri)&&e.integer.is(T.version)&&r.typedArray(T.cells,s.is)}A(y,"is"),g.is=y})(o||(t.NotebookDocument=o={}));var l;(function(g){g.method="notebookDocument/sync",g.messageDirection=n.MessageDirection.clientToServer,g.type=new n.RegistrationType(g.method)})(l||(t.NotebookDocumentSyncRegistrationType=l={}));var u;(function(g){g.method="notebookDocument/didOpen",g.messageDirection=n.MessageDirection.clientToServer,g.type=new n.ProtocolNotificationType(g.method),g.registrationMethod=l.method})(u||(t.DidOpenNotebookDocumentNotification=u={}));var h;(function(g){function m(v){const T=v;return r.objectLiteral(T)&&e.uinteger.is(T.start)&&e.uinteger.is(T.deleteCount)&&(T.cells===void 0||r.typedArray(T.cells,s.is))}A(m,"is"),g.is=m;function y(v,T,b){const w={start:v,deleteCount:T};return b!==void 0&&(w.cells=b),w}A(y,"create"),g.create=y})(h||(t.NotebookCellArrayChange=h={}));var d;(function(g){g.method="notebookDocument/didChange",g.messageDirection=n.MessageDirection.clientToServer,g.type=new n.ProtocolNotificationType(g.method),g.registrationMethod=l.method})(d||(t.DidChangeNotebookDocumentNotification=d={}));var f;(function(g){g.method="notebookDocument/didSave",g.messageDirection=n.MessageDirection.clientToServer,g.type=new n.ProtocolNotificationType(g.method),g.registrationMethod=l.method})(f||(t.DidSaveNotebookDocumentNotification=f={}));var p;(function(g){g.method="notebookDocument/didClose",g.messageDirection=n.MessageDirection.clientToServer,g.type=new n.ProtocolNotificationType(g.method),g.registrationMethod=l.method})(p||(t.DidCloseNotebookDocumentNotification=p={}))}}),a1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineCompletion.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InlineCompletionRequest=void 0;var e=mi(),r;(function(n){n.method="textDocument/inlineCompletion",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.InlineCompletionRequest=r={}))}}),s1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceSymbolRequest=t.CodeActionResolveRequest=t.CodeActionRequest=t.DocumentSymbolRequest=t.DocumentHighlightRequest=t.ReferencesRequest=t.DefinitionRequest=t.SignatureHelpRequest=t.SignatureHelpTriggerKind=t.HoverRequest=t.CompletionResolveRequest=t.CompletionRequest=t.CompletionTriggerKind=t.PublishDiagnosticsNotification=t.WatchKind=t.RelativePattern=t.FileChangeType=t.DidChangeWatchedFilesNotification=t.WillSaveTextDocumentWaitUntilRequest=t.WillSaveTextDocumentNotification=t.TextDocumentSaveReason=t.DidSaveTextDocumentNotification=t.DidCloseTextDocumentNotification=t.DidChangeTextDocumentNotification=t.TextDocumentContentChangeEvent=t.DidOpenTextDocumentNotification=t.TextDocumentSyncKind=t.TelemetryEventNotification=t.LogMessageNotification=t.ShowMessageRequest=t.ShowMessageNotification=t.MessageType=t.DidChangeConfigurationNotification=t.ExitNotification=t.ShutdownRequest=t.InitializedNotification=t.InitializeErrorCodes=t.InitializeRequest=t.WorkDoneProgressOptions=t.TextDocumentRegistrationOptions=t.StaticRegistrationOptions=t.PositionEncodingKind=t.FailureHandlingKind=t.ResourceOperationKind=t.UnregistrationRequest=t.RegistrationRequest=t.DocumentSelector=t.NotebookCellTextDocumentFilter=t.NotebookDocumentFilter=t.TextDocumentFilter=void 0,t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.WillRenameFilesRequest=t.DidRenameFilesNotification=t.WillCreateFilesRequest=t.DidCreateFilesNotification=t.FileOperationPatternKind=t.LinkedEditingRangeRequest=t.ShowDocumentRequest=t.SemanticTokensRegistrationType=t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.TokenFormat=t.CallHierarchyPrepareRequest=t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=t.SelectionRangeRequest=t.DeclarationRequest=t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=t.ColorPresentationRequest=t.DocumentColorRequest=t.ConfigurationRequest=t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=t.TypeDefinitionRequest=t.ImplementationRequest=t.ApplyWorkspaceEditRequest=t.ExecuteCommandRequest=t.PrepareRenameRequest=t.RenameRequest=t.PrepareSupportDefaultBehavior=t.DocumentOnTypeFormattingRequest=t.DocumentRangesFormattingRequest=t.DocumentRangeFormattingRequest=t.DocumentFormattingRequest=t.DocumentLinkResolveRequest=t.DocumentLinkRequest=t.CodeLensRefreshRequest=t.CodeLensResolveRequest=t.CodeLensRequest=t.WorkspaceSymbolResolveRequest=void 0,t.InlineCompletionRequest=t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=t.InlineValueRefreshRequest=t.InlineValueRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchySubtypesRequest=t.TypeHierarchyPrepareRequest=void 0;var e=mi(),r=(SS(),kW(wL)),n=SW(),i=Fyt();Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:A(function(){return i.ImplementationRequest},"get")});var a=zyt();Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:A(function(){return a.TypeDefinitionRequest},"get")});var s=Vyt();Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:A(function(){return s.WorkspaceFoldersRequest},"get")}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:A(function(){return s.DidChangeWorkspaceFoldersNotification},"get")});var o=Gyt();Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:A(function(){return o.ConfigurationRequest},"get")});var l=Wyt();Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:A(function(){return l.DocumentColorRequest},"get")}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:A(function(){return l.ColorPresentationRequest},"get")});var u=Hyt();Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:A(function(){return u.FoldingRangeRequest},"get")}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:A(function(){return u.FoldingRangeRefreshRequest},"get")});var h=qyt();Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:A(function(){return h.DeclarationRequest},"get")});var d=Uyt();Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:A(function(){return d.SelectionRangeRequest},"get")});var f=Yyt();Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:A(function(){return f.WorkDoneProgress},"get")}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:A(function(){return f.WorkDoneProgressCreateRequest},"get")}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:A(function(){return f.WorkDoneProgressCancelNotification},"get")});var p=Xyt();Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:A(function(){return p.CallHierarchyIncomingCallsRequest},"get")}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:A(function(){return p.CallHierarchyOutgoingCallsRequest},"get")}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:A(function(){return p.CallHierarchyPrepareRequest},"get")});var g=jyt();Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:A(function(){return g.TokenFormat},"get")}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:A(function(){return g.SemanticTokensRequest},"get")}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:A(function(){return g.SemanticTokensDeltaRequest},"get")}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:A(function(){return g.SemanticTokensRangeRequest},"get")}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:A(function(){return g.SemanticTokensRefreshRequest},"get")}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:A(function(){return g.SemanticTokensRegistrationType},"get")});var m=Kyt();Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:A(function(){return m.ShowDocumentRequest},"get")});var y=Zyt();Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:A(function(){return y.LinkedEditingRangeRequest},"get")});var v=Qyt();Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:A(function(){return v.FileOperationPatternKind},"get")}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:A(function(){return v.DidCreateFilesNotification},"get")}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:A(function(){return v.WillCreateFilesRequest},"get")}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:A(function(){return v.DidRenameFilesNotification},"get")}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:A(function(){return v.WillRenameFilesRequest},"get")}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:A(function(){return v.DidDeleteFilesNotification},"get")}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:A(function(){return v.WillDeleteFilesRequest},"get")});var T=Jyt();Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:A(function(){return T.UniquenessLevel},"get")}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:A(function(){return T.MonikerKind},"get")}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:A(function(){return T.MonikerRequest},"get")});var b=e1t();Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:A(function(){return b.TypeHierarchyPrepareRequest},"get")}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:A(function(){return b.TypeHierarchySubtypesRequest},"get")}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:A(function(){return b.TypeHierarchySupertypesRequest},"get")});var w=t1t();Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:A(function(){return w.InlineValueRequest},"get")}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:A(function(){return w.InlineValueRefreshRequest},"get")});var C=r1t();Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:A(function(){return C.InlayHintRequest},"get")}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:A(function(){return C.InlayHintResolveRequest},"get")}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:A(function(){return C.InlayHintRefreshRequest},"get")});var S=n1t();Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:A(function(){return S.DiagnosticServerCancellationData},"get")}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:A(function(){return S.DocumentDiagnosticReportKind},"get")}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:A(function(){return S.DocumentDiagnosticRequest},"get")}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:A(function(){return S.WorkspaceDiagnosticRequest},"get")}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:A(function(){return S.DiagnosticRefreshRequest},"get")});var k=i1t();Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:A(function(){return k.NotebookCellKind},"get")}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:A(function(){return k.ExecutionSummary},"get")}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:A(function(){return k.NotebookCell},"get")}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:A(function(){return k.NotebookDocument},"get")}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:A(function(){return k.NotebookDocumentSyncRegistrationType},"get")}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:A(function(){return k.DidOpenNotebookDocumentNotification},"get")}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:A(function(){return k.NotebookCellArrayChange},"get")}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:A(function(){return k.DidChangeNotebookDocumentNotification},"get")}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:A(function(){return k.DidSaveNotebookDocumentNotification},"get")}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:A(function(){return k.DidCloseNotebookDocumentNotification},"get")});var E=a1t();Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:A(function(){return E.InlineCompletionRequest},"get")});var _;(function(pe){function Ct(lt){const st=lt;return n.string(st)||n.string(st.language)||n.string(st.scheme)||n.string(st.pattern)}A(Ct,"is"),pe.is=Ct})(_||(t.TextDocumentFilter=_={}));var M;(function(pe){function Ct(lt){const st=lt;return n.objectLiteral(st)&&(n.string(st.notebookType)||n.string(st.scheme)||n.string(st.pattern))}A(Ct,"is"),pe.is=Ct})(M||(t.NotebookDocumentFilter=M={}));var L;(function(pe){function Ct(lt){const st=lt;return n.objectLiteral(st)&&(n.string(st.notebook)||M.is(st.notebook))&&(st.language===void 0||n.string(st.language))}A(Ct,"is"),pe.is=Ct})(L||(t.NotebookCellTextDocumentFilter=L={}));var P;(function(pe){function Ct(lt){if(!Array.isArray(lt))return!1;for(let st of lt)if(!n.string(st)&&!_.is(st)&&!L.is(st))return!1;return!0}A(Ct,"is"),pe.is=Ct})(P||(t.DocumentSelector=P={}));var D;(function(pe){pe.method="client/registerCapability",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolRequestType(pe.method)})(D||(t.RegistrationRequest=D={}));var R;(function(pe){pe.method="client/unregisterCapability",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolRequestType(pe.method)})(R||(t.UnregistrationRequest=R={}));var I;(function(pe){pe.Create="create",pe.Rename="rename",pe.Delete="delete"})(I||(t.ResourceOperationKind=I={}));var $;(function(pe){pe.Abort="abort",pe.Transactional="transactional",pe.TextOnlyTransactional="textOnlyTransactional",pe.Undo="undo"})($||(t.FailureHandlingKind=$={}));var O;(function(pe){pe.UTF8="utf-8",pe.UTF16="utf-16",pe.UTF32="utf-32"})(O||(t.PositionEncodingKind=O={}));var N;(function(pe){function Ct(lt){const st=lt;return st&&n.string(st.id)&&st.id.length>0}A(Ct,"hasId"),pe.hasId=Ct})(N||(t.StaticRegistrationOptions=N={}));var F;(function(pe){function Ct(lt){const st=lt;return st&&(st.documentSelector===null||P.is(st.documentSelector))}A(Ct,"is"),pe.is=Ct})(F||(t.TextDocumentRegistrationOptions=F={}));var z;(function(pe){function Ct(st){const mt=st;return n.objectLiteral(mt)&&(mt.workDoneProgress===void 0||n.boolean(mt.workDoneProgress))}A(Ct,"is"),pe.is=Ct;function lt(st){const mt=st;return mt&&n.boolean(mt.workDoneProgress)}A(lt,"hasWorkDoneProgress"),pe.hasWorkDoneProgress=lt})(z||(t.WorkDoneProgressOptions=z={}));var V;(function(pe){pe.method="initialize",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(V||(t.InitializeRequest=V={}));var B;(function(pe){pe.unknownProtocolVersion=1})(B||(t.InitializeErrorCodes=B={}));var G;(function(pe){pe.method="initialized",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(G||(t.InitializedNotification=G={}));var H;(function(pe){pe.method="shutdown",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType0(pe.method)})(H||(t.ShutdownRequest=H={}));var q;(function(pe){pe.method="exit",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType0(pe.method)})(q||(t.ExitNotification=q={}));var Z;(function(pe){pe.method="workspace/didChangeConfiguration",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(Z||(t.DidChangeConfigurationNotification=Z={}));var Y;(function(pe){pe.Error=1,pe.Warning=2,pe.Info=3,pe.Log=4,pe.Debug=5})(Y||(t.MessageType=Y={}));var ie;(function(pe){pe.method="window/showMessage",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolNotificationType(pe.method)})(ie||(t.ShowMessageNotification=ie={}));var K;(function(pe){pe.method="window/showMessageRequest",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolRequestType(pe.method)})(K||(t.ShowMessageRequest=K={}));var Q;(function(pe){pe.method="window/logMessage",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolNotificationType(pe.method)})(Q||(t.LogMessageNotification=Q={}));var te;(function(pe){pe.method="telemetry/event",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolNotificationType(pe.method)})(te||(t.TelemetryEventNotification=te={}));var J;(function(pe){pe.None=0,pe.Full=1,pe.Incremental=2})(J||(t.TextDocumentSyncKind=J={}));var ge;(function(pe){pe.method="textDocument/didOpen",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(ge||(t.DidOpenTextDocumentNotification=ge={}));var ee;(function(pe){function Ct(st){let mt=st;return mt!=null&&typeof mt.text=="string"&&mt.range!==void 0&&(mt.rangeLength===void 0||typeof mt.rangeLength=="number")}A(Ct,"isIncremental"),pe.isIncremental=Ct;function lt(st){let mt=st;return mt!=null&&typeof mt.text=="string"&&mt.range===void 0&&mt.rangeLength===void 0}A(lt,"isFull"),pe.isFull=lt})(ee||(t.TextDocumentContentChangeEvent=ee={}));var Re;(function(pe){pe.method="textDocument/didChange",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(Re||(t.DidChangeTextDocumentNotification=Re={}));var Ie;(function(pe){pe.method="textDocument/didClose",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(Ie||(t.DidCloseTextDocumentNotification=Ie={}));var Be;(function(pe){pe.method="textDocument/didSave",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(Be||(t.DidSaveTextDocumentNotification=Be={}));var ce;(function(pe){pe.Manual=1,pe.AfterDelay=2,pe.FocusOut=3})(ce||(t.TextDocumentSaveReason=ce={}));var oe;(function(pe){pe.method="textDocument/willSave",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(oe||(t.WillSaveTextDocumentNotification=oe={}));var be;(function(pe){pe.method="textDocument/willSaveWaitUntil",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(be||(t.WillSaveTextDocumentWaitUntilRequest=be={}));var fe;(function(pe){pe.method="workspace/didChangeWatchedFiles",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolNotificationType(pe.method)})(fe||(t.DidChangeWatchedFilesNotification=fe={}));var Pe;(function(pe){pe.Created=1,pe.Changed=2,pe.Deleted=3})(Pe||(t.FileChangeType=Pe={}));var ve;(function(pe){function Ct(lt){const st=lt;return n.objectLiteral(st)&&(r.URI.is(st.baseUri)||r.WorkspaceFolder.is(st.baseUri))&&n.string(st.pattern)}A(Ct,"is"),pe.is=Ct})(ve||(t.RelativePattern=ve={}));var Ce;(function(pe){pe.Create=1,pe.Change=2,pe.Delete=4})(Ce||(t.WatchKind=Ce={}));var Ve;(function(pe){pe.method="textDocument/publishDiagnostics",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolNotificationType(pe.method)})(Ve||(t.PublishDiagnosticsNotification=Ve={}));var se;(function(pe){pe.Invoked=1,pe.TriggerCharacter=2,pe.TriggerForIncompleteCompletions=3})(se||(t.CompletionTriggerKind=se={}));var de;(function(pe){pe.method="textDocument/completion",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(de||(t.CompletionRequest=de={}));var Te;(function(pe){pe.method="completionItem/resolve",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Te||(t.CompletionResolveRequest=Te={}));var ae;(function(pe){pe.method="textDocument/hover",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(ae||(t.HoverRequest=ae={}));var he;(function(pe){pe.Invoked=1,pe.TriggerCharacter=2,pe.ContentChange=3})(he||(t.SignatureHelpTriggerKind=he={}));var W;(function(pe){pe.method="textDocument/signatureHelp",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(W||(t.SignatureHelpRequest=W={}));var ne;(function(pe){pe.method="textDocument/definition",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(ne||(t.DefinitionRequest=ne={}));var j;(function(pe){pe.method="textDocument/references",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(j||(t.ReferencesRequest=j={}));var ue;(function(pe){pe.method="textDocument/documentHighlight",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(ue||(t.DocumentHighlightRequest=ue={}));var X;(function(pe){pe.method="textDocument/documentSymbol",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(X||(t.DocumentSymbolRequest=X={}));var Oe;(function(pe){pe.method="textDocument/codeAction",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Oe||(t.CodeActionRequest=Oe={}));var xe;(function(pe){pe.method="codeAction/resolve",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(xe||(t.CodeActionResolveRequest=xe={}));var Ge;(function(pe){pe.method="workspace/symbol",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Ge||(t.WorkspaceSymbolRequest=Ge={}));var _e;(function(pe){pe.method="workspaceSymbol/resolve",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(_e||(t.WorkspaceSymbolResolveRequest=_e={}));var $e;(function(pe){pe.method="textDocument/codeLens",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})($e||(t.CodeLensRequest=$e={}));var Me;(function(pe){pe.method="codeLens/resolve",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Me||(t.CodeLensResolveRequest=Me={}));var He;(function(pe){pe.method="workspace/codeLens/refresh",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolRequestType0(pe.method)})(He||(t.CodeLensRefreshRequest=He={}));var De;(function(pe){pe.method="textDocument/documentLink",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(De||(t.DocumentLinkRequest=De={}));var Ke;(function(pe){pe.method="documentLink/resolve",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Ke||(t.DocumentLinkResolveRequest=Ke={}));var Ae;(function(pe){pe.method="textDocument/formatting",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Ae||(t.DocumentFormattingRequest=Ae={}));var at;(function(pe){pe.method="textDocument/rangeFormatting",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(at||(t.DocumentRangeFormattingRequest=at={}));var Ee;(function(pe){pe.method="textDocument/rangesFormatting",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Ee||(t.DocumentRangesFormattingRequest=Ee={}));var pt;(function(pe){pe.method="textDocument/onTypeFormatting",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(pt||(t.DocumentOnTypeFormattingRequest=pt={}));var ht;(function(pe){pe.Identifier=1})(ht||(t.PrepareSupportDefaultBehavior=ht={}));var rt;(function(pe){pe.method="textDocument/rename",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(rt||(t.RenameRequest=rt={}));var Et;(function(pe){pe.method="textDocument/prepareRename",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(Et||(t.PrepareRenameRequest=Et={}));var vt;(function(pe){pe.method="workspace/executeCommand",pe.messageDirection=e.MessageDirection.clientToServer,pe.type=new e.ProtocolRequestType(pe.method)})(vt||(t.ExecuteCommandRequest=vt={}));var ot;(function(pe){pe.method="workspace/applyEdit",pe.messageDirection=e.MessageDirection.serverToClient,pe.type=new e.ProtocolRequestType("workspace/applyEdit")})(ot||(t.ApplyWorkspaceEditRequest=ot={}))}}),o1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var e=Px();function r(n,i,a,s){return e.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,e.createMessageConnection)(n,i,a,s)}A(r,"createProtocolConnection"),t.createProtocolConnection=r}}),l1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(t){var e=t&&t.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:A(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(Px(),t),r((SS(),kW(wL)),t),r(mi(),t),r(s1t(),t);var n=o1t();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:A(function(){return n.createProtocolConnection},"get")});var i;(function(a){a.lspReservedErrorRangeStart=-32899,a.RequestFailed=-32803,a.ServerCancelled=-32802,a.ContentModified=-32801,a.RequestCancelled=-32800,a.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}}),c1t=Nr({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(t){var e=t&&t.__createBinding||(Object.create?(function(a,s,o,l){l===void 0&&(l=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:A(function(){return s[o]},"get")}),Object.defineProperty(a,l,u)}):(function(a,s,o,l){l===void 0&&(l=o),a[l]=s[o]})),r=t&&t.__exportStar||function(a,s){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,a,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var n=Lte();r(Lte(),t),r(l1t(),t);function i(a,s,o,l){return(0,n.createMessageConnection)(a,s,o,l)}A(i,"createProtocolConnection"),t.createProtocolConnection=i}}),cbe={};Df(cbe,{AbstractAstReflection:()=>_W,AbstractCstNode:()=>Lq,AbstractLangiumParser:()=>Iq,AbstractParserErrorMessageProvider:()=>K3e,AbstractThreadedAsyncParser:()=>N4t,AstUtils:()=>RW,BiMap:()=>d6,Cancellation:()=>zn,CompositeCstNodeImpl:()=>b7,ContextCache:()=>E7,CstNodeBuilder:()=>Y3e,CstUtils:()=>EW,DEFAULT_TOKENIZE_OPTIONS:()=>Kq,DONE_RESULT:()=>Is,DatatypeSymbol:()=>l6,DefaultAstNodeDescriptionProvider:()=>E5e,DefaultAstNodeLocator:()=>_5e,DefaultAsyncParser:()=>U5e,DefaultCommentProvider:()=>q5e,DefaultConfigurationProvider:()=>R5e,DefaultDocumentBuilder:()=>L5e,DefaultDocumentValidator:()=>S5e,DefaultHydrator:()=>X5e,DefaultIndexManager:()=>M5e,DefaultJsonSerializer:()=>T5e,DefaultLangiumDocumentFactory:()=>d5e,DefaultLangiumDocuments:()=>f5e,DefaultLangiumProfiler:()=>B4t,DefaultLexer:()=>Zq,DefaultLexerErrorMessageProvider:()=>N5e,DefaultLinker:()=>p5e,DefaultNameProvider:()=>g5e,DefaultReferenceDescriptionProvider:()=>A5e,DefaultReferences:()=>m5e,DefaultScopeComputation:()=>y5e,DefaultScopeProvider:()=>x5e,DefaultServiceRegistry:()=>w5e,DefaultTokenBuilder:()=>w7,DefaultValueConverter:()=>Fq,DefaultWorkspaceLock:()=>Y5e,DefaultWorkspaceManager:()=>I5e,Deferred:()=>Mh,Disposable:()=>p0,DisposableCache:()=>S7,DocumentCache:()=>b5e,DocumentState:()=>Gr,DocumentValidator:()=>ul,EMPTY_SCOPE:()=>R4t,EMPTY_STREAM:()=>Xb,EmptyFileSystem:()=>ns,EmptyFileSystemProvider:()=>Z5e,ErrorWithLocation:()=>IL,GrammarAST:()=>dbe,GrammarUtils:()=>aH,IndentationAwareLexer:()=>O4t,IndentationAwareTokenBuilder:()=>K5e,JSDocDocumentationProvider:()=>H5e,LangiumCompletionParser:()=>Z3e,LangiumParser:()=>j3e,LangiumParserErrorMessageProvider:()=>Nq,LeafCstNodeImpl:()=>o6,LexingMode:()=>n0,MapScope:()=>_4t,Module:()=>aB,MultiMap:()=>Ih,MultiMapScope:()=>v5e,OperationCancelled:()=>Vc,ParserWorker:()=>D4t,ProfilingTask:()=>J5e,Reduction:()=>hk,RefResolving:()=>mp,RegExpUtils:()=>oH,RootCstNodeImpl:()=>Mq,SimpleCache:()=>qq,StreamImpl:()=>zc,StreamScope:()=>tB,TextDocument:()=>u6,TreeStreamImpl:()=>jb,URI:()=>Bo,UriTrie:()=>Wq,UriUtils:()=>Fs,VALIDATE_EACH_NODE:()=>k5e,ValidationCategory:()=>f6,ValidationRegistry:()=>C5e,ValueConverter:()=>Nc,WorkspaceCache:()=>Uq,assertCondition:()=>sH,assertUnreachable:()=>Of,createCompletionParser:()=>$q,createDefaultCoreModule:()=>La,createDefaultSharedCoreModule:()=>Ma,createGrammarConfig:()=>SH,createLangiumParser:()=>Pq,createParser:()=>x7,delayNextTick:()=>C7,diagnosticData:()=>r0,eagerLoad:()=>iU,getDiagnosticRange:()=>Xq,indentationBuilderDefaultOptions:()=>oB,inject:()=>tn,interruptAndCheck:()=>va,isAstNode:()=>Hi,isAstNodeDescription:()=>AW,isAstNodeWithComment:()=>Yq,isCompositeCstNode:()=>Ch,isIMultiModeLexerDefinition:()=>R7,isJSDoc:()=>Jq,isLeafCstNode:()=>vg,isLinkingError:()=>_p,isMultiReference:()=>Yc,isNamed:()=>Hq,isOperationCancelled:()=>Pg,isReference:()=>Bs,isRootCstNode:()=>kL,isTokenTypeArray:()=>_7,isTokenTypeDictionary:()=>p6,loadGrammarFromJson:()=>Ia,parseJSDoc:()=>Qq,prepareLangiumParser:()=>Bq,setInterruptionPeriod:()=>zq,startCancelableOperation:()=>k7,stream:()=>Sn,toDiagnosticData:()=>jq,toDiagnosticSeverity:()=>lC});var EW={};Df(EW,{DefaultNameRegexp:()=>eH,RangeComparison:()=>$c,compareRange:()=>QW,findCommentNode:()=>tH,findDeclarationNodeAtOffset:()=>Mbe,findLeafNodeAtOffset:()=>ML,findLeafNodeBeforeOffset:()=>rH,flattenCst:()=>Lbe,getDatatypeNode:()=>Rbe,getInteriorNodes:()=>Dbe,getNextNode:()=>Ibe,getPreviousNode:()=>iH,getStartlineNode:()=>Nbe,inRange:()=>JW,isChildNode:()=>ZW,isCommentNode:()=>q_,streamCst:()=>Jb,toDocumentSegment:()=>ex,tokenToRange:()=>dk});function Hi(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}A(Hi,"isAstNode");function Bs(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}A(Bs,"isReference");function Yc(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}A(Yc,"isMultiReference");function AW(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}A(AW,"isAstNodeDescription");function _p(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}A(_p,"isLinkingError");var Ky,_W=(Ky=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const r=this.types[e.container.$type];if(!r)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const n=(i=r.properties[e.property])==null?void 0:i.referenceType;if(!n)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){const r=this.types[e];return r||{name:e,properties:{},superTypes:[]}}isInstance(e,r){return Hi(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const a=this.types[e],s=a?a.superTypes.some(o=>this.isSubtype(o,r)):!1;return n[r]=s,s}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}},A(Ky,"AbstractAstReflection"),Ky);function Ch(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}A(Ch,"isCompositeCstNode");function vg(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}A(vg,"isLeafCstNode");function kL(t){return Ch(t)&&typeof t.fullText=="string"}A(kL,"isRootCstNode");var lo,zc=(lo=class{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:A(()=>this.nextFn(e.state),"next"),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){const n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new lo(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return Is})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=ube(i.value)),a=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,a=n.next();for(;!a.done;){if(i>=r&&a.value===e)return i;a=n.next(),i++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new lo(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?Is:{done:!1,value:e(i)}})}filter(e){return new lo(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return Is})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,a=n.next();for(;!a.done;)i===void 0?i=a.value:i=e(i,a.value),a=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const i=e.next();if(i.done)return n;const a=this.recursiveReduce(e,r,n);return a===void 0?i.value:r(a,i.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new lo(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:n,value:i}=this.nextFn(r.this);if(!n){const a=e(i);if(uk(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return Is})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new lo(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:i,value:a}=r.nextFn(n.this);if(!i)if(uk(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return Is})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new lo(()=>{const r=this.startFn();for(let n=0;n<e;n++)if(this.nextFn(r).done)return r;return r},this.nextFn)}limit(e){return new lo(()=>({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?Is:this.nextFn(r.state)))}distinct(e){return new lo(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return Is})}exclude(e,r){const n=new Set;for(const i of e){const a=r?r(i):i;n.add(a)}return this.filter(i=>{const a=r?r(i):i;return!n.has(a)})}},A(lo,"StreamImpl"),lo);function ube(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}A(ube,"toString");function uk(t){return!!t&&typeof t[Symbol.iterator]=="function"}A(uk,"isIterable");var Xb=new zc(()=>{},()=>Is),Is=Object.freeze({done:!0,value:void 0});function Sn(...t){if(t.length===1){const e=t[0];if(e instanceof zc)return e;if(uk(e))return new zc(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new zc(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:Is)}return t.length>1?new zc(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){const r=t[e.collIndex++];uk(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return Is}):Xb}A(Sn,"stream");var Zy,jb=(Zy=class extends zc{constructor(e,r,n){super(()=>({iterators:n!=null&&n.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(r(s.value)[Symbol.iterator]()),s}return Is})}iterator(){const e={state:this.startFn(),next:A(()=>this.nextFn(e.state),"next"),prune:A(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},A(Zy,"TreeStreamImpl"),Zy),hk;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}A(e,"sum"),t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}A(r,"product"),t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}A(n,"min"),t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}A(i,"max"),t.max=i})(hk||(hk={}));var RW={};Df(RW,{assignMandatoryProperties:()=>LW,copyAstNode:()=>M_,findRootNode:()=>Cy,getContainerOfType:()=>bg,getDocument:()=>tc,getReferenceNodes:()=>R_,hasContainerOfType:()=>hbe,linkContentToContainer:()=>Kb,streamAllContents:()=>Uh,streamAst:()=>rc,streamContents:()=>AS,streamReferences:()=>Zb});function Kb(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Hi(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&Kb(i,e))}):Hi(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&Kb(n,e)))}A(Kb,"linkContentToContainer");function bg(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}A(bg,"getContainerOfType");function hbe(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}A(hbe,"hasContainerOfType");function tc(t){const r=Cy(t).$document;if(!r)throw new Error("AST node has no document.");return r}A(tc,"getDocument");function Cy(t){for(;t.$container;)t=t.$container;return t}A(Cy,"findRootNode");function R_(t){return Bs(t)?t.ref?[t.ref]:[]:Yc(t)?t.items.map(e=>e.ref):[]}A(R_,"getReferenceNodes");function AS(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new zc(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex<n.keys.length;){const i=n.keys[n.keyIndex];if(!i.startsWith("$")){const a=t[i];if(Hi(a)){if(n.keyIndex++,L_(a,r))return{done:!1,value:a}}else if(Array.isArray(a)){for(;n.arrayIndex<a.length;){const s=n.arrayIndex++,o=a[s];if(Hi(o)&&L_(o,r))return{done:!1,value:o}}n.arrayIndex=0}}n.keyIndex++}return Is})}A(AS,"streamContents");function Uh(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new jb(t,r=>AS(r,e))}A(Uh,"streamAllContents");function rc(t,e){if(t){if(e!=null&&e.range&&!L_(t,e.range))return new jb(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new jb(t,r=>AS(r,e),{includeRoot:!0})}A(rc,"streamAst");function L_(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?JW(r,e):!1}A(L_,"isAstNodeInRange");function Zb(t){return new zc(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){const r=e.keys[e.keyIndex];if(!r.startsWith("$")){const n=t[r];if(Bs(n)||Yc(n))return e.keyIndex++,{done:!1,value:{reference:n,container:t,property:r}};if(Array.isArray(n)){for(;e.arrayIndex<n.length;){const i=e.arrayIndex++,a=n[i];if(Bs(a)||Yc(n))return{done:!1,value:{reference:a,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Is})}A(Zb,"streamReferences");function LW(t,e){const r=t.getTypeMetaData(e.$type),n=e;for(const i of Object.values(r.properties))i.defaultValue!==void 0&&n[i.name]===void 0&&(n[i.name]=MW(i.defaultValue))}A(LW,"assignMandatoryProperties");function MW(t){return Array.isArray(t)?[...t.map(MW)]:t}A(MW,"copyDefaultValue");function M_(t,e,r){const n={$type:t.$type};r&&(r.set(t,n),r.set(n,t));for(const[i,a]of Object.entries(t))if(!i.startsWith("$"))if(Hi(a))n[i]=M_(a,e,r);else if(Bs(a))n[i]=e(n,i,a.$refNode,a.$refText,a);else if(Array.isArray(a)){const s=[];for(const o of a)Hi(o)?s.push(M_(o,e,r)):Bs(o)?s.push(e(n,i,o.$refNode,o.$refText,o)):s.push(o);n[i]=s}else n[i]=a;return Kb(n,{deep:!0}),n}A(M_,"copyAstNode");var dbe={};Df(dbe,{AbstractElement:()=>ao,AbstractParserRule:()=>Xw,AbstractRule:()=>Zm,AbstractType:()=>_o,Action:()=>gd,Alternatives:()=>jw,ArrayLiteral:()=>I_,ArrayType:()=>N_,Assignment:()=>md,BooleanLiteral:()=>D_,CharacterRange:()=>yd,Condition:()=>vd,Conjunction:()=>Kw,CrossReference:()=>bd,Disjunction:()=>Zw,EndOfFile:()=>O_,Grammar:()=>Gu,GrammarImport:()=>$_,Group:()=>Rp,InferredType:()=>P_,InfixRule:()=>_c,InfixRuleOperatorList:()=>Qw,InfixRuleOperators:()=>B_,Interface:()=>Qm,Keyword:()=>Jm,LangiumGrammarAstReflection:()=>KW,LangiumGrammarTerminals:()=>u1t,NamedArgument:()=>ey,NegatedToken:()=>Lp,Negation:()=>F_,NumberLiteral:()=>z_,Parameter:()=>ty,ParameterReference:()=>V_,ParserRule:()=>Il,ReferenceType:()=>Jw,RegexToken:()=>Mp,ReturnType:()=>G_,RuleCall:()=>Ip,SimpleType:()=>ry,StringLiteral:()=>W_,TerminalAlternatives:()=>Np,TerminalElement:()=>so,TerminalGroup:()=>Dp,TerminalRule:()=>Wu,TerminalRuleCall:()=>Op,Type:()=>eC,TypeAttribute:()=>$p,TypeDefinition:()=>Pp,UnionType:()=>H_,UnorderedGroup:()=>tC,UntilToken:()=>Bp,ValueLiteral:()=>Fp,Wildcard:()=>ny,isAbstractElement:()=>SL,isAbstractParserRule:()=>xg,isAbstractRule:()=>fbe,isAbstractType:()=>pbe,isAction:()=>pf,isAlternatives:()=>EL,isArrayLiteral:()=>gbe,isArrayType:()=>IW,isAssignment:()=>kh,isBooleanLiteral:()=>NW,isCharacterRange:()=>DW,isCondition:()=>mbe,isConjunction:()=>OW,isCrossReference:()=>Tg,isDisjunction:()=>$W,isEndOfFile:()=>PW,isGrammar:()=>ybe,isGrammarImport:()=>vbe,isGroup:()=>wg,isInferredType:()=>_S,isInfixRule:()=>Qb,isInfixRuleOperatorList:()=>bbe,isInfixRuleOperators:()=>xbe,isInterface:()=>BW,isKeyword:()=>Sh,isNamedArgument:()=>Tbe,isNegatedToken:()=>FW,isNegation:()=>zW,isNumberLiteral:()=>wbe,isParameter:()=>Cbe,isParameterReference:()=>VW,isParserRule:()=>Ys,isReferenceType:()=>GW,isRegexToken:()=>WW,isReturnType:()=>HW,isRuleCall:()=>Eh,isSimpleType:()=>AL,isStringLiteral:()=>kbe,isTerminalAlternatives:()=>qW,isTerminalElement:()=>Sbe,isTerminalGroup:()=>UW,isTerminalRule:()=>Sl,isTerminalRuleCall:()=>_L,isType:()=>RL,isTypeAttribute:()=>Ebe,isTypeDefinition:()=>Abe,isUnionType:()=>YW,isUnorderedGroup:()=>LL,isUntilToken:()=>XW,isValueLiteral:()=>_be,isWildcard:()=>jW,reflection:()=>pr});var u1t={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},ao={$type:"AbstractElement",cardinality:"cardinality"};function SL(t){return pr.isInstance(t,ao.$type)}A(SL,"isAbstractElement");var Xw={$type:"AbstractParserRule"};function xg(t){return pr.isInstance(t,Xw.$type)}A(xg,"isAbstractParserRule");var Zm={$type:"AbstractRule"};function fbe(t){return pr.isInstance(t,Zm.$type)}A(fbe,"isAbstractRule");var _o={$type:"AbstractType"};function pbe(t){return pr.isInstance(t,_o.$type)}A(pbe,"isAbstractType");var gd={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function pf(t){return pr.isInstance(t,gd.$type)}A(pf,"isAction");var jw={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function EL(t){return pr.isInstance(t,jw.$type)}A(EL,"isAlternatives");var I_={$type:"ArrayLiteral",elements:"elements"};function gbe(t){return pr.isInstance(t,I_.$type)}A(gbe,"isArrayLiteral");var N_={$type:"ArrayType",elementType:"elementType"};function IW(t){return pr.isInstance(t,N_.$type)}A(IW,"isArrayType");var md={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function kh(t){return pr.isInstance(t,md.$type)}A(kh,"isAssignment");var D_={$type:"BooleanLiteral",true:"true"};function NW(t){return pr.isInstance(t,D_.$type)}A(NW,"isBooleanLiteral");var yd={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function DW(t){return pr.isInstance(t,yd.$type)}A(DW,"isCharacterRange");var vd={$type:"Condition"};function mbe(t){return pr.isInstance(t,vd.$type)}A(mbe,"isCondition");var Kw={$type:"Conjunction",left:"left",right:"right"};function OW(t){return pr.isInstance(t,Kw.$type)}A(OW,"isConjunction");var bd={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function Tg(t){return pr.isInstance(t,bd.$type)}A(Tg,"isCrossReference");var Zw={$type:"Disjunction",left:"left",right:"right"};function $W(t){return pr.isInstance(t,Zw.$type)}A($W,"isDisjunction");var O_={$type:"EndOfFile",cardinality:"cardinality"};function PW(t){return pr.isInstance(t,O_.$type)}A(PW,"isEndOfFile");var Gu={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function ybe(t){return pr.isInstance(t,Gu.$type)}A(ybe,"isGrammar");var $_={$type:"GrammarImport",path:"path"};function vbe(t){return pr.isInstance(t,$_.$type)}A(vbe,"isGrammarImport");var Rp={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function wg(t){return pr.isInstance(t,Rp.$type)}A(wg,"isGroup");var P_={$type:"InferredType",name:"name"};function _S(t){return pr.isInstance(t,P_.$type)}A(_S,"isInferredType");var _c={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function Qb(t){return pr.isInstance(t,_c.$type)}A(Qb,"isInfixRule");var Qw={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function bbe(t){return pr.isInstance(t,Qw.$type)}A(bbe,"isInfixRuleOperatorList");var B_={$type:"InfixRuleOperators",precedences:"precedences"};function xbe(t){return pr.isInstance(t,B_.$type)}A(xbe,"isInfixRuleOperators");var Qm={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function BW(t){return pr.isInstance(t,Qm.$type)}A(BW,"isInterface");var Jm={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Sh(t){return pr.isInstance(t,Jm.$type)}A(Sh,"isKeyword");var ey={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function Tbe(t){return pr.isInstance(t,ey.$type)}A(Tbe,"isNamedArgument");var Lp={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function FW(t){return pr.isInstance(t,Lp.$type)}A(FW,"isNegatedToken");var F_={$type:"Negation",value:"value"};function zW(t){return pr.isInstance(t,F_.$type)}A(zW,"isNegation");var z_={$type:"NumberLiteral",value:"value"};function wbe(t){return pr.isInstance(t,z_.$type)}A(wbe,"isNumberLiteral");var ty={$type:"Parameter",name:"name"};function Cbe(t){return pr.isInstance(t,ty.$type)}A(Cbe,"isParameter");var V_={$type:"ParameterReference",parameter:"parameter"};function VW(t){return pr.isInstance(t,V_.$type)}A(VW,"isParameterReference");var Il={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function Ys(t){return pr.isInstance(t,Il.$type)}A(Ys,"isParserRule");var Jw={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function GW(t){return pr.isInstance(t,Jw.$type)}A(GW,"isReferenceType");var Mp={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function WW(t){return pr.isInstance(t,Mp.$type)}A(WW,"isRegexToken");var G_={$type:"ReturnType",name:"name"};function HW(t){return pr.isInstance(t,G_.$type)}A(HW,"isReturnType");var Ip={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Eh(t){return pr.isInstance(t,Ip.$type)}A(Eh,"isRuleCall");var ry={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function AL(t){return pr.isInstance(t,ry.$type)}A(AL,"isSimpleType");var W_={$type:"StringLiteral",value:"value"};function kbe(t){return pr.isInstance(t,W_.$type)}A(kbe,"isStringLiteral");var Np={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function qW(t){return pr.isInstance(t,Np.$type)}A(qW,"isTerminalAlternatives");var so={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function Sbe(t){return pr.isInstance(t,so.$type)}A(Sbe,"isTerminalElement");var Dp={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function UW(t){return pr.isInstance(t,Dp.$type)}A(UW,"isTerminalGroup");var Wu={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function Sl(t){return pr.isInstance(t,Wu.$type)}A(Sl,"isTerminalRule");var Op={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function _L(t){return pr.isInstance(t,Op.$type)}A(_L,"isTerminalRuleCall");var eC={$type:"Type",name:"name",type:"type"};function RL(t){return pr.isInstance(t,eC.$type)}A(RL,"isType");var $p={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function Ebe(t){return pr.isInstance(t,$p.$type)}A(Ebe,"isTypeAttribute");var Pp={$type:"TypeDefinition"};function Abe(t){return pr.isInstance(t,Pp.$type)}A(Abe,"isTypeDefinition");var H_={$type:"UnionType",types:"types"};function YW(t){return pr.isInstance(t,H_.$type)}A(YW,"isUnionType");var tC={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function LL(t){return pr.isInstance(t,tC.$type)}A(LL,"isUnorderedGroup");var Bp={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function XW(t){return pr.isInstance(t,Bp.$type)}A(XW,"isUntilToken");var Fp={$type:"ValueLiteral"};function _be(t){return pr.isInstance(t,Fp.$type)}A(_be,"isValueLiteral");var ny={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function jW(t){return pr.isInstance(t,ny.$type)}A(jW,"isWildcard");var Qy,KW=(Qy=class extends _W{constructor(){super(...arguments),this.types={AbstractElement:{name:ao.$type,properties:{cardinality:{name:ao.cardinality}},superTypes:[]},AbstractParserRule:{name:Xw.$type,properties:{},superTypes:[Zm.$type,_o.$type]},AbstractRule:{name:Zm.$type,properties:{},superTypes:[]},AbstractType:{name:_o.$type,properties:{},superTypes:[]},Action:{name:gd.$type,properties:{cardinality:{name:gd.cardinality},feature:{name:gd.feature},inferredType:{name:gd.inferredType},operator:{name:gd.operator},type:{name:gd.type,referenceType:_o.$type}},superTypes:[ao.$type]},Alternatives:{name:jw.$type,properties:{cardinality:{name:jw.cardinality},elements:{name:jw.elements,defaultValue:[]}},superTypes:[ao.$type]},ArrayLiteral:{name:I_.$type,properties:{elements:{name:I_.elements,defaultValue:[]}},superTypes:[Fp.$type]},ArrayType:{name:N_.$type,properties:{elementType:{name:N_.elementType}},superTypes:[Pp.$type]},Assignment:{name:md.$type,properties:{cardinality:{name:md.cardinality},feature:{name:md.feature},operator:{name:md.operator},predicate:{name:md.predicate},terminal:{name:md.terminal}},superTypes:[ao.$type]},BooleanLiteral:{name:D_.$type,properties:{true:{name:D_.true,defaultValue:!1}},superTypes:[vd.$type,Fp.$type]},CharacterRange:{name:yd.$type,properties:{cardinality:{name:yd.cardinality},left:{name:yd.left},lookahead:{name:yd.lookahead},parenthesized:{name:yd.parenthesized,defaultValue:!1},right:{name:yd.right}},superTypes:[so.$type]},Condition:{name:vd.$type,properties:{},superTypes:[]},Conjunction:{name:Kw.$type,properties:{left:{name:Kw.left},right:{name:Kw.right}},superTypes:[vd.$type]},CrossReference:{name:bd.$type,properties:{cardinality:{name:bd.cardinality},deprecatedSyntax:{name:bd.deprecatedSyntax,defaultValue:!1},isMulti:{name:bd.isMulti,defaultValue:!1},terminal:{name:bd.terminal},type:{name:bd.type,referenceType:_o.$type}},superTypes:[ao.$type]},Disjunction:{name:Zw.$type,properties:{left:{name:Zw.left},right:{name:Zw.right}},superTypes:[vd.$type]},EndOfFile:{name:O_.$type,properties:{cardinality:{name:O_.cardinality}},superTypes:[ao.$type]},Grammar:{name:Gu.$type,properties:{imports:{name:Gu.imports,defaultValue:[]},interfaces:{name:Gu.interfaces,defaultValue:[]},isDeclared:{name:Gu.isDeclared,defaultValue:!1},name:{name:Gu.name},rules:{name:Gu.rules,defaultValue:[]},types:{name:Gu.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:$_.$type,properties:{path:{name:$_.path}},superTypes:[]},Group:{name:Rp.$type,properties:{cardinality:{name:Rp.cardinality},elements:{name:Rp.elements,defaultValue:[]},guardCondition:{name:Rp.guardCondition},predicate:{name:Rp.predicate}},superTypes:[ao.$type]},InferredType:{name:P_.$type,properties:{name:{name:P_.name}},superTypes:[_o.$type]},InfixRule:{name:_c.$type,properties:{call:{name:_c.call},dataType:{name:_c.dataType},inferredType:{name:_c.inferredType},name:{name:_c.name},operators:{name:_c.operators},parameters:{name:_c.parameters,defaultValue:[]},returnType:{name:_c.returnType,referenceType:_o.$type}},superTypes:[Xw.$type]},InfixRuleOperatorList:{name:Qw.$type,properties:{associativity:{name:Qw.associativity},operators:{name:Qw.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:B_.$type,properties:{precedences:{name:B_.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:Qm.$type,properties:{attributes:{name:Qm.attributes,defaultValue:[]},name:{name:Qm.name},superTypes:{name:Qm.superTypes,defaultValue:[],referenceType:_o.$type}},superTypes:[_o.$type]},Keyword:{name:Jm.$type,properties:{cardinality:{name:Jm.cardinality},predicate:{name:Jm.predicate},value:{name:Jm.value}},superTypes:[ao.$type]},NamedArgument:{name:ey.$type,properties:{calledByName:{name:ey.calledByName,defaultValue:!1},parameter:{name:ey.parameter,referenceType:ty.$type},value:{name:ey.value}},superTypes:[]},NegatedToken:{name:Lp.$type,properties:{cardinality:{name:Lp.cardinality},lookahead:{name:Lp.lookahead},parenthesized:{name:Lp.parenthesized,defaultValue:!1},terminal:{name:Lp.terminal}},superTypes:[so.$type]},Negation:{name:F_.$type,properties:{value:{name:F_.value}},superTypes:[vd.$type]},NumberLiteral:{name:z_.$type,properties:{value:{name:z_.value}},superTypes:[Fp.$type]},Parameter:{name:ty.$type,properties:{name:{name:ty.name}},superTypes:[]},ParameterReference:{name:V_.$type,properties:{parameter:{name:V_.parameter,referenceType:ty.$type}},superTypes:[vd.$type]},ParserRule:{name:Il.$type,properties:{dataType:{name:Il.dataType},definition:{name:Il.definition},entry:{name:Il.entry,defaultValue:!1},fragment:{name:Il.fragment,defaultValue:!1},inferredType:{name:Il.inferredType},name:{name:Il.name},parameters:{name:Il.parameters,defaultValue:[]},returnType:{name:Il.returnType,referenceType:_o.$type}},superTypes:[Xw.$type]},ReferenceType:{name:Jw.$type,properties:{isMulti:{name:Jw.isMulti,defaultValue:!1},referenceType:{name:Jw.referenceType}},superTypes:[Pp.$type]},RegexToken:{name:Mp.$type,properties:{cardinality:{name:Mp.cardinality},lookahead:{name:Mp.lookahead},parenthesized:{name:Mp.parenthesized,defaultValue:!1},regex:{name:Mp.regex}},superTypes:[so.$type]},ReturnType:{name:G_.$type,properties:{name:{name:G_.name}},superTypes:[]},RuleCall:{name:Ip.$type,properties:{arguments:{name:Ip.arguments,defaultValue:[]},cardinality:{name:Ip.cardinality},predicate:{name:Ip.predicate},rule:{name:Ip.rule,referenceType:Zm.$type}},superTypes:[ao.$type]},SimpleType:{name:ry.$type,properties:{primitiveType:{name:ry.primitiveType},stringType:{name:ry.stringType},typeRef:{name:ry.typeRef,referenceType:_o.$type}},superTypes:[Pp.$type]},StringLiteral:{name:W_.$type,properties:{value:{name:W_.value}},superTypes:[Fp.$type]},TerminalAlternatives:{name:Np.$type,properties:{cardinality:{name:Np.cardinality},elements:{name:Np.elements,defaultValue:[]},lookahead:{name:Np.lookahead},parenthesized:{name:Np.parenthesized,defaultValue:!1}},superTypes:[so.$type]},TerminalElement:{name:so.$type,properties:{cardinality:{name:so.cardinality},lookahead:{name:so.lookahead},parenthesized:{name:so.parenthesized,defaultValue:!1}},superTypes:[ao.$type]},TerminalGroup:{name:Dp.$type,properties:{cardinality:{name:Dp.cardinality},elements:{name:Dp.elements,defaultValue:[]},lookahead:{name:Dp.lookahead},parenthesized:{name:Dp.parenthesized,defaultValue:!1}},superTypes:[so.$type]},TerminalRule:{name:Wu.$type,properties:{definition:{name:Wu.definition},fragment:{name:Wu.fragment,defaultValue:!1},hidden:{name:Wu.hidden,defaultValue:!1},name:{name:Wu.name},type:{name:Wu.type}},superTypes:[Zm.$type]},TerminalRuleCall:{name:Op.$type,properties:{cardinality:{name:Op.cardinality},lookahead:{name:Op.lookahead},parenthesized:{name:Op.parenthesized,defaultValue:!1},rule:{name:Op.rule,referenceType:Wu.$type}},superTypes:[so.$type]},Type:{name:eC.$type,properties:{name:{name:eC.name},type:{name:eC.type}},superTypes:[_o.$type]},TypeAttribute:{name:$p.$type,properties:{defaultValue:{name:$p.defaultValue},isOptional:{name:$p.isOptional,defaultValue:!1},name:{name:$p.name},type:{name:$p.type}},superTypes:[]},TypeDefinition:{name:Pp.$type,properties:{},superTypes:[]},UnionType:{name:H_.$type,properties:{types:{name:H_.types,defaultValue:[]}},superTypes:[Pp.$type]},UnorderedGroup:{name:tC.$type,properties:{cardinality:{name:tC.cardinality},elements:{name:tC.elements,defaultValue:[]}},superTypes:[ao.$type]},UntilToken:{name:Bp.$type,properties:{cardinality:{name:Bp.cardinality},lookahead:{name:Bp.lookahead},parenthesized:{name:Bp.parenthesized,defaultValue:!1},terminal:{name:Bp.terminal}},superTypes:[so.$type]},ValueLiteral:{name:Fp.$type,properties:{},superTypes:[]},Wildcard:{name:ny.$type,properties:{cardinality:{name:ny.cardinality},lookahead:{name:ny.lookahead},parenthesized:{name:ny.parenthesized,defaultValue:!1}},superTypes:[so.$type]}}}},A(Qy,"LangiumGrammarAstReflection"),Qy),pr=new KW;function Rbe(t){let e=t,r=!1;for(;e;){const n=bg(e.grammarSource,Ys);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}A(Rbe,"getDatatypeNode");function Jb(t){return new jb(t,e=>Ch(e)?e.content:[],{includeRoot:!0})}A(Jb,"streamCst");function Lbe(t){return Jb(t).filter(vg)}A(Lbe,"flattenCst");function ZW(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}A(ZW,"isChildNode");function dk(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}A(dk,"tokenToRange");function ex(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}A(ex,"toDocumentSegment");var $c;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})($c||($c={}));function QW(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return $c.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return $c.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return r&&n?$c.Inside:r?$c.OverlapBack:n?$c.OverlapFront:$c.Outside}A(QW,"compareRange");function JW(t,e){return QW(t,e)>$c.After}A(JW,"inRange");var eH=/^[\w\p{L}]$/u;function Mbe(t,e,r=eH){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return ML(t,e)}}A(Mbe,"findDeclarationNodeAtOffset");function tH(t,e){if(t){const r=iH(t,!0);if(r&&q_(r,e))return r;if(kL(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(q_(a,e))return a}}}}A(tH,"findCommentNode");function q_(t,e){return vg(t)&&e.includes(t.tokenType.name)}A(q_,"isCommentNode");function ML(t,e){if(vg(t))return t;if(Ch(t)){const r=nH(t,e,!1);if(r)return ML(r,e)}}A(ML,"findLeafNodeAtOffset");function rH(t,e){if(vg(t))return t;if(Ch(t)){const r=nH(t,e,!0);if(r)return rH(r,e)}}A(rH,"findLeafNodeBeforeOffset");function nH(t,e,r){let n=0,i=t.content.length-1,a;for(;n<=i;){const s=Math.floor((n+i)/2),o=t.content[s];if(o.offset<=e&&o.end>e)return o;o.end<=e?(a=r?o:void 0,n=s+1):i=s-1}return a}A(nH,"binarySearch");function iH(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const i=r.content[n];if(e||!i.hidden)return i}t=r}}A(iH,"getPreviousNode");function Ibe(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;n<i;){n++;const a=r.content[n];if(e||!a.hidden)return a}t=r}}A(Ibe,"getNextNode");function Nbe(t){if(t.range.start.character===0)return t;const e=t.range.start.line;let r=t,n;for(;t.container;){const i=t.container,a=n??i.content.indexOf(t);if(a===0?(t=i,n=void 0):(n=a-1,t=i.content[n]),t.range.start.line!==e)break;r=t}return r}A(Nbe,"getStartlineNode");function Dbe(t,e){const r=Obe(t,e);return r?r.parent.content.slice(r.a+1,r.b):[]}A(Dbe,"getInteriorNodes");function Obe(t,e){const r=E9(t),n=E9(e);let i;for(let a=0;a<r.length&&a<n.length;a++){const s=r[a],o=n[a];if(s.parent===o.parent)i={parent:s.parent,a:s.index,b:o.index};else break}return i}A(Obe,"getCommonParent");function E9(t){const e=[];for(;t.container;){const r=t.container,n=r.content.indexOf(t);e.push({parent:r,index:n}),t=r}return e.reverse()}A(E9,"getParentChain");var aH={};Df(aH,{findAssignment:()=>vH,findNameAssignment:()=>FL,findNodeForKeyword:()=>yH,findNodeForProperty:()=>$L,findNodesForKeyword:()=>Wbe,findNodesForKeywordInternal:()=>BL,findNodesForProperty:()=>mH,getActionAtElement:()=>xH,getActionType:()=>wH,getAllReachableRules:()=>OL,getAllRulesUsedForCrossReferences:()=>Gbe,getCrossReferenceTerminal:()=>pH,getEntryRule:()=>hH,getExplicitRuleType:()=>LS,getHiddenRules:()=>dH,getRuleType:()=>CH,getRuleTypeName:()=>Xbe,getTypeName:()=>q0,isArrayCardinality:()=>qbe,isArrayOperator:()=>Ube,isCommentTerminal:()=>gH,isDataType:()=>Ybe,isDataTypeRule:()=>RS,isOptionalCardinality:()=>Hbe,terminalRegex:()=>MS});var Jy,IL=(Jy=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},A(Jy,"ErrorWithLocation"),Jy);function Of(t,e="Error: Got unexpected value."){throw new Error(e)}A(Of,"assertUnreachable");function sH(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}A(sH,"assertCondition");var oH={};Df(oH,{NEWLINE_REGEXP:()=>Bbe,escapeRegExp:()=>Bx,getTerminalParts:()=>zbe,isMultilineComment:()=>lH,isWhitespace:()=>DL,partialMatches:()=>cH,partialRegExp:()=>uH,whitespaceCharacters:()=>Vbe});function Tr(t){return t.charCodeAt(0)}A(Tr,"cc");function R3(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}A(R3,"insertToSet");function Em(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}A(Em,"addFlag");function fp(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}A(fp,"ASSERT_EXISTS");function $be(){throw Error("Internal Error - Should never get here!")}A($be,"ASSERT_NEVER_REACH_HERE");function A9(t){return t.type==="Character"}A(A9,"isCharacter");var U_=[];for(let t=Tr("0");t<=Tr("9");t++)U_.push(t);var Y_=[Tr("_")].concat(U_);for(let t=Tr("a");t<=Tr("z");t++)Y_.push(t);for(let t=Tr("A");t<=Tr("Z");t++)Y_.push(t);var Mte=[Tr(" "),Tr("\f"),Tr(`
`),Tr("\r"),Tr(" "),Tr("\v"),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr(" "),Tr("\u2028"),Tr("\u2029"),Tr(" "),Tr(" "),Tr(" "),Tr("\uFEFF")],h1t=/[0-9a-fA-F]/,a4=/[0-9]/,d1t=/[1-9]/,e1,Pbe=(e1=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const r=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Em(n,"global");break;case"i":Em(n,"ignoreCase");break;case"m":Em(n,"multiLine");break;case"u":Em(n,"unicode");break;case"y":Em(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){const e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){const e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":r="Lookbehind";break;case"!":r="NegativeLookbehind"}break}}fp(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return $be()}quantifier(e=!1){let r;const n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),r={atLeast:i,atMost:a}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;fp(r);break}if(!(e===!0&&r===void 0)&&fp(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e;const r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),fp(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Tr(`
`),Tr("\r"),Tr("\u2028"),Tr("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=U_;break;case"D":e=U_,r=!0;break;case"s":e=Mte;break;case"S":e=Mte,r=!0;break;case"w":e=Y_;break;case"W":e=Y_,r=!0;break}if(fp(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Tr("\f");break;case"n":e=Tr(`
`);break;case"r":e=Tr("\r");break;case"t":e=Tr(" ");break;case"v":e=Tr("\v");break}if(fp(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:Tr("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:Tr(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:Tr(e)}}}characterClass(){const e=[];let r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){const n=this.classAtom();if(n.type,A9(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,A9(i)){if(i.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:i.value})}else R3(n.value,e),e.push(Tr("-")),R3(i.value,e)}else R3(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:Tr("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}const r=this.disjunction();this.consumeChar(")");const n={type:"Group",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(d1t.test(e)===!1)throw Error("Expecting a positive integer");for(;a4.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(a4.test(e)===!1)throw Error("Expecting an integer");for(;a4.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case`
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:Tr(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return a4.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!"||this.peekChar(2)==="<"&&(this.peekChar(3)==="="||this.peekChar(3)==="!"));default:return!1}}isQuantifier(){const e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i<e;i++){const a=this.popChar();if(h1t.test(a)===!1)throw Error("Expecting a HexDecimal digits");r+=a}return{type:"Character",value:parseInt(r,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){const e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},A(e1,"RegExpParser"),e1),t1,NL=(t1=class{visitChildren(e){for(const r in e){const n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},A(t1,"BaseRegExpVisitor"),t1),Bbe=/\r?\n/gm,Fbe=new Pbe,r1,f1t=(r1=class extends NL{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const r=String.fromCharCode(e.value);if(!this.multiline&&r===`
`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=Bx(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){const r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!`
`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}},A(r1,"TerminalRegExpVisitor"),r1),e0=new f1t;function zbe(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=Fbe.pattern(t),r=[];for(const n of e.value.value)e0.reset(t),e0.visit(n),r.push({start:e0.startRegexp,end:e0.endRegex});return r}catch{return[]}}A(zbe,"getTerminalParts");function lH(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),e0.reset(t),e0.visit(Fbe.pattern(t)),e0.multiline}catch{return!1}}A(lH,"isMultilineComment");var Vbe=`\f
\r \v              \u2028\u2029   \uFEFF`.split("");function DL(t){const e=typeof t=="string"?new RegExp(t):t;return Vbe.some(r=>e.test(r))}A(DL,"isWhitespace");function Bx(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}A(Bx,"escapeRegExp");function cH(t,e){const r=uH(t),n=e.match(r);return!!n&&n[0].length>0}A(cH,"partialMatches");function uH(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",s;function o(u){a+=r.substr(n,u),n+=u}A(o,"appendRaw");function l(u){a+="(?:"+r.substr(n,u)+"|$)",n+=u}for(A(l,"appendOptional");n<r.length;)switch(r[n]){case"\\":switch(r[n+1]){case"c":l(3);break;case"x":l(4);break;case"u":e.unicode?r[n+2]==="{"?l(r.indexOf("}",n)-n+1):l(6):l(2);break;case"p":case"P":e.unicode?l(r.indexOf("}",n)-n+1):l(2);break;case"k":l(r.indexOf(">",n)-n+1);break;default:l(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],l(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?o(s[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":s=n,n+=3,i(),a+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),a+=r.substr(s,n-s);break;default:o(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else o(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1);break}return a}return A(i,"process"),new RegExp(i(),t.flags)}A(uH,"partialRegExp");function hH(t){return t.rules.find(e=>Ys(e)&&e.entry)}A(hH,"getEntryRule");function dH(t){return t.rules.filter(e=>Sl(e)&&e.hidden)}A(dH,"getHiddenRules");function OL(t,e){const r=new Set,n=hH(t);if(!n)return new Set(t.rules);const i=[n].concat(dH(t));for(const s of i)fH(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||Sl(s)&&s.hidden)&&a.add(s);return a}A(OL,"getAllReachableRules");function fH(t,e,r){e.add(t.name),Uh(t).forEach(n=>{if(Eh(n)||r&&_L(n)){const i=n.rule.ref;i&&!e.has(i.name)&&fH(i,e,r)}})}A(fH,"ruleDfs");function Gbe(t){const e=new Set;return Uh(t).forEach(r=>{Tg(r)&&(Ys(r.type.ref)&&e.add(r.type.ref),_S(r.type.ref)&&Ys(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}A(Gbe,"getAllRulesUsedForCrossReferences");function pH(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=FL(t.type.ref);return e==null?void 0:e.terminal}}A(pH,"getCrossReferenceTerminal");function gH(t){return t.hidden&&!DL(MS(t))}A(gH,"isCommentTerminal");function mH(t,e){return!t||!e?[]:PL(t,e,t.astNode,!0)}A(mH,"findNodesForProperty");function $L(t,e,r){if(!t||!e)return;const n=PL(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}A($L,"findNodeForProperty");function PL(t,e,r,n){if(!n){const i=bg(t.grammarSource,kh);if(i&&i.feature===e)return[t]}return Ch(t)&&t.astNode===r?t.content.flatMap(i=>PL(i,e,r,!1)):[]}A(PL,"findNodesForPropertyInternal");function Wbe(t,e){return t?BL(t,e,t==null?void 0:t.astNode):[]}A(Wbe,"findNodesForKeyword");function yH(t,e,r){if(!t)return;const n=BL(t,e,t==null?void 0:t.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}A(yH,"findNodeForKeyword");function BL(t,e,r){if(t.astNode!==r)return[];if(Sh(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=Jb(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?Sh(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}A(BL,"findNodesForKeywordInternal");function vH(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=bg(t.grammarSource,kh);if(n)return n;t=t.container}}A(vH,"findAssignment");function FL(t){let e=t;return _S(e)&&(pf(e.$container)?e=e.$container.$container:xg(e.$container)?e=e.$container:Of(e.$container)),bH(t,e,new Map)}A(FL,"findNameAssignment");function bH(t,e,r){var i;function n(a,s){let o;return bg(a,kh)||(o=bH(s,s,r)),r.set(t,o),o}if(A(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of Uh(e)){if(kh(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(Eh(a)&&Ys(a.rule.ref))return n(a,a.rule.ref);if(AL(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}A(bH,"findNameAssignmentInternal");function xH(t){const e=t.$container;if(wg(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const a=r[i];if(pf(a))return a;{const s=Uh(r[i]).find(pf);if(s)return s}}}if(SL(e))return xH(e)}A(xH,"getActionAtElement");function Hbe(t,e){return t==="?"||t==="*"||wg(e)&&!!e.guardCondition}A(Hbe,"isOptionalCardinality");function qbe(t){return t==="*"||t==="+"}A(qbe,"isArrayCardinality");function Ube(t){return t==="+="}A(Ube,"isArrayOperator");function RS(t){return TH(t,new Set)}A(RS,"isDataTypeRule");function TH(t,e){if(e.has(t))return!0;e.add(t);for(const r of Uh(t))if(Eh(r)){if(!r.rule.ref||Ys(r.rule.ref)&&!TH(r.rule.ref,e)||Qb(r.rule.ref))return!1}else{if(kh(r))return!1;if(pf(r))return!1}return!!t.definition}A(TH,"isDataTypeRuleInternal");function Ybe(t){return X_(t.type,new Set)}A(Ybe,"isDataType");function X_(t,e){if(e.has(t))return!0;if(e.add(t),IW(t))return!1;if(GW(t))return!1;if(YW(t))return t.types.every(r=>X_(r,e));if(AL(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const r=t.typeRef.ref;return RL(r)?X_(r.type,e):!1}else return!1}else return!1}A(X_,"isDataTypeInternal");function LS(t){if(!Sl(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e)return e.name}}}A(LS,"getExplicitRuleType");function q0(t){if(xg(t))return Ys(t)&&RS(t)?t.name:LS(t)??t.name;if(BW(t)||RL(t)||HW(t))return t.name;if(pf(t)){const e=wH(t);if(e)return e}else if(_S(t))return t.name;throw new Error("Cannot get name of Unknown Type")}A(q0,"getTypeName");function wH(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return q0(t.type.ref)}A(wH,"getActionType");function Xbe(t){var e;return Sl(t)?((e=t.type)==null?void 0:e.name)??"string":Ys(t)&&RS(t)?t.name:LS(t)??t.name}A(Xbe,"getRuleTypeName");function CH(t){var e;return Sl(t)?((e=t.type)==null?void 0:e.name)??"string":LS(t)??t.name}A(CH,"getRuleType");function MS(t){const e={s:!1,i:!1,u:!1},r=Cg(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}A(MS,"terminalRegex");var kH=/[\s\S]/.source;function Cg(t,e){var r;if(qW(t))return jbe(t);if(UW(t))return Kbe(t);if(DW(t))return Jbe(t);if(_L(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Xc(Cg(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(FW(t))return Qbe(t);if(XW(t))return Zbe(t);if(WW(t)){const n=t.regex.lastIndexOf("/"),i=t.regex.substring(1,n),a=t.regex.substring(n+1);return e&&(e.i=a.includes("i"),e.s=a.includes("s"),e.u=a.includes("u")),Xc(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(jW(t))return Xc(kH,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}, ${(r=t==null?void 0:t.$cstNode)==null?void 0:r.text}`)}}}A(Cg,"abstractElementToRegex");function jbe(t){return Xc(t.elements.map(e=>Cg(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}A(jbe,"terminalAlternativesToRegex");function Kbe(t){return Xc(t.elements.map(e=>Cg(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}A(Kbe,"terminalGroupToRegex");function Zbe(t){return Xc(`${kH}*?${Cg(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}A(Zbe,"untilTokenToRegex");function Qbe(t){return Xc(`(?!${Cg(t.terminal)})${kH}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}A(Qbe,"negateTokenToRegex");function Jbe(t){return t.right?Xc(`[${L3(t.left)}-${L3(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Xc(L3(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}A(Jbe,"characterRangeToRegex");function L3(t){return Bx(t.value)}A(L3,"keywordToRegex");function Xc(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}A(Xc,"withCardinality");function SH(t){const e=[],r=t.Grammar;for(const n of r.rules)Sl(n)&&gH(n)&&lH(MS(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:eH}}A(SH,"createGrammarConfig");var p1t=typeof global=="object"&&global&&global.Object===Object&&global,exe=p1t,g1t=typeof self=="object"&&self&&self.Object===Object&&self,m1t=exe||g1t||Function("return this")(),pu=m1t,y1t=pu.Symbol,Cl=y1t,txe=Object.prototype,v1t=txe.hasOwnProperty,b1t=txe.toString,TT=Cl?Cl.toStringTag:void 0;function rxe(t){var e=v1t.call(t,TT),r=t[TT];try{t[TT]=void 0;var n=!0}catch{}var i=b1t.call(t);return n&&(e?t[TT]=r:delete t[TT]),i}A(rxe,"getRawTag");var x1t=rxe,T1t=Object.prototype,w1t=T1t.toString;function nxe(t){return w1t.call(t)}A(nxe,"objectToString");var C1t=nxe,k1t="[object Null]",S1t="[object Undefined]",Ite=Cl?Cl.toStringTag:void 0;function ixe(t){return t==null?t===void 0?S1t:k1t:Ite&&Ite in Object(t)?x1t(t):C1t(t)}A(ixe,"baseGetTag");var $f=ixe;function axe(t){return t!=null&&typeof t=="object"}A(axe,"isObjectLike");var cc=axe,E1t="[object Symbol]";function sxe(t){return typeof t=="symbol"||cc(t)&&$f(t)==E1t}A(sxe,"isSymbol");var zL=sxe;function oxe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}A(oxe,"arrayMap");var IS=oxe,A1t=Array.isArray,cn=A1t,Nte=Cl?Cl.prototype:void 0,Dte=Nte?Nte.toString:void 0;function EH(t){if(typeof t=="string")return t;if(cn(t))return IS(t,EH)+"";if(zL(t))return Dte?Dte.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}A(EH,"baseToString");var _1t=EH,R1t=/\s/;function lxe(t){for(var e=t.length;e--&&R1t.test(t.charAt(e)););return e}A(lxe,"trimmedEndIndex");var L1t=lxe,M1t=/^\s+/;function cxe(t){return t&&t.slice(0,L1t(t)+1).replace(M1t,"")}A(cxe,"baseTrim");var I1t=cxe;function uxe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}A(uxe,"isObject");var kl=uxe,Ote=NaN,N1t=/^[-+]0x[0-9a-f]+$/i,D1t=/^0b[01]+$/i,O1t=/^0o[0-7]+$/i,$1t=parseInt;function hxe(t){if(typeof t=="number")return t;if(zL(t))return Ote;if(kl(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=kl(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=I1t(t);var r=D1t.test(t);return r||O1t.test(t)?$1t(t.slice(2),r?2:8):N1t.test(t)?Ote:+t}A(hxe,"toNumber");var P1t=hxe,$te=1/0,B1t=17976931348623157e292;function dxe(t){if(!t)return t===0?t:0;if(t=P1t(t),t===$te||t===-$te){var e=t<0?-1:1;return e*B1t}return t===t?t:0}A(dxe,"toFinite");var F1t=dxe;function fxe(t){var e=F1t(t),r=e%1;return e===e?r?e-r:e:0}A(fxe,"toInteger");var NS=fxe;function pxe(t){return t}A(pxe,"identity");var DS=pxe,z1t="[object AsyncFunction]",V1t="[object Function]",G1t="[object GeneratorFunction]",W1t="[object Proxy]";function gxe(t){if(!kl(t))return!1;var e=$f(t);return e==V1t||e==G1t||e==z1t||e==W1t}A(gxe,"isFunction");var Yh=gxe,H1t=pu["__core-js_shared__"],cN=H1t,Pte=(function(){var t=/[^.]+$/.exec(cN&&cN.keys&&cN.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function mxe(t){return!!Pte&&Pte in t}A(mxe,"isMasked");var q1t=mxe,U1t=Function.prototype,Y1t=U1t.toString;function yxe(t){if(t!=null){try{return Y1t.call(t)}catch{}try{return t+""}catch{}}return""}A(yxe,"toSource");var kg=yxe,X1t=/[\\^$.*+?()[\]{}|]/g,j1t=/^\[object .+?Constructor\]$/,K1t=Function.prototype,Z1t=Object.prototype,Q1t=K1t.toString,J1t=Z1t.hasOwnProperty,evt=RegExp("^"+Q1t.call(J1t).replace(X1t,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function vxe(t){if(!kl(t)||q1t(t))return!1;var e=Yh(t)?evt:j1t;return e.test(kg(t))}A(vxe,"baseIsNative");var tvt=vxe;function bxe(t,e){return t==null?void 0:t[e]}A(bxe,"getValue");var rvt=bxe;function xxe(t,e){var r=rvt(t,e);return tvt(r)?r:void 0}A(xxe,"getNative");var Sg=xxe,nvt=Sg(pu,"WeakMap"),_9=nvt,Bte=Object.create,ivt=(function(){function t(){}return A(t,"object"),function(e){if(!kl(e))return{};if(Bte)return Bte(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),avt=ivt;function Txe(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}A(Txe,"apply");var svt=Txe;function wxe(){}A(wxe,"noop");var ga=wxe;function Cxe(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}A(Cxe,"copyArray");var ovt=Cxe,lvt=800,cvt=16,uvt=Date.now;function kxe(t){var e=0,r=0;return function(){var n=uvt(),i=cvt-(n-r);if(r=n,i>0){if(++e>=lvt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}A(kxe,"shortOut");var hvt=kxe;function Sxe(t){return function(){return t}}A(Sxe,"constant");var dvt=Sxe,fvt=(function(){try{var t=Sg(Object,"defineProperty");return t({},"",{}),t}catch{}})(),j_=fvt,pvt=j_?function(t,e){return j_(t,"toString",{configurable:!0,enumerable:!1,value:dvt(e),writable:!0})}:DS,gvt=pvt,mvt=hvt(gvt),yvt=mvt;function Exe(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}A(Exe,"arrayEach");var Axe=Exe;function _xe(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a<i;)if(e(t[a],a,t))return a;return-1}A(_xe,"baseFindIndex");var Rxe=_xe;function Lxe(t){return t!==t}A(Lxe,"baseIsNaN");var vvt=Lxe;function Mxe(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}A(Mxe,"strictIndexOf");var bvt=Mxe;function Ixe(t,e,r){return e===e?bvt(t,e,r):Rxe(t,vvt,r)}A(Ixe,"baseIndexOf");var AH=Ixe;function Nxe(t,e){var r=t==null?0:t.length;return!!r&&AH(t,e,0)>-1}A(Nxe,"arrayIncludes");var Dxe=Nxe,xvt=9007199254740991,Tvt=/^(?:0|[1-9]\d*)$/;function Oxe(t,e){var r=typeof t;return e=e??xvt,!!e&&(r=="number"||r!="symbol"&&Tvt.test(t))&&t>-1&&t%1==0&&t<e}A(Oxe,"isIndex");var VL=Oxe;function $xe(t,e,r){e=="__proto__"&&j_?j_(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}A($xe,"baseAssignValue");var _H=$xe;function Pxe(t,e){return t===e||t!==t&&e!==e}A(Pxe,"eq");var OS=Pxe,wvt=Object.prototype,Cvt=wvt.hasOwnProperty;function Bxe(t,e,r){var n=t[e];(!(Cvt.call(t,e)&&OS(n,r))||r===void 0&&!(e in t))&&_H(t,e,r)}A(Bxe,"assignValue");var GL=Bxe;function Fxe(t,e,r,n){var i=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var o=e[a],l=n?n(r[o],t[o],o,r,t):void 0;l===void 0&&(l=t[o]),i?_H(r,o,l):GL(r,o,l)}return r}A(Fxe,"copyObject");var $S=Fxe,Fte=Math.max;function zxe(t,e,r){return e=Fte(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,a=Fte(n.length-e,0),s=Array(a);++i<a;)s[i]=n[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=n[i];return o[e]=r(s),svt(t,this,o)}}A(zxe,"overRest");var kvt=zxe;function Vxe(t,e){return yvt(kvt(t,e,DS),t+"")}A(Vxe,"baseRest");var RH=Vxe,Svt=9007199254740991;function Gxe(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Svt}A(Gxe,"isLength");var LH=Gxe;function Wxe(t){return t!=null&&LH(t.length)&&!Yh(t)}A(Wxe,"isArrayLike");var gu=Wxe;function Hxe(t,e,r){if(!kl(r))return!1;var n=typeof e;return(n=="number"?gu(r)&&VL(e,r.length):n=="string"&&e in r)?OS(r[e],t):!1}A(Hxe,"isIterateeCall");var WL=Hxe;function qxe(t){return RH(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&WL(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var o=r[n];o&&t(e,o,n,a)}return e})}A(qxe,"createAssigner");var Evt=qxe,Avt=Object.prototype;function Uxe(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Avt;return t===r}A(Uxe,"isPrototype");var PS=Uxe;function Yxe(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}A(Yxe,"baseTimes");var _vt=Yxe,Rvt="[object Arguments]";function Xxe(t){return cc(t)&&$f(t)==Rvt}A(Xxe,"baseIsArguments");var zte=Xxe,jxe=Object.prototype,Lvt=jxe.hasOwnProperty,Mvt=jxe.propertyIsEnumerable,Ivt=zte((function(){return arguments})())?zte:function(t){return cc(t)&&Lvt.call(t,"callee")&&!Mvt.call(t,"callee")},HL=Ivt;function Kxe(){return!1}A(Kxe,"stubFalse");var Nvt=Kxe,Zxe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Vte=Zxe&&typeof module=="object"&&module&&!module.nodeType&&module,Dvt=Vte&&Vte.exports===Zxe,Gte=Dvt?pu.Buffer:void 0,Ovt=Gte?Gte.isBuffer:void 0,$vt=Ovt||Nvt,fk=$vt,Pvt="[object Arguments]",Bvt="[object Array]",Fvt="[object Boolean]",zvt="[object Date]",Vvt="[object Error]",Gvt="[object Function]",Wvt="[object Map]",Hvt="[object Number]",qvt="[object Object]",Uvt="[object RegExp]",Yvt="[object Set]",Xvt="[object String]",jvt="[object WeakMap]",Kvt="[object ArrayBuffer]",Zvt="[object DataView]",Qvt="[object Float32Array]",Jvt="[object Float64Array]",e2t="[object Int8Array]",t2t="[object Int16Array]",r2t="[object Int32Array]",n2t="[object Uint8Array]",i2t="[object Uint8ClampedArray]",a2t="[object Uint16Array]",s2t="[object Uint32Array]",jn={};jn[Qvt]=jn[Jvt]=jn[e2t]=jn[t2t]=jn[r2t]=jn[n2t]=jn[i2t]=jn[a2t]=jn[s2t]=!0;jn[Pvt]=jn[Bvt]=jn[Kvt]=jn[Fvt]=jn[Zvt]=jn[zvt]=jn[Vvt]=jn[Gvt]=jn[Wvt]=jn[Hvt]=jn[qvt]=jn[Uvt]=jn[Yvt]=jn[Xvt]=jn[jvt]=!1;function Qxe(t){return cc(t)&&LH(t.length)&&!!jn[$f(t)]}A(Qxe,"baseIsTypedArray");var o2t=Qxe;function Jxe(t){return function(e){return t(e)}}A(Jxe,"baseUnary");var BS=Jxe,eTe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,rC=eTe&&typeof module=="object"&&module&&!module.nodeType&&module,l2t=rC&&rC.exports===eTe,uN=l2t&&exe.process,c2t=(function(){try{var t=rC&&rC.require&&rC.require("util").types;return t||uN&&uN.binding&&uN.binding("util")}catch{}})(),gf=c2t,Wte=gf&&gf.isTypedArray,u2t=Wte?BS(Wte):o2t,MH=u2t,h2t=Object.prototype,d2t=h2t.hasOwnProperty;function tTe(t,e){var r=cn(t),n=!r&&HL(t),i=!r&&!n&&fk(t),a=!r&&!n&&!i&&MH(t),s=r||n||i||a,o=s?_vt(t.length,String):[],l=o.length;for(var u in t)(e||d2t.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||VL(u,l)))&&o.push(u);return o}A(tTe,"arrayLikeKeys");var rTe=tTe;function nTe(t,e){return function(r){return t(e(r))}}A(nTe,"overArg");var iTe=nTe,f2t=iTe(Object.keys,Object),p2t=f2t,g2t=Object.prototype,m2t=g2t.hasOwnProperty;function aTe(t){if(!PS(t))return p2t(t);var e=[];for(var r in Object(t))m2t.call(t,r)&&r!="constructor"&&e.push(r);return e}A(aTe,"baseKeys");var sTe=aTe;function oTe(t){return gu(t)?rTe(t):sTe(t)}A(oTe,"keys");var Go=oTe,y2t=Object.prototype,v2t=y2t.hasOwnProperty,b2t=Evt(function(t,e){if(PS(e)||gu(e)){$S(e,Go(e),t);return}for(var r in e)v2t.call(e,r)&&GL(t,r,e[r])}),Wo=b2t;function lTe(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}A(lTe,"nativeKeysIn");var x2t=lTe,T2t=Object.prototype,w2t=T2t.hasOwnProperty;function cTe(t){if(!kl(t))return x2t(t);var e=PS(t),r=[];for(var n in t)n=="constructor"&&(e||!w2t.call(t,n))||r.push(n);return r}A(cTe,"baseKeysIn");var C2t=cTe;function uTe(t){return gu(t)?rTe(t,!0):C2t(t)}A(uTe,"keysIn");var qL=uTe,k2t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,S2t=/^\w*$/;function hTe(t,e){if(cn(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||zL(t)?!0:S2t.test(t)||!k2t.test(t)||e!=null&&t in Object(e)}A(hTe,"isKey");var IH=hTe,E2t=Sg(Object,"create"),pk=E2t;function dTe(){this.__data__=pk?pk(null):{},this.size=0}A(dTe,"hashClear");var A2t=dTe;function fTe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}A(fTe,"hashDelete");var _2t=fTe,R2t="__lodash_hash_undefined__",L2t=Object.prototype,M2t=L2t.hasOwnProperty;function pTe(t){var e=this.__data__;if(pk){var r=e[t];return r===R2t?void 0:r}return M2t.call(e,t)?e[t]:void 0}A(pTe,"hashGet");var I2t=pTe,N2t=Object.prototype,D2t=N2t.hasOwnProperty;function gTe(t){var e=this.__data__;return pk?e[t]!==void 0:D2t.call(e,t)}A(gTe,"hashHas");var O2t=gTe,$2t="__lodash_hash_undefined__";function mTe(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=pk&&e===void 0?$2t:e,this}A(mTe,"hashSet");var P2t=mTe;function Eg(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}A(Eg,"Hash");Eg.prototype.clear=A2t;Eg.prototype.delete=_2t;Eg.prototype.get=I2t;Eg.prototype.has=O2t;Eg.prototype.set=P2t;var Hte=Eg;function yTe(){this.__data__=[],this.size=0}A(yTe,"listCacheClear");var B2t=yTe;function vTe(t,e){for(var r=t.length;r--;)if(OS(t[r][0],e))return r;return-1}A(vTe,"assocIndexOf");var UL=vTe,F2t=Array.prototype,z2t=F2t.splice;function bTe(t){var e=this.__data__,r=UL(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():z2t.call(e,r,1),--this.size,!0}A(bTe,"listCacheDelete");var V2t=bTe;function xTe(t){var e=this.__data__,r=UL(e,t);return r<0?void 0:e[r][1]}A(xTe,"listCacheGet");var G2t=xTe;function TTe(t){return UL(this.__data__,t)>-1}A(TTe,"listCacheHas");var W2t=TTe;function wTe(t,e){var r=this.__data__,n=UL(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}A(wTe,"listCacheSet");var H2t=wTe;function Ag(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}A(Ag,"ListCache");Ag.prototype.clear=B2t;Ag.prototype.delete=V2t;Ag.prototype.get=G2t;Ag.prototype.has=W2t;Ag.prototype.set=H2t;var YL=Ag,q2t=Sg(pu,"Map"),gk=q2t;function CTe(){this.size=0,this.__data__={hash:new Hte,map:new(gk||YL),string:new Hte}}A(CTe,"mapCacheClear");var U2t=CTe;function kTe(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}A(kTe,"isKeyable");var Y2t=kTe;function STe(t,e){var r=t.__data__;return Y2t(e)?r[typeof e=="string"?"string":"hash"]:r.map}A(STe,"getMapData");var XL=STe;function ETe(t){var e=XL(this,t).delete(t);return this.size-=e?1:0,e}A(ETe,"mapCacheDelete");var X2t=ETe;function ATe(t){return XL(this,t).get(t)}A(ATe,"mapCacheGet");var j2t=ATe;function _Te(t){return XL(this,t).has(t)}A(_Te,"mapCacheHas");var K2t=_Te;function RTe(t,e){var r=XL(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}A(RTe,"mapCacheSet");var Z2t=RTe;function _g(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}A(_g,"MapCache");_g.prototype.clear=U2t;_g.prototype.delete=X2t;_g.prototype.get=j2t;_g.prototype.has=K2t;_g.prototype.set=Z2t;var jL=_g,Q2t="Expected a function";function KL(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Q2t);var r=A(function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s)||a,s},"memoized");return r.cache=new(KL.Cache||jL),r}A(KL,"memoize");KL.Cache=jL;var J2t=KL,ebt=500;function LTe(t){var e=J2t(t,function(n){return r.size===ebt&&r.clear(),n}),r=e.cache;return e}A(LTe,"memoizeCapped");var tbt=LTe,rbt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nbt=/\\(\\)?/g,ibt=tbt(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(rbt,function(r,n,i,a){e.push(i?a.replace(nbt,"$1"):n||r)}),e}),abt=ibt;function MTe(t){return t==null?"":_1t(t)}A(MTe,"toString");var sbt=MTe;function ITe(t,e){return cn(t)?t:IH(t,e)?[t]:abt(sbt(t))}A(ITe,"castPath");var ZL=ITe;function NTe(t){if(typeof t=="string"||zL(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}A(NTe,"toKey");var FS=NTe;function DTe(t,e){e=ZL(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[FS(e[r++])];return r&&r==n?t:void 0}A(DTe,"baseGet");var NH=DTe;function OTe(t,e,r){var n=t==null?void 0:NH(t,e);return n===void 0?r:n}A(OTe,"get");var obt=OTe;function $Te(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}A($Te,"arrayPush");var DH=$Te,qte=Cl?Cl.isConcatSpreadable:void 0;function PTe(t){return cn(t)||HL(t)||!!(qte&&t&&t[qte])}A(PTe,"isFlattenable");var lbt=PTe;function OH(t,e,r,n,i){var a=-1,s=t.length;for(r||(r=lbt),i||(i=[]);++a<s;){var o=t[a];e>0&&r(o)?e>1?OH(o,e-1,r,n,i):DH(i,o):n||(i[i.length]=o)}return i}A(OH,"baseFlatten");var $H=OH;function BTe(t){var e=t==null?0:t.length;return e?$H(t,1):[]}A(BTe,"flatten");var nc=BTe,cbt=iTe(Object.getPrototypeOf,Object),FTe=cbt;function zTe(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++n<i;)a[n]=t[n+e];return a}A(zTe,"baseSlice");var VTe=zTe;function GTe(t,e,r,n){var i=-1,a=t==null?0:t.length;for(n&&a&&(r=t[++i]);++i<a;)r=e(r,t[i],i,t);return r}A(GTe,"arrayReduce");var ubt=GTe;function WTe(){this.__data__=new YL,this.size=0}A(WTe,"stackClear");var hbt=WTe;function HTe(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}A(HTe,"stackDelete");var dbt=HTe;function qTe(t){return this.__data__.get(t)}A(qTe,"stackGet");var fbt=qTe;function UTe(t){return this.__data__.has(t)}A(UTe,"stackHas");var pbt=UTe,gbt=200;function YTe(t,e){var r=this.__data__;if(r instanceof YL){var n=r.__data__;if(!gk||n.length<gbt-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new jL(n)}return r.set(t,e),this.size=r.size,this}A(YTe,"stackSet");var mbt=YTe;function Rg(t){var e=this.__data__=new YL(t);this.size=e.size}A(Rg,"Stack");Rg.prototype.clear=hbt;Rg.prototype.delete=dbt;Rg.prototype.get=fbt;Rg.prototype.has=pbt;Rg.prototype.set=mbt;var nC=Rg;function XTe(t,e){return t&&$S(e,Go(e),t)}A(XTe,"baseAssign");var ybt=XTe;function jTe(t,e){return t&&$S(e,qL(e),t)}A(jTe,"baseAssignIn");var vbt=jTe,KTe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ute=KTe&&typeof module=="object"&&module&&!module.nodeType&&module,bbt=Ute&&Ute.exports===KTe,Yte=bbt?pu.Buffer:void 0,Xte=Yte?Yte.allocUnsafe:void 0;function ZTe(t,e){if(e)return t.slice();var r=t.length,n=Xte?Xte(r):new t.constructor(r);return t.copy(n),n}A(ZTe,"cloneBuffer");var xbt=ZTe;function QTe(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[i++]=s)}return a}A(QTe,"arrayFilter");var PH=QTe;function JTe(){return[]}A(JTe,"stubArray");var ewe=JTe,Tbt=Object.prototype,wbt=Tbt.propertyIsEnumerable,jte=Object.getOwnPropertySymbols,Cbt=jte?function(t){return t==null?[]:(t=Object(t),PH(jte(t),function(e){return wbt.call(t,e)}))}:ewe,BH=Cbt;function twe(t,e){return $S(t,BH(t),e)}A(twe,"copySymbols");var kbt=twe,Sbt=Object.getOwnPropertySymbols,Ebt=Sbt?function(t){for(var e=[];t;)DH(e,BH(t)),t=FTe(t);return e}:ewe,rwe=Ebt;function nwe(t,e){return $S(t,rwe(t),e)}A(nwe,"copySymbolsIn");var Abt=nwe;function iwe(t,e,r){var n=e(t);return cn(t)?n:DH(n,r(t))}A(iwe,"baseGetAllKeys");var awe=iwe;function swe(t){return awe(t,Go,BH)}A(swe,"getAllKeys");var R9=swe;function owe(t){return awe(t,qL,rwe)}A(owe,"getAllKeysIn");var lwe=owe,_bt=Sg(pu,"DataView"),L9=_bt,Rbt=Sg(pu,"Promise"),M9=Rbt,Lbt=Sg(pu,"Set"),ky=Lbt,Kte="[object Map]",Mbt="[object Object]",Zte="[object Promise]",Qte="[object Set]",Jte="[object WeakMap]",ere="[object DataView]",Ibt=kg(L9),Nbt=kg(gk),Dbt=kg(M9),Obt=kg(ky),$bt=kg(_9),pp=$f;(L9&&pp(new L9(new ArrayBuffer(1)))!=ere||gk&&pp(new gk)!=Kte||M9&&pp(M9.resolve())!=Zte||ky&&pp(new ky)!=Qte||_9&&pp(new _9)!=Jte)&&(pp=A(function(t){var e=$f(t),r=e==Mbt?t.constructor:void 0,n=r?kg(r):"";if(n)switch(n){case Ibt:return ere;case Nbt:return Kte;case Dbt:return Zte;case Obt:return Qte;case $bt:return Jte}return e},"getTag"));var tx=pp,Pbt=Object.prototype,Bbt=Pbt.hasOwnProperty;function cwe(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Bbt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}A(cwe,"initCloneArray");var Fbt=cwe,zbt=pu.Uint8Array,K_=zbt;function uwe(t){var e=new t.constructor(t.byteLength);return new K_(e).set(new K_(t)),e}A(uwe,"cloneArrayBuffer");var FH=uwe;function hwe(t,e){var r=e?FH(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}A(hwe,"cloneDataView");var Vbt=hwe,Gbt=/\w*$/;function dwe(t){var e=new t.constructor(t.source,Gbt.exec(t));return e.lastIndex=t.lastIndex,e}A(dwe,"cloneRegExp");var Wbt=dwe,tre=Cl?Cl.prototype:void 0,rre=tre?tre.valueOf:void 0;function fwe(t){return rre?Object(rre.call(t)):{}}A(fwe,"cloneSymbol");var Hbt=fwe;function pwe(t,e){var r=e?FH(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}A(pwe,"cloneTypedArray");var qbt=pwe,Ubt="[object Boolean]",Ybt="[object Date]",Xbt="[object Map]",jbt="[object Number]",Kbt="[object RegExp]",Zbt="[object Set]",Qbt="[object String]",Jbt="[object Symbol]",ext="[object ArrayBuffer]",txt="[object DataView]",rxt="[object Float32Array]",nxt="[object Float64Array]",ixt="[object Int8Array]",axt="[object Int16Array]",sxt="[object Int32Array]",oxt="[object Uint8Array]",lxt="[object Uint8ClampedArray]",cxt="[object Uint16Array]",uxt="[object Uint32Array]";function gwe(t,e,r){var n=t.constructor;switch(e){case ext:return FH(t);case Ubt:case Ybt:return new n(+t);case txt:return Vbt(t,r);case rxt:case nxt:case ixt:case axt:case sxt:case oxt:case lxt:case cxt:case uxt:return qbt(t,r);case Xbt:return new n;case jbt:case Qbt:return new n(t);case Kbt:return Wbt(t);case Zbt:return new n;case Jbt:return Hbt(t)}}A(gwe,"initCloneByTag");var hxt=gwe;function mwe(t){return typeof t.constructor=="function"&&!PS(t)?avt(FTe(t)):{}}A(mwe,"initCloneObject");var dxt=mwe,fxt="[object Map]";function ywe(t){return cc(t)&&tx(t)==fxt}A(ywe,"baseIsMap");var pxt=ywe,nre=gf&&gf.isMap,gxt=nre?BS(nre):pxt,mxt=gxt,yxt="[object Set]";function vwe(t){return cc(t)&&tx(t)==yxt}A(vwe,"baseIsSet");var vxt=vwe,ire=gf&&gf.isSet,bxt=ire?BS(ire):vxt,xxt=bxt,Txt=1,wxt=2,Cxt=4,bwe="[object Arguments]",kxt="[object Array]",Sxt="[object Boolean]",Ext="[object Date]",Axt="[object Error]",xwe="[object Function]",_xt="[object GeneratorFunction]",Rxt="[object Map]",Lxt="[object Number]",Twe="[object Object]",Mxt="[object RegExp]",Ixt="[object Set]",Nxt="[object String]",Dxt="[object Symbol]",Oxt="[object WeakMap]",$xt="[object ArrayBuffer]",Pxt="[object DataView]",Bxt="[object Float32Array]",Fxt="[object Float64Array]",zxt="[object Int8Array]",Vxt="[object Int16Array]",Gxt="[object Int32Array]",Wxt="[object Uint8Array]",Hxt="[object Uint8ClampedArray]",qxt="[object Uint16Array]",Uxt="[object Uint32Array]",Bn={};Bn[bwe]=Bn[kxt]=Bn[$xt]=Bn[Pxt]=Bn[Sxt]=Bn[Ext]=Bn[Bxt]=Bn[Fxt]=Bn[zxt]=Bn[Vxt]=Bn[Gxt]=Bn[Rxt]=Bn[Lxt]=Bn[Twe]=Bn[Mxt]=Bn[Ixt]=Bn[Nxt]=Bn[Dxt]=Bn[Wxt]=Bn[Hxt]=Bn[qxt]=Bn[Uxt]=!0;Bn[Axt]=Bn[xwe]=Bn[Oxt]=!1;function iC(t,e,r,n,i,a){var s,o=e&Txt,l=e&wxt,u=e&Cxt;if(r&&(s=i?r(t,n,i,a):r(t)),s!==void 0)return s;if(!kl(t))return t;var h=cn(t);if(h){if(s=Fbt(t),!o)return ovt(t,s)}else{var d=tx(t),f=d==xwe||d==_xt;if(fk(t))return xbt(t,o);if(d==Twe||d==bwe||f&&!i){if(s=l||f?{}:dxt(t),!o)return l?Abt(t,vbt(s,t)):kbt(t,ybt(s,t))}else{if(!Bn[d])return i?t:{};s=hxt(t,d,o)}}a||(a=new nC);var p=a.get(t);if(p)return p;a.set(t,s),xxt(t)?t.forEach(function(y){s.add(iC(y,e,r,y,t,a))}):mxt(t)&&t.forEach(function(y,v){s.set(v,iC(y,e,r,v,t,a))});var g=u?l?lwe:R9:l?qL:Go,m=h?void 0:g(t);return Axe(m||t,function(y,v){m&&(v=y,y=t[v]),GL(s,v,iC(y,e,r,v,t,a))}),s}A(iC,"baseClone");var Yxt=iC,Xxt=4;function wwe(t){return Yxt(t,Xxt)}A(wwe,"clone");var es=wwe;function Cwe(t){for(var e=-1,r=t==null?0:t.length,n=0,i=[];++e<r;){var a=t[e];a&&(i[n++]=a)}return i}A(Cwe,"compact");var zS=Cwe,jxt="__lodash_hash_undefined__";function kwe(t){return this.__data__.set(t,jxt),this}A(kwe,"setCacheAdd");var Kxt=kwe;function Swe(t){return this.__data__.has(t)}A(Swe,"setCacheHas");var Zxt=Swe;function mk(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new jL;++e<r;)this.add(t[e])}A(mk,"SetCache");mk.prototype.add=mk.prototype.push=Kxt;mk.prototype.has=Zxt;var zH=mk;function Ewe(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}A(Ewe,"arraySome");var Awe=Ewe;function _we(t,e){return t.has(e)}A(_we,"cacheHas");var VH=_we,Qxt=1,Jxt=2;function Rwe(t,e,r,n,i,a){var s=r&Qxt,o=t.length,l=e.length;if(o!=l&&!(s&&l>o))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&Jxt?new zH:void 0;for(a.set(t,e),a.set(e,t);++d<o;){var g=t[d],m=e[d];if(n)var y=s?n(m,g,d,e,t,a):n(g,m,d,t,e,a);if(y!==void 0){if(y)continue;f=!1;break}if(p){if(!Awe(e,function(v,T){if(!VH(p,T)&&(g===v||i(g,v,r,n,a)))return p.push(T)})){f=!1;break}}else if(!(g===m||i(g,m,r,n,a))){f=!1;break}}return a.delete(t),a.delete(e),f}A(Rwe,"equalArrays");var Lwe=Rwe;function Mwe(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}A(Mwe,"mapToArray");var eTt=Mwe;function Iwe(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}A(Iwe,"setToArray");var GH=Iwe,tTt=1,rTt=2,nTt="[object Boolean]",iTt="[object Date]",aTt="[object Error]",sTt="[object Map]",oTt="[object Number]",lTt="[object RegExp]",cTt="[object Set]",uTt="[object String]",hTt="[object Symbol]",dTt="[object ArrayBuffer]",fTt="[object DataView]",are=Cl?Cl.prototype:void 0,hN=are?are.valueOf:void 0;function Nwe(t,e,r,n,i,a,s){switch(r){case fTt:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case dTt:return!(t.byteLength!=e.byteLength||!a(new K_(t),new K_(e)));case nTt:case iTt:case oTt:return OS(+t,+e);case aTt:return t.name==e.name&&t.message==e.message;case lTt:case uTt:return t==e+"";case sTt:var o=eTt;case cTt:var l=n&tTt;if(o||(o=GH),t.size!=e.size&&!l)return!1;var u=s.get(t);if(u)return u==e;n|=rTt,s.set(t,e);var h=Lwe(o(t),o(e),n,i,a,s);return s.delete(t),h;case hTt:if(hN)return hN.call(t)==hN.call(e)}return!1}A(Nwe,"equalByTag");var pTt=Nwe,gTt=1,mTt=Object.prototype,yTt=mTt.hasOwnProperty;function Dwe(t,e,r,n,i,a){var s=r&gTt,o=R9(t),l=o.length,u=R9(e),h=u.length;if(l!=h&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in e:yTt.call(e,f)))return!1}var p=a.get(t),g=a.get(e);if(p&&g)return p==e&&g==t;var m=!0;a.set(t,e),a.set(e,t);for(var y=s;++d<l;){f=o[d];var v=t[f],T=e[f];if(n)var b=s?n(T,v,f,e,t,a):n(v,T,f,t,e,a);if(!(b===void 0?v===T||i(v,T,r,n,a):b)){m=!1;break}y||(y=f=="constructor")}if(m&&!y){var w=t.constructor,C=e.constructor;w!=C&&"constructor"in t&&"constructor"in e&&!(typeof w=="function"&&w instanceof w&&typeof C=="function"&&C instanceof C)&&(m=!1)}return a.delete(t),a.delete(e),m}A(Dwe,"equalObjects");var vTt=Dwe,bTt=1,sre="[object Arguments]",ore="[object Array]",s4="[object Object]",xTt=Object.prototype,lre=xTt.hasOwnProperty;function Owe(t,e,r,n,i,a){var s=cn(t),o=cn(e),l=s?ore:tx(t),u=o?ore:tx(e);l=l==sre?s4:l,u=u==sre?s4:u;var h=l==s4,d=u==s4,f=l==u;if(f&&fk(t)){if(!fk(e))return!1;s=!0,h=!1}if(f&&!h)return a||(a=new nC),s||MH(t)?Lwe(t,e,r,n,i,a):pTt(t,e,l,r,n,i,a);if(!(r&bTt)){var p=h&&lre.call(t,"__wrapped__"),g=d&&lre.call(e,"__wrapped__");if(p||g){var m=p?t.value():t,y=g?e.value():e;return a||(a=new nC),i(m,y,r,n,a)}}return f?(a||(a=new nC),vTt(t,e,r,n,i,a)):!1}A(Owe,"baseIsEqualDeep");var TTt=Owe;function WH(t,e,r,n,i){return t===e?!0:t==null||e==null||!cc(t)&&!cc(e)?t!==t&&e!==e:TTt(t,e,r,n,WH,i)}A(WH,"baseIsEqual");var $we=WH,wTt=1,CTt=2;function Pwe(t,e,r,n){var i=r.length,a=i,s=!n;if(t==null)return!a;for(t=Object(t);i--;){var o=r[i];if(s&&o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++i<a;){o=r[i];var l=o[0],u=t[l],h=o[1];if(s&&o[2]){if(u===void 0&&!(l in t))return!1}else{var d=new nC;if(n)var f=n(u,h,l,t,e,d);if(!(f===void 0?$we(h,u,wTt|CTt,n,d):f))return!1}}return!0}A(Pwe,"baseIsMatch");var kTt=Pwe;function Bwe(t){return t===t&&!kl(t)}A(Bwe,"isStrictComparable");var Fwe=Bwe;function zwe(t){for(var e=Go(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,Fwe(i)]}return e}A(zwe,"getMatchData");var STt=zwe;function Vwe(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}A(Vwe,"matchesStrictComparable");var Gwe=Vwe;function Wwe(t){var e=STt(t);return e.length==1&&e[0][2]?Gwe(e[0][0],e[0][1]):function(r){return r===t||kTt(r,t,e)}}A(Wwe,"baseMatches");var ETt=Wwe;function Hwe(t,e){return t!=null&&e in Object(t)}A(Hwe,"baseHasIn");var ATt=Hwe;function qwe(t,e,r){e=ZL(e,t);for(var n=-1,i=e.length,a=!1;++n<i;){var s=FS(e[n]);if(!(a=t!=null&&r(t,s)))break;t=t[s]}return a||++n!=i?a:(i=t==null?0:t.length,!!i&&LH(i)&&VL(s,i)&&(cn(t)||HL(t)))}A(qwe,"hasPath");var Uwe=qwe;function Ywe(t,e){return t!=null&&Uwe(t,e,ATt)}A(Ywe,"hasIn");var _Tt=Ywe,RTt=1,LTt=2;function Xwe(t,e){return IH(t)&&Fwe(e)?Gwe(FS(t),e):function(r){var n=obt(r,t);return n===void 0&&n===e?_Tt(r,t):$we(e,n,RTt|LTt)}}A(Xwe,"baseMatchesProperty");var MTt=Xwe;function jwe(t){return function(e){return e==null?void 0:e[t]}}A(jwe,"baseProperty");var ITt=jwe;function Kwe(t){return function(e){return NH(e,t)}}A(Kwe,"basePropertyDeep");var NTt=Kwe;function Zwe(t){return IH(t)?ITt(FS(t)):NTt(t)}A(Zwe,"property");var DTt=Zwe;function Qwe(t){return typeof t=="function"?t:t==null?DS:typeof t=="object"?cn(t)?MTt(t[0],t[1]):ETt(t):DTt(t)}A(Qwe,"baseIteratee");var mu=Qwe;function Jwe(t,e,r,n){for(var i=-1,a=t==null?0:t.length;++i<a;){var s=t[i];e(n,s,r(s),t)}return n}A(Jwe,"arrayAggregator");var OTt=Jwe;function eCe(t){return function(e,r,n){for(var i=-1,a=Object(e),s=n(e),o=s.length;o--;){var l=s[t?o:++i];if(r(a[l],l,a)===!1)break}return e}}A(eCe,"createBaseFor");var $Tt=eCe,PTt=$Tt(),BTt=PTt;function tCe(t,e){return t&&BTt(t,e,Go)}A(tCe,"baseForOwn");var FTt=tCe;function rCe(t,e){return function(r,n){if(r==null)return r;if(!gu(r))return t(r,n);for(var i=r.length,a=e?i:-1,s=Object(r);(e?a--:++a<i)&&n(s[a],a,s)!==!1;);return r}}A(rCe,"createBaseEach");var zTt=rCe,VTt=zTt(FTt),Lg=VTt;function nCe(t,e,r,n){return Lg(t,function(i,a,s){e(n,i,r(i),s)}),n}A(nCe,"baseAggregator");var GTt=nCe;function iCe(t,e){return function(r,n){var i=cn(r)?OTt:GTt,a=e?e():{};return i(r,t,mu(n),a)}}A(iCe,"createAggregator");var WTt=iCe,aCe=Object.prototype,HTt=aCe.hasOwnProperty,qTt=RH(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&WL(e[0],e[1],i)&&(n=1);++r<n;)for(var a=e[r],s=qL(a),o=-1,l=s.length;++o<l;){var u=s[o],h=t[u];(h===void 0||OS(h,aCe[u])&&!HTt.call(t,u))&&(t[u]=a[u])}return t}),HH=qTt;function sCe(t){return cc(t)&&gu(t)}A(sCe,"isArrayLikeObject");var cre=sCe;function oCe(t,e,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}A(oCe,"arrayIncludesWith");var lCe=oCe,UTt=200;function cCe(t,e,r,n){var i=-1,a=Dxe,s=!0,o=t.length,l=[],u=e.length;if(!o)return l;r&&(e=IS(e,BS(r))),n?(a=lCe,s=!1):e.length>=UTt&&(a=VH,s=!1,e=new zH(e));e:for(;++i<o;){var h=t[i],d=r==null?h:r(h);if(h=n||h!==0?h:0,s&&d===d){for(var f=u;f--;)if(e[f]===d)continue e;l.push(h)}else a(e,d,n)||l.push(h)}return l}A(cCe,"baseDifference");var YTt=cCe,XTt=RH(function(t,e){return cre(t)?YTt(t,$H(e,1,cre,!0)):[]}),QL=XTt;function uCe(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}A(uCe,"last");var U0=uCe;function hCe(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:NS(e),VTe(t,e<0?0:e,n)):[]}A(hCe,"drop");var Ga=hCe;function dCe(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:NS(e),e=n-e,VTe(t,0,e<0?0:e)):[]}A(dCe,"dropRight");var yk=dCe;function fCe(t){return typeof t=="function"?t:DS}A(fCe,"castFunction");var jTt=fCe;function pCe(t,e){var r=cn(t)?Axe:Lg;return r(t,jTt(e))}A(pCe,"forEach");var kr=pCe;function gCe(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}A(gCe,"arrayEvery");var KTt=gCe;function mCe(t,e){var r=!0;return Lg(t,function(n,i,a){return r=!!e(n,i,a),r}),r}A(mCe,"baseEvery");var ZTt=mCe;function yCe(t,e,r){var n=cn(t)?KTt:ZTt;return r&&WL(t,e,r)&&(e=void 0),n(t,mu(e))}A(yCe,"every");var ic=yCe;function vCe(t,e){var r=[];return Lg(t,function(n,i,a){e(n,i,a)&&r.push(n)}),r}A(vCe,"baseFilter");var bCe=vCe;function xCe(t,e){var r=cn(t)?PH:bCe;return r(t,mu(e))}A(xCe,"filter");var El=xCe;function TCe(t){return function(e,r,n){var i=Object(e);if(!gu(e)){var a=mu(r);e=Go(e),r=A(function(o){return a(i[o],o,i)},"predicate")}var s=t(e,r,n);return s>-1?i[a?e[s]:s]:void 0}}A(TCe,"createFind");var QTt=TCe,JTt=Math.max;function wCe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:NS(r);return i<0&&(i=JTt(n+i,0)),Rxe(t,mu(e),i)}A(wCe,"findIndex");var ewt=wCe,twt=QTt(ewt),rx=twt;function CCe(t){return t&&t.length?t[0]:void 0}A(CCe,"head");var uc=CCe;function kCe(t,e){var r=-1,n=gu(t)?Array(t.length):[];return Lg(t,function(i,a,s){n[++r]=e(i,a,s)}),n}A(kCe,"baseMap");var rwt=kCe;function SCe(t,e){var r=cn(t)?IS:rwt;return r(t,mu(e))}A(SCe,"map");var ir=SCe;function ECe(t,e){return $H(ir(t,e),1)}A(ECe,"flatMap");var vl=ECe,nwt=Object.prototype,iwt=nwt.hasOwnProperty,awt=WTt(function(t,e,r){iwt.call(t,r)?t[r].push(e):_H(t,r,[e])}),swt=awt,owt=Object.prototype,lwt=owt.hasOwnProperty;function ACe(t,e){return t!=null&&lwt.call(t,e)}A(ACe,"baseHas");var cwt=ACe;function _Ce(t,e){return t!=null&&Uwe(t,e,cwt)}A(_Ce,"has");var mr=_Ce,uwt="[object String]";function RCe(t){return typeof t=="string"||!cn(t)&&cc(t)&&$f(t)==uwt}A(RCe,"isString");var wo=RCe;function LCe(t,e){return IS(e,function(r){return t[r]})}A(LCe,"baseValues");var hwt=LCe;function MCe(t){return t==null?[]:hwt(t,Go(t))}A(MCe,"values");var na=MCe,dwt=Math.max;function ICe(t,e,r,n){t=gu(t)?t:na(t),r=r&&!n?NS(r):0;var i=t.length;return r<0&&(r=dwt(i+r,0)),wo(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&AH(t,e,r)>-1}A(ICe,"includes");var to=ICe,fwt=Math.max;function NCe(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:NS(r);return i<0&&(i=fwt(n+i,0)),AH(t,e,i)}A(NCe,"indexOf");var ure=NCe,pwt="[object Map]",gwt="[object Set]",mwt=Object.prototype,ywt=mwt.hasOwnProperty;function DCe(t){if(t==null)return!0;if(gu(t)&&(cn(t)||typeof t=="string"||typeof t.splice=="function"||fk(t)||MH(t)||HL(t)))return!t.length;var e=tx(t);if(e==pwt||e==gwt)return!t.size;if(PS(t))return!sTe(t).length;for(var r in t)if(ywt.call(t,r))return!1;return!0}A(DCe,"isEmpty");var Vn=DCe,vwt="[object RegExp]";function OCe(t){return cc(t)&&$f(t)==vwt}A(OCe,"baseIsRegExp");var bwt=OCe,hre=gf&&gf.isRegExp,xwt=hre?BS(hre):bwt,Ah=xwt;function $Ce(t){return t===void 0}A($Ce,"isUndefined");var _h=$Ce,Twt="Expected a function";function PCe(t){if(typeof t!="function")throw new TypeError(Twt);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}A(PCe,"negate");var wwt=PCe;function BCe(t,e,r,n){if(!kl(t))return t;e=ZL(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i<a;){var l=FS(e[i]),u=r;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=s){var h=o[l];u=n?n(h,l,o):void 0,u===void 0&&(u=kl(h)?h:VL(e[i+1])?[]:{})}GL(o,l,u),o=o[l]}return t}A(BCe,"baseSet");var Cwt=BCe;function FCe(t,e,r){for(var n=-1,i=e.length,a={};++n<i;){var s=e[n],o=NH(t,s);r(o,s)&&Cwt(a,ZL(s,t),o)}return a}A(FCe,"basePickBy");var kwt=FCe;function zCe(t,e){if(t==null)return{};var r=IS(lwe(t),function(n){return[n]});return e=mu(e),kwt(t,r,function(n,i){return e(n,i[0])})}A(zCe,"pickBy");var fc=zCe;function VCe(t,e,r,n,i){return i(t,function(a,s,o){r=n?(n=!1,a):e(r,a,s,o)}),r}A(VCe,"baseReduce");var Swt=VCe;function GCe(t,e,r){var n=cn(t)?ubt:Swt,i=arguments.length<3;return n(t,mu(e),r,i,Lg)}A(GCe,"reduce");var Ho=GCe;function WCe(t,e){var r=cn(t)?PH:bCe;return r(t,wwt(mu(e)))}A(WCe,"reject");var JL=WCe;function HCe(t,e){var r;return Lg(t,function(n,i,a){return r=e(n,i,a),!r}),!!r}A(HCe,"baseSome");var Ewt=HCe;function qCe(t,e,r){var n=cn(t)?Awe:Ewt;return r&&WL(t,e,r)&&(e=void 0),n(t,mu(e))}A(qCe,"some");var UCe=qCe,Awt=1/0,_wt=ky&&1/GH(new ky([,-0]))[1]==Awt?function(t){return new ky(t)}:ga,Rwt=_wt,Lwt=200;function YCe(t,e,r){var n=-1,i=Dxe,a=t.length,s=!0,o=[],l=o;if(r)s=!1,i=lCe;else if(a>=Lwt){var u=e?null:Rwt(t);if(u)return GH(u);s=!1,i=VH,l=new zH}else l=e?[]:o;e:for(;++n<a;){var h=t[n],d=e?e(h):h;if(h=r||h!==0?h:0,s&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;e&&l.push(d),o.push(h)}else i(l,d,r)||(l!==o&&l.push(d),o.push(h))}return o}A(YCe,"baseUniq");var Mwt=YCe;function XCe(t){return t&&t.length?Mwt(t):[]}A(XCe,"uniq");var qH=XCe;function Z_(t){console&&console.error&&console.error(`Error: ${t}`)}A(Z_,"PRINT_ERROR");function UH(t){console&&console.warn&&console.warn(`Warning: ${t}`)}A(UH,"PRINT_WARNING");function YH(t){const e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}A(YH,"timer");function XH(t){function e(){}A(e,"FakeConstructor"),e.prototype=t;const r=new e;function n(){return typeof r.bar}return A(n,"fakeAccess"),n(),n(),t}A(XH,"toFastProperties");function jCe(t){return KCe(t)?t.LABEL:t.name}A(jCe,"tokenLabel");function KCe(t){return wo(t.LABEL)&&t.LABEL!==""}A(KCe,"hasTokenLabel");var n1,yu=(n1=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),kr(this.definition,r=>{r.accept(e)})}},A(n1,"AbstractProduction"),n1),i1,Xs=(i1=class extends yu{constructor(e){super([]),this.idx=1,Wo(this,fc(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},A(i1,"NonTerminal"),i1),a1,Fx=(a1=class extends yu{constructor(e){super(e.definition),this.orgText="",Wo(this,fc(e,r=>r!==void 0))}},A(a1,"Rule"),a1),s1,Co=(s1=class extends yu{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Wo(this,fc(e,r=>r!==void 0))}},A(s1,"Alternative"),s1),o1,Qa=(o1=class extends yu{constructor(e){super(e.definition),this.idx=1,Wo(this,fc(e,r=>r!==void 0))}},A(o1,"Option"),o1),l1,Xo=(l1=class extends yu{constructor(e){super(e.definition),this.idx=1,Wo(this,fc(e,r=>r!==void 0))}},A(l1,"RepetitionMandatory"),l1),c1,jo=(c1=class extends yu{constructor(e){super(e.definition),this.idx=1,Wo(this,fc(e,r=>r!==void 0))}},A(c1,"RepetitionMandatoryWithSeparator"),c1),u1,ki=(u1=class extends yu{constructor(e){super(e.definition),this.idx=1,Wo(this,fc(e,r=>r!==void 0))}},A(u1,"Repetition"),u1),h1,ko=(h1=class extends yu{constructor(e){super(e.definition),this.idx=1,Wo(this,fc(e,r=>r!==void 0))}},A(h1,"RepetitionWithSeparator"),h1),d1,So=(d1=class extends yu{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Wo(this,fc(e,r=>r!==void 0))}},A(d1,"Alternation"),d1),f1,Jn=(f1=class{constructor(e){this.idx=1,Wo(this,fc(e,r=>r!==void 0))}accept(e){e.visit(this)}},A(f1,"Terminal"),f1);function ZCe(t){return ir(t,aC)}A(ZCe,"serializeGrammar");function aC(t){function e(r){return ir(r,aC)}if(A(e,"convertDefinition"),t instanceof Xs){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return wo(t.label)&&(r.label=t.label),r}else{if(t instanceof Co)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Qa)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Xo)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof jo)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:aC(new Jn({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ko)return{type:"RepetitionWithSeparator",idx:t.idx,separator:aC(new Jn({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ki)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof So)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Jn){const r={type:"Terminal",name:t.terminalType.name,label:jCe(t.terminalType),idx:t.idx};wo(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=Ah(n)?n.source:n),r}else{if(t instanceof Fx)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}A(aC,"serializeProduction");var p1,zx=(p1=class{visit(e){const r=e;switch(r.constructor){case Xs:return this.visitNonTerminal(r);case Co:return this.visitAlternative(r);case Qa:return this.visitOption(r);case Xo:return this.visitRepetitionMandatory(r);case jo:return this.visitRepetitionMandatoryWithSeparator(r);case ko:return this.visitRepetitionWithSeparator(r);case ki:return this.visitRepetition(r);case So:return this.visitAlternation(r);case Jn:return this.visitTerminal(r);case Fx:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}},A(p1,"GAstVisitor"),p1);function QCe(t){return t instanceof Co||t instanceof Qa||t instanceof ki||t instanceof Xo||t instanceof jo||t instanceof ko||t instanceof Jn||t instanceof Fx}A(QCe,"isSequenceProd");function vk(t,e=[]){return t instanceof Qa||t instanceof ki||t instanceof ko?!0:t instanceof So?UCe(t.definition,n=>vk(n,e)):t instanceof Xs&&to(e,t)?!1:t instanceof yu?(t instanceof Xs&&e.push(t),ic(t.definition,n=>vk(n,e))):!1}A(vk,"isOptionalProd");function JCe(t){return t instanceof So}A(JCe,"isBranchingProd");function Gl(t){if(t instanceof Xs)return"SUBRULE";if(t instanceof Qa)return"OPTION";if(t instanceof So)return"OR";if(t instanceof Xo)return"AT_LEAST_ONE";if(t instanceof jo)return"AT_LEAST_ONE_SEP";if(t instanceof ko)return"MANY_SEP";if(t instanceof ki)return"MANY";if(t instanceof Jn)return"CONSUME";throw Error("non exhaustive match")}A(Gl,"getProductionDslName");var g1,e7=(g1=class{walk(e,r=[]){kr(e.definition,(n,i)=>{const a=Ga(e.definition,i+1);if(n instanceof Xs)this.walkProdRef(n,a,r);else if(n instanceof Jn)this.walkTerminal(n,a,r);else if(n instanceof Co)this.walkFlat(n,a,r);else if(n instanceof Qa)this.walkOption(n,a,r);else if(n instanceof Xo)this.walkAtLeastOne(n,a,r);else if(n instanceof jo)this.walkAtLeastOneSep(n,a,r);else if(n instanceof ko)this.walkManySep(n,a,r);else if(n instanceof ki)this.walkMany(n,a,r);else if(n instanceof So)this.walkOr(n,a,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){const i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){const i=[new Qa({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=I9(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new Qa({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=I9(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);kr(e.definition,a=>{const s=new Co({definition:[a]});this.walk(s,i)})}},A(g1,"RestWalker"),g1);function I9(t,e,r){return[new Qa({definition:[new Jn({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}A(I9,"restForRepetitionWithSeparator");function Vx(t){if(t instanceof Xs)return Vx(t.referencedRule);if(t instanceof Jn)return rke(t);if(QCe(t))return eke(t);if(JCe(t))return tke(t);throw Error("non exhaustive match")}A(Vx,"first");function eke(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=vk(a),e=e.concat(Vx(a)),n=n+1,i=r.length>n;return qH(e)}A(eke,"firstForSequence");function tke(t){const e=ir(t.definition,r=>Vx(r));return qH(nc(e))}A(tke,"firstForBranching");function rke(t){return[t.terminalType]}A(rke,"firstForTerminal");var nke="_~IN~_",m1,Iwt=(m1=class extends e7{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const i=ake(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new Co({definition:a}),o=Vx(s);this.follows[i]=o}},A(m1,"ResyncFollowsWalker"),m1);function ike(t){const e={};return kr(t,r=>{const n=new Iwt(r).startWalking();Wo(e,n)}),e}A(ike,"computeAllProdsFollows");function ake(t,e){return t.name+e+nke}A(ake,"buildBetweenProdsFollowPrefix");var M3={},Nwt=new Pbe;function VS(t){const e=t.toString();if(M3.hasOwnProperty(e))return M3[e];{const r=Nwt.pattern(e);return M3[e]=r,r}}A(VS,"getRegExpAst");function ske(){M3={}}A(ske,"clearRegExpParserCache");var oke="Complement Sets are not supported for first char optimization",Q_=`Unable to use "first char" lexer optimizations:
`;function lke(t,e=!1){try{const r=VS(t);return J_(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===oke)e&&UH(`${Q_} Unable to optimize: < ${t.toString()} >
Complement Sets cannot be automatically optimized.
This will disable the lexer's first char optimizations.
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=`
This will disable the lexer's first char optimizations.
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Z_(`${Q_}
Failed parsing: < ${t.toString()} >
Using the @chevrotain/regexp-to-ast library
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}A(lke,"getOptimizedStartCodesIndices");function J_(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)J_(t.value[i],e,r);break;case"Alternative":const n=t.value;for(let i=0;i<n.length;i++){const a=n[i];switch(a.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"Lookbehind":case"NegativeLookbehind":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const s=a;switch(s.type){case"Character":cw(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(oke);kr(s.value,l=>{if(typeof l=="number")cw(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)cw(h,e,r);else{for(let h=u.from;h<=u.to&&h<hw;h++)cw(h,e,r);if(u.to>=hw){const h=u.from>=hw?u.from:hw,d=u.to,f=Rh(h),p=Rh(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":J_(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}const o=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&e6(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return na(e)}A(J_,"firstCharOptimizedIndices");function cw(t,e,r){const n=Rh(t);e[n]=n,r===!0&&cke(t,e)}A(cw,"addOptimizedIdxToResult");function cke(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=Rh(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=Rh(i.charCodeAt(0));e[a]=a}}}A(cke,"handleIgnoreCase");function N9(t,e){return rx(t.value,r=>{if(typeof r=="number")return to(e,r);{const n=r;return rx(e,i=>n.from<=i&&i<=n.to)!==void 0}})}A(N9,"findCode");function e6(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?cn(t.value)?ic(t.value,e6):e6(t.value):!1}A(e6,"isWholeOptional");var y1,Dwt=(y1=class extends NL{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){to(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?N9(e,this.targetCharCodes)===void 0&&(this.found=!0):N9(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},A(y1,"CharCodeFinder"),y1);function t7(t,e){if(e instanceof RegExp){const r=VS(e),n=new Dwt(t);return n.visit(r),n.found}else return rx(e,r=>to(t,r.charCodeAt(0)))!==void 0}A(t7,"canMatchCharCode");var Y0="PATTERN",uw="defaultMode",o4="modes";function uke(t,e){e=HH(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
`],tracer:A((T,b)=>b(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{Mke()});let n;r("Reject Lexer.NA",()=>{n=JL(t,T=>T[Y0]===Gs.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=ir(n,T=>{const b=T[Y0];if(Ah(b)){const w=b.source;return w.length===1&&w!=="^"&&w!=="$"&&w!=="."&&!b.ignoreCase?w:w.length===2&&w[0]==="\\"&&!to(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],w[1])?w[1]:D9(b)}else{if(Yh(b))return i=!0,{exec:b};if(typeof b=="object")return i=!0,b;if(typeof b=="string"){if(b.length===1)return b;{const w=b.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),C=new RegExp(w);return D9(C)}}else throw Error("non exhaustive match")}})});let s,o,l,u,h;r("misc mapping",()=>{s=ir(n,T=>T.tokenTypeIdx),o=ir(n,T=>{const b=T.GROUP;if(b!==Gs.SKIPPED){if(wo(b))return b;if(_h(b))return!1;throw Error("non exhaustive match")}}),l=ir(n,T=>{const b=T.LONGER_ALT;if(b)return cn(b)?ir(b,C=>ure(n,C)):[ure(n,b)]}),u=ir(n,T=>T.PUSH_MODE),h=ir(n,T=>mr(T,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const T=ZH(e.lineTerminatorCharacters);d=ir(n,b=>!1),e.positionTracking!=="onlyOffset"&&(d=ir(n,b=>mr(b,"LINE_BREAKS")?!!b.LINE_BREAKS:KH(b,T)===!1&&t7(T,b.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=ir(n,jH),p=ir(a,Rke),g=Ho(n,(T,b)=>{const w=b.GROUP;return wo(w)&&w!==Gs.SKIPPED&&(T[w]=[]),T},{}),m=ir(a,(T,b)=>({pattern:a[b],longerAlt:l[b],canLineTerminator:d[b],isCustom:f[b],short:p[b],group:o[b],push:u[b],pop:h[b],tokenTypeIdx:s[b],tokenType:n[b]}))});let y=!0,v=[];return e.safeMode||r("First Char Optimization",()=>{v=Ho(n,(T,b,w)=>{if(typeof b.PATTERN=="string"){const C=b.PATTERN.charCodeAt(0),S=Rh(C);I3(T,S,m[w])}else if(cn(b.START_CHARS_HINT)){let C;kr(b.START_CHARS_HINT,S=>{const k=typeof S=="string"?S.charCodeAt(0):S,E=Rh(k);C!==E&&(C=E,I3(T,E,m[w]))})}else if(Ah(b.PATTERN))if(b.PATTERN.unicode)y=!1,e.ensureOptimizations&&Z_(`${Q_} Unable to analyze < ${b.PATTERN.toString()} > pattern.
The regexp unicode flag is not currently supported by the regexp-to-ast library.
This will disable the lexer's first char optimizations.
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const C=lke(b.PATTERN,e.ensureOptimizations);Vn(C)&&(y=!1),kr(C,S=>{I3(T,S,m[w])})}else e.ensureOptimizations&&Z_(`${Q_} TokenType: <${b.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
This will disable the lexer's first char optimizations.
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return T},[])}),{emptyGroups:g,patternIdxToConfig:m,charCodeToPatternIdxToConfig:v,hasCustom:i,canBeOptimized:y}}A(uke,"analyzeTokenTypes");function hke(t,e){let r=[];const n=fke(t);r=r.concat(n.errors);const i=pke(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(dke(a)),r=r.concat(xke(a)),r=r.concat(Tke(a,e)),r=r.concat(wke(a)),r}A(hke,"validatePatterns");function dke(t){let e=[];const r=El(t,n=>Ah(n[Y0]));return e=e.concat(gke(r)),e=e.concat(yke(r)),e=e.concat(vke(r)),e=e.concat(bke(r)),e=e.concat(mke(r)),e}A(dke,"validateRegExpPattern");function fke(t){const e=El(t,i=>!mr(i,Y0)),r=ir(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Si.MISSING_PATTERN,tokenTypes:[i]})),n=QL(t,e);return{errors:r,valid:n}}A(fke,"findMissingPatterns");function pke(t){const e=El(t,i=>{const a=i[Y0];return!Ah(a)&&!Yh(a)&&!mr(a,"exec")&&!wo(a)}),r=ir(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Si.INVALID_PATTERN,tokenTypes:[i]})),n=QL(t,e);return{errors:r,valid:n}}A(pke,"findInvalidPatterns");var Owt=/[^\\][$]/;function gke(t){const i=class i extends NL{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}};A(i,"EndAnchorFinder");let e=i;const r=El(t,a=>{const s=a.PATTERN;try{const o=VS(s),l=new e;return l.visit(o),l.found}catch{return Owt.test(s.source)}});return ir(r,a=>({message:`Unexpected RegExp Anchor Error:
Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Si.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}A(gke,"findEndOfInputAnchor");function mke(t){const e=El(t,n=>n.PATTERN.test(""));return ir(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Si.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}A(mke,"findEmptyMatchRegExps");var $wt=/[^\\[][\^]|^\^/;function yke(t){const i=class i extends NL{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}};A(i,"StartAnchorFinder");let e=i;const r=El(t,a=>{const s=a.PATTERN;try{const o=VS(s),l=new e;return l.visit(o),l.found}catch{return $wt.test(s.source)}});return ir(r,a=>({message:`Unexpected RegExp Anchor Error:
Token Type: ->`+a.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Si.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}A(yke,"findStartOfInputAnchor");function vke(t){const e=El(t,n=>{const i=n[Y0];return i instanceof RegExp&&(i.multiline||i.global)});return ir(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Si.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}A(vke,"findUnsupportedFlags");function bke(t){const e=[];let r=ir(t,a=>Ho(t,(s,o)=>(a.PATTERN.source===o.PATTERN.source&&!to(e,o)&&o.PATTERN!==Gs.NA&&(e.push(o),s.push(o)),s),[]));r=zS(r);const n=El(r,a=>a.length>1);return ir(n,a=>{const s=ir(a,l=>l.name);return{message:`The same RegExp pattern ->${uc(a).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:Si.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}A(bke,"findDuplicatePatterns");function xke(t){const e=El(t,n=>{if(!mr(n,"GROUP"))return!1;const i=n.GROUP;return i!==Gs.SKIPPED&&i!==Gs.NA&&!wo(i)});return ir(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Si.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}A(xke,"findInvalidGroupType");function Tke(t,e){const r=El(t,i=>i.PUSH_MODE!==void 0&&!to(e,i.PUSH_MODE));return ir(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:Si.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}A(Tke,"findModesThatDoNotExist");function wke(t){const e=[],r=Ho(t,(n,i,a)=>{const s=i.PATTERN;return s===Gs.NA||(wo(s)?n.push({str:s,idx:a,tokenType:i}):Ah(s)&&kke(s)&&n.push({str:s.source,idx:a,tokenType:i})),n},[]);return kr(t,(n,i)=>{kr(r,({str:a,idx:s,tokenType:o})=>{if(i<s&&Cke(a,n.PATTERN)){const l=`Token: ->${o.name}<- can never be matched.
Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition.
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:Si.UNREACHABLE_PATTERN,tokenTypes:[n,o]})}})}),e}A(wke,"findUnreachablePatterns");function Cke(t,e){if(Ah(e)){if(Ske(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(Yh(e))return e(t,0,[],{});if(mr(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}A(Cke,"tryToMatchStrToPattern");function kke(t){return rx([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}A(kke,"noMetaChar");function Ske(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(t.source)}A(Ske,"usesLookAheadOrBehind");function D9(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}A(D9,"addStickyFlag");function Eke(t,e,r){const n=[];return mr(t,uw)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+uw+`> property in its definition
`,type:Si.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),mr(t,o4)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+o4+`> property in its definition
`,type:Si.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),mr(t,o4)&&mr(t,uw)&&!mr(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${uw}: <${t.defaultMode}>which does not exist
`,type:Si.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),mr(t,o4)&&kr(t.modes,(i,a)=>{kr(i,(s,o)=>{if(_h(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${o}>
`,type:Si.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(mr(s,"LONGER_ALT")){const l=cn(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];kr(l,u=>{!_h(u)&&!to(i,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${s.name}> outside of mode <${a}>
`,type:Si.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}A(Eke,"performRuntimeChecks");function Ake(t,e,r){const n=[];let i=!1;const a=zS(nc(na(t.modes))),s=JL(a,l=>l[Y0]===Gs.NA),o=ZH(r);return e&&kr(s,l=>{const u=KH(l,o);if(u!==!1){const d={message:Lke(l,u),type:u.issue,tokenType:l};n.push(d)}else mr(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):t7(o,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
This Lexer has been defined to track line and column information,
But none of the Token Types can be identified as matching a line terminator.
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
for details.`,type:Si.NO_LINE_BREAKS_FLAGS}),n}A(Ake,"performWarningRuntimeChecks");function _ke(t){const e={},r=Go(t);return kr(r,n=>{const i=t[n];if(cn(i))e[n]=[];else throw Error("non exhaustive match")}),e}A(_ke,"cloneEmptyGroups");function jH(t){const e=t.PATTERN;if(Ah(e))return!1;if(Yh(e))return!0;if(mr(e,"exec"))return!0;if(wo(e))return!1;throw Error("non exhaustive match")}A(jH,"isCustomPattern");function Rke(t){return wo(t)&&t.length===1?t.charCodeAt(0):!1}A(Rke,"isShortPattern");var Pwt={test:A(function(t){const e=t.length;for(let r=this.lastIndex;r<e;r++){const n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},"test"),lastIndex:0};function KH(t,e){if(mr(t,"LINE_BREAKS"))return!1;if(Ah(t.PATTERN)){try{t7(e,t.PATTERN)}catch(r){return{issue:Si.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(wo(t.PATTERN))return!1;if(jH(t))return{issue:Si.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}A(KH,"checkLineBreaksIssues");function Lke(t,e){if(e.issue===Si.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
The problem is in the <${t.name}> Token Type
Root cause: ${e.errMsg}.
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===Si.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
The problem is in the <${t.name}> Token Type
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}A(Lke,"buildLineBreakIssueMessage");function ZH(t){return ir(t,r=>wo(r)?r.charCodeAt(0):r)}A(ZH,"getCharCodes");function I3(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}A(I3,"addToMapOfArrays");var hw=256,N3=[];function Rh(t){return t<hw?t:N3[t]}A(Rh,"charCodeToOptimizedIndex");function Mke(){if(Vn(N3)){N3=new Array(65536);for(let t=0;t<65536;t++)N3[t]=t>255?255+~~(t/255):t}}A(Mke,"initCharCodeToOptimizedIndexMap");function Gx(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}A(Gx,"tokenStructuredMatcher");function bk(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}A(bk,"tokenStructuredMatcherNoCategories");var dre=1,Ike={};function Wx(t){const e=Nke(t);Dke(e),$ke(e),Oke(e),kr(e,r=>{r.isParent=r.categoryMatches.length>0})}A(Wx,"augmentTokenTypes");function Nke(t){let e=es(t),r=t,n=!0;for(;n;){r=zS(nc(ir(r,a=>a.CATEGORIES)));const i=QL(r,e);e=e.concat(i),Vn(i)?n=!1:r=i}return e}A(Nke,"expandCategories");function Dke(t){kr(t,e=>{JH(e)||(Ike[dre]=e,e.tokenTypeIdx=dre++),O9(e)&&!cn(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),O9(e)||(e.CATEGORIES=[]),Pke(e)||(e.categoryMatches=[]),Bke(e)||(e.categoryMatchesMap={})})}A(Dke,"assignTokenDefaultProps");function Oke(t){kr(t,e=>{e.categoryMatches=[],kr(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(Ike[n].tokenTypeIdx)})})}A(Oke,"assignCategoriesTokensProp");function $ke(t){kr(t,e=>{QH([],e)})}A($ke,"assignCategoriesMapProp");function QH(t,e){kr(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),kr(e.CATEGORIES,r=>{const n=t.concat(e);to(n,r)||QH(n,r)})}A(QH,"singleAssignCategoriesToksMap");function JH(t){return mr(t,"tokenTypeIdx")}A(JH,"hasShortKeyProperty");function O9(t){return mr(t,"CATEGORIES")}A(O9,"hasCategoriesProperty");function Pke(t){return mr(t,"categoryMatches")}A(Pke,"hasExtendingTokensTypesProperty");function Bke(t){return mr(t,"categoryMatchesMap")}A(Bke,"hasExtendingTokensTypesMapProperty");function Fke(t){return mr(t,"tokenTypeIdx")}A(Fke,"isTokenType");var $9={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,a){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}},Si;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(Si||(Si={}));var dw={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:$9,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(dw);var v1,Gs=(v1=class{constructor(e,r=dw){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${s}--> <${i}>`);const{time:o,value:l}=YH(a),u=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(`${s}<-- <${i}> time: ${o}ms`),this.traceInitIndent--,l}else return a()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
a boolean 2nd argument is no longer supported`);this.config=Wo({},dw,r);const n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===dw.lineTerminatorsPattern)this.config.lineTerminatorsPattern=Pwt;else if(this.config.lineTerminatorCharacters===dw.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),cn(e)?i={modes:{defaultMode:es(e)},defaultMode:uw}:(a=!1,i=es(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Eke(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Ake(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},kr(i.modes,(o,l)=>{i.modes[l]=JL(o,u=>_h(u))});const s=Go(i.modes);if(kr(i.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(hke(o,s))}),Vn(this.lexerDefinitionErrors)){Wx(o);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=uke(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=u.charCodeToPatternIdxToConfig,this.emptyGroups=Wo({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Vn(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=ir(this.lexerDefinitionErrors,u=>u.message).join(`-----------------------
`);throw new Error(`Errors detected in definition of Lexer:
`+l)}kr(this.lexerDefinitionWarning,o=>{UH(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=ga),this.trackStartLines===!1&&(this.computeNewColumn=DS),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=ga),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=Ho(this.canModeBeOptimized,(l,u,h)=>(u===!1&&l.push(h),l),[]);if(r.ensureOptimizations&&!Vn(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized.
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{ske()}),this.TRACE_INIT("toFastProperties",()=>{XH(this)})})}tokenize(e,r=this.defaultMode){if(!Vn(this.lexerDefinitionErrors)){const i=ir(this.lexerDefinitionErrors,a=>a.message).join(`-----------------------
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,a,s,o,l,u,h,d,f,p,g,m,y,v;const T=e,b=T.length;let w=0,C=0;const S=this.hasCustom?0:Math.floor(e.length/10),k=new Array(S),E=[];let _=this.trackStartLines?1:void 0,M=this.trackStartLines?1:void 0;const L=_ke(this.emptyGroups),P=this.trackStartLines,D=this.config.lineTerminatorsPattern;let R=0,I=[],$=[];const O=[],N=[];Object.freeze(N);let F=!1;const z=A(H=>{if(O.length===1&&H.tokenType.PUSH_MODE===void 0){const q=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(H);E.push({offset:H.startOffset,line:H.startLine,column:H.startColumn,length:H.image.length,message:q})}else{O.pop();const q=U0(O);I=this.patternIdxToConfig[q],$=this.charCodeToPatternIdxToConfig[q],R=I.length;const Z=this.canModeBeOptimized[q]&&this.config.safeMode===!1;$&&Z?F=!0:F=!1}},"pop_mode");function V(H){O.push(H),$=this.charCodeToPatternIdxToConfig[H],I=this.patternIdxToConfig[H],R=I.length,R=I.length;const q=this.canModeBeOptimized[H]&&this.config.safeMode===!1;$&&q?F=!0:F=!1}A(V,"push_mode"),V.call(this,r);let B;const G=this.config.recoveryEnabled;for(;w<b;){l=null,d=-1;const H=T.charCodeAt(w);let q;if(F){const Y=Rh(H),ie=$[Y];q=ie!==void 0?ie:N}else q=I;const Z=q.length;for(n=0;n<Z;n++){B=q[n];const Y=B.pattern;u=null;const ie=B.short;if(ie!==!1?H===ie&&(d=1,l=Y):B.isCustom===!0?(v=Y.exec(T,w,k,L),v!==null?(l=v[0],d=l.length,v.payload!==void 0&&(u=v.payload)):l=null):(Y.lastIndex=w,d=this.matchLength(Y,e,w)),d!==-1){if(o=B.longerAlt,o!==void 0){l=e.substring(w,w+d);const K=o.length;for(a=0;a<K;a++){const Q=I[o[a]],te=Q.pattern;if(h=null,Q.isCustom===!0?(v=te.exec(T,w,k,L),v!==null?(s=v[0],v.payload!==void 0&&(h=v.payload)):s=null):(te.lastIndex=w,s=this.match(te,e,w)),s&&s.length>l.length){l=s,d=s.length,u=h,B=Q;break}}}break}}if(d!==-1){if(f=B.group,f!==void 0&&(l=l!==null?l:e.substring(w,w+d),p=B.tokenTypeIdx,g=this.createTokenInstance(l,w,p,B.tokenType,_,M,d),this.handlePayload(g,u),f===!1?C=this.addToken(k,C,g):L[f].push(g)),P===!0&&B.canLineTerminator===!0){let Y=0,ie,K;D.lastIndex=0;do l=l!==null?l:e.substring(w,w+d),ie=D.test(l),ie===!0&&(K=D.lastIndex-1,Y++);while(ie===!0);Y!==0?(_=_+Y,M=d-K,this.updateTokenEndLineColumnLocation(g,f,K,Y,_,M,d)):M=this.computeNewColumn(M,d)}else M=this.computeNewColumn(M,d);w=w+d,this.handleModes(B,z,V,g)}else{const Y=w,ie=_,K=M;let Q=G===!1;for(;Q===!1&&w<b;)for(w++,i=0;i<R;i++){const te=I[i],J=te.pattern,ge=te.short;if(ge!==!1?T.charCodeAt(w)===ge&&(Q=!0):te.isCustom===!0?Q=J.exec(T,w,k,L)!==null:(J.lastIndex=w,Q=J.exec(e)!==null),Q===!0)break}if(m=w-Y,M=this.computeNewColumn(M,m),y=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(T,Y,m,ie,K,U0(O)),E.push({offset:Y,line:ie,column:K,length:m,message:y}),G===!1)break}}return this.hasCustom||(k.length=C),{tokens:k,groups:L,errors:E}}handleModes(e,r,n,i){if(e.pop===!0){const a=e.push;r(i),a!==void 0&&n.call(this,a)}else e.push!==void 0&&n.call(this,e.push)}updateTokenEndLineColumnLocation(e,r,n,i,a,s,o){let l,u;r!==void 0&&(l=n===o-1,u=l?-1:0,i===1&&l===!0||(e.endLine=a+u,e.endColumn=s-1+-u))}computeNewColumn(e,r){return e+r}createOffsetOnlyToken(e,r,n,i){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:i}}createStartOnlyToken(e,r,n,i,a,s){return{image:e,startOffset:r,startLine:a,startColumn:s,tokenTypeIdx:n,tokenType:i}}createFullToken(e,r,n,i,a,s,o){return{image:e,startOffset:r,endOffset:r+o-1,startLine:a,endLine:a,startColumn:s,endColumn:s+o-1,tokenTypeIdx:n,tokenType:i}}addTokenUsingPush(e,r,n){return e.push(n),r}addTokenUsingMemberAccess(e,r,n){return e[r]=n,r++,r}handlePayloadNoCustom(e,r){}handlePayloadWithCustom(e,r){r!==null&&(e.payload=r)}match(e,r,n){return e.test(r)===!0?r.substring(n,e.lastIndex):null}matchLength(e,r,n){return e.test(r)===!0?e.lastIndex-n:-1}},A(v1,"Lexer"),v1);Gs.SKIPPED="This marks a skipped Token pattern, this means each token identified by it will be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";Gs.NA=/NOT_APPLICABLE/;function f0(t){return eq(t)?t.LABEL:t.name}A(f0,"tokenLabel");function eq(t){return wo(t.LABEL)&&t.LABEL!==""}A(eq,"hasTokenLabel");var Bwt="parent",fre="categories",pre="label",gre="group",mre="push_mode",yre="pop_mode",vre="longer_alt",bre="line_breaks",xre="start_chars_hint";function Sy(t){return zke(t)}A(Sy,"createToken");function zke(t){const e=t.pattern,r={};if(r.name=t.name,_h(e)||(r.PATTERN=e),mr(t,Bwt))throw`The parent property is no longer supported.
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return mr(t,fre)&&(r.CATEGORIES=t[fre]),Wx([r]),mr(t,pre)&&(r.LABEL=t[pre]),mr(t,gre)&&(r.GROUP=t[gre]),mr(t,yre)&&(r.POP_MODE=t[yre]),mr(t,mre)&&(r.PUSH_MODE=t[mre]),mr(t,vre)&&(r.LONGER_ALT=t[vre]),mr(t,bre)&&(r.LINE_BREAKS=t[bre]),mr(t,xre)&&(r.START_CHARS_HINT=t[xre]),r}A(zke,"createTokenInternal");var mf=Sy({name:"EOF",pattern:Gs.NA});Wx([mf]);function GS(t,e,r,n,i,a,s,o){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:a,startColumn:s,endColumn:o,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}A(GS,"createTokenInstance");function tq(t,e){return Gx(t,e)}A(tq,"tokenMatcher");var iy={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${eq(t)?`--> ${f0(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){const a="Expecting: ",o=`
but found: '`+uc(e).image+"'";if(n)return a+n+o;{const l=Ho(t,(f,p)=>f.concat(p),[]),u=ir(l,f=>`[${ir(f,p=>f0(p)).join(", ")}]`),d=`one of these possible Token sequences:
${ir(u,(f,p)=>` ${p+1}. ${f}`).join(`
`)}`;return a+d+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const i="Expecting: ",s=`
but found: '`+uc(e).image+"'";if(r)return i+r+s;{const l=`expecting at least one iteration which starts with one of these possible Token sequences::
<${ir(t,u=>`[${ir(u,h=>f0(h)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(iy);var Fwt={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
inside top level rule: ->`+t.name+"<-"}},t0={buildDuplicateFoundError(t,e){function r(h){return h instanceof Jn?h.terminalType.name:h instanceof Xs?h.nonTerminalName:""}A(r,"getExtraProductionArgument");const n=t.name,i=uc(e),a=i.idx,s=Gl(i),o=r(i),l=a>0;let u=`->${s}${l?a:""}<- ${o?`with argument: ->${o}<-`:""}
appears more than once (${e.length} times) in the top level rule: ->${n}<-.
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
`;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,`
`),u},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
To resolve this make sure each Terminal and Non-Terminal names are unique
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=ir(t.prefixPath,i=>f0(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
in <OR${r}> inside <${t.topLevelRule.name}> Rule,
<${e}> may appears as a prefix path in all these alternatives.
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
For Further details.`},buildAlternationAmbiguityError(t){const e=t.alternation.idx===0?"":t.alternation.idx,r=t.prefixPath.length===0;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${e}> inside <${t.topLevelRule.name}> Rule,
`;if(r)n+=`These alternatives are all empty (match no tokens), making them indistinguishable.
Only the last alternative may be empty.
`;else{const i=ir(t.prefixPath,a=>f0(a)).join(", ");n+=`<${i}> may appears as a prefix path in all these alternatives.
`}return n+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
For Further details.`,n},buildEmptyRepetitionError(t){let e=Gl(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
<OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,r=ir(t.leftRecursionPath,a=>a.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
rule: <${e}> can be invoked from itself (directly or indirectly)
without consuming any Tokens. The grammar path that causes this is:
${n}
To fix this refactor your grammar to remove the left recursion.
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Fx?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function Vke(t,e){const r=new zwt(t,e);return r.resolveRefs(),r.errors}A(Vke,"resolveGrammar");var b1,zwt=(b1=class extends zx{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){kr(na(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:js.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},A(b1,"GastRefResolverVisitor"),b1),x1,Vwt=(x1=class extends e7{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=es(this.path.ruleStack).reverse(),this.occurrenceStack=es(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){Vn(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},A(x1,"AbstractNextPossibleTokensWalker"),x1),T1,Gwt=(T1=class extends Vwt{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=r.concat(n),a=new Co({definition:i});this.possibleTokTypes=Vx(a),this.found=!0}}},A(T1,"NextAfterTokenWalker"),T1),w1,r7=(w1=class extends e7{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},A(w1,"AbstractNextTerminalAfterProductionWalker"),w1),C1,Wwt=(C1=class extends r7{walkMany(e,r,n){if(e.idx===this.occurrence){const i=uc(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Jn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},A(C1,"NextTerminalAfterManyWalker"),C1),k1,Tre=(k1=class extends r7{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=uc(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Jn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},A(k1,"NextTerminalAfterManySepWalker"),k1),S1,Hwt=(S1=class extends r7{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=uc(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Jn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},A(S1,"NextTerminalAfterAtLeastOneWalker"),S1),E1,wre=(E1=class extends r7{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=uc(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Jn&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},A(E1,"NextTerminalAfterAtLeastOneSepWalker"),E1);function t6(t,e,r=[]){r=es(r);let n=[],i=0;function a(o){return o.concat(Ga(t,i+1))}A(a,"remainingPathWith");function s(o){const l=t6(a(o),e,r);return n.concat(l)}for(A(s,"getAlternativesForProd");r.length<e&&i<t.length;){const o=t[i];if(o instanceof Co)return s(o.definition);if(o instanceof Xs)return s(o.definition);if(o instanceof Qa)n=s(o.definition);else if(o instanceof Xo){const l=o.definition.concat([new ki({definition:o.definition})]);return s(l)}else if(o instanceof jo){const l=[new Co({definition:o.definition}),new ki({definition:[new Jn({terminalType:o.separator})].concat(o.definition)})];return s(l)}else if(o instanceof ko){const l=o.definition.concat([new ki({definition:[new Jn({terminalType:o.separator})].concat(o.definition)})]);n=s(l)}else if(o instanceof ki){const l=o.definition.concat([new ki({definition:o.definition})]);n=s(l)}else{if(o instanceof So)return kr(o.definition,l=>{Vn(l.definition)===!1&&(n=s(l.definition))}),n;if(o instanceof Jn)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:Ga(t,i)}),n}A(t6,"possiblePathsFrom");function rq(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const l=e.length,u=l-n-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Vn(d);){const f=d.pop();if(f===s){o&&U0(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,y=f.occurrenceStack;if(Vn(p))continue;const v=p[0];if(v===i){const T={idx:g,def:Ga(p),ruleStack:yk(m),occurrenceStack:yk(y)};d.push(T)}else if(v instanceof Jn)if(g<l-1){const T=g+1,b=e[T];if(r(b,v.terminalType)){const w={idx:T,def:Ga(p),ruleStack:m,occurrenceStack:y};d.push(w)}}else if(g===l-1)h.push({nextTokenType:v.terminalType,nextTokenOccurrence:v.idx,ruleStack:m,occurrenceStack:y}),o=!0;else throw Error("non exhaustive match");else if(v instanceof Xs){const T=es(m);T.push(v.nonTerminalName);const b=es(y);b.push(v.idx);const w={idx:g,def:v.definition.concat(a,Ga(p)),ruleStack:T,occurrenceStack:b};d.push(w)}else if(v instanceof Qa){const T={idx:g,def:Ga(p),ruleStack:m,occurrenceStack:y};d.push(T),d.push(s);const b={idx:g,def:v.definition.concat(Ga(p)),ruleStack:m,occurrenceStack:y};d.push(b)}else if(v instanceof Xo){const T=new ki({definition:v.definition,idx:v.idx}),b=v.definition.concat([T],Ga(p)),w={idx:g,def:b,ruleStack:m,occurrenceStack:y};d.push(w)}else if(v instanceof jo){const T=new Jn({terminalType:v.separator}),b=new ki({definition:[T].concat(v.definition),idx:v.idx}),w=v.definition.concat([b],Ga(p)),C={idx:g,def:w,ruleStack:m,occurrenceStack:y};d.push(C)}else if(v instanceof ko){const T={idx:g,def:Ga(p),ruleStack:m,occurrenceStack:y};d.push(T),d.push(s);const b=new Jn({terminalType:v.separator}),w=new ki({definition:[b].concat(v.definition),idx:v.idx}),C=v.definition.concat([w],Ga(p)),S={idx:g,def:C,ruleStack:m,occurrenceStack:y};d.push(S)}else if(v instanceof ki){const T={idx:g,def:Ga(p),ruleStack:m,occurrenceStack:y};d.push(T),d.push(s);const b=new ki({definition:v.definition,idx:v.idx}),w=v.definition.concat([b],Ga(p)),C={idx:g,def:w,ruleStack:m,occurrenceStack:y};d.push(C)}else if(v instanceof So)for(let T=v.definition.length-1;T>=0;T--){const b=v.definition[T],w={idx:g,def:b.definition.concat(Ga(p)),ruleStack:m,occurrenceStack:y};d.push(w),d.push(s)}else if(v instanceof Co)d.push({idx:g,def:v.definition.concat(Ga(p)),ruleStack:m,occurrenceStack:y});else if(v instanceof Fx)d.push(Gke(v,g,m,y));else throw Error("non exhaustive match")}return h}A(rq,"nextPossibleTokensAfter");function Gke(t,e,r,n){const i=es(r);i.push(t.name);const a=es(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}A(Gke,"expandTopLevelRule");var pi;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(pi||(pi={}));function n7(t){if(t instanceof Qa||t==="Option")return pi.OPTION;if(t instanceof ki||t==="Repetition")return pi.REPETITION;if(t instanceof Xo||t==="RepetitionMandatory")return pi.REPETITION_MANDATORY;if(t instanceof jo||t==="RepetitionMandatoryWithSeparator")return pi.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof ko||t==="RepetitionWithSeparator")return pi.REPETITION_WITH_SEPARATOR;if(t instanceof So||t==="Alternation")return pi.ALTERNATION;throw Error("non exhaustive match")}A(n7,"getProdType");function P9(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=n7(n);return a===pi.ALTERNATION?WS(e,r,i):HS(e,r,a,i)}A(P9,"getLookaheadPaths");function Wke(t,e,r,n,i,a){const s=WS(t,e,r),o=iq(s)?bk:Gx;return a(s,n,o,i)}A(Wke,"buildLookaheadFuncForOr");function Hke(t,e,r,n,i,a){const s=HS(t,e,i,r),o=iq(s)?bk:Gx;return a(s[0],o,n)}A(Hke,"buildLookaheadFuncForOptionalProd");function qke(t,e,r,n){const i=t.length,a=ic(t,s=>ic(s,o=>o.length===1));if(e)return function(s){const o=ir(s,l=>l.GATE);for(let l=0;l<i;l++){const u=t[l],h=u.length,d=o[l];if(!(d!==void 0&&d.call(this)===!1))e:for(let f=0;f<h;f++){const p=u[f],g=p.length;for(let m=0;m<g;m++){const y=this.LA(m+1);if(r(y,p[m])===!1)continue e}return l}}};if(a&&!n){const s=ir(t,l=>nc(l)),o=Ho(s,(l,u,h)=>(kr(u,d=>{mr(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),kr(d.categoryMatches,f=>{mr(l,f)||(l[f]=h)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){const o=t[s],l=o.length;e:for(let u=0;u<l;u++){const h=o[u],d=h.length;for(let f=0;f<d;f++){const p=this.LA(f+1);if(r(p,h[f])===!1)continue e}return s}}}}A(qke,"buildAlternativesLookAheadFunc");function Uke(t,e,r){const n=ic(t,a=>a.length===1),i=t.length;if(n&&!r){const a=nc(t);if(a.length===1&&Vn(a[0].categoryMatches)){const o=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const s=Ho(a,(o,l,u)=>(o[l.tokenTypeIdx]=!0,kr(l.categoryMatches,h=>{o[h]=!0}),o),[]);return function(){const o=this.LA(1);return s[o.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;a<i;a++){const s=t[a],o=s.length;for(let l=0;l<o;l++){const u=this.LA(l+1);if(e(u,s[l])===!1)continue e}return!0}return!1}}A(Uke,"buildSingleAlternativeLookaheadFunction");var A1,qwt=(A1=class extends e7{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,pi.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,pi.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,pi.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,pi.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,pi.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},A(A1,"RestDefinitionFinderWalker"),A1),_1,Yke=(_1=class extends zx{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,pi.OPTION)}visitRepetition(e){this.checkIsTarget(e,pi.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,pi.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,pi.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,pi.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,pi.ALTERNATION)}},A(_1,"InsideDefinitionFinderVisitor"),_1);function B9(t){const e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}A(B9,"initializeArrayOfArrays");function D3(t){let e=[""];for(let r=0;r<t.length;r++){const n=t[r],i=[];for(let a=0;a<e.length;a++){const s=e[a];i.push(s+"_"+n.tokenTypeIdx);for(let o=0;o<n.categoryMatches.length;o++){const l="_"+n.categoryMatches[o];i.push(s+l)}}e=i}return e}A(D3,"pathToHashKeys");function Xke(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;const i=t[n];for(let a=0;a<e.length;a++){const s=e[a];if(i[s]===!0)return!1}}return!0}A(Xke,"isUniquePrefixHash");function nq(t,e){const r=ir(t,s=>t6([s],1)),n=B9(r.length),i=ir(r,s=>{const o={};return kr(s,l=>{const u=D3(l.partialPath);kr(u,h=>{o[h]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=B9(o.length);for(let l=0;l<o.length;l++){const u=o[l];for(let h=0;h<u.length;h++){const d=u[h].partialPath,f=u[h].suffixDef,p=D3(d);if(Xke(i,p,l)||Vn(f)||d.length===e){const m=n[l];if(r6(m,d)===!1){m.push(d);for(let y=0;y<p.length;y++){const v=p[y];i[l][v]=!0}}}else{const m=t6(f,s+1,d);a[l]=a[l].concat(m),kr(m,y=>{const v=D3(y.partialPath);kr(v,T=>{i[l][T]=!0})})}}}}return n}A(nq,"lookAheadSequenceFromAlternatives");function WS(t,e,r,n){const i=new Yke(t,pi.ALTERNATION,n);return e.accept(i),nq(i.result,r)}A(WS,"getLookaheadPathsForOr");function HS(t,e,r,n){const i=new Yke(t,r);e.accept(i);const a=i.result,o=new qwt(e,t,r).startWalking(),l=new Co({definition:a}),u=new Co({definition:o});return nq([l,u],n)}A(HS,"getLookaheadPathsForOptionalProd");function r6(t,e){e:for(let r=0;r<t.length;r++){const n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){const a=e[i],s=n[i];if((a===s||s.categoryMatchesMap[a.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}A(r6,"containsPath");function jke(t,e){return t.length<e.length&&ic(t,(r,n)=>{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}A(jke,"isStrictPrefixOfPath");function iq(t){return ic(t,e=>ic(e,r=>ic(r,n=>Vn(n.categoryMatches))))}A(iq,"areTokenCategoriesNotUsed");function Kke(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return ir(e,r=>Object.assign({type:js.CUSTOM_LOOKAHEAD_VALIDATION},r))}A(Kke,"validateLookahead");function Zke(t,e,r,n){const i=vl(t,l=>Qke(l,r)),a=lSe(t,e,r),s=vl(t,l=>iSe(l,r)),o=vl(t,l=>eSe(l,t,n,r));return i.concat(a,s,o)}A(Zke,"validateGrammar");function Qke(t,e){const r=new Uwt;t.accept(r);const n=r.allProductions,i=swt(n,Jke),a=fc(i,o=>o.length>1);return ir(na(a),o=>{const l=uc(o),u=e.buildDuplicateFoundError(t,o),h=Gl(l),d={message:u,type:js.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=aq(l);return f&&(d.parameter=f),d})}A(Qke,"validateDuplicateProductions");function Jke(t){return`${Gl(t)}_#_${t.idx}_#_${aq(t)}`}A(Jke,"identifyProductionForDuplicates");function aq(t){return t instanceof Jn?t.terminalType.name:t instanceof Xs?t.nonTerminalName:""}A(aq,"getExtraProductionArgument");var R1,Uwt=(R1=class extends zx{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}},A(R1,"OccurrenceValidationCollector"),R1);function eSe(t,e,r,n){const i=[];if(Ho(e,(s,o)=>o.name===t.name?s+1:s,0)>1){const s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:js.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}A(eSe,"validateRuleDoesNotAlreadyExist");function tSe(t,e,r){const n=[];let i;return to(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:js.INVALID_RULE_OVERRIDE,ruleName:t})),n}A(tSe,"validateRuleIsOverridden");function sq(t,e,r,n=[]){const i=[],a=sC(e.definition);if(Vn(a))return[];{const s=t.name;to(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:js.LEFT_RECURSION,ruleName:s});const l=QL(a,n.concat([t])),u=vl(l,h=>{const d=es(n);return d.push(h),sq(t,h,r,d)});return i.concat(u)}}A(sq,"validateNoLeftRecursion");function sC(t){let e=[];if(Vn(t))return e;const r=uc(t);if(r instanceof Xs)e.push(r.referencedRule);else if(r instanceof Co||r instanceof Qa||r instanceof Xo||r instanceof jo||r instanceof ko||r instanceof ki)e=e.concat(sC(r.definition));else if(r instanceof So)e=nc(ir(r.definition,a=>sC(a.definition)));else if(!(r instanceof Jn))throw Error("non exhaustive match");const n=vk(r),i=t.length>1;if(n&&i){const a=Ga(t);return e.concat(sC(a))}else return e}A(sC,"getFirstNoneTerminal");var L1,oq=(L1=class extends zx{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},A(L1,"OrCollector"),L1);function rSe(t,e){const r=new oq;t.accept(r);const n=r.alternations;return vl(n,a=>{const s=yk(a.definition);return vl(s,(o,l)=>{const u=rq([o],[],Gx,1);return Vn(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:js.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}A(rSe,"validateEmptyOrAlternative");function nSe(t,e,r){const n=new oq;t.accept(n);let i=n.alternations;return i=JL(i,s=>s.ignoreAmbiguities===!0),vl(i,s=>{const o=s.idx,l=s.maxLookahead||e,u=WS(o,t,l,s),h=sSe(u,s,t,r),d=oSe(u,s,t,r);return h.concat(d)})}A(nSe,"validateAmbiguousAlternationAlternatives");var M1,Ywt=(M1=class extends zx{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}},A(M1,"RepetitionCollector"),M1);function iSe(t,e){const r=new oq;t.accept(r);const n=r.alternations;return vl(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:js.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}A(iSe,"validateTooManyAlts");function aSe(t,e,r){const n=[];return kr(t,i=>{const a=new Ywt;i.accept(a);const s=a.allProductions;kr(s,o=>{const l=n7(o),u=o.maxLookahead||e,h=o.idx,f=HS(h,i,l,u)[0];if(Vn(nc(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:p,type:js.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}A(aSe,"validateSomeNonEmptyLookaheadPath");function sSe(t,e,r,n){const i=[],a=Ho(t,(o,l,u)=>(e.definition[u].ignoreAmbiguities===!0||kr(l,h=>{const d=[u];kr(t,(f,p)=>{u!==p&&r6(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!r6(i,h)&&(i.push(h),o.push({alts:d,path:h}))}),o),[]);return ir(a,o=>{const l=ir(o.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:js.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}A(sSe,"checkAlternativesAmbiguities");function oSe(t,e,r,n){const i=Ho(t,(s,o,l)=>{const u=ir(o,h=>({idx:l,path:h}));return s.concat(u)},[]);return zS(vl(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];const l=s.idx,u=s.path,h=El(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx<l&&jke(f.path,u));return ir(h,f=>{const p=[f.idx+1,l+1],g=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:js.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}A(oSe,"checkPrefixAlternativesAmbiguities");function lSe(t,e,r){const n=[],i=ir(e,a=>a.name);return kr(t,a=>{const s=a.name;if(to(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:js.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}A(lSe,"checkTerminalAndNoneTerminalsNameSpace");function cSe(t){const e=HH(t,{errMsgProvider:Fwt}),r={};return kr(t.rules,n=>{r[n.name]=n}),Vke(r,e.errMsgProvider)}A(cSe,"resolveGrammar");function uSe(t){return t=HH(t,{errMsgProvider:t0}),Zke(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}A(uSe,"validateGrammar");var hSe="MismatchedTokenException",dSe="NoViableAltException",fSe="EarlyExitException",pSe="NotAllInputParsedException",gSe=[hSe,dSe,fSe,pSe];Object.freeze(gSe);function xk(t){return to(gSe,t.name)}A(xk,"isRecognitionException");var I1,i7=(I1=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},A(I1,"RecognitionException"),I1),N1,mSe=(N1=class extends i7{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=hSe}},A(N1,"MismatchedTokenException"),N1),D1,Xwt=(D1=class extends i7{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=dSe}},A(D1,"NoViableAltException"),D1),O1,jwt=(O1=class extends i7{constructor(e,r){super(e,r),this.name=pSe}},A(O1,"NotAllInputParsedException"),O1),$1,Kwt=($1=class extends i7{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=fSe}},A($1,"EarlyExitException"),$1),dN={},ySe="InRuleRecoveryException",P1,Zwt=(P1=class extends Error{constructor(e){super(e),this.name=ySe}},A(P1,"InRuleRecoveryException"),P1),B1,Qwt=(B1=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=mr(e,"recoveryEnabled")?e.recoveryEnabled:Lh.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=vSe)}getTokenToInsert(e){const r=GS(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let l=!1;const u=this.LA(1);let h=this.LA(1);const d=A(()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),g=new mSe(p,u,this.LA(0));g.resyncedTokens=yk(o),this.SAVE_ERROR(g)},"generateErrorMessage");for(;!l;)if(this.tokenMatcher(h,i)){d();return}else if(n.call(this)){d(),e.apply(this,r);return}else this.tokenMatcher(h,a)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){const n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new Zwt("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Vn(r))return!1;const n=this.LA(1);return rx(r,a=>this.tokenMatcher(n,a))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return to(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=rx(e,a=>tq(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return dN;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return ir(e,(n,i)=>i===0?dN:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=ir(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return nc(e)}getFollowSetFromFollowKey(e){if(e===dN)return[mf];const r=e.ruleName+e.idxInCallingRule+nke+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,mf)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return yk(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=es(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return ir(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},A(B1,"Recoverable"),B1);function vSe(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[o];if(l===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];l=new a(p,i).startWalking(),this.firstAfterRepMap[o]=l}let u=l.token,h=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=mf,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,s)&&this.tryInRepetitionRecovery(t,e,r,u)}A(vSe,"attemptInRepetitionRecovery");var Jwt=4,Pf=8,bSe=1<<Pf,xSe=2<<Pf,F9=3<<Pf,z9=4<<Pf,V9=5<<Pf,O3=6<<Pf;function $3(t,e,r){return r|e|t}A($3,"getKeyForAutomaticLookahead");var F1,lq=(F1=class{constructor(e){var r;this.maxLookahead=(r=e==null?void 0:e.maxLookahead)!==null&&r!==void 0?r:Lh.maxLookahead}validate(e){const r=this.validateNoLeftRecursion(e.rules);if(Vn(r)){const n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),a=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...a]}return r}validateNoLeftRecursion(e){return vl(e,r=>sq(r,r,t0))}validateEmptyOrAlternatives(e){return vl(e,r=>rSe(r,t0))}validateAmbiguousAlternationAlternatives(e,r){return vl(e,n=>nSe(n,r,t0))}validateSomeNonEmptyLookaheadPath(e,r){return aSe(e,r,t0)}buildLookaheadForAlternation(e){return Wke(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,qke)}buildLookaheadForOptional(e){return Hke(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,n7(e.prodType),Uke)}},A(F1,"LLkLookaheadStrategy"),F1),z1,eCt=(z1=class{initLooksAhead(e){this.dynamicTokensEnabled=mr(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Lh.dynamicTokensEnabled,this.maxLookahead=mr(e,"maxLookahead")?e.maxLookahead:Lh.maxLookahead,this.lookaheadStrategy=mr(e,"lookaheadStrategy")?e.lookaheadStrategy:new lq({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){kr(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=TSe(r);kr(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${Gl(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=$3(this.fullRuleNameToShort[r.name],bSe,u.idx);this.setLaFuncCache(f,d)})}),kr(i,u=>{this.computeLookaheadFunc(r,u.idx,F9,"Repetition",u.maxLookahead,Gl(u))}),kr(a,u=>{this.computeLookaheadFunc(r,u.idx,xSe,"Option",u.maxLookahead,Gl(u))}),kr(s,u=>{this.computeLookaheadFunc(r,u.idx,z9,"RepetitionMandatory",u.maxLookahead,Gl(u))}),kr(o,u=>{this.computeLookaheadFunc(r,u.idx,O3,"RepetitionMandatoryWithSeparator",u.maxLookahead,Gl(u))}),kr(l,u=>{this.computeLookaheadFunc(r,u.idx,V9,"RepetitionWithSeparator",u.maxLookahead,Gl(u))})})})}computeLookaheadFunc(e,r,n,i,a,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=$3(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return $3(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},A(z1,"LooksAhead"),z1),V1,tCt=(V1=class extends zx{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},A(V1,"DslMethodsCollectorVisitor"),V1),l4=new tCt;function TSe(t){l4.reset(),t.accept(l4);const e=l4.dslMethods;return l4.reset(),e}A(TSe,"collectMethods");function G9(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}A(G9,"setNodeLocationOnlyOffset");function W9(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}A(W9,"setNodeLocationFull");function wSe(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}A(wSe,"addTerminalToCst");function CSe(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}A(CSe,"addNoneTerminalToCst");var rCt="name";function cq(t,e){Object.defineProperty(t,rCt,{enumerable:!1,configurable:!0,writable:!1,value:e})}A(cq,"defineNameProp");function kSe(t,e){const r=Go(t),n=r.length;for(let i=0;i<n;i++){const a=r[i],s=t[a],o=s.length;for(let l=0;l<o;l++){const u=s[l];u.tokenTypeIdx===void 0&&this[u.name](u.children,e)}}}A(kSe,"defaultVisit");function SSe(t,e){const r=A(function(){},"derivedConstructor");cq(r,t+"BaseSemantics");const n={visit:A(function(i,a){if(cn(i)&&(i=i[0]),!_h(i))return this[i.name](i.children,a)},"visit"),validateVisitor:A(function(){const i=ASe(this,e);if(!Vn(i)){const a=ir(i,s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
${a.join(`
`).replace(/\n/g,`
`)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}A(SSe,"createBaseSemanticVisitorConstructor");function ESe(t,e,r){const n=A(function(){},"derivedConstructor");cq(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return kr(e,a=>{i[a]=kSe}),n.prototype=i,n.prototype.constructor=n,n}A(ESe,"createBaseVisitorConstructorWithDefaults");var H9;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(H9||(H9={}));function ASe(t,e){return _Se(t,e)}A(ASe,"validateVisitor");function _Se(t,e){const r=El(e,i=>Yh(t[i])===!1),n=ir(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:H9.MISSING_METHOD,methodName:i}));return zS(n)}A(_Se,"validateMissingCstMethods");var G1,nCt=(G1=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=mr(e,"nodeLocationTracking")?e.nodeLocationTracking:Lh.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ga,this.cstFinallyStateUpdate=ga,this.cstPostTerminal=ga,this.cstPostNonTerminal=ga,this.cstPostRule=ga;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=W9,this.setNodeLocationFromNode=W9,this.cstPostRule=ga,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ga,this.setNodeLocationFromNode=ga,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=G9,this.setNodeLocationFromNode=G9,this.cstPostRule=ga,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ga,this.setNodeLocationFromNode=ga,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ga,this.setNodeLocationFromNode=ga,this.cstPostRule=ga,this.setInitialNodeLocation=ga;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];wSe(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];CSe(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(_h(this.baseCstVisitorConstructor)){const e=SSe(this.className,Go(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(_h(this.baseCstVisitorWithDefaultsConstructor)){const e=ESe(this.className,Go(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},A(G1,"TreeBuilder"),G1),W1,iCt=(W1=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):n6}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?n6:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},A(W1,"LexerAdapter"),W1),H1,aCt=(H1=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=i6){if(to(this.definedRulesNames,e)){const s={message:t0.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:js.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=i6){const i=tSe(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const a=this.defineRule(e,r,n);return this[e]=a,a}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(xk(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return ZCe(na(this.gastProductionsCache))}},A(H1,"RecognizerApi"),H1),q1,sCt=(q1=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=bk,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},mr(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
For Further details.`);if(cn(e)){if(Vn(e))throw Error(`A Token Vocabulary cannot be empty.
Note that the first argument for the parser constructor
is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
For Further details.`)}if(cn(e))this.tokensMap=Ho(e,(a,s)=>(a[s.name]=s,a),{});else if(mr(e,"modes")&&ic(nc(na(e.modes)),Fke)){const a=nc(na(e.modes)),s=qH(a);this.tokensMap=Ho(s,(o,l)=>(o[l.name]=l,o),{})}else if(kl(e))this.tokensMap=es(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=mf;const n=mr(e,"modes")?nc(na(e.modes)):na(e),i=ic(n,a=>Vn(a.categoryMatches));this.tokenMatcher=i?bk:Gx,Wx(na(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=mr(n,"resyncEnabled")?n.resyncEnabled:i6.resyncEnabled,a=mr(n,"recoveryValueFunc")?n.recoveryValueFunc:i6.recoveryValueFunc,s=this.ruleShortNameIdx<<Jwt+Pf;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let o;return this.outputCst===!0?o=A(function(...h){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,h);const d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,i,a)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTry"):o=A(function(...h){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,h)}catch(d){return this.invokeRuleCatch(d,i,a)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTryCst"),Object.assign(o,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){const i=this.RULE_STACK.length===1,a=r&&!this.isBackTracking()&&this.recoveryEnabled;if(xk(e)){const s=e;if(a){const o=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(o))if(s.resyncedTokens=this.reSyncTo(o),this.outputCst){const l=this.CST_STACK[this.CST_STACK.length-1];return l.recoveredNode=!0,l}else return n(e);else{if(this.outputCst){const l=this.CST_STACK[this.CST_STACK.length-1];l.recoveredNode=!0,s.partialCstResult=l}throw s}}else{if(i)return this.moveToTerminatedState(),n(e);throw s}}else throw e}optionInternal(e,r){const n=this.getKeyForAutomaticLookahead(xSe,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof e!="function"){a=e.DEF;const s=e.GATE;if(s!==void 0){const o=i;i=A(()=>s.call(this)&&o.call(this),"lookAheadFunc")}}else a=e;if(i.call(this)===!0)return a.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(z9,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const s=r.GATE;if(s!==void 0){const o=i;i=A(()=>s.call(this)&&o.call(this),"lookAheadFunc")}}else a=r;if(i.call(this)===!0){let s=this.doSingleRepetition(a);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,pi.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,z9,e,Hwt)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(O3,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=A(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,wre],o,O3,e,wre)}else throw this.raiseEarlyExitException(e,pi.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(F9,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const o=r.GATE;if(o!==void 0){const l=i;i=A(()=>o.call(this)&&l.call(this),"lookaheadFunction")}}else a=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,F9,e,Wwt,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(V9,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const o=A(()=>this.tokenMatcher(this.LA(1),a),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,o,i,Tre],o,V9,e,Tre)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,O3,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(bSe,r),i=cn(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new jwt(r,e))}}subruleInternal(e,r,n){let i;try{const a=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,a),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(a){throw this.subruleInternalError(a,n,e.ruleName)}}subruleInternalError(e,r,n){throw xk(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{const a=this.LA(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),i=a):this.consumeInternalError(e,a,n)}catch(a){i=this.consumeInternalRecovery(e,r,a)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i;const a=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new mSe(i,r,a))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(a){throw a.name===ySe?n:a}}else throw n}saveRecogState(){const e=this.errors,r=es(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),mf)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},A(q1,"RecognizerEngine"),q1),U1,oCt=(U1=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=mr(e,"errorMessageProvider")?e.errorMessageProvider:Lh.errorMessageProvider}SAVE_ERROR(e){if(xk(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:es(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return es(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=HS(e,a,r,this.maxLookahead)[0],l=[];for(let h=1;h<=this.maxLookahead;h++)l.push(this.LA(h));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new Kwt(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=WS(e,i,this.maxLookahead),s=[];for(let u=1;u<=this.maxLookahead;u++)s.push(this.LA(u));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Xwt(l,this.LA(1),o))}},A(U1,"ErrorHandler"),U1),Y1,lCt=(Y1=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(_h(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return rq([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=uc(e.ruleStack),i=this.getGAstProductions()[r];return new Gwt(i,e).startWalking()}},A(Y1,"ContentAssist"),Y1),a7={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(a7);var Cre=!0,kre=Math.pow(2,Pf)-1,RSe=Sy({name:"RECORDING_PHASE_TOKEN",pattern:Gs.NA});Wx([RSe]);var LSe=GS(RSe,`This IToken indicates the Parser is in Recording Phase
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(LSe);var cCt={name:`This CSTNode indicates the Parser is in Recording Phase
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},X1,uCt=(X1=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let r=0;r<10;r++){const n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return n6}topLevelRuleRecord(e,r){try{const n=new Fx({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
This error was thrown during the "grammar recording phase" For more info see:
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return Am.call(this,Qa,e,r)}atLeastOneInternalRecord(e,r){Am.call(this,Xo,r,e)}atLeastOneSepFirstInternalRecord(e,r){Am.call(this,jo,r,e,Cre)}manyInternalRecord(e,r){Am.call(this,ki,r,e)}manySepFirstInternalRecord(e,r){Am.call(this,ko,r,e,Cre)}orInternalRecord(e,r){return MSe.call(this,e,r)}subruleInternalRecord(e,r,n){if(Tk(r),!e||mr(e,"ruleName")===!1){const o=new Error(`<SUBRULE${q9(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=U0(this.recordingProdStack),a=e.ruleName,s=new Xs({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?cCt:a7}consumeInternalRecord(e,r,n){if(Tk(r),!JH(e)){const s=new Error(`<CONSUME${q9(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const i=U0(this.recordingProdStack),a=new Jn({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(a),LSe}},A(X1,"GastRecorder"),X1);function Am(t,e,r,n=!1){Tk(r);const i=U0(this.recordingProdStack),a=Yh(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),mr(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),a7}A(Am,"recordProd");function MSe(t,e){Tk(e);const r=U0(this.recordingProdStack),n=cn(t)===!1,i=n===!1?t:t.DEF,a=new So({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});mr(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=UCe(i,o=>Yh(o.GATE));return a.hasPredicates=s,r.definition.push(a),kr(i,o=>{const l=new Co({definition:[]});a.definition.push(l),mr(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:mr(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),a7}A(MSe,"recordOrProd");function q9(t){return t===0?"":`${t}`}A(q9,"getIdxSuffix");function Tk(t){if(t<0||t>kre){const e=new Error(`Invalid DSL Method idx value: <${t}>
Idx value must be a none negative value smaller than ${kre+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}A(Tk,"assertMethodIdxIsValid");var j1,hCt=(j1=class{initPerformanceTracer(e){if(mr(e,"traceInitPerf")){const r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=Lh.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);const{time:i,value:a}=YH(r),s=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,a}else return r()}},A(j1,"PerformanceTracer"),j1);function ISe(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(t.prototype,i,a):t.prototype[i]=r.prototype[i]})})}A(ISe,"applyMixins");var n6=GS(mf,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(n6);var Lh=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:iy,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),i6=Object.freeze({recoveryValueFunc:A(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),js;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(js||(js={}));function U9(t=void 0){return function(){return t}}A(U9,"EMPTY_ALT");var m0,uq=(m0=class{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{XH(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),kr(this.definedRulesNames,i=>{const s=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=cSe({rules:na(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Vn(n)&&this.skipValidations===!1){const i=uSe({rules:na(this.gastProductionsCache),tokenTypes:na(this.tokensMap),errMsgProvider:t0,grammarName:r}),a=Kke({lookaheadStrategy:this.lookaheadStrategy,rules:na(this.gastProductionsCache),tokenTypes:na(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),Vn(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=ike(na(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,a;(a=(i=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(i,{rules:na(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(na(this.gastProductionsCache))})),!m0.DEFER_DEFINITION_ERRORS_HANDLING&&!Vn(this.definitionErrors))throw e=ir(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
${e.join(`
-------------------------------
`)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),mr(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
For further details.`);this.skipValidations=mr(r,"skipValidations")?r.skipValidations:Lh.skipValidations}},A(m0,"Parser"),m0);uq.DEFER_DEFINITION_ERRORS_HANDLING=!1;ISe(uq,[Qwt,eCt,nCt,iCt,sCt,aCt,oCt,lCt,uCt,hCt]);var K1,dCt=(K1=class extends uq{constructor(e,r=Lh){const n=es(r);n.outputCst=!1,super(e,n)}},A(K1,"EmbeddedActionsParser"),K1);function NSe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}A(NSe,"arrayMap");var DSe=NSe;function OSe(){this.__data__=[],this.size=0}A(OSe,"listCacheClear");var fCt=OSe;function $Se(t,e){return t===e||t!==t&&e!==e}A($Se,"eq");var PSe=$Se;function BSe(t,e){for(var r=t.length;r--;)if(PSe(t[r][0],e))return r;return-1}A(BSe,"assocIndexOf");var s7=BSe,pCt=Array.prototype,gCt=pCt.splice;function FSe(t){var e=this.__data__,r=s7(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():gCt.call(e,r,1),--this.size,!0}A(FSe,"listCacheDelete");var mCt=FSe;function zSe(t){var e=this.__data__,r=s7(e,t);return r<0?void 0:e[r][1]}A(zSe,"listCacheGet");var yCt=zSe;function VSe(t){return s7(this.__data__,t)>-1}A(VSe,"listCacheHas");var vCt=VSe;function GSe(t,e){var r=this.__data__,n=s7(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}A(GSe,"listCacheSet");var bCt=GSe;function Mg(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}A(Mg,"ListCache");Mg.prototype.clear=fCt;Mg.prototype.delete=mCt;Mg.prototype.get=yCt;Mg.prototype.has=vCt;Mg.prototype.set=bCt;var o7=Mg;function WSe(){this.__data__=new o7,this.size=0}A(WSe,"stackClear");var xCt=WSe;function HSe(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}A(HSe,"stackDelete");var TCt=HSe;function qSe(t){return this.__data__.get(t)}A(qSe,"stackGet");var wCt=qSe;function USe(t){return this.__data__.has(t)}A(USe,"stackHas");var CCt=USe,kCt=typeof global=="object"&&global&&global.Object===Object&&global,YSe=kCt,SCt=typeof self=="object"&&self&&self.Object===Object&&self,ECt=YSe||SCt||Function("return this")(),Xh=ECt,ACt=Xh.Symbol,ru=ACt,XSe=Object.prototype,_Ct=XSe.hasOwnProperty,RCt=XSe.toString,wT=ru?ru.toStringTag:void 0;function jSe(t){var e=_Ct.call(t,wT),r=t[wT];try{t[wT]=void 0;var n=!0}catch{}var i=RCt.call(t);return n&&(e?t[wT]=r:delete t[wT]),i}A(jSe,"getRawTag");var LCt=jSe,MCt=Object.prototype,ICt=MCt.toString;function KSe(t){return ICt.call(t)}A(KSe,"objectToString");var NCt=KSe,DCt="[object Null]",OCt="[object Undefined]",Sre=ru?ru.toStringTag:void 0;function ZSe(t){return t==null?t===void 0?OCt:DCt:Sre&&Sre in Object(t)?LCt(t):NCt(t)}A(ZSe,"baseGetTag");var Hx=ZSe;function QSe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}A(QSe,"isObject");var hq=QSe,$Ct="[object AsyncFunction]",PCt="[object Function]",BCt="[object GeneratorFunction]",FCt="[object Proxy]";function JSe(t){if(!hq(t))return!1;var e=Hx(t);return e==PCt||e==BCt||e==$Ct||e==FCt}A(JSe,"isFunction");var eEe=JSe,zCt=Xh["__core-js_shared__"],fN=zCt,Ere=(function(){var t=/[^.]+$/.exec(fN&&fN.keys&&fN.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function tEe(t){return!!Ere&&Ere in t}A(tEe,"isMasked");var VCt=tEe,GCt=Function.prototype,WCt=GCt.toString;function rEe(t){if(t!=null){try{return WCt.call(t)}catch{}try{return t+""}catch{}}return""}A(rEe,"toSource");var Ig=rEe,HCt=/[\\^$.*+?()[\]{}|]/g,qCt=/^\[object .+?Constructor\]$/,UCt=Function.prototype,YCt=Object.prototype,XCt=UCt.toString,jCt=YCt.hasOwnProperty,KCt=RegExp("^"+XCt.call(jCt).replace(HCt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nEe(t){if(!hq(t)||VCt(t))return!1;var e=eEe(t)?KCt:qCt;return e.test(Ig(t))}A(nEe,"baseIsNative");var ZCt=nEe;function iEe(t,e){return t==null?void 0:t[e]}A(iEe,"getValue");var QCt=iEe;function aEe(t,e){var r=QCt(t,e);return ZCt(r)?r:void 0}A(aEe,"getNative");var qx=aEe,JCt=qx(Xh,"Map"),wk=JCt,ekt=qx(Object,"create"),Ck=ekt;function sEe(){this.__data__=Ck?Ck(null):{},this.size=0}A(sEe,"hashClear");var tkt=sEe;function oEe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}A(oEe,"hashDelete");var rkt=oEe,nkt="__lodash_hash_undefined__",ikt=Object.prototype,akt=ikt.hasOwnProperty;function lEe(t){var e=this.__data__;if(Ck){var r=e[t];return r===nkt?void 0:r}return akt.call(e,t)?e[t]:void 0}A(lEe,"hashGet");var skt=lEe,okt=Object.prototype,lkt=okt.hasOwnProperty;function cEe(t){var e=this.__data__;return Ck?e[t]!==void 0:lkt.call(e,t)}A(cEe,"hashHas");var ckt=cEe,ukt="__lodash_hash_undefined__";function uEe(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Ck&&e===void 0?ukt:e,this}A(uEe,"hashSet");var hkt=uEe;function Ng(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}A(Ng,"Hash");Ng.prototype.clear=tkt;Ng.prototype.delete=rkt;Ng.prototype.get=skt;Ng.prototype.has=ckt;Ng.prototype.set=hkt;var Are=Ng;function hEe(){this.size=0,this.__data__={hash:new Are,map:new(wk||o7),string:new Are}}A(hEe,"mapCacheClear");var dkt=hEe;function dEe(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}A(dEe,"isKeyable");var fkt=dEe;function fEe(t,e){var r=t.__data__;return fkt(e)?r[typeof e=="string"?"string":"hash"]:r.map}A(fEe,"getMapData");var l7=fEe;function pEe(t){var e=l7(this,t).delete(t);return this.size-=e?1:0,e}A(pEe,"mapCacheDelete");var pkt=pEe;function gEe(t){return l7(this,t).get(t)}A(gEe,"mapCacheGet");var gkt=gEe;function mEe(t){return l7(this,t).has(t)}A(mEe,"mapCacheHas");var mkt=mEe;function yEe(t,e){var r=l7(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}A(yEe,"mapCacheSet");var ykt=yEe;function Dg(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}A(Dg,"MapCache");Dg.prototype.clear=dkt;Dg.prototype.delete=pkt;Dg.prototype.get=gkt;Dg.prototype.has=mkt;Dg.prototype.set=ykt;var c7=Dg,vkt=200;function vEe(t,e){var r=this.__data__;if(r instanceof o7){var n=r.__data__;if(!wk||n.length<vkt-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new c7(n)}return r.set(t,e),this.size=r.size,this}A(vEe,"stackSet");var bkt=vEe;function Og(t){var e=this.__data__=new o7(t);this.size=e.size}A(Og,"Stack");Og.prototype.clear=xCt;Og.prototype.delete=TCt;Og.prototype.get=wCt;Og.prototype.has=CCt;Og.prototype.set=bkt;var P3=Og,xkt="__lodash_hash_undefined__";function bEe(t){return this.__data__.set(t,xkt),this}A(bEe,"setCacheAdd");var Tkt=bEe;function xEe(t){return this.__data__.has(t)}A(xEe,"setCacheHas");var wkt=xEe;function kk(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new c7;++e<r;)this.add(t[e])}A(kk,"SetCache");kk.prototype.add=kk.prototype.push=Tkt;kk.prototype.has=wkt;var TEe=kk;function wEe(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}A(wEe,"arraySome");var Ckt=wEe;function CEe(t,e){return t.has(e)}A(CEe,"cacheHas");var kEe=CEe,kkt=1,Skt=2;function SEe(t,e,r,n,i,a){var s=r&kkt,o=t.length,l=e.length;if(o!=l&&!(s&&l>o))return!1;var u=a.get(t),h=a.get(e);if(u&&h)return u==e&&h==t;var d=-1,f=!0,p=r&Skt?new TEe:void 0;for(a.set(t,e),a.set(e,t);++d<o;){var g=t[d],m=e[d];if(n)var y=s?n(m,g,d,e,t,a):n(g,m,d,t,e,a);if(y!==void 0){if(y)continue;f=!1;break}if(p){if(!Ckt(e,function(v,T){if(!kEe(p,T)&&(g===v||i(g,v,r,n,a)))return p.push(T)})){f=!1;break}}else if(!(g===m||i(g,m,r,n,a))){f=!1;break}}return a.delete(t),a.delete(e),f}A(SEe,"equalArrays");var EEe=SEe,Ekt=Xh.Uint8Array,_re=Ekt;function AEe(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}A(AEe,"mapToArray");var Akt=AEe;function _Ee(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}A(_Ee,"setToArray");var dq=_Ee,_kt=1,Rkt=2,Lkt="[object Boolean]",Mkt="[object Date]",Ikt="[object Error]",Nkt="[object Map]",Dkt="[object Number]",Okt="[object RegExp]",$kt="[object Set]",Pkt="[object String]",Bkt="[object Symbol]",Fkt="[object ArrayBuffer]",zkt="[object DataView]",Rre=ru?ru.prototype:void 0,pN=Rre?Rre.valueOf:void 0;function REe(t,e,r,n,i,a,s){switch(r){case zkt:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Fkt:return!(t.byteLength!=e.byteLength||!a(new _re(t),new _re(e)));case Lkt:case Mkt:case Dkt:return PSe(+t,+e);case Ikt:return t.name==e.name&&t.message==e.message;case Okt:case Pkt:return t==e+"";case Nkt:var o=Akt;case $kt:var l=n&_kt;if(o||(o=dq),t.size!=e.size&&!l)return!1;var u=s.get(t);if(u)return u==e;n|=Rkt,s.set(t,e);var h=EEe(o(t),o(e),n,i,a,s);return s.delete(t),h;case Bkt:if(pN)return pN.call(t)==pN.call(e)}return!1}A(REe,"equalByTag");var Vkt=REe;function LEe(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}A(LEe,"arrayPush");var MEe=LEe,Gkt=Array.isArray,Ks=Gkt;function IEe(t,e,r){var n=e(t);return Ks(t)?n:MEe(n,r(t))}A(IEe,"baseGetAllKeys");var Wkt=IEe;function NEe(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[i++]=s)}return a}A(NEe,"arrayFilter");var DEe=NEe;function OEe(){return[]}A(OEe,"stubArray");var Hkt=OEe,qkt=Object.prototype,Ukt=qkt.propertyIsEnumerable,Lre=Object.getOwnPropertySymbols,Ykt=Lre?function(t){return t==null?[]:(t=Object(t),DEe(Lre(t),function(e){return Ukt.call(t,e)}))}:Hkt,Xkt=Ykt;function $Ee(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}A($Ee,"baseTimes");var jkt=$Ee;function PEe(t){return t!=null&&typeof t=="object"}A(PEe,"isObjectLike");var nx=PEe,Kkt="[object Arguments]";function BEe(t){return nx(t)&&Hx(t)==Kkt}A(BEe,"baseIsArguments");var Mre=BEe,FEe=Object.prototype,Zkt=FEe.hasOwnProperty,Qkt=FEe.propertyIsEnumerable,Jkt=Mre((function(){return arguments})())?Mre:function(t){return nx(t)&&Zkt.call(t,"callee")&&!Qkt.call(t,"callee")},u7=Jkt;function zEe(){return!1}A(zEe,"stubFalse");var eSt=zEe,VEe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ire=VEe&&typeof module=="object"&&module&&!module.nodeType&&module,tSt=Ire&&Ire.exports===VEe,Nre=tSt?Xh.Buffer:void 0,rSt=Nre?Nre.isBuffer:void 0,nSt=rSt||eSt,a6=nSt,iSt=9007199254740991,aSt=/^(?:0|[1-9]\d*)$/;function GEe(t,e){var r=typeof t;return e=e??iSt,!!e&&(r=="number"||r!="symbol"&&aSt.test(t))&&t>-1&&t%1==0&&t<e}A(GEe,"isIndex");var WEe=GEe,sSt=9007199254740991;function HEe(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=sSt}A(HEe,"isLength");var fq=HEe,oSt="[object Arguments]",lSt="[object Array]",cSt="[object Boolean]",uSt="[object Date]",hSt="[object Error]",dSt="[object Function]",fSt="[object Map]",pSt="[object Number]",gSt="[object Object]",mSt="[object RegExp]",ySt="[object Set]",vSt="[object String]",bSt="[object WeakMap]",xSt="[object ArrayBuffer]",TSt="[object DataView]",wSt="[object Float32Array]",CSt="[object Float64Array]",kSt="[object Int8Array]",SSt="[object Int16Array]",ESt="[object Int32Array]",ASt="[object Uint8Array]",_St="[object Uint8ClampedArray]",RSt="[object Uint16Array]",LSt="[object Uint32Array]",Kn={};Kn[wSt]=Kn[CSt]=Kn[kSt]=Kn[SSt]=Kn[ESt]=Kn[ASt]=Kn[_St]=Kn[RSt]=Kn[LSt]=!0;Kn[oSt]=Kn[lSt]=Kn[xSt]=Kn[cSt]=Kn[TSt]=Kn[uSt]=Kn[hSt]=Kn[dSt]=Kn[fSt]=Kn[pSt]=Kn[gSt]=Kn[mSt]=Kn[ySt]=Kn[vSt]=Kn[bSt]=!1;function qEe(t){return nx(t)&&fq(t.length)&&!!Kn[Hx(t)]}A(qEe,"baseIsTypedArray");var MSt=qEe;function UEe(t){return function(e){return t(e)}}A(UEe,"baseUnary");var ISt=UEe,YEe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,oC=YEe&&typeof module=="object"&&module&&!module.nodeType&&module,NSt=oC&&oC.exports===YEe,gN=NSt&&YSe.process,DSt=(function(){try{var t=oC&&oC.require&&oC.require("util").types;return t||gN&&gN.binding&&gN.binding("util")}catch{}})(),Dre=DSt,Ore=Dre&&Dre.isTypedArray,OSt=Ore?ISt(Ore):MSt,pq=OSt,$St=Object.prototype,PSt=$St.hasOwnProperty;function XEe(t,e){var r=Ks(t),n=!r&&u7(t),i=!r&&!n&&a6(t),a=!r&&!n&&!i&&pq(t),s=r||n||i||a,o=s?jkt(t.length,String):[],l=o.length;for(var u in t)(e||PSt.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||WEe(u,l)))&&o.push(u);return o}A(XEe,"arrayLikeKeys");var BSt=XEe,FSt=Object.prototype;function jEe(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||FSt;return t===r}A(jEe,"isPrototype");var KEe=jEe;function ZEe(t,e){return function(r){return t(e(r))}}A(ZEe,"overArg");var zSt=ZEe,VSt=zSt(Object.keys,Object),GSt=VSt,WSt=Object.prototype,HSt=WSt.hasOwnProperty;function QEe(t){if(!KEe(t))return GSt(t);var e=[];for(var r in Object(t))HSt.call(t,r)&&r!="constructor"&&e.push(r);return e}A(QEe,"baseKeys");var JEe=QEe;function e4e(t){return t!=null&&fq(t.length)&&!eEe(t)}A(e4e,"isArrayLike");var h7=e4e;function t4e(t){return h7(t)?BSt(t):JEe(t)}A(t4e,"keys");var gq=t4e;function r4e(t){return Wkt(t,gq,Xkt)}A(r4e,"getAllKeys");var $re=r4e,qSt=1,USt=Object.prototype,YSt=USt.hasOwnProperty;function n4e(t,e,r,n,i,a){var s=r&qSt,o=$re(t),l=o.length,u=$re(e),h=u.length;if(l!=h&&!s)return!1;for(var d=l;d--;){var f=o[d];if(!(s?f in e:YSt.call(e,f)))return!1}var p=a.get(t),g=a.get(e);if(p&&g)return p==e&&g==t;var m=!0;a.set(t,e),a.set(e,t);for(var y=s;++d<l;){f=o[d];var v=t[f],T=e[f];if(n)var b=s?n(T,v,f,e,t,a):n(v,T,f,t,e,a);if(!(b===void 0?v===T||i(v,T,r,n,a):b)){m=!1;break}y||(y=f=="constructor")}if(m&&!y){var w=t.constructor,C=e.constructor;w!=C&&"constructor"in t&&"constructor"in e&&!(typeof w=="function"&&w instanceof w&&typeof C=="function"&&C instanceof C)&&(m=!1)}return a.delete(t),a.delete(e),m}A(n4e,"equalObjects");var XSt=n4e,jSt=qx(Xh,"DataView"),Y9=jSt,KSt=qx(Xh,"Promise"),X9=KSt,ZSt=qx(Xh,"Set"),Ey=ZSt,QSt=qx(Xh,"WeakMap"),j9=QSt,Pre="[object Map]",JSt="[object Object]",Bre="[object Promise]",Fre="[object Set]",zre="[object WeakMap]",Vre="[object DataView]",eEt=Ig(Y9),tEt=Ig(wk),rEt=Ig(X9),nEt=Ig(Ey),iEt=Ig(j9),gp=Hx;(Y9&&gp(new Y9(new ArrayBuffer(1)))!=Vre||wk&&gp(new wk)!=Pre||X9&&gp(X9.resolve())!=Bre||Ey&&gp(new Ey)!=Fre||j9&&gp(new j9)!=zre)&&(gp=A(function(t){var e=Hx(t),r=e==JSt?t.constructor:void 0,n=r?Ig(r):"";if(n)switch(n){case eEt:return Vre;case tEt:return Pre;case rEt:return Bre;case nEt:return Fre;case iEt:return zre}return e},"getTag"));var K9=gp,aEt=1,Gre="[object Arguments]",Wre="[object Array]",c4="[object Object]",sEt=Object.prototype,Hre=sEt.hasOwnProperty;function i4e(t,e,r,n,i,a){var s=Ks(t),o=Ks(e),l=s?Wre:K9(t),u=o?Wre:K9(e);l=l==Gre?c4:l,u=u==Gre?c4:u;var h=l==c4,d=u==c4,f=l==u;if(f&&a6(t)){if(!a6(e))return!1;s=!0,h=!1}if(f&&!h)return a||(a=new P3),s||pq(t)?EEe(t,e,r,n,i,a):Vkt(t,e,l,r,n,i,a);if(!(r&aEt)){var p=h&&Hre.call(t,"__wrapped__"),g=d&&Hre.call(e,"__wrapped__");if(p||g){var m=p?t.value():t,y=g?e.value():e;return a||(a=new P3),i(m,y,r,n,a)}}return f?(a||(a=new P3),XSt(t,e,r,n,i,a)):!1}A(i4e,"baseIsEqualDeep");var oEt=i4e;function mq(t,e,r,n,i){return t===e?!0:t==null||e==null||!nx(t)&&!nx(e)?t!==t&&e!==e:oEt(t,e,r,n,mq,i)}A(mq,"baseIsEqual");var a4e=mq,lEt=1,cEt=2;function s4e(t,e,r,n){var i=r.length,a=i,s=!n;if(t==null)return!a;for(t=Object(t);i--;){var o=r[i];if(s&&o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++i<a;){o=r[i];var l=o[0],u=t[l],h=o[1];if(s&&o[2]){if(u===void 0&&!(l in t))return!1}else{var d=new P3;if(n)var f=n(u,h,l,t,e,d);if(!(f===void 0?a4e(h,u,lEt|cEt,n,d):f))return!1}}return!0}A(s4e,"baseIsMatch");var uEt=s4e;function o4e(t){return t===t&&!hq(t)}A(o4e,"isStrictComparable");var l4e=o4e;function c4e(t){for(var e=gq(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,l4e(i)]}return e}A(c4e,"getMatchData");var hEt=c4e;function u4e(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}A(u4e,"matchesStrictComparable");var h4e=u4e;function d4e(t){var e=hEt(t);return e.length==1&&e[0][2]?h4e(e[0][0],e[0][1]):function(r){return r===t||uEt(r,t,e)}}A(d4e,"baseMatches");var dEt=d4e,fEt="[object Symbol]";function f4e(t){return typeof t=="symbol"||nx(t)&&Hx(t)==fEt}A(f4e,"isSymbol");var d7=f4e,pEt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,gEt=/^\w*$/;function p4e(t,e){if(Ks(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||d7(t)?!0:gEt.test(t)||!pEt.test(t)||e!=null&&t in Object(e)}A(p4e,"isKey");var yq=p4e,mEt="Expected a function";function f7(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(mEt);var r=A(function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s)||a,s},"memoized");return r.cache=new(f7.Cache||c7),r}A(f7,"memoize");f7.Cache=c7;var yEt=f7,vEt=500;function g4e(t){var e=yEt(t,function(n){return r.size===vEt&&r.clear(),n}),r=e.cache;return e}A(g4e,"memoizeCapped");var bEt=g4e,xEt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,TEt=/\\(\\)?/g,wEt=bEt(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(xEt,function(r,n,i,a){e.push(i?a.replace(TEt,"$1"):n||r)}),e}),CEt=wEt,qre=ru?ru.prototype:void 0,Ure=qre?qre.toString:void 0;function vq(t){if(typeof t=="string")return t;if(Ks(t))return DSe(t,vq)+"";if(d7(t))return Ure?Ure.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}A(vq,"baseToString");var kEt=vq;function m4e(t){return t==null?"":kEt(t)}A(m4e,"toString");var SEt=m4e;function y4e(t,e){return Ks(t)?t:yq(t,e)?[t]:CEt(SEt(t))}A(y4e,"castPath");var v4e=y4e;function b4e(t){if(typeof t=="string"||d7(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}A(b4e,"toKey");var p7=b4e;function x4e(t,e){e=v4e(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[p7(e[r++])];return r&&r==n?t:void 0}A(x4e,"baseGet");var T4e=x4e;function w4e(t,e,r){var n=t==null?void 0:T4e(t,e);return n===void 0?r:n}A(w4e,"get");var EEt=w4e;function C4e(t,e){return t!=null&&e in Object(t)}A(C4e,"baseHasIn");var AEt=C4e;function k4e(t,e,r){e=v4e(e,t);for(var n=-1,i=e.length,a=!1;++n<i;){var s=p7(e[n]);if(!(a=t!=null&&r(t,s)))break;t=t[s]}return a||++n!=i?a:(i=t==null?0:t.length,!!i&&fq(i)&&WEe(s,i)&&(Ks(t)||u7(t)))}A(k4e,"hasPath");var _Et=k4e;function S4e(t,e){return t!=null&&_Et(t,e,AEt)}A(S4e,"hasIn");var REt=S4e,LEt=1,MEt=2;function E4e(t,e){return yq(t)&&l4e(e)?h4e(p7(t),e):function(r){var n=EEt(r,t);return n===void 0&&n===e?REt(r,t):a4e(e,n,LEt|MEt)}}A(E4e,"baseMatchesProperty");var IEt=E4e;function A4e(t){return t}A(A4e,"identity");var bq=A4e;function _4e(t){return function(e){return e==null?void 0:e[t]}}A(_4e,"baseProperty");var NEt=_4e;function R4e(t){return function(e){return T4e(e,t)}}A(R4e,"basePropertyDeep");var DEt=R4e;function L4e(t){return yq(t)?NEt(p7(t)):DEt(t)}A(L4e,"property");var OEt=L4e;function M4e(t){return typeof t=="function"?t:t==null?bq:typeof t=="object"?Ks(t)?IEt(t[0],t[1]):dEt(t):OEt(t)}A(M4e,"baseIteratee");var g7=M4e;function I4e(t){return function(e,r,n){for(var i=-1,a=Object(e),s=n(e),o=s.length;o--;){var l=s[t?o:++i];if(r(a[l],l,a)===!1)break}return e}}A(I4e,"createBaseFor");var $Et=I4e,PEt=$Et(),BEt=PEt;function N4e(t,e){return t&&BEt(t,e,gq)}A(N4e,"baseForOwn");var FEt=N4e;function D4e(t,e){return function(r,n){if(r==null)return r;if(!h7(r))return t(r,n);for(var i=r.length,a=e?i:-1,s=Object(r);(e?a--:++a<i)&&n(s[a],a,s)!==!1;);return r}}A(D4e,"createBaseEach");var zEt=D4e,VEt=zEt(FEt),m7=VEt;function O4e(t,e){var r=-1,n=h7(t)?Array(t.length):[];return m7(t,function(i,a,s){n[++r]=e(i,a,s)}),n}A(O4e,"baseMap");var GEt=O4e;function $4e(t,e){var r=Ks(t)?DSe:GEt;return r(t,g7(e))}A($4e,"map");var nh=$4e;function P4e(t,e){var r=[];return m7(t,function(n,i,a){e(n,i,a)&&r.push(n)}),r}A(P4e,"baseFilter");var WEt=P4e;function B4e(t,e){var r=Ks(t)?DEe:WEt;return r(t,g7(e))}A(B4e,"filter");var HEt=B4e;function X0(t,e,r){return`${t.name}_${e}_${r}`}A(X0,"buildATNKey");var yf=1,qEt=2,F4e=4,z4e=5,qS=7,UEt=8,YEt=9,XEt=10,jEt=11,V4e=12,Z1,xq=(Z1=class{constructor(e){this.target=e}isEpsilon(){return!1}},A(Z1,"AbstractTransition"),Z1),Q1,Tq=(Q1=class extends xq{constructor(e,r){super(e),this.tokenType=r}},A(Q1,"AtomTransition"),Q1),J1,G4e=(J1=class extends xq{constructor(e){super(e)}isEpsilon(){return!0}},A(J1,"EpsilonTransition"),J1),ev,wq=(ev=class extends xq{constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}},A(ev,"RuleTransition"),ev);function W4e(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};H4e(e,t);const r=t.length;for(let n=0;n<r;n++){const i=t[n],a=Bf(e,i,i);a!==void 0&&t3e(e,i,a)}return e}A(W4e,"createATN");function H4e(t,e){const r=e.length;for(let n=0;n<r;n++){const i=e[n],a=oa(t,i,void 0,{type:qEt}),s=oa(t,i,void 0,{type:qS});a.stop=s,t.ruleToStartState.set(i,a),t.ruleToStopState.set(i,s)}}A(H4e,"createRuleStartAndStopATNStates");function Cq(t,e,r){return r instanceof Jn?y7(t,e,r.terminalType,r):r instanceof Xs?e3e(t,e,r):r instanceof So?j4e(t,e,r):r instanceof Qa?K4e(t,e,r):r instanceof ki?q4e(t,e,r):r instanceof ko?U4e(t,e,r):r instanceof Xo?Y4e(t,e,r):r instanceof jo?X4e(t,e,r):Bf(t,e,r)}A(Cq,"atom");function q4e(t,e,r){const n=oa(t,e,r,{type:z4e});jh(t,n);const i=$g(t,e,n,r,Bf(t,e,r));return Sq(t,e,r,i)}A(q4e,"repetition");function U4e(t,e,r){const n=oa(t,e,r,{type:z4e});jh(t,n);const i=$g(t,e,n,r,Bf(t,e,r)),a=y7(t,e,r.separator,r);return Sq(t,e,r,i,a)}A(U4e,"repetitionSep");function Y4e(t,e,r){const n=oa(t,e,r,{type:F4e});jh(t,n);const i=$g(t,e,n,r,Bf(t,e,r));return kq(t,e,r,i)}A(Y4e,"repetitionMandatory");function X4e(t,e,r){const n=oa(t,e,r,{type:F4e});jh(t,n);const i=$g(t,e,n,r,Bf(t,e,r)),a=y7(t,e,r.separator,r);return kq(t,e,r,i,a)}A(X4e,"repetitionMandatorySep");function j4e(t,e,r){const n=oa(t,e,r,{type:yf});jh(t,n);const i=nh(r.definition,s=>Cq(t,e,s));return $g(t,e,n,r,...i)}A(j4e,"alternation");function K4e(t,e,r){const n=oa(t,e,r,{type:yf});jh(t,n);const i=$g(t,e,n,r,Bf(t,e,r));return Z4e(t,e,r,i)}A(K4e,"option");function Bf(t,e,r){const n=HEt(nh(r.definition,i=>Cq(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:J4e(t,n)}A(Bf,"block");function kq(t,e,r,n,i){const a=n.left,s=n.right,o=oa(t,e,r,{type:jEt});jh(t,o);const l=oa(t,e,r,{type:V4e});return a.loopback=o,l.loopback=o,t.decisionMap[X0(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,Ii(s,o),i===void 0?(Ii(o,a),Ii(o,l)):(Ii(o,l),Ii(o,i.left),Ii(i.right,a)),{left:a,right:l}}A(kq,"plus");function Sq(t,e,r,n,i){const a=n.left,s=n.right,o=oa(t,e,r,{type:XEt});jh(t,o);const l=oa(t,e,r,{type:V4e}),u=oa(t,e,r,{type:YEt});return o.loopback=u,l.loopback=u,Ii(o,a),Ii(o,l),Ii(s,u),i!==void 0?(Ii(u,l),Ii(u,i.left),Ii(i.right,a)):Ii(u,o),t.decisionMap[X0(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:l}}A(Sq,"star");function Z4e(t,e,r,n){const i=n.left,a=n.right;return Ii(i,a),t.decisionMap[X0(e,"Option",r.idx)]=i,n}A(Z4e,"optional");function jh(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}A(jh,"defineDecisionState");function $g(t,e,r,n,...i){const a=oa(t,e,n,{type:UEt,start:r});r.end=a;for(const o of i)o!==void 0?(Ii(r,o.left),Ii(o.right,a)):Ii(r,a);const s={left:r,right:a};return t.decisionMap[X0(e,Q4e(n),n.idx)]=r,s}A($g,"makeAlts");function Q4e(t){if(t instanceof So)return"Alternation";if(t instanceof Qa)return"Option";if(t instanceof ki)return"Repetition";if(t instanceof ko)return"RepetitionWithSeparator";if(t instanceof Xo)return"RepetitionMandatory";if(t instanceof jo)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}A(Q4e,"getProdType");function J4e(t,e){const r=e.length;for(let a=0;a<r-1;a++){const s=e[a];let o;s.left.transitions.length===1&&(o=s.left.transitions[0]);const l=o instanceof wq,u=o,h=e[a+1].left;s.left.type===yf&&s.right.type===yf&&o!==void 0&&(l&&u.followState===s.right||o.target===s.right)?(l?u.followState=h:o.target=h,r3e(t,s.right)):Ii(s.right,h)}const n=e[0],i=e[r-1];return{left:n.left,right:i.right}}A(J4e,"makeBlock");function y7(t,e,r,n){const i=oa(t,e,n,{type:yf}),a=oa(t,e,n,{type:yf});return v7(i,new Tq(a,r)),{left:i,right:a}}A(y7,"tokenRef");function e3e(t,e,r){const n=r.referencedRule,i=t.ruleToStartState.get(n),a=oa(t,e,r,{type:yf}),s=oa(t,e,r,{type:yf}),o=new wq(i,n,s);return v7(a,o),{left:a,right:s}}A(e3e,"ruleRef");function t3e(t,e,r){const n=t.ruleToStartState.get(e);Ii(n,r.left);const i=t.ruleToStopState.get(e);return Ii(r.right,i),{left:n,right:i}}A(t3e,"buildRuleHandle");function Ii(t,e){const r=new G4e(e);v7(t,r)}A(Ii,"epsilon");function oa(t,e,r,n){const i=Object.assign({atn:t,production:r,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},n);return t.states.push(i),i}A(oa,"newState");function v7(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}A(v7,"addTransition");function r3e(t,e){t.states.splice(t.states.indexOf(e),1)}A(r3e,"removeState");var s6={},tv,Z9=(tv=class{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const r=Eq(e);r in this.map||(this.map[r]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return nh(this.configs,e=>e.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}},A(tv,"ATNConfigSet"),tv);function Eq(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}A(Eq,"getATNConfigKey");function n3e(t,e,r){for(var n=-1,i=t.length;++n<i;){var a=t[n],s=e(a);if(s!=null&&(o===void 0?s===s&&!d7(s):r(s,o)))var o=s,l=a}return l}A(n3e,"baseExtremum");var KEt=n3e;function i3e(t,e){return t<e}A(i3e,"baseLt");var ZEt=i3e;function a3e(t){return t&&t.length?KEt(t,bq,ZEt):void 0}A(a3e,"min");var QEt=a3e,Yre=ru?ru.isConcatSpreadable:void 0;function s3e(t){return Ks(t)||u7(t)||!!(Yre&&t&&t[Yre])}A(s3e,"isFlattenable");var JEt=s3e;function Aq(t,e,r,n,i){var a=-1,s=t.length;for(r||(r=JEt),i||(i=[]);++a<s;){var o=t[a];e>0&&r(o)?e>1?Aq(o,e-1,r,n,i):MEe(i,o):n||(i[i.length]=o)}return i}A(Aq,"baseFlatten");var o3e=Aq;function l3e(t,e){return o3e(nh(t,e),1)}A(l3e,"flatMap");var e4t=l3e;function c3e(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a<i;)if(e(t[a],a,t))return a;return-1}A(c3e,"baseFindIndex");var t4t=c3e;function u3e(t){return t!==t}A(u3e,"baseIsNaN");var r4t=u3e;function h3e(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}A(h3e,"strictIndexOf");var n4t=h3e;function d3e(t,e,r){return e===e?n4t(t,e,r):t4t(t,r4t,r)}A(d3e,"baseIndexOf");var i4t=d3e;function f3e(t,e){var r=t==null?0:t.length;return!!r&&i4t(t,e,0)>-1}A(f3e,"arrayIncludes");var a4t=f3e;function p3e(t,e,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}A(p3e,"arrayIncludesWith");var s4t=p3e;function g3e(){}A(g3e,"noop");var o4t=g3e,l4t=1/0,c4t=Ey&&1/dq(new Ey([,-0]))[1]==l4t?function(t){return new Ey(t)}:o4t,u4t=c4t,h4t=200;function m3e(t,e,r){var n=-1,i=a4t,a=t.length,s=!0,o=[],l=o;if(r)s=!1,i=s4t;else if(a>=h4t){var u=e?null:u4t(t);if(u)return dq(u);s=!1,i=kEe,l=new TEe}else l=e?[]:o;e:for(;++n<a;){var h=t[n],d=e?e(h):h;if(h=r||h!==0?h:0,s&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;e&&l.push(d),o.push(h)}else i(l,d,r)||(l!==o&&l.push(d),o.push(h))}return o}A(m3e,"baseUniq");var d4t=m3e;function y3e(t,e){return t&&t.length?d4t(t,g7(e)):[]}A(y3e,"uniqBy");var f4t=y3e;function v3e(t){var e=t==null?0:t.length;return e?o3e(t,1):[]}A(v3e,"flatten");var p4t=v3e;function b3e(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}A(b3e,"arrayEach");var g4t=b3e;function x3e(t){return typeof t=="function"?t:bq}A(x3e,"castFunction");var m4t=x3e;function T3e(t,e){var r=Ks(t)?g4t:m7;return r(t,m4t(e))}A(T3e,"forEach");var mN=T3e,y4t="[object Map]",v4t="[object Set]",b4t=Object.prototype,x4t=b4t.hasOwnProperty;function w3e(t){if(t==null)return!0;if(h7(t)&&(Ks(t)||typeof t=="string"||typeof t.splice=="function"||a6(t)||pq(t)||u7(t)))return!t.length;var e=K9(t);if(e==y4t||e==v4t)return!t.size;if(KEe(t))return!JEe(t).length;for(var r in t)if(x4t.call(t,r))return!1;return!0}A(w3e,"isEmpty");var T4t=w3e;function C3e(t,e,r,n){var i=-1,a=t==null?0:t.length;for(n&&a&&(r=t[++i]);++i<a;)r=e(r,t[i],i,t);return r}A(C3e,"arrayReduce");var w4t=C3e;function k3e(t,e,r,n,i){return i(t,function(a,s,o){r=n?(n=!1,a):e(r,a,s,o)}),r}A(k3e,"baseReduce");var C4t=k3e;function S3e(t,e,r){var n=Ks(t)?w4t:C4t,i=arguments.length<3;return n(t,g7(e),r,i,m7)}A(S3e,"reduce");var Xre=S3e;function E3e(t,e){const r={};return n=>{const i=n.toString();let a=r[i];return a!==void 0||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}A(E3e,"createDFACache");var rv,A3e=(rv=class{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="";const r=this.predicates.length;for(let n=0;n<r;n++)e+=this.predicates[n]===!0?"1":"0";return e}},A(rv,"PredicateSet"),rv),jre=new A3e,nv,k4t=(nv=class extends lq{constructor(e){var r;super(),this.logging=(r=e==null?void 0:e.logging)!==null&&r!==void 0?r:(n=>console.log(n))}initialize(e){this.atn=W4e(e.rules),this.dfas=_3e(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=X0(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=nh(P9({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>nh(f,p=>p[0]));if(Q9(d,!1)&&!a){const f=Xre(d,(p,g,m)=>(mN(g,y=>{y&&(p[y.tokenTypeIdx]=m,mN(y.categoryMatches,v=>{p[v]=m}))}),p),{});return i?function(p){var g;const m=this.LA(1),y=f[m.tokenTypeIdx];if(p!==void 0&&y!==void 0){const v=(g=p[y])===null||g===void 0?void 0:g.GATE;if(v!==void 0&&v.call(this)===!1)return}return y}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new A3e,g=f===void 0?0:f.length;for(let y=0;y<g;y++){const v=f==null?void 0:f[y].GATE;p.set(y,v===void 0||v.call(this))}const m=B3.call(this,s,h,p,o);return typeof m=="number"?m:void 0}:function(){const f=B3.call(this,s,h,jre,o);return typeof f=="number"?f:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:r,rule:n,prodType:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,l=X0(n,i,r),h=this.atn.decisionMap[l].decision,d=nh(P9({maxLookahead:1,occurrence:r,prodType:i,rule:n}),f=>nh(f,p=>p[0]));if(Q9(d)&&d[0][0]&&!a){const f=d[0],p=p4t(f);if(p.length===1&&T4t(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=Xre(p,(m,y)=>(y!==void 0&&(m[y.tokenTypeIdx]=!0,mN(y.categoryMatches,v=>{m[v]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=B3.call(this,s,h,jre,o);return typeof f=="object"?!1:f===0}}},A(nv,"LLStarLookaheadStrategy"),nv);function Q9(t,e=!0){const r=new Set;for(const n of t){const i=new Set;for(const a of n){if(a===void 0){if(e)break;return!1}const s=[a.tokenTypeIdx].concat(a.categoryMatches);for(const o of s)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}A(Q9,"isLL1Sequence");function _3e(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=E3e(t.decisionStates[n],n);return r}A(_3e,"initATNSimulator");function B3(t,e,r,n){const i=t[e](r);let a=i.start;if(a===void 0){const o=F3e(i.atnStartState);a=Rq(i,_q(o)),i.start=a}return R3e.apply(this,[i,a,r,n])}A(B3,"adaptivePredict");function R3e(t,e,r,n){let i=e,a=1;const s=[];let o=this.LA(a++);for(;;){let l=O3e(i,o);if(l===void 0&&(l=L3e.apply(this,[t,i,o,a,r,n])),l===s6)return D3e(s,i,o);if(l.isAcceptState===!0)return l.prediction;i=l,s.push(o),o=this.LA(a++)}}A(R3e,"performLookahead");function L3e(t,e,r,n,i,a){const s=$3e(e.configs,r,i);if(s.size===0)return J9(t,e,r,s6),s6;let o=_q(s);const l=B3e(s,i);if(l!==void 0)o.isAcceptState=!0,o.prediction=l,o.configs.uniqueAlt=l;else if(W3e(s)){const u=QEt(s.alts);o.isAcceptState=!0,o.prediction=u,o.configs.uniqueAlt=u,M3e.apply(this,[t,n,s.alts,a])}return o=J9(t,e,r,o),o}A(L3e,"computeLookaheadTarget");function M3e(t,e,r,n){const i=[];for(let u=1;u<=e;u++)i.push(this.LA(u).tokenType);const a=t.atnStartState,s=a.rule,o=a.production,l=I3e({topLevelRule:s,ambiguityIndices:r,production:o,prefixPath:i});n(l)}A(M3e,"reportLookaheadAmbiguity");function I3e(t){const e=nh(t.prefixPath,i=>f0(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${N3e(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,
<${e}> may appears as a prefix path in all these alternatives.
`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
For Further details.`,n}A(I3e,"buildAmbiguityError");function N3e(t){if(t instanceof Xs)return"SUBRULE";if(t instanceof Qa)return"OPTION";if(t instanceof So)return"OR";if(t instanceof Xo)return"AT_LEAST_ONE";if(t instanceof jo)return"AT_LEAST_ONE_SEP";if(t instanceof ko)return"MANY_SEP";if(t instanceof ki)return"MANY";if(t instanceof Jn)return"CONSUME";throw Error("non exhaustive match")}A(N3e,"getProductionDslName");function D3e(t,e,r){const n=e4t(e.configs.elements,a=>a.state.transitions),i=f4t(n.filter(a=>a instanceof Tq).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}A(D3e,"buildAdaptivePredictError");function O3e(t,e){return t.edges[e.tokenTypeIdx]}A(O3e,"getExistingTargetState");function $3e(t,e,r){const n=new Z9,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===qS){i.push(s);continue}const o=s.state.transitions.length;for(let l=0;l<o;l++){const u=s.state.transitions[l],h=P3e(u,e);h!==void 0&&n.add({state:h,alt:s.alt,stack:s.stack})}}let a;if(i.length===0&&n.size===1&&(a=n),a===void 0){a=new Z9;for(const s of n.elements)Sk(s,a)}if(i.length>0&&!V3e(a))for(const s of i)a.add(s);return a}A($3e,"computeReachSet");function P3e(t,e){if(t instanceof Tq&&tq(e,t.tokenType))return t.target}A(P3e,"getReachableTarget");function B3e(t,e){let r;for(const n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}A(B3e,"getUniqueAlt");function _q(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}A(_q,"newDFAState");function J9(t,e,r,n){return n=Rq(t,n),e.edges[r.tokenTypeIdx]=n,n}A(J9,"addDFAEdge");function Rq(t,e){if(e===s6)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}A(Rq,"addDFAState");function F3e(t){const e=new Z9,r=t.transitions.length;for(let n=0;n<r;n++){const a={state:t.transitions[n].target,alt:n,stack:[]};Sk(a,e)}return e}A(F3e,"computeStartState");function Sk(t,e){const r=t.state;if(r.type===qS){if(t.stack.length>0){const i=[...t.stack],s={state:i.pop(),alt:t.alt,stack:i};Sk(s,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i<n;i++){const a=r.transitions[i],s=z3e(t,a);s!==void 0&&Sk(s,e)}}A(Sk,"closure");function z3e(t,e){if(e instanceof G4e)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof wq){const r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}A(z3e,"getEpsilonTarget");function V3e(t){for(const e of t.elements)if(e.state.type===qS)return!0;return!1}A(V3e,"hasConfigInRuleStopState");function G3e(t){for(const e of t.elements)if(e.state.type!==qS)return!1;return!0}A(G3e,"allConfigsInRuleStopStates");function W3e(t){if(G3e(t))return!0;const e=H3e(t.elements);return q3e(e)&&!U3e(e)}A(W3e,"hasConflictTerminatingPrediction");function H3e(t){const e=new Map;for(const r of t){const n=Eq(r,!1);let i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[r.alt]=!0}return e}A(H3e,"getConflictingAltSets");function q3e(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}A(q3e,"hasConflictingAltSet");function U3e(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}A(U3e,"hasStateAssociatedWithOneAlt");SS();var iv,Y3e=(iv=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Mq(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new b7;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new o6(e.startOffset,e.image.length,dk(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const a of e){const s=new o6(a.startOffset,a.image.length,dk(a),a.tokenType,!0);s.root=this.rootNode,r.push(s)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const a=n.container.content.indexOf(n);if(a>0){n.container.content.splice(a,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&!e.$infix&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}},A(iv,"CstNodeBuilder"),iv),av,Lq=(av=class{get hidden(){return!1}get astNode(){var r,n;const e=typeof((r=this._astNode)==null?void 0:r.$type)=="string"?this._astNode:(n=this.container)==null?void 0:n.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},A(av,"AbstractCstNode"),av),sv,o6=(sv=class extends Lq{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=i,this._length=r,this._range=n}},A(sv,"LeafCstNodeImpl"),sv),ov,b7=(ov=class extends Lq{constructor(){super(...arguments),this.content=new S4t(this)}get offset(){var e;return((e=this.firstNonHiddenNode)==null?void 0:e.offset)??0}get length(){return this.end-this.offset}get end(){var e;return((e=this.lastNonHiddenNode)==null?void 0:e.end)??0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line<n.start.line?n.start:i.end}}return this._rangeCache}else return{start:mn.create(0,0),end:mn.create(0,0)}}get firstNonHiddenNode(){for(const e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}},A(ov,"CompositeCstNodeImpl"),ov),y0,S4t=(y0=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,y0.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(const r of e)r.container=this.parent}},A(y0,"CstNodeContainer"),y0),lv,Mq=(lv=class extends b7{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},A(lv,"RootCstNodeImpl"),lv),l6=Symbol("Datatype");function F3(t){return t.$type===l6}A(F3,"isDataTypeNode");var Kre="​",X3e=A(t=>t.endsWith(Kre)?t:t+Kre,"withRuleSuffix"),cv,Iq=(cv=class{constructor(e){var i;this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";(i=e.shared.profilers.LangiumProfiler)!=null&&i.isActive("parsing")?this.wrapper=new A4t(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new Q3e(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},A(cv,"AbstractLangiumParser"),cv),uv,j3e=(uv=class extends Iq{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Y3e,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){const n=this.computeRuleType(e);let i;Qb(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(X3e(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),Ys(e)&&e.entry&&(this.mainRule=a),a}registerPrecedenceMap(e){const r=e.name,n=new Map;for(let i=0;i<e.operators.precedences.length;i++){const a=e.operators.precedences[i];for(const s of a.operators)n.set(s.value,{precedence:i,rightAssoc:a.associativity==="right"})}this.operatorPrecedence.set(r,n)}computeRuleType(e){return Qb(e)?q0(e):e.fragment?void 0:RS(e)?l6:q0(e)}parse(e,r={}){this.nodeBuilder.buildRootNode(e);const n=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=n.tokens;const i=r.rule?this.allRules.get(r.rule):this.mainRule;if(!i)throw new Error(r.rule?`No rule found with name '${r.rule}'`:"No main rule available.");const a=this.doParse(i);return this.nodeBuilder.addHiddenNodes(n.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,Kb(a,{deep:!0}),{value:a,lexerErrors:n.errors,lexerReport:n.report,parserErrors:this.wrapper.errors}}doParse(e){let r=this.wrapper.rule(e);if(this.stack.length>0&&(r=this.construct()),r===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return r}startImplementation(e,r,n){return i=>{const a=!this.isRecording()&&e!==void 0;if(a){const s={$type:e};this.stack.push(s),e===l6?s.value="":r!==void 0&&(s.$infixName=r)}return n(i),a?this.construct():void 0}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const n=e.startOffset;for(let i=0;i<r.length;i++)if(r[i].startOffset>n)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const a=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,crossRef:l}=this.getAssignment(n),u=this.current;if(o){const h=Sh(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,h,s,l)}else if(F3(u)){let h=i.image;Sh(n)||(h=this.converter.convert(h,s).toString()),u.value+=h}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,a){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,r,a)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&s&&s.length>0&&this.performSubruleAssignment(o,i,s))}}performSubruleAssignment(e,r,n){const{assignment:i,crossRef:a}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,a);else if(!i){const s=this.current;if(F3(s))s.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(l)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);const a={$type:e};this.stack.push(a),this.assign(r.operator,r.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):F3(e)?this.converter.convert(e.value,e.$cstNode):(LW(this.astReflection,e),e)}constructInfix(e,r){const n=e.parts;if(!Array.isArray(n)||n.length===0)return;const i=e.operators;if(!Array.isArray(i)||n.length<2)return n[0];let a=0,s=-1;for(let m=0;m<i.length;m++){const y=i[m],v=r.get(y)??{precedence:1/0,rightAssoc:!1};v.precedence>s?(s=v.precedence,a=m):v.precedence===s&&(v.rightAssoc||(a=m))}const o=i.slice(0,a),l=i.slice(a+1),u=n.slice(0,a+1),h=n.slice(a+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:o},f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:h,operators:l},p=this.constructInfix(d,r),g=this.constructInfix(f,r);return{$type:e.$type,$cstNode:e.$cstNode,left:p,operator:i[a],right:g}}getAssignment(e){if(!this.assignmentMap.has(e)){const r=bg(e,kh);this.assignmentMap.set(e,{assignment:r,crossRef:r&&Tg(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const s=this.current;let o;switch(a==="single"&&typeof n=="string"?o=this.linker.buildReference(s,r,i,n):a==="multi"&&typeof n=="string"?o=this.linker.buildMultiReference(s,r,i,n):o=n,e){case"=":{s[r]=o;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(o)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const s=e[i];s===void 0?e[i]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},A(uv,"LangiumParser"),uv),hv,K3e=(hv=class{buildMismatchTokenMessage(e){return iy.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return iy.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return iy.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return iy.buildEarlyExitMessage(e)}},A(hv,"AbstractParserErrorMessageProvider"),hv),dv,Nq=(dv=class extends K3e{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},A(dv,"LangiumParserErrorMessageProvider"),dv),fv,Z3e=(fv=class extends Iq{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){const n=this.wrapper.DEFINE_RULE(X3e(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,a){this.before(i),this.wrapper.wrapSubrule(e,r,a),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}},A(fv,"LangiumCompletionParser"),fv),E4t={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Nq},pv,Q3e=(pv=class extends dCt{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...E4t,lookaheadStrategy:n?new lq({maxLookahead:r.maxLookahead}):new k4t({logging:r.skipValidations?()=>{}:void 0}),...r})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r,n){return this.RULE(e,r,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r,void 0)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}rule(e){return e.call(this,{})}},A(pv,"ChevrotainWrapper"),pv),gv,A4t=(gv=class extends Q3e{constructor(e,r,n){super(e,r),this.task=n}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,r,n){this.task.startSubTask(this.ruleName(r));try{return super.subrule(e,r,n)}finally{this.task.stopSubTask(this.ruleName(r))}}},A(gv,"ProfilerWrapper"),gv);function x7(t,e,r){return J3e({parser:e,tokens:r,ruleNames:new Map},t),e}A(x7,"createParser");function J3e(t,e){const r=OL(e,!1),n=Sn(e.rules).filter(Ys).filter(a=>r.has(a));for(const a of n){const s={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(a,vf(s,a.definition))}const i=Sn(e.rules).filter(Qb).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,e5e(t,a))}A(J3e,"buildRules");function e5e(t,e){const r=e.call.rule.ref;if(!r)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(Sl(r))throw new Error("Cannot use terminal rule in infix expression");const n=e.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},a={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},s={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(a,s);const l={$container:s,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...a,$container:s};s.elements.push(l,u);const d=n.map(p=>t.tokens[p.value]).map((p,g)=>({ALT:A(()=>t.parser.consume(g,p,l),"ALT")}));let f;return p=>{f??(f=T7(t,r)),t.parser.subrule(0,f,!1,a,p),t.parser.many(0,{DEF:A(()=>{t.parser.alternatives(0,d),t.parser.subrule(1,f,!1,u,p)},"DEF")})}}A(e5e,"buildInfixRule");function vf(t,e,r=!1){let n;if(Sh(e))n=o5e(t,e);else if(pf(e))n=t5e(t,e);else if(kh(e))n=vf(t,e.terminal);else if(Tg(e))n=Dq(t,e);else if(Eh(e))n=r5e(t,e);else if(EL(e))n=i5e(t,e);else if(LL(e))n=a5e(t,e);else if(wg(e))n=s5e(t,e);else if(PW(e)){const i=t.consume++;n=A(()=>t.parser.consume(i,mf,e),"method")}else throw new IL(e.$cstNode,`Unexpected element type: ${e.$type}`);return Oq(t,r?void 0:Ek(e),n,e.cardinality)}A(vf,"buildElement");function t5e(t,e){const r=q0(e);return()=>t.parser.action(r,e)}A(t5e,"buildAction");function r5e(t,e){const r=e.rule.ref;if(xg(r)){const n=t.subrule++,i=Ys(r)&&r.fragment,a=e.arguments.length>0?n5e(r,e.arguments):()=>({});let s;return o=>{s??(s=T7(t,r)),t.parser.subrule(n,s,i,e,a(o))}}else if(Sl(r)){const n=t.consume++,i=c6(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)Of();else throw new IL(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}A(r5e,"buildRuleCall");function n5e(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>{var a,s;return{parameterName:(s=(a=i.parameter)==null?void 0:a.ref)==null?void 0:s.name,predicate:Hl(i.value)}});return i=>{const a={};for(const{parameterName:s,predicate:o}of n)s&&(a[s]=o(i));return a}}else{const n=e.map(i=>Hl(i.value));return i=>{const a={};for(let s=0;s<n.length;s++)if(s<t.parameters.length){const o=t.parameters[s].name,l=n[s];a[o]=l(i)}return a}}}A(n5e,"buildRuleCallPredicate");function Hl(t){if($W(t)){const e=Hl(t.left),r=Hl(t.right);return n=>e(n)||r(n)}else if(OW(t)){const e=Hl(t.left),r=Hl(t.right);return n=>e(n)&&r(n)}else if(zW(t)){const e=Hl(t.value);return r=>!e(r)}else if(VW(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(NW(t)){const e=!!t.true;return()=>e}Of()}A(Hl,"buildPredicate");function i5e(t,e){if(e.elements.length===1)return vf(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:vf(t,i,!0)},s=Ek(i);s&&(a.GATE=Hl(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:A(()=>a.ALT(i),"ALT")},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}A(i5e,"buildAlternatives");function a5e(t,e){if(e.elements.length===1)return vf(t,e.elements[0]);const r=[];for(const o of e.elements){const l={ALT:vf(t,o,!0)},u=Ek(o);u&&(l.GATE=Hl(u)),r.push(l)}const n=t.or++,i=A((o,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${o}_${u}`},"idFunc"),a=A(o=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:A(()=>!0,"ALT")},d=t.parser;h.ALT=()=>{if(l.ALT(o),!d.isRecording()){const p=i(n,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const g=d.unorderedGroups.get(p);typeof(g==null?void 0:g[u])>"u"&&(g[u]=!0)}};const f=l.GATE;return f?h.GATE=()=>f(o):h.GATE=()=>{const p=d.unorderedGroups.get(i(n,d));return!(p!=null&&p[u])},h})),"alternatives"),s=Oq(t,Ek(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}A(a5e,"buildUnorderedGroup");function s5e(t,e){const r=e.elements.map(n=>vf(t,n));return n=>r.forEach(i=>i(n))}A(s5e,"buildGroup");function Ek(t){if(wg(t))return t.guardCondition}A(Ek,"getGuardCondition");function Dq(t,e,r=e.terminal){if(r)if(Eh(r)&&Ys(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return s=>{a??(a=T7(t,n)),t.parser.subrule(i,a,!1,e,s)}}else if(Eh(r)&&Sl(r.rule.ref)){const n=t.consume++,i=c6(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Sh(r)){const n=t.consume++,i=c6(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const n=FL(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+q0(e.type.ref));return Dq(t,e,i)}}A(Dq,"buildCrossReference");function o5e(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}A(o5e,"buildKeyword");function Oq(t,e,r,n){const i=e&&Hl(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:A(()=>r(s),"ALT"),GATE:A(()=>i(s),"GATE")},{ALT:U9(),GATE:A(()=>!i(s),"GATE")}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:A(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else if(n==="+"){const a=t.many++;if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:A(()=>t.parser.atLeastOne(a,{DEF:A(()=>r(o),"DEF")}),"ALT"),GATE:A(()=>i(o),"GATE")},{ALT:U9(),GATE:A(()=>!i(o),"GATE")}])}else return s=>t.parser.atLeastOne(a,{DEF:A(()=>r(s),"DEF")})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:A(()=>r(s),"DEF"),GATE:i?()=>i(s):void 0})}else Of()}A(Oq,"wrap");function T7(t,e){const r=l5e(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}A(T7,"getRule");function l5e(t,e){if(xg(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Ys(n);)(wg(n)||EL(n)||LL(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}A(l5e,"getRuleName");function c6(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}A(c6,"getToken");function $q(t){const e=t.Grammar,r=t.parser.Lexer,n=new Z3e(t);return x7(e,n,r.definition),n.finalize(),n}A($q,"createCompletionParser");function Pq(t){const e=Bq(t);return e.finalize(),e}A(Pq,"createLangiumParser");function Bq(t){const e=t.Grammar,r=t.parser.Lexer,n=new j3e(t);return x7(e,n,r.definition)}A(Bq,"prepareLangiumParser");var mv,w7=(mv=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=Sn(OL(e,!1)),i=this.buildTerminalTokens(n),a=this.buildKeywordTokens(n,i,r);return a.push(...i),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Sl).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=MS(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=DL(r)?Gs.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(xg).flatMap(i=>Uh(i).filter(Sh)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&n.caseInsensitive)))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),a={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,r){return r?new RegExp(Bx(e.value),"i"):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const a=i==null?void 0:i.PATTERN;return a!=null&&a.source&&cH("^"+a.source+"$",e.value)&&n.push(i),n},[])}},A(mv,"DefaultTokenBuilder"),mv),yv,Fq=(yv=class{convert(e,r){let n=r.grammarSource;if(Tg(n)&&(n=pH(n)),Eh(n)){const i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return Nc.convertInt(r);case"STRING":return Nc.convertString(r);case"ID":return Nc.convertID(r)}switch((i=CH(e))==null?void 0:i.toLowerCase()){case"number":return Nc.convertNumber(r);case"boolean":return Nc.convertBoolean(r);case"bigint":return Nc.convertBigint(r);case"date":return Nc.convertDate(r);default:return r}}},A(yv,"DefaultValueConverter"),yv),Nc;(function(t){function e(u){let h="";for(let d=1;d<u.length-1;d++){const f=u.charAt(d);if(f==="\\"){const p=u.charAt(++d);h+=r(p)}else h+=f}return h}A(e,"convertString"),t.convertString=e;function r(u){switch(u){case"b":return"\b";case"f":return"\f";case"n":return`
`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return u}}A(r,"convertEscapeCharacter");function n(u){return u.charAt(0)==="^"?u.substring(1):u}A(n,"convertID"),t.convertID=n;function i(u){return parseInt(u)}A(i,"convertInt"),t.convertInt=i;function a(u){return BigInt(u)}A(a,"convertBigint"),t.convertBigint=a;function s(u){return new Date(u)}A(s,"convertDate"),t.convertDate=s;function o(u){return Number(u)}A(o,"convertNumber"),t.convertNumber=o;function l(u){return u.toLowerCase()==="true"}A(l,"convertBoolean"),t.convertBoolean=l})(Nc||(Nc={}));var zn={};TL(zn,CW(CL()));function C7(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}A(C7,"delayNextTick");var z3=0,c5e=10;function k7(){return z3=performance.now(),new zn.CancellationTokenSource}A(k7,"startCancelableOperation");function zq(t){c5e=t}A(zq,"setInterruptionPeriod");var Vc=Symbol("OperationCancelled");function Pg(t){return t===Vc}A(Pg,"isOperationCancelled");async function va(t){if(t===zn.CancellationToken.None)return;const e=performance.now();if(e-z3>=c5e&&(z3=e,await C7(),z3=performance.now()),t.isCancellationRequested)throw Vc}A(va,"interruptAndCheck");var vv,Mh=(vv=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},A(vv,"Deferred"),vv),Xd,Zre=(Xd=class{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(Xd.isIncremental(n)){const i=Gq(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const h=eB(n.text,!1,a);if(l-o===h.length)for(let f=0,p=h.length;f<p;f++)u[f+o+1]=h[f];else h.length<1e4?u.splice(o+1,l-o,...h):this._lineOffsets=u=u.slice(0,o+1).concat(h,u.slice(l+1));const d=n.text.length-(s-a);if(d!==0)for(let f=o+1+h.length,p=u.length;f<p;f++)u[f]=u[f]+d}else if(Xd.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=r}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=eB(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const r=this.getLineOffsets();let n=0,i=r.length;if(i===0)return{line:0,character:e};for(;n<i;){const s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}const a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1<r.length?r[e.line+1]:this._content.length,a=Math.min(n+e.character,i);return this.ensureBeforeEOL(a,n)}ensureBeforeEOL(e,r){for(;e>r&&Vq(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}},A(Xd,"FullTextDocument"),Xd),u6;(function(t){function e(i,a,s,o){return new Zre(i,a,s,o)}A(e,"create"),t.create=e;function r(i,a,s){if(i instanceof Zre)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}A(r,"update"),t.update=r;function n(i,a){const s=i.getText(),o=h6(a.map(u5e),(h,d)=>{const f=h.range.start.line-d.range.start.line;return f===0?h.range.start.character-d.range.start.character:f});let l=0;const u=[];for(const h of o){const d=i.offsetAt(h.range.start);if(d<l)throw new Error("Overlapping edit");d>l&&u.push(s.substring(l,d)),h.newText.length&&u.push(h.newText),l=i.offsetAt(h.range.end)}return u.push(s.substr(l)),u.join("")}A(n,"applyEdits"),t.applyEdits=n})(u6||(u6={}));function h6(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);h6(n,e),h6(i,e);let a=0,s=0,o=0;for(;a<n.length&&s<i.length;)e(n[a],i[s])<=0?t[o++]=n[a++]:t[o++]=i[s++];for(;a<n.length;)t[o++]=n[a++];for(;s<i.length;)t[o++]=i[s++];return t}A(h6,"mergeSort");function eB(t,e,r=0){const n=e?[r]:[];for(let i=0;i<t.length;i++){const a=t.charCodeAt(i);Vq(a)&&(a===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}A(eB,"computeLineOffsets");function Vq(t){return t===13||t===10}A(Vq,"isEOL");function Gq(t){const e=t.start,r=t.end;return e.line>r.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}A(Gq,"getWellformedRange");function u5e(t){const e=Gq(t.range);return e!==t.range?{newText:t.newText,range:e}:t}A(u5e,"getWellformedEdit");var h5e;(()=>{var t={975:D=>{function R(O){if(typeof O!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(O))}A(R,"e");function I(O,N){for(var F,z="",V=0,B=-1,G=0,H=0;H<=O.length;++H){if(H<O.length)F=O.charCodeAt(H);else{if(F===47)break;F=47}if(F===47){if(!(B===H-1||G===1))if(B!==H-1&&G===2){if(z.length<2||V!==2||z.charCodeAt(z.length-1)!==46||z.charCodeAt(z.length-2)!==46){if(z.length>2){var q=z.lastIndexOf("/");if(q!==z.length-1){q===-1?(z="",V=0):V=(z=z.slice(0,q)).length-1-z.lastIndexOf("/"),B=H,G=0;continue}}else if(z.length===2||z.length===1){z="",V=0,B=H,G=0;continue}}N&&(z.length>0?z+="/..":z="..",V=2)}else z.length>0?z+="/"+O.slice(B+1,H):z=O.slice(B+1,H),V=H-B-1;B=H,G=0}else F===46&&G!==-1?++G:G=-1}return z}A(I,"r");var $={resolve:A(function(){for(var O,N="",F=!1,z=arguments.length-1;z>=-1&&!F;z--){var V;z>=0?V=arguments[z]:(O===void 0&&(O=process.cwd()),V=O),R(V),V.length!==0&&(N=V+"/"+N,F=V.charCodeAt(0)===47)}return N=I(N,!F),F?N.length>0?"/"+N:"/":N.length>0?N:"."},"resolve"),normalize:A(function(O){if(R(O),O.length===0)return".";var N=O.charCodeAt(0)===47,F=O.charCodeAt(O.length-1)===47;return(O=I(O,!N)).length!==0||N||(O="."),O.length>0&&F&&(O+="/"),N?"/"+O:O},"normalize"),isAbsolute:A(function(O){return R(O),O.length>0&&O.charCodeAt(0)===47},"isAbsolute"),join:A(function(){if(arguments.length===0)return".";for(var O,N=0;N<arguments.length;++N){var F=arguments[N];R(F),F.length>0&&(O===void 0?O=F:O+="/"+F)}return O===void 0?".":$.normalize(O)},"join"),relative:A(function(O,N){if(R(O),R(N),O===N||(O=$.resolve(O))===(N=$.resolve(N)))return"";for(var F=1;F<O.length&&O.charCodeAt(F)===47;++F);for(var z=O.length,V=z-F,B=1;B<N.length&&N.charCodeAt(B)===47;++B);for(var G=N.length-B,H=V<G?V:G,q=-1,Z=0;Z<=H;++Z){if(Z===H){if(G>H){if(N.charCodeAt(B+Z)===47)return N.slice(B+Z+1);if(Z===0)return N.slice(B+Z)}else V>H&&(O.charCodeAt(F+Z)===47?q=Z:Z===0&&(q=0));break}var Y=O.charCodeAt(F+Z);if(Y!==N.charCodeAt(B+Z))break;Y===47&&(q=Z)}var ie="";for(Z=F+q+1;Z<=z;++Z)Z!==z&&O.charCodeAt(Z)!==47||(ie.length===0?ie+="..":ie+="/..");return ie.length>0?ie+N.slice(B+q):(B+=q,N.charCodeAt(B)===47&&++B,N.slice(B))},"relative"),_makeLong:A(function(O){return O},"_makeLong"),dirname:A(function(O){if(R(O),O.length===0)return".";for(var N=O.charCodeAt(0),F=N===47,z=-1,V=!0,B=O.length-1;B>=1;--B)if((N=O.charCodeAt(B))===47){if(!V){z=B;break}}else V=!1;return z===-1?F?"/":".":F&&z===1?"//":O.slice(0,z)},"dirname"),basename:A(function(O,N){if(N!==void 0&&typeof N!="string")throw new TypeError('"ext" argument must be a string');R(O);var F,z=0,V=-1,B=!0;if(N!==void 0&&N.length>0&&N.length<=O.length){if(N.length===O.length&&N===O)return"";var G=N.length-1,H=-1;for(F=O.length-1;F>=0;--F){var q=O.charCodeAt(F);if(q===47){if(!B){z=F+1;break}}else H===-1&&(B=!1,H=F+1),G>=0&&(q===N.charCodeAt(G)?--G==-1&&(V=F):(G=-1,V=H))}return z===V?V=H:V===-1&&(V=O.length),O.slice(z,V)}for(F=O.length-1;F>=0;--F)if(O.charCodeAt(F)===47){if(!B){z=F+1;break}}else V===-1&&(B=!1,V=F+1);return V===-1?"":O.slice(z,V)},"basename"),extname:A(function(O){R(O);for(var N=-1,F=0,z=-1,V=!0,B=0,G=O.length-1;G>=0;--G){var H=O.charCodeAt(G);if(H!==47)z===-1&&(V=!1,z=G+1),H===46?N===-1?N=G:B!==1&&(B=1):N!==-1&&(B=-1);else if(!V){F=G+1;break}}return N===-1||z===-1||B===0||B===1&&N===z-1&&N===F+1?"":O.slice(N,z)},"extname"),format:A(function(O){if(O===null||typeof O!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof O);return(function(N,F){var z=F.dir||F.root,V=F.base||(F.name||"")+(F.ext||"");return z?z===F.root?z+V:z+"/"+V:V})(0,O)},"format"),parse:A(function(O){R(O);var N={root:"",dir:"",base:"",ext:"",name:""};if(O.length===0)return N;var F,z=O.charCodeAt(0),V=z===47;V?(N.root="/",F=1):F=0;for(var B=-1,G=0,H=-1,q=!0,Z=O.length-1,Y=0;Z>=F;--Z)if((z=O.charCodeAt(Z))!==47)H===-1&&(q=!1,H=Z+1),z===46?B===-1?B=Z:Y!==1&&(Y=1):B!==-1&&(Y=-1);else if(!q){G=Z+1;break}return B===-1||H===-1||Y===0||Y===1&&B===H-1&&B===G+1?H!==-1&&(N.base=N.name=G===0&&V?O.slice(1,H):O.slice(G,H)):(G===0&&V?(N.name=O.slice(1,B),N.base=O.slice(1,H)):(N.name=O.slice(G,B),N.base=O.slice(G,H)),N.ext=O.slice(B,H)),G>0?N.dir=O.slice(0,G-1):V&&(N.dir="/"),N},"parse"),sep:"/",delimiter:":",win32:null,posix:null};$.posix=$,D.exports=$}},e={};function r(D){var R=e[D];if(R!==void 0)return R.exports;var I=e[D]={exports:{}};return t[D](I,I.exports,r),I.exports}A(r,"r"),r.d=(D,R)=>{for(var I in R)r.o(R,I)&&!r.o(D,I)&&Object.defineProperty(D,I,{enumerable:!0,get:R[I]})},r.o=(D,R)=>Object.prototype.hasOwnProperty.call(D,R),r.r=D=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(D,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(D,"__esModule",{value:!0})};var n={};let i;r.r(n),r.d(n,{URI:A(()=>f,"URI"),Utils:A(()=>M,"Utils")}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const a=/^\w[\w\d+.-]*$/,s=/^\//,o=/^\/\//;function l(D,R){if(!D.scheme&&R)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${D.authority}", path: "${D.path}", query: "${D.query}", fragment: "${D.fragment}"}`);if(D.scheme&&!a.test(D.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(D.path){if(D.authority){if(!s.test(D.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(D.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}A(l,"a");const u="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,L=class L{constructor(R,I,$,O,N,F=!1){jt(this,"scheme");jt(this,"authority");jt(this,"path");jt(this,"query");jt(this,"fragment");typeof R=="object"?(this.scheme=R.scheme||u,this.authority=R.authority||u,this.path=R.path||u,this.query=R.query||u,this.fragment=R.fragment||u):(this.scheme=(function(z,V){return z||V?z:"file"})(R,F),this.authority=I||u,this.path=(function(z,V){switch(z){case"https":case"http":case"file":V?V[0]!==h&&(V=h+V):V=h}return V})(this.scheme,$||u),this.query=O||u,this.fragment=N||u,l(this,F))}static isUri(R){return R instanceof L||!!R&&typeof R.authority=="string"&&typeof R.fragment=="string"&&typeof R.path=="string"&&typeof R.query=="string"&&typeof R.scheme=="string"&&typeof R.fsPath=="string"&&typeof R.with=="function"&&typeof R.toString=="function"}get fsPath(){return T(this,!1)}with(R){if(!R)return this;let{scheme:I,authority:$,path:O,query:N,fragment:F}=R;return I===void 0?I=this.scheme:I===null&&(I=u),$===void 0?$=this.authority:$===null&&($=u),O===void 0?O=this.path:O===null&&(O=u),N===void 0?N=this.query:N===null&&(N=u),F===void 0?F=this.fragment:F===null&&(F=u),I===this.scheme&&$===this.authority&&O===this.path&&N===this.query&&F===this.fragment?this:new g(I,$,O,N,F)}static parse(R,I=!1){const $=d.exec(R);return $?new g($[2]||u,S($[4]||u),S($[5]||u),S($[7]||u),S($[9]||u),I):new g(u,u,u,u,u)}static file(R){let I=u;if(i&&(R=R.replace(/\\/g,h)),R[0]===h&&R[1]===h){const $=R.indexOf(h,2);$===-1?(I=R.substring(2),R=h):(I=R.substring(2,$),R=R.substring($)||h)}return new g("file",I,R,u,u)}static from(R){const I=new g(R.scheme,R.authority,R.path,R.query,R.fragment);return l(I,!0),I}toString(R=!1){return b(this,R)}toJSON(){return this}static revive(R){if(R){if(R instanceof L)return R;{const I=new g(R);return I._formatted=R.external,I._fsPath=R._sep===p?R.fsPath:null,I}}return R}};A(L,"l");let f=L;const p=i?1:void 0,P=class P extends f{constructor(){super(...arguments);jt(this,"_formatted",null);jt(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=T(this,!1)),this._fsPath}toString(I=!1){return I?b(this,!0):(this._formatted||(this._formatted=b(this,!1)),this._formatted)}toJSON(){const I={$mid:1};return this._fsPath&&(I.fsPath=this._fsPath,I._sep=p),this._formatted&&(I.external=this._formatted),this.path&&(I.path=this.path),this.scheme&&(I.scheme=this.scheme),this.authority&&(I.authority=this.authority),this.query&&(I.query=this.query),this.fragment&&(I.fragment=this.fragment),I}};A(P,"d");let g=P;const m={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function y(D,R,I){let $,O=-1;for(let N=0;N<D.length;N++){const F=D.charCodeAt(N);if(F>=97&&F<=122||F>=65&&F<=90||F>=48&&F<=57||F===45||F===46||F===95||F===126||R&&F===47||I&&F===91||I&&F===93||I&&F===58)O!==-1&&($+=encodeURIComponent(D.substring(O,N)),O=-1),$!==void 0&&($+=D.charAt(N));else{$===void 0&&($=D.substr(0,N));const z=m[F];z!==void 0?(O!==-1&&($+=encodeURIComponent(D.substring(O,N)),O=-1),$+=z):O===-1&&(O=N)}}return O!==-1&&($+=encodeURIComponent(D.substring(O))),$!==void 0?$:D}A(y,"m");function v(D){let R;for(let I=0;I<D.length;I++){const $=D.charCodeAt(I);$===35||$===63?(R===void 0&&(R=D.substr(0,I)),R+=m[$]):R!==void 0&&(R+=D[I])}return R!==void 0?R:D}A(v,"y");function T(D,R){let I;return I=D.authority&&D.path.length>1&&D.scheme==="file"?`//${D.authority}${D.path}`:D.path.charCodeAt(0)===47&&(D.path.charCodeAt(1)>=65&&D.path.charCodeAt(1)<=90||D.path.charCodeAt(1)>=97&&D.path.charCodeAt(1)<=122)&&D.path.charCodeAt(2)===58?R?D.path.substr(1):D.path[1].toLowerCase()+D.path.substr(2):D.path,i&&(I=I.replace(/\//g,"\\")),I}A(T,"v");function b(D,R){const I=R?v:y;let $="",{scheme:O,authority:N,path:F,query:z,fragment:V}=D;if(O&&($+=O,$+=":"),(N||O==="file")&&($+=h,$+=h),N){let B=N.indexOf("@");if(B!==-1){const G=N.substr(0,B);N=N.substr(B+1),B=G.lastIndexOf(":"),B===-1?$+=I(G,!1,!1):($+=I(G.substr(0,B),!1,!1),$+=":",$+=I(G.substr(B+1),!1,!0)),$+="@"}N=N.toLowerCase(),B=N.lastIndexOf(":"),B===-1?$+=I(N,!1,!0):($+=I(N.substr(0,B),!1,!0),$+=N.substr(B))}if(F){if(F.length>=3&&F.charCodeAt(0)===47&&F.charCodeAt(2)===58){const B=F.charCodeAt(1);B>=65&&B<=90&&(F=`/${String.fromCharCode(B+32)}:${F.substr(3)}`)}else if(F.length>=2&&F.charCodeAt(1)===58){const B=F.charCodeAt(0);B>=65&&B<=90&&(F=`${String.fromCharCode(B+32)}:${F.substr(2)}`)}$+=I(F,!0,!1)}return z&&($+="?",$+=I(z,!1,!1)),V&&($+="#",$+=R?V:y(V,!1,!1)),$}A(b,"b");function w(D){try{return decodeURIComponent(D)}catch{return D.length>3?D.substr(0,3)+w(D.substr(3)):D}}A(w,"C");const C=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function S(D){return D.match(C)?D.replace(C,(R=>w(R))):D}A(S,"w");var k=r(975);const E=k.posix||k,_="/";var M;(function(D){D.joinPath=function(R,...I){return R.with({path:E.join(R.path,...I)})},D.resolvePath=function(R,...I){let $=R.path,O=!1;$[0]!==_&&($=_+$,O=!0);let N=E.resolve($,...I);return O&&N[0]===_&&!R.authority&&(N=N.substring(1)),R.with({path:N})},D.dirname=function(R){if(R.path.length===0||R.path===_)return R;let I=E.dirname(R.path);return I.length===1&&I.charCodeAt(0)===46&&(I=""),R.with({path:I})},D.basename=function(R){return E.basename(R.path)},D.extname=function(R){return E.extname(R.path)}})(M||(M={})),h5e=n})();var{URI:Bo,Utils:CT}=h5e,Fs;(function(t){t.basename=CT.basename,t.dirname=CT.dirname,t.extname=CT.extname,t.joinPath=CT.joinPath,t.resolvePath=CT.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(s,o){return(s==null?void 0:s.toString())===(o==null?void 0:o.toString())}A(r,"equals"),t.equals=r;function n(s,o){const l=typeof s=="string"?Bo.parse(s).path:s.path,u=typeof o=="string"?Bo.parse(o).path:o.path,h=l.split("/").filter(m=>m.length>0),d=u.split("/").filter(m=>m.length>0);if(e){const m=/^[A-Z]:$/;if(h[0]&&m.test(h[0])&&(h[0]=h[0].toLowerCase()),d[0]&&m.test(d[0])&&(d[0]=d[0].toLowerCase()),h[0]!==d[0])return u.substring(1)}let f=0;for(;f<h.length&&h[f]===d[f];f++);const p="../".repeat(h.length-f),g=d.slice(f).join("/");return p+g}A(n,"relative"),t.relative=n;function i(s){return Bo.parse(s.toString()).toString()}A(i,"normalize"),t.normalize=i;function a(s,o){let l=typeof s=="string"?s:s.path,u=typeof o=="string"?o:o.path;return u.charAt(u.length-1)==="/"&&(u=u.slice(0,-1)),l.charAt(l.length-1)==="/"&&(l=l.slice(0,-1)),u===l?!0:u.length<l.length||u.charAt(l.length)!=="/"?!1:u.startsWith(l)}A(a,"contains"),t.contains=a})(Fs||(Fs={}));var bv,Wq=(bv=class{constructor(){this.root={name:"",children:new Map}}normalizeUri(e){return Fs.normalize(e)}clear(){this.root.children.clear()}insert(e,r){const n=this.getNode(this.normalizeUri(e),!0);n.element=r}delete(e){const r=this.getNode(this.normalizeUri(e),!1);r!=null&&r.parent&&r.parent.children.delete(r.name)}has(e){var r;return((r=this.getNode(this.normalizeUri(e),!1))==null?void 0:r.element)!==void 0}hasNode(e){return this.getNode(this.normalizeUri(e),!1)!==void 0}find(e){var r;return(r=this.getNode(this.normalizeUri(e),!1))==null?void 0:r.element}findNode(e){const r=this.normalizeUri(e),n=this.getNode(r,!1);if(n)return{name:n.name,uri:Fs.joinPath(Bo.parse(r),n.name).toString(),element:n.element}}findChildren(e){const r=this.normalizeUri(e),n=this.getNode(r,!1);return n?Array.from(n.children.values()).map(i=>({name:i.name,uri:Fs.joinPath(Bo.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(Fs.normalize(e),!1);return r?this.collectValues(r):[]}getNode(e,r){const n=e.split("/");e.charAt(e.length-1)==="/"&&n.pop();let i=this.root;for(const a of n){let s=i.children.get(a);if(!s)if(r)s={name:a,children:new Map,parent:i},i.children.set(a,s);else return;i=s}return i}collectValues(e){const r=[];e.element&&r.push(e.element);for(const n of e.children.values())r.push(...this.collectValues(n));return r}},A(bv,"UriTrie"),bv),Gr;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(Gr||(Gr={}));var xv,d5e=(xv=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=zn.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??Bo.parse(e.uri),zn.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return zn.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:Gr.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:Gr.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var s,o;const n=(s=e.parseResult.value.$cstNode)==null?void 0:s.root.fullText,i=(o=this.textDocuments)==null?void 0:o.get(e.uri.toString()),a=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const l=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:l})}return n!==a&&(e.parseResult=await this.parseAsync(e.uri,a,r),e.parseResult.value.$document=e),e.state=Gr.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){const n=this.serviceRegistry;let i;return()=>i??(i=u6.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},A(xv,"DefaultLangiumDocumentFactory"),xv),Tv,f5e=(Tv=class{constructor(e){this.documentTrie=new Wq,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return Sn(this.documentTrie.all())}addDocument(e){const r=e.uri.toString();if(this.documentTrie.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentTrie.insert(r,e)}getDocument(e){const r=e.toString();return this.documentTrie.find(r)}getDocuments(e){const r=e.toString();return this.documentTrie.findAll(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&this.documentBuilder().resetToState(n,Gr.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=Gr.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=Gr.Changed;return this.documentTrie.delete(r),n}},A(Tv,"DefaultLangiumDocuments"),Tv),mp=Symbol("RefResolving"),wv,p5e=(wv=class{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,r=zn.CancellationToken.None){var n;if((n=this.profiler)!=null&&n.isActive("linking")){const i=this.profiler.createTask("linking",this.languageId);i.start();try{for(const a of rc(e.parseResult.value))await va(r),Zb(a).forEach(s=>{const o=`${a.$type}:${s.property}`;i.startSubTask(o);try{this.doLink(s,e)}finally{i.stopSubTask(o)}})}finally{i.stop()}}else for(const i of rc(e.parseResult.value))await va(r),Zb(i).forEach(a=>this.doLink(a,e))}doLink(e,r){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=mp;try{const i=this.getCandidate(e);if(_p(i))n._ref=i;else{n._nodeDescription=i;const a=this.loadAstNode(i);n._ref=a??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${n.$refText}':`,i);const a=i.message??String(i);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${a}`}}r.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=mp;try{const i=this.getCandidates(e),a=[];if(_p(i))n._linkingError=i;else for(const s of i){const o=this.loadAstNode(s);o&&a.push({ref:o,$nodeDescription:s})}n._items=a}catch(i){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${i}`},n._items=[]}r.references.push(n)}}unlink(e){for(const r of e.references)"_ref"in r?(r._ref=void 0,delete r._nodeDescription):"_items"in r&&(r._items=void 0,delete r._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const n=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return n.length>0?n:this.createLinkingError(e)}buildReference(e,r,n,i){const a=this,s={$refNode:n,$refText:i,_ref:void 0,get ref(){if(Hi(this._ref))return this._ref;if(AW(this._nodeDescription)){const o=a.loadAstNode(this._nodeDescription);this._ref=o??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=mp;const o=Cy(e).$document,l=a.getLinkedNode({reference:s,container:e,property:r});if(l.error&&o&&o.state<Gr.ComputedScopes)return this._ref=void 0;this._ref=l.node??l.error,this._nodeDescription=l.descr,o==null||o.references.push(this)}else this._ref===mp&&a.throwCyclicReferenceError(e,r,i);return Hi(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return _p(this._ref)?this._ref:void 0}};return s}buildMultiReference(e,r,n,i){const a=this,s={$refNode:n,$refText:i,_items:void 0,get items(){if(Array.isArray(this._items))return this._items;if(this._items===void 0){this._items=mp;const o=Cy(e).$document,l=a.getCandidates({reference:s,container:e,property:r}),u=[];if(_p(l))this._linkingError=l;else for(const h of l){const d=a.loadAstNode(h);d&&u.push({ref:d,$nodeDescription:h})}this._items=u,o==null||o.references.push(this)}else this._items===mp&&a.throwCyclicReferenceError(e,r,i);return Array.isArray(this._items)?this._items:[]},get error(){if(this._linkingError)return this._linkingError;if(!(this.items.length>0))return this._linkingError=a.createLinkingError({reference:s,container:e,property:r})}};return s}throwCyclicReferenceError(e,r,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${n}')`)}getLinkedNode(e){try{const r=this.getCandidate(e);if(_p(r))return{error:r};const n=this.loadAstNode(r);return n?{node:n,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const n=r.message??String(r);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node)return e.node;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=Cy(e.container).$document;n&&n.state<Gr.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`);const i=this.reflection.getReferenceType(e);return{info:e,message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:r}}},A(wv,"DefaultLinker"),wv);function Hq(t){return typeof t.name=="string"}A(Hq,"isNamed");var Cv,g5e=(Cv=class{getName(e){if(Hq(e))return e.name}getNameNode(e){return $L(e.$cstNode,"name")}},A(Cv,"DefaultNameProvider"),Cv),kv,m5e=(kv=class{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator,this.documents=e.shared.workspace.LangiumDocuments,this.hasMultiReference=rc(e.Grammar).some(r=>Tg(r)&&r.isMulti)}findDeclarations(e){if(e){const r=vH(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(Bs(i)||Yc(i))return R_(i);if(Array.isArray(i)){for(const a of i)if((Bs(a)||Yc(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return R_(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||ZW(e,i)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(r.head());if(n){for(const i of Zb(n))if(Yc(i.reference)&&i.reference.items.some(a=>a.ref===e))return i.reference.items.map(a=>a.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const r=this.documents.getDocument(e.sourceUri);if(r)return this.nodeLocator.getAstNode(r.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const r=this.findDeclarations(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i)??i.$cstNode;a&&n.push(a)}return n}findReferences(e,r){const n=[];r.includeDeclaration&&n.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>Fs.equals(a.sourceUri,r.documentUri))),n.push(...i),Sn(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const s=tc(i),o=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:s.uri,sourcePath:o,targetUri:s.uri,targetPath:o,segment:ex(a),local:!0})}}return n}},A(kv,"DefaultReferences"),kv),Sv,Ih=(Sv=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return hk.sum(Sn(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const r=this.map.get(e);return r?Sn(r):Xb}has(e,r){if(r===void 0)return this.map.has(e);{const n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return Sn(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return Sn(this.map.keys())}values(){return Sn(this.map.values()).flat()}entriesGroupedByKey(){return Sn(this.map.entries())}},A(Sv,"MultiMap"),Sv),Ev,d6=(Ev=class{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}},A(Ev,"BiMap"),Ev),Av,y5e=(Av=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=zn.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=AS,i=zn.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const s of n(e))await va(i),this.addExportedSymbol(s,a,r);return a}addExportedSymbol(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async collectLocalSymbols(e,r=zn.CancellationToken.None){const n=e.parseResult.value,i=new Ih;for(const a of Uh(n))await va(r),this.addLocalSymbol(a,e,i);return i}addLocalSymbol(e,r,n){const i=e.$container;if(i){const a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}},A(Av,"DefaultScopeComputation"),Av),_v,tB=(_v=class{constructor(e,r,n){this.elements=e,this.outerScope=r,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===r):this.elements.find(i=>i.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===r):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},A(_v,"StreamScope"),_v),Rv,_4t=(Rv=class{constructor(e,r,n){this.elements=new Map,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.set(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r),i=n?[n]:[];return(this.concatOuterScope||i.length>0)&&this.outerScope?Sn(i).concat(this.outerScope.getElements(e)):Sn(i)}getAllElements(){let e=Sn(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},A(Rv,"MapScope"),Rv),Lv,v5e=(Lv=class{constructor(e,r,n){this.elements=new Ih,this.caseInsensitive=(n==null?void 0:n.caseInsensitive)??!1,this.concatOuterScope=(n==null?void 0:n.concatOuterScope)??!0;for(const i of e){const a=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(a,i)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);return(this.concatOuterScope||n.length===0)&&this.outerScope?Sn(n).concat(this.outerScope.getElements(e)):Sn(n)}getAllElements(){let e=Sn(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},A(Lv,"MultiMapScope"),Lv),R4t={getElement(){},getElements(){return Xb},getAllElements(){return Xb}},Mv,S7=(Mv=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},A(Mv,"DisposableCache"),Mv),Iv,qq=(Iv=class extends S7{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){const n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},A(Iv,"SimpleCache"),Iv),Nv,E7=(Nv=class extends S7{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}},A(Nv,"ContextCache"),Nv),Dv,b5e=(Dv=class extends E7{constructor(e,r){super(n=>n.toString()),r?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(r,n=>{this.clear(n.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{for(const a of i)this.clear(a)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{const a=n.concat(i);for(const s of a)this.clear(s)}))}},A(Dv,"DocumentCache"),Dv),Ov,Uq=(Ov=class extends qq{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},A(Ov,"WorkspaceCache"),Ov),$v,x5e=($v=class{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new Uq(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=tc(e.container).localSymbols;if(i){let s=e.container;do i.has(s)&&r.push(i.getStream(s).filter(o=>this.reflection.isSubtype(o.type,n))),s=s.$container;while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new tB(Sn(e),r,n)}createScopeForNodes(e,r,n){const i=Sn(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new tB(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new v5e(this.indexManager.allElements(e)))}},A($v,"DefaultScopeProvider"),$v);function Yq(t){return typeof t.$comment=="string"}A(Yq,"isAstNodeWithComment");function rB(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}A(rB,"isIntermediateReference");var Pv,T5e=(Pv=class{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){const n=r??{},i=r==null?void 0:r.replacer,a=A((o,l)=>this.replacer(o,l,n),"defaultReplacer"),s=i?(o,l)=>i(o,l,a):a;try{return this.currentDocument=tc(e),JSON.stringify(e,s,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:o}){var l,u,h;if(!this.ignoreProperties.has(e))if(Bs(r)){const d=r.ref,f=n?r.$refText:void 0;if(d){const p=tc(d);let g="";this.currentDocument&&this.currentDocument!==p&&(o?g=o(p.uri,d):g=p.uri.toString());const m=this.astNodeLocator.getAstNodePath(d);return{$ref:`${g}#${m}`,$refText:f}}else return{$error:((l=r.error)==null?void 0:l.message)??"Could not resolve reference",$refText:f}}else if(Yc(r)){const d=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=tc(p.ref);let y="";this.currentDocument&&this.currentDocument!==m&&(o?y=o(m.uri,g):y=m.uri.toString());const v=this.astNodeLocator.getAstNodePath(g);f.push(`${y}#${v}`)}return{$refs:f,$refText:d}}else if(Hi(r)){let d;if(a&&(d=this.addAstNodeRegionWithAssignmentsTo({...r}),(!e||r.$document)&&(d!=null&&d.$textRegion)&&(d.$textRegion.documentURI=(u=this.currentDocument)==null?void 0:u.uri.toString())),i&&!e&&(d??(d={...r}),d.$sourceText=(h=r.$cstNode)==null?void 0:h.text),s){d??(d={...r});const f=this.commentProvider.getComment(r);f&&(d.$comment=f.replace(/\r/g,""))}return d??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=A(n=>({offset:n.offset,end:n.end,length:n.length,range:n.range}),"createDocumentSegment");if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=mH(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[l,u]of Object.entries(e))if(Array.isArray(u))for(let h=0;h<u.length;h++){const d=u[h];rB(d)?u[h]=this.reviveReference(e,l,r,d,n):Hi(d)&&this.linkNode(d,r,n,e,l,h)}else rB(u)?e[l]=this.reviveReference(e,l,r,u,n):Hi(u)&&this.linkNode(u,r,n,e,l);const o=e;o.$container=i,o.$containerProperty=a,o.$containerIndex=s}reviveReference(e,r,n,i,a){let s=i.$refText,o=i.$error,l;if(i.$ref){const u=this.getRefNode(n,i.$ref,a.uriConverter);if(Hi(u))return s||(s=this.nameProvider.getName(u)),{$refText:s??"",ref:u};o=u}else if(i.$refs){const u=[];for(const h of i.$refs){const d=this.getRefNode(n,h,a.uriConverter);Hi(d)&&u.push({ref:d})}if(u.length===0)l={$refText:s??"",items:u},o??(o="Could not resolve multi-reference");else return{$refText:s??"",items:u}}if(o)return l??(l={$refText:s??"",ref:void 0}),l.error={info:{container:e,property:r,reference:l},message:o},l}getRefNode(e,r,n){try{const i=r.indexOf("#");if(i===0){const l=this.astNodeLocator.getAstNode(e,r.substring(1));return l||"Could not resolve path: "+r}if(i<0){const l=n?n(r):Bo.parse(r),u=this.langiumDocuments.getDocument(l);return u?u.parseResult.value:"Could not find document for URI: "+r}const a=n?n(r.substring(0,i)):Bo.parse(r.substring(0,i)),s=this.langiumDocuments.getDocument(a);if(!s)return"Could not find document for URI: "+r;if(i===r.length-1)return s.parseResult.value;const o=this.astNodeLocator.getAstNode(s.parseResult.value,r.substring(i+1));return o||"Could not resolve URI: "+r}catch(i){return String(i)}}},A(Pv,"DefaultJsonSerializer"),Pv),Bv,w5e=(Bv=class{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.fileNameMap=new Map,this.textDocuments=e==null?void 0:e.workspace.TextDocuments}register(e){const r=e.LanguageMetaData;for(const n of r.fileExtensions)this.fileExtensionMap.has(n)&&console.warn(`The file extension ${n} is used by multiple languages. It is now assigned to '${r.languageId}'.`),this.fileExtensionMap.set(n,e);if(r.fileNames)for(const n of r.fileNames)this.fileNameMap.has(n)&&console.warn(`The file name ${n} is used by multiple languages. It is now assigned to '${r.languageId}'.`),this.fileNameMap.set(n,e);this.languageIdMap.set(r.languageId,e)}getServices(e){var s,o;if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const r=(o=(s=this.textDocuments)==null?void 0:s.get(e))==null?void 0:o.languageId;if(r!==void 0){const l=this.languageIdMap.get(r);if(l)return l}const n=Fs.extname(e),i=Fs.basename(e),a=this.fileNameMap.get(i)??this.fileExtensionMap.get(n);if(!a)throw r?new Error(`The service registry contains no services for the extension '${n}' for language '${r}'.`):new Error(`The service registry contains no services for the extension '${n}'.`);return a}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}},A(Bv,"DefaultServiceRegistry"),Bv);function r0(t){return{code:t}}A(r0,"diagnosticData");var f6;(function(t){t.defaults=["fast","slow","built-in"],t.all=t.defaults})(f6||(f6={}));var Fv,C5e=(Fv=class{constructor(e){this.entries=new Ih,this.knownCategories=new Set(f6.defaults),this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,r=this,n="fast"){if(n==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");this.knownCategories.add(n);for(const[i,a]of Object.entries(e)){const s=a;if(Array.isArray(s))for(const o of s){const l={check:this.wrapValidationException(o,r),category:n};this.addEntry(i,l)}else if(typeof s=="function"){const o={check:this.wrapValidationException(s,r),category:n};this.addEntry(i,o)}else Of()}}wrapValidationException(e,r){return async(n,i,a)=>{await this.handleException(()=>e.call(r,n,i,a),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(a){if(Pg(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=Sn(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,a,s,o)=>{await this.handleException(()=>e.call(n,i,a,s,o),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},A(Fv,"ValidationRegistry"),Fv),k5e=Object.freeze({validateNode:!0,validateChildren:!0}),zv,S5e=(zv=class{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,r={},n=zn.CancellationToken.None){const i=e.parseResult,a=[];if(await va(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ul.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ul.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)==null?void 0:o.code)===ul.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(Pg(s))throw s;console.error("An error occurred during validation:",s)}return await va(n),a}processLexingErrors(e,r,n){var a;const i=[...e.lexerErrors,...((a=e.lexerReport)==null?void 0:a.diagnostics)??[]];for(const s of i){const o=s.severity??"error",l={severity:lC(o),range:{start:{line:s.line-1,character:s.column-1},end:{line:s.line-1,character:s.column+s.length-1}},message:s.message,data:jq(o),source:this.getSource()};r.push(l)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){const s=i.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=dk(i.token);if(a){const s={severity:lC("error"),range:a,message:i.message,data:r0(ul.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){var i;for(const a of e.references){const s=a.error;if(s){const o={node:s.info.container,range:(i=a.$refNode)==null?void 0:i.range,property:s.info.property,index:s.info.index,data:{code:ul.LinkingError,containerType:s.info.container.$type,property:s.info.property,refText:s.info.reference.$refText}};r.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,r,n=zn.CancellationToken.None){const i=[],a=A((s,o,l)=>{i.push(this.toDiagnostic(s,o,l))},"acceptor");return await this.validateAstBefore(e,r,a,n),await this.validateAstNodes(e,r,a,n),await this.validateAstAfter(e,r,a,n),i}async validateAstBefore(e,r,n,i=zn.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const s of a)await va(i),await s(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=zn.CancellationToken.None){var a;if((a=this.profiler)!=null&&a.isActive("validating")){const s=this.profiler.createTask("validating",this.languageId);s.start();try{const o=rc(e).iterator();for(const l of o){s.startSubTask(l.$type);const u=this.validateSingleNodeOptions(l,r);if(u.validateNode)try{const h=this.validationRegistry.getChecks(l.$type,r.categories);for(const d of h)await d(l,n,i)}finally{s.stopSubTask(l.$type)}u.validateChildren||o.prune()}}finally{s.stop()}}else{const s=rc(e).iterator();for(const o of s){await va(i);const l=this.validateSingleNodeOptions(o,r);if(l.validateNode){const u=this.validationRegistry.getChecks(o.$type,r.categories);for(const h of u)await h(o,n,i)}l.validateChildren||s.prune()}}}validateSingleNodeOptions(e,r){return k5e}async validateAstAfter(e,r,n,i=zn.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const s of a)await va(i),await s(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:Xq(n),severity:lC(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},A(zv,"DefaultDocumentValidator"),zv);function Xq(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=$L(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=yH(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}A(Xq,"getDiagnosticRange");function lC(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}A(lC,"toDiagnosticSeverity");function jq(t){switch(t){case"error":return r0(ul.LexingError);case"warning":return r0(ul.LexingWarning);case"info":return r0(ul.LexingInfo);case"hint":return r0(ul.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}A(jq,"toDiagnosticData");var ul;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(ul||(ul={}));var Vv,E5e=(Vv=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??tc(e);r??(r=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${a} has no name.`);let s;const o=A(()=>s??(s=ex(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return o()},selectionSegment:ex(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}},A(Vv,"DefaultAstNodeDescriptionProvider"),Vv),Gv,A5e=(Gv=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=zn.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of rc(i))await va(r),Zb(a).forEach(s=>{s.reference.error||n.push(...this.createInfoDescriptions(s))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];Bs(r)&&r.$nodeDescription?n=[r.$nodeDescription]:Yc(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=tc(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),s=[],o=ex(r.$refNode);for(const l of n)s.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:o,local:Fs.equals(l.documentUri,i)});return s}},A(Gv,"DefaultReferenceDescriptionProvider"),Gv),Wv,_5e=(Wv=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((i,a)=>{if(!i||a.length===0)return i;const s=a.indexOf(this.indexSeparator);if(s>0){const o=a.substring(0,s),l=parseInt(a.substring(s+1)),u=i[o];return u==null?void 0:u[l]}return i[a]},e)}},A(Wv,"DefaultAstNodeLocator"),Wv),A7={};TL(A7,CW($x()));var Hv,R5e=(Hv=class{constructor(e){this._ready=new Mh,this.onConfigurationSectionUpdateEmitter=new A7.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r;this.workspaceConfig=((r=e.capabilities.workspace)==null?void 0:r.configuration)??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([r,n])=>{this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},A(Hv,"DefaultConfigurationProvider"),Hv),u4=CW(c1t()),p0;(function(t){function e(r){return{dispose:A(async()=>await r(),"dispose")}}A(e,"create"),t.create=e})(p0||(p0={}));var qv,L5e=(qv=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Ih,this.documentPhaseListeners=new Ih,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Gr.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=zn.CancellationToken.None){var i;for(const a of e){const s=a.uri.toString();if(a.state===Gr.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,Gr.IndexedReferences);else if(typeof r.validation=="object"){const o=this.findMissingValidationCategories(a,r);o.length>0&&(this.buildState.set(s,{completed:!1,options:{validation:{categories:o}},result:(i=this.buildState.get(s))==null?void 0:i.result}),a.state=Gr.IndexedReferences)}}else this.buildState.delete(s)}this.currentState=Gr.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=zn.CancellationToken.None){this.currentState=Gr.Changed;const i=[];for(const l of r){const u=this.langiumDocuments.deleteDocuments(l);for(const h of u)i.push(h.uri),this.cleanUpDeleted(h)}const a=(await Promise.all(e.map(l=>this.findChangedUris(l)))).flat();for(const l of a){let u=this.langiumDocuments.getDocument(l);u===void 0&&(u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),u.state=Gr.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,Gr.Changed)}const s=Sn(a).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,Gr.ComputedScopes)),await this.emitUpdate(a,i),await va(n);const o=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var u;return l.state<Gr.Validated||!((u=this.buildState.get(l.uri.toString()))!=null&&u.completed)||this.resultsAreIncomplete(l,this.updateBuildOptions)}).toArray());await this.buildDocuments(o,this.updateBuildOptions,n)}resultsAreIncomplete(e,r){return this.findMissingValidationCategories(e,r).length>=1}findMissingValidationCategories(e,r){var o,l;const n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=(o=n==null?void 0:n.result)!=null&&o.validationChecks?new Set((l=n==null?void 0:n.result)==null?void 0:l.validationChecks):n!=null&&n.completed?i:new Set,s=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return Sn(s).filter(u=>!a.has(u)).toArray()}async findChangedUris(e){var n;if(this.langiumDocuments.getDocument(e)??((n=this.textDocuments)==null?void 0:n.get(e)))return[e];try{const i=await this.fileSystemProvider.stat(e);if(i.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(i))return[e]}catch{}return[]}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r<n;){for(;r<e.length&&this.hasTextDocument(e[r]);)r++;for(;n>=0&&!this.hasTextDocument(e[n]);)n--;r<n&&([e[r],e[n]]=[e[n],e[r]])}return e}hasTextDocument(e){var r;return!!((r=this.textDocuments)!=null&&r.get(e.uri))}shouldRelink(e,r){return e.references.some(n=>n.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),p0.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case Gr.Changed:case Gr.Parsed:this.indexManager.removeContent(e.uri);case Gr.IndexedContent:e.localSymbols=void 0;case Gr.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case Gr.Linked:this.indexManager.removeReferences(e.uri);case Gr.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case Gr.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=Gr.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,Gr.Parsed,n,s=>this.langiumDocumentFactory.update(s,n)),await this.runCancelable(e,Gr.IndexedContent,n,s=>this.indexManager.updateContent(s,n)),await this.runCancelable(e,Gr.ComputedScopes,n,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await o.collectLocalSymbols(s,n)});const i=e.filter(s=>this.shouldLink(s));await this.runCancelable(i,Gr.Linked,n,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,n)),await this.runCancelable(i,Gr.IndexedReferences,n,s=>this.indexManager.updateReferences(s,n));const a=e.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(a,Gr.Validated,n,async s=>{await this.validate(s,n),this.markAsCompleted(s)})}markAsCompleted(e){const r=this.buildState.get(e.uri.toString());r&&(r.completed=!0)}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a==null?void 0:a.result})}}async runCancelable(e,r,n,i){for(const s of e)s.state<r&&(await va(n),await i(s),s.state=r,await this.notifyDocumentPhase(s,r,n));const a=e.filter(s=>s.state===r);await this.notifyBuildPhase(a,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),p0.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),p0.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=zn.CancellationToken.None),i?this.awaitDocumentState(e,i,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,r,n){const i=this.langiumDocuments.getDocument(r);if(i){if(i.state>=e)return Promise.resolve(r);if(n.isCancellationRequested)return Promise.reject(Vc);if(this.currentState>=e&&e>i.state)return Promise.reject(new u4.ResponseError(u4.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${Gr[i.state]}, requiring ${Gr[e]}, but workspace state is already ${Gr[this.currentState]}. Returning undefined.`))}else return Promise.reject(new u4.ResponseError(u4.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,s)=>{const o=this.onDocumentPhase(e,u=>{Fs.equals(u.uri,r)&&(o.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{o.dispose(),l.dispose(),s(Vc)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(Vc):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),s.dispose(),n()}),s=r.onCancellationRequested(()=>{a.dispose(),s.dispose(),i(Vc)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const s of a)try{await va(n),await s(e,n)}catch(o){if(!Pg(o))throw o}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const a=this.buildPhaseListeners.get(r).slice();for(const s of a)await va(n),await s(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){const n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),a=typeof i.validation=="object"?{...i.validation}:{};a.categories=this.findMissingValidationCategories(e,i);const s=await n.validateDocument(e,a,r);e.diagnostics?e.diagnostics.push(...s):e.diagnostics=s;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=Sn(o.result.validationChecks).concat(a.categories).distinct().toArray():o.result.validationChecks=[...a.categories])}getBuildOptions(e){var r;return((r=this.buildState.get(e.uri.toString()))==null?void 0:r.options)??{}}},A(qv,"DefaultDocumentBuilder"),qv),Uv,M5e=(Uv=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new E7,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=tc(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{Fs.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),Sn(i)}allElements(e,r){let n=Sn(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){return r?this.symbolByTypeIndex.get(e,r,()=>(this.symbolIndex.get(e)??[]).filter(a=>this.astReflection.isSubtype(a.type,r))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r)}removeReferences(e){const r=e.toString();this.referenceIndex.delete(r)}async updateContent(e,r=zn.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,r),a=e.uri.toString();this.symbolIndex.set(a,i),this.symbolByTypeIndex.clear(a)}async updateReferences(e,r=zn.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}},A(Uv,"DefaultIndexManager"),Uv),Yv,I5e=(Yv=class{constructor(e){this.initialBuildOptions={},this._ready=new Mh,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(r=>this.initializeWorkspace(this.folders??[],r))}async initializeWorkspace(e,r=zn.CancellationToken.None){const n=await this.performStartup(e);await va(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=A(s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)},"collector");await this.loadAdditionalDocuments(e,n);const i=[];await Promise.all(e.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,i)));const a=Sn(i).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(a,n),this._ready.resolve(),r}async loadWorkspaceDocuments(e,r){await Promise.all(e.map(async n=>{const i=await this.langiumDocuments.getOrCreateDocument(n);r(i)}))}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return Bo.parse(e.uri)}async traverseFolder(e,r){try{const n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,r):i.isFile&&r.push(i.uri))}))}catch(n){console.error("Failure to read directory content of "+e.toString(!0),n)}}async searchFolder(e){const r=[];return await this.traverseFolder(e,r),r}shouldIncludeEntry(e){const r=Fs.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},A(Yv,"DefaultWorkspaceManager"),Yv),Xv,N5e=(Xv=class{buildUnexpectedCharactersMessage(e,r,n,i,a){return $9.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return $9.buildUnableToPopLexerModeMessage(e)}},A(Xv,"DefaultLexerErrorMessageProvider"),Xv),Kq={mode:"full"},jv,Zq=(jv=class{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=p6(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new Gs(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=Kq){var i,a;const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:(a=(i=this.tokenBuilder).flushLexingReport)==null?void 0:a.call(i,e)}}toTokenTypeDictionary(e){if(p6(e))return e;const r=R7(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},A(jv,"DefaultLexer"),jv);function _7(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}A(_7,"isTokenTypeArray");function R7(t){return t&&"modes"in t&&"defaultMode"in t}A(R7,"isIMultiModeLexerDefinition");function p6(t){return!_7(t)&&!R7(t)}A(p6,"isTokenTypeDictionary");SS();function Qq(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=mn.create(0,0));const a=eU(t),s=L7(n),o=D5e({lines:a,position:i,options:s});return P5e({index:0,tokens:o,position:i})}A(Qq,"parseJSDoc");function Jq(t,e){const r=L7(e),n=eU(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!(s!=null&&s.exec(i))&&!!(o!=null&&o.exec(a))}A(Jq,"isJSDoc");function eU(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(Bbe)}A(eU,"getLines");var Qre=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,L4t=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function D5e(t){var i,a,s;const e=[];let r=t.position.line,n=t.position.character;for(let o=0;o<t.lines.length;o++){const l=o===0,u=o===t.lines.length-1;let h=t.lines[o],d=0;if(l&&t.options.start){const p=(i=t.options.start)==null?void 0:i.exec(h);p&&(d=p.index+p[0].length)}else{const p=(a=t.options.line)==null?void 0:a.exec(h);p&&(d=p.index+p[0].length)}if(u){const p=(s=t.options.end)==null?void 0:s.exec(h);p&&(h=h.substring(0,p.index))}if(h=h.substring(0,$5e(h)),g6(h,d)>=h.length){if(e.length>0){const p=mn.create(r,n);e.push({type:"break",content:"",range:jr.create(p,p)})}}else{Qre.lastIndex=d;const p=Qre.exec(h);if(p){const g=p[0],m=p[1],y=mn.create(r,n+d),v=mn.create(r,n+d+g.length);e.push({type:"tag",content:m,range:jr.create(y,v)}),d+=g.length,d=g6(h,d)}if(d<h.length){const g=h.substring(d),m=Array.from(g.matchAll(L4t));e.push(...O5e(m,g,r,n+d))}}r++,n=0}return e.length>0&&e[e.length-1].type==="break"?e.slice(0,-1):e}A(D5e,"tokenize");function O5e(t,e,r,n){const i=[];if(t.length===0){const a=mn.create(r,n),s=mn.create(r,n+e.length);i.push({type:"text",content:e,range:jr.create(a,s)})}else{let a=0;for(const o of t){const l=o.index,u=e.substring(a,l);u.length>0&&i.push({type:"text",content:e.substring(a,l),range:jr.create(mn.create(r,a+n),mn.create(r,l+n))});let h=u.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:jr.create(mn.create(r,a+h+n),mn.create(r,a+h+d.length+n))}),h+=d.length,o.length===4){h+=o[2].length;const f=o[3];i.push({type:"text",content:f,range:jr.create(mn.create(r,a+h+n),mn.create(r,a+h+f.length+n))})}else i.push({type:"text",content:"",range:jr.create(mn.create(r,a+h+n),mn.create(r,a+h+n))});a=l+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:jr.create(mn.create(r,a+n),mn.create(r,a+n+s.length))})}return i}A(O5e,"buildInlineTokens");var M4t=/\S/,I4t=/\s*$/;function g6(t,e){const r=t.substring(e).match(M4t);return r?e+r.index:t.length}A(g6,"skipWhitespace");function $5e(t){const e=t.match(I4t);if(e&&typeof e.index=="number")return e.index}A($5e,"lastCharacter");function P5e(t){var a,s;const e=mn.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Jre([],jr.create(e,e));const r=[];for(;t.index<t.tokens.length;){const o=B5e(t,r[r.length-1]);o&&r.push(o)}const n=((a=r[0])==null?void 0:a.range.start)??e,i=((s=r[r.length-1])==null?void 0:s.range.end)??e;return new Jre(r,jr.create(n,i))}A(P5e,"parseJSDocComment");function B5e(t,e){const r=t.tokens[t.index];if(r.type==="tag")return rU(t,!1);if(r.type==="text"||r.type==="inline-tag")return tU(t);F5e(r,e),t.index++}A(B5e,"parseJSDocElement");function F5e(t,e){if(e){const r=new W5e("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}A(F5e,"appendEmptyLine");function tU(t){let e=t.tokens[t.index];const r=e;let n=e;const i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(z5e(t)),n=e,e=t.tokens[t.index];return new nB(i,jr.create(r.range.start,n.range.end))}A(tU,"parseJSDocText");function z5e(t){return t.tokens[t.index].type==="inline-tag"?rU(t,!0):nU(t)}A(z5e,"parseJSDocInline");function rU(t,e){const r=t.tokens[t.index++],n=r.content.substring(1),i=t.tokens[t.index];if((i==null?void 0:i.type)==="text")if(e){const a=nU(t);return new yN(n,new nB([a],a.range),e,jr.create(r.range.start,a.range.end))}else{const a=tU(t);return new yN(n,a,e,jr.create(r.range.start,a.range.end))}else{const a=r.range;return new yN(n,new nB([],a),e,a)}}A(rU,"parseJSDocTag");function nU(t){const e=t.tokens[t.index++];return new W5e(e.content,e.range)}A(nU,"parseJSDocLine");function L7(t){if(!t)return L7({start:"/**",end:"*/",line:"*"});const{start:e,end:r,line:n}=t;return{start:V3(e,!0),end:V3(r,!1),line:V3(n,!0)}}A(L7,"normalizeOptions");function V3(t,e){if(typeof t=="string"||typeof t=="object"){const r=typeof t=="string"?Bx(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}A(V3,"normalizeOption");var Kv,Jre=(Kv=class{constructor(e,r){this.elements=e,this.range=r}getTag(e){return this.getAllTags().find(r=>r.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=iB(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=iB(r)+i}return r.trim()}},A(Kv,"JSDocCommentImpl"),Kv),Zv,yN=(Zv=class{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e}
${r}`),this.inline?`{${e}}`:e}toMarkdown(e){var r;return((r=e==null?void 0:e.renderTag)==null?void 0:r.call(e,this))??this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const a=V5e(this.name,r,e??{});if(typeof a=="string")return a}let n="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?n="*":(e==null?void 0:e.tag)==="bold"?n="**":(e==null?void 0:e.tag)==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} — ${r}`:this.content.inlines.length>1&&(i=`${i}
${r}`),this.inline?`{${i}}`:i}},A(Zv,"JSDocTagImpl"),Zv);function V5e(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const o=g6(e,i);a=e.substring(o),e=e.substring(0,i)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(a=`\`${a}\``),((n=r.renderLink)==null?void 0:n.call(r,e,a))??G5e(e,a)}}A(V5e,"renderInlineTag");function G5e(t,e){try{return Bo.parse(t,!0),`[${e}](${t})`}catch{return t}}A(G5e,"renderLinkDefault");var Qv,nB=(Qv=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;r<this.inlines.length;r++){const n=this.inlines[r],i=this.inlines[r+1];e+=n.toString(),i&&i.range.start.line>n.range.start.line&&(e+=`
`)}return e}toMarkdown(e){let r="";for(let n=0;n<this.inlines.length;n++){const i=this.inlines[n],a=this.inlines[n+1];r+=i.toMarkdown(e),a&&a.range.start.line>i.range.start.line&&(r+=`
`)}return r}},A(Qv,"JSDocTextImpl"),Qv),Jv,W5e=(Jv=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},A(Jv,"JSDocLineImpl"),Jv);function iB(t){return t.endsWith(`
`)?`
`:`
`}A(iB,"fillNewlines");var e2,H5e=(e2=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&Jq(r))return Qq(r).toMarkdown({renderLink:A((i,a)=>this.documentationLinkRenderer(e,i,a),"renderLink"),renderTag:A(i=>this.documentationTagRenderer(e,i),"renderTag")})}documentationLinkRenderer(e,r,n){const i=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(i&&i.nameSegment){const a=i.nameSegment.range.start.line+1,s=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${a},${s}`});return`[${n}](${o.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const i=tc(e).localSymbols;if(!i)return;let a=e;do{const o=i.getStream(a).find(l=>l.name===r);if(o)return o;a=a.$container}while(a)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}},A(e2,"JSDocDocumentationProvider"),e2),t2,q5e=(t2=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return Yq(e)?e.$comment:(r=tH(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},A(t2,"DefaultCommentProvider"),t2),r2,U5e=(r2=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},A(r2,"DefaultAsyncParser"),r2),n2,N4t=(n2=class{constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length<this.threadCount;){const e=this.createWorker();e.onReady(()=>{if(this.queue.length>0){const r=this.queue.shift();r&&(e.lock(),r.resolve(e))}}),this.workerPool.push(e)}}async parse(e,r){const n=await this.acquireParserWorker(r),i=new Mh;let a;const s=r.onCancellationRequested(()=>{a=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(o=>{const l=this.hydrator.hydrate(o);i.resolve(l)}).catch(o=>{i.reject(o)}).finally(()=>{s.dispose(),clearTimeout(a)}),i.promise}terminateWorker(e){e.terminate();const r=this.workerPool.indexOf(e);r>=0&&this.workerPool.splice(r,1)}async acquireParserWorker(e){this.initializeWorkers();for(const n of this.workerPool)if(n.ready)return n.lock(),n;const r=new Mh;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(Vc)}),this.queue.push(r),r.promise}},A(n2,"AbstractThreadedAsyncParser"),n2),i2,D4t=(i2=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new A7.Emitter,this.deferred=new Mh,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(a=>{const s=a;this.deferred.resolve(s),this.unlock()}),n(a=>{this.deferred.reject(a),this.unlock()})}terminate(){this.deferred.reject(Vc),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw new Error("Parser worker is busy");return this._parsing=!0,this.deferred=new Mh,this.sendMessage(e),this.deferred.promise}},A(i2,"ParserWorker"),i2),a2,Y5e=(a2=class{constructor(){this.previousTokenSource=new zn.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=k7();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=zn.CancellationToken.None){const i=new Mh,a={action:r,deferred:i,cancellationToken:n};return e.push(a),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{const a=await Promise.resolve().then(()=>r(i));n.resolve(a)}catch(a){Pg(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},A(a2,"DefaultWorkspaceLock"),a2),s2,X5e=(s2=class{constructor(e){this.grammarElementIdMap=new d6,this.tokenTypeIdMap=new d6,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>({...r,message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const r=new Map,n=new Map;for(const i of rc(e))r.set(i,{});if(e.$cstNode)for(const i of Jb(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Hi(o)?s.push(this.dehydrateAstNode(o,r)):Bs(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else Hi(a)?n[i]=this.dehydrateAstNode(a,r):Bs(a)?n[i]=this.dehydrateReference(a,r):a!==void 0&&(n[i]=a);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return kL(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Ch(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):vg(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){const r=new Map,n=new Map;for(const a of rc(e))r.set(a,{});let i;if(e.$cstNode)for(const a of Jb(e.$cstNode)){let s;"fullText"in a?(s=new Mq(a.fullText),i=s):"content"in a?s=new b7:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(n.set(a,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)Hi(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):Bs(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else Hi(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):Bs(a)?n[i]=this.hydrateReference(a,n,i,r):a!==void 0&&(n[i]=a);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){const i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),Ch(i))for(const a of e.content){const s=this.hydrateCstNode(a,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,l=e.endColumn,u=e.hidden;return new o6(n,i,{start:{line:a,character:s},end:{line:o,character:l}},r,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const r of rc(this.grammar))SL(r)&&this.grammarElementIdMap.set(r,e++)}},A(s2,"DefaultHydrator"),s2);function La(t){return{documentation:{CommentProvider:A(e=>new q5e(e),"CommentProvider"),DocumentationProvider:A(e=>new H5e(e),"DocumentationProvider")},parser:{AsyncParser:A(e=>new U5e(e),"AsyncParser"),GrammarConfig:A(e=>SH(e),"GrammarConfig"),LangiumParser:A(e=>Pq(e),"LangiumParser"),CompletionParser:A(e=>$q(e),"CompletionParser"),ValueConverter:A(()=>new Fq,"ValueConverter"),TokenBuilder:A(()=>new w7,"TokenBuilder"),Lexer:A(e=>new Zq(e),"Lexer"),ParserErrorMessageProvider:A(()=>new Nq,"ParserErrorMessageProvider"),LexerErrorMessageProvider:A(()=>new N5e,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:A(()=>new _5e,"AstNodeLocator"),AstNodeDescriptionProvider:A(e=>new E5e(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:A(e=>new A5e(e),"ReferenceDescriptionProvider")},references:{Linker:A(e=>new p5e(e),"Linker"),NameProvider:A(()=>new g5e,"NameProvider"),ScopeProvider:A(e=>new x5e(e),"ScopeProvider"),ScopeComputation:A(e=>new y5e(e),"ScopeComputation"),References:A(e=>new m5e(e),"References")},serializer:{Hydrator:A(e=>new X5e(e),"Hydrator"),JsonSerializer:A(e=>new T5e(e),"JsonSerializer")},validation:{DocumentValidator:A(e=>new S5e(e),"DocumentValidator"),ValidationRegistry:A(e=>new C5e(e),"ValidationRegistry")},shared:A(()=>t.shared,"shared")}}A(La,"createDefaultCoreModule");function Ma(t){return{ServiceRegistry:A(e=>new w5e(e),"ServiceRegistry"),workspace:{LangiumDocuments:A(e=>new f5e(e),"LangiumDocuments"),LangiumDocumentFactory:A(e=>new d5e(e),"LangiumDocumentFactory"),DocumentBuilder:A(e=>new L5e(e),"DocumentBuilder"),IndexManager:A(e=>new M5e(e),"IndexManager"),WorkspaceManager:A(e=>new I5e(e),"WorkspaceManager"),FileSystemProvider:A(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:A(()=>new Y5e,"WorkspaceLock"),ConfigurationProvider:A(e=>new R5e(e),"ConfigurationProvider")},profilers:{}}}A(Ma,"createDefaultSharedCoreModule");var aB;(function(t){t.merge=(e,r)=>ix(ix({},e),r)})(aB||(aB={}));function tn(t,e,r,n,i,a,s,o,l){const u=[t,e,r,n,i,a,s,o,l].reduce(ix,{});return aU(u)}A(tn,"inject");var j5e=Symbol("isProxy");function iU(t){if(t&&t[j5e])for(const e of Object.values(t))iU(e);return t}A(iU,"eagerLoad");function aU(t,e){const r=new Proxy({},{deleteProperty:A(()=>!1,"deleteProperty"),set:A(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:A((n,i)=>i===j5e?!0:sB(n,i,t,e||r),"get"),getOwnPropertyDescriptor:A((n,i)=>(sB(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:A((n,i)=>i in t,"has"),ownKeys:A(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}A(aU,"_inject");var ene=Symbol();function sB(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+t[e]);if(t[e]===ene)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){const i=r[e];t[e]=ene;try{t[e]=typeof i=="function"?i(n):aU(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}A(sB,"_resolve");function ix(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!=null)if(typeof n=="object"){const i=t[r];typeof i=="object"&&i!==null?t[r]=ix(i,n):t[r]=ix({},n)}else t[r]=n}return t}A(ix,"_merge");var oB={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},n0;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(n0||(n0={}));var o2,K5e=(o2=class extends w7{constructor(e=oB){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...oB,...e},this.indentTokenType=Sy({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=Sy({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!_7(n))throw new Error("Invalid tokens built by default builder");const{indentTokenName:i,dedentTokenName:a,whitespaceTokenName:s,ignoreIndentationDelimiters:o}=this.options;let l,u,h;const d=[];for(const f of n){for(const[p,g]of o)f.name===p?f.PUSH_MODE=n0.IGNORE_INDENTATION:f.name===g&&(f.POP_MODE=!0);f.name===a?l=f:f.name===i?u=f:f.name===s?h=f:d.push(f)}if(!l||!u||!h)throw new Error("Some indentation/whitespace tokens not found!");return o.length>0?{modes:{[n0.REGULAR]:[l,u,...d,h],[n0.IGNORE_INDENTATION]:[...d,h]},defaultMode:n0.REGULAR}:[l,u,h,...d]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,r){return r===0||`\r
`.includes(e[r-1])}matchWhitespace(e,r,n,i){this.whitespaceRegExp.lastIndex=r;const a=this.whitespaceRegExp.exec(e);return{currIndentLevel:(a==null?void 0:a[0].length)??0,prevIndentLevel:this.indentationStack.at(-1),match:a}}createIndentationTokenInstance(e,r,n,i){const a=this.getLineNumber(r,i);return GS(e,n,i,i+n.length,a,a,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,i){if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);return a<=s?null:(this.indentationStack.push(a),o)}dedentMatcher(e,r,n,i){var d,f;if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:s,match:o}=this.matchWhitespace(e,r,n,i);if(a>=s)return null;const l=this.indentationStack.lastIndexOf(a);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${a} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:((d=o==null?void 0:o[0])==null?void 0:d.length)??0,line:this.getLineNumber(e,r),column:1}),null;const u=this.indentationStack.length-l-1,h=((f=e.substring(0,r).match(/[\r\n]+$/))==null?void 0:f[0].length)??1;for(let p=0;p<u;p++){const g=this.createIndentationTokenInstance(this.dedentTokenType,e,"",r-(h-1));n.push(g),this.indentationStack.pop()}return null}buildTerminalToken(e){const r=super.buildTerminalToken(e),{indentTokenName:n,dedentTokenName:i,whitespaceTokenName:a}=this.options;return r.name===n?this.indentTokenType:r.name===i?this.dedentTokenType:r.name===a?Sy({name:a,pattern:this.whitespaceRegExp,group:Gs.SKIPPED}):r}flushRemainingDedents(e){const r=[];for(;this.indentationStack.length>1;)r.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length)),this.indentationStack.pop();return this.indentationStack=[0],r}},A(o2,"IndentationAwareTokenBuilder"),o2),l2,O4t=(l2=class extends Zq{constructor(e){if(super(e),e.parser.TokenBuilder instanceof K5e)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=Kq){const n=super.tokenize(e),i=n.report;(r==null?void 0:r.mode)==="full"&&n.tokens.push(...i.remainingDedents),i.remainingDedents=[];const{indentTokenType:a,dedentTokenType:s}=this.indentationTokenBuilder,o=a.tokenTypeIdx,l=s.tokenTypeIdx,u=[],h=n.tokens.length-1;for(let d=0;d<h;d++){const f=n.tokens[d],p=n.tokens[d+1];if(f.tokenTypeIdx===o&&p.tokenTypeIdx===l){d++;continue}u.push(f)}return h>=0&&u.push(n.tokens[h]),n.tokens=u,n}},A(l2,"IndentationAwareLexer"),l2),sU={};Df(sU,{AstUtils:()=>RW,BiMap:()=>d6,Cancellation:()=>zn,ContextCache:()=>E7,CstUtils:()=>EW,DONE_RESULT:()=>Is,Deferred:()=>Mh,Disposable:()=>p0,DisposableCache:()=>S7,DocumentCache:()=>b5e,EMPTY_STREAM:()=>Xb,ErrorWithLocation:()=>IL,GrammarUtils:()=>aH,MultiMap:()=>Ih,OperationCancelled:()=>Vc,Reduction:()=>hk,RegExpUtils:()=>oH,SimpleCache:()=>qq,StreamImpl:()=>zc,TreeStreamImpl:()=>jb,URI:()=>Bo,UriTrie:()=>Wq,UriUtils:()=>Fs,WorkspaceCache:()=>Uq,assertCondition:()=>sH,assertUnreachable:()=>Of,delayNextTick:()=>C7,interruptAndCheck:()=>va,isOperationCancelled:()=>Pg,loadGrammarFromJson:()=>Ia,setInterruptionPeriod:()=>zq,startCancelableOperation:()=>k7,stream:()=>Sn});TL(sU,A7);var c2,Z5e=(c2=class{stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},A(c2,"EmptyFileSystemProvider"),c2),ns={fileSystemProvider:A(()=>new Z5e,"fileSystemProvider")},$4t={Grammar:A(()=>{},"Grammar"),LanguageMetaData:A(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},P4t={AstReflection:A(()=>new KW,"AstReflection")};function Q5e(){const t=tn(Ma(ns),P4t),e=tn(La({shared:t}),$4t);return t.ServiceRegistry.register(e),e}A(Q5e,"createMinimalGrammarServices");function Ia(t){const e=Q5e(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,Bo.parse(`memory:/${r.name??"grammar"}.langium`)),r}A(Ia,"loadGrammarFromJson");TL(cbe,sU);var u2,B4t=(u2=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new Ih}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(r=>this.activeCategories.add(r)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(r=>this.activeCategories.delete(r)):this.activeCategories.clear()}createTask(e,r){if(!this.isActive(e))throw new Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${r}'.`),new J5e(n=>this.records.add(e,this.dumpRecord(e,n)),r)}dumpRecord(e,r){console.info(`Task ${e}.${r.identifier} executed in ${r.duration.toFixed(2)}ms and ended at ${r.date.toISOString()}`);const n=[];for(const s of r.entries.keys()){const o=r.entries.get(s),l=o.reduce((u,h)=>u+h);n.push({name:`${r.identifier}.${s}`,count:o.length,duration:l})}const i=r.duration-n.map(s=>s.duration).reduce((s,o)=>s+o,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((s,o)=>o.duration-s.duration);function a(s){return Math.round(100*s)/100}return A(a,"Round"),console.table(n.map(s=>({Element:s.name,Count:s.count,"Self %":a(100*s.duration/r.duration),"Time (ms)":a(s.duration)}))),r}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(r=>e.some(n=>n===r[0])).flatMap(r=>r[1])}},A(u2,"DefaultLangiumProfiler"),u2),h2,J5e=(h2=class{constructor(e,r){this.stack=[],this.entries=new Ih,this.addRecord=e,this.identifier=r}start(){if(this.startTime!==void 0)throw new Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw new Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(r=>r.id).join(", ")}.`);const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const r=this.stack.pop();if(!r)throw new Error(`Task "${this.identifier}.${e}" was not started.`);if(r.id!==e)throw new Error(`Sub-Task "${r.id}" is not already stopped.`);const n=performance.now()-r.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);const i=n-r.content;this.entries.add(e,i)}},A(h2,"ProfilingTask"),h2),lB;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[\w ]+)\]/}})(lB||(lB={}));var cB;(t=>{t.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(cB||(cB={}));var uB;(t=>{t.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(uB||(uB={}));var hB;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(hB||(hB={}));var dB;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(dB||(dB={}));var fB;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(fB||(fB={}));var pB;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(pB||(pB={}));var gB;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(gB||(gB={}));var mB;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(mB||(mB={}));var yB;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(yB||(yB={}));var vB;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(vB||(vB={}));var bB;(t=>{t.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(bB||(bB={}));var xB;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(xB||(xB={}));var TB;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(TB||(TB={}));var wB;(t=>{t.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+</,LINK_ARROW:/-->|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(wB||(wB={}));({...lB.Terminals,...cB.Terminals,...uB.Terminals,...hB.Terminals,...dB.Terminals,...fB.Terminals,...pB.Terminals,...gB.Terminals,...mB.Terminals,...yB.Terminals,...vB.Terminals,...bB.Terminals,...TB.Terminals,...xB.Terminals,...wB.Terminals});var tne={$type:"AbnfAlternation",alternatives:"alternatives"},rne={$type:"AbnfConcatenation",elements:"elements"},vN={$type:"AbnfElement",primary:"primary",repeat:"repeat"},nne={$type:"AbnfGroup",element:"element"},ine={$type:"AbnfNumVal",value:"value"},ane={$type:"AbnfOptionalGroup",element:"element"},nm={$type:"AbnfPrimary"},bN={$type:"AbnfRule",definition:"definition",name:"name"},sne={$type:"AbnfRuleName",name:"name"},one={$type:"AbnfStringLiteral",value:"value"},h4={$type:"Accelerator",name:"name",x:"x",y:"y"},xN={$type:"Alignment",direction:"direction",members:"members"},d4={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},kT={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},TN={$type:"Annotations",x:"x",y:"y"},Sc={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function F4t(t){return Pi.isInstance(t,Sc.$type)}A(F4t,"isArchitecture");var f4={$type:"Axis",label:"label",name:"name"},G3={$type:"Branch",name:"name",order:"order"};function z4t(t){return Pi.isInstance(t,G3.$type)}A(z4t,"isBranch");var lne={$type:"Checkout",branch:"branch"},p4={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},wN={$type:"ClassDefStatement",className:"className",styleText:"styleText"},_m={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function V4t(t){return Pi.isInstance(t,_m.$type)}A(V4t,"isCommit");var g4={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},Qf={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},m4={$type:"Curve",entries:"entries",label:"label",name:"name"},yp={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function G4t(t){return Pi.isInstance(t,yp.$type)}A(G4t,"isCynefin");var y4={$type:"Deaccelerator",name:"name",x:"x",y:"y"},cne={$type:"Decorator",strategy:"strategy"},im={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},W3={$type:"DomainBlock",domain:"domain",items:"items"};function W4t(t){return Pi.isInstance(t,W3.$type)}A(W4t,"isDomainBlock");var CB={$type:"DomainItem",label:"label"};function H4t(t){return Pi.isInstance(t,CB.$type)}A(H4t,"isDomainItem");var une={$type:"EbnfChoice",alternatives:"alternatives"},hne={$type:"EbnfExceptionPostfix",except:"except"},dne={$type:"EbnfGroup",element:"element"},fne={$type:"EbnfNonTerminal",name:"name"},pne={$type:"EbnfOneOrMorePostfix",operator:"operator"},gne={$type:"EbnfOptional",element:"element"},mne={$type:"EbnfOptionalPostfix",operator:"operator"},ST={$type:"EbnfPostfix"},Jf={$type:"EbnfPrimary"},yne={$type:"EbnfRepetition",element:"element"},CN={$type:"EbnfRule",definition:"definition",name:"name"},vne={$type:"EbnfSequence",elements:"elements"},bne={$type:"EbnfSpecial",text:"text"},kN={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},xne={$type:"EbnfTerminal",value:"value"},Tne={$type:"EbnfZeroOrMorePostfix",operator:"operator"},bc={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},am={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},ep={$type:"EmFrame"},ET={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},wne={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},SN={$type:"EmModelEntity",name:"name"};function q4t(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}A(q4t,"isEmModelEntityType");var v4={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},zu={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function eAe(t){return Pi.isInstance(t,zu.$type)}A(eAe,"isEmResetFrame");var od={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},EN={$type:"Entry",axis:"axis",value:"value"},Mu={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},Cne={$type:"Evolution",stages:"stages"},b4={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},AN={$type:"Evolve",component:"component",target:"target"},vp={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function U4t(t){return Pi.isInstance(t,vp.$type)}A(U4t,"isGitGraph");var AT={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},fw={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function Y4t(t){return Pi.isInstance(t,fw.$type)}A(Y4t,"isInfo");var _T={$type:"Item",classSelector:"classSelector",name:"name"},_N={$type:"Junction",id:"id",in:"in"},RT={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},x4={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},tp={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},Rm={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function X4t(t){return Pi.isInstance(t,Rm.$type)}A(X4t,"isMerge");var T4={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},RN={$type:"Option",name:"name",value:"value"},Lm={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function j4t(t){return Pi.isInstance(t,Lm.$type)}A(j4t,"isPacket");var Mm={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function K4t(t){return Pi.isInstance(t,Mm.$type)}A(K4t,"isPacketBlock");var kne={$type:"PegAny",dot:"dot"},Sne={$type:"PegGroup",element:"element"},Ene={$type:"PegIdentifier",name:"name"},Ane={$type:"PegLiteral",value:"value"},_ne={$type:"PegOrderedChoice",alternatives:"alternatives"},LN={$type:"PegPrefix",operator:"operator",suffix:"suffix"},LT={$type:"PegPrimary"},MN={$type:"PegRule",definition:"definition",name:"name"},Rne={$type:"PegSequence",elements:"elements"},IN={$type:"PegSuffix",operator:"operator",primary:"primary"},bp={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function Z4t(t){return Pi.isInstance(t,bp.$type)}A(Z4t,"isPie");var H3={$type:"PieSection",label:"label",value:"value"};function Q4t(t){return Pi.isInstance(t,H3.$type)}A(Q4t,"isPieSection");var NN={$type:"Pipeline",components:"components",parent:"parent"},w4={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},rp={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},Im={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function J4t(t){return Pi.isInstance(t,Im.$type)}A(J4t,"isRailroad");var Nm={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function e3t(t){return Pi.isInstance(t,Nm.$type)}A(e3t,"isRailroadAbnf");var Lne={$type:"RailroadChoiceExpr",alternatives:"alternatives"},Dm={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function t3t(t){return Pi.isInstance(t,Dm.$type)}A(t3t,"isRailroadEbnf");var Iu={$type:"RailroadExpression"},Mne={$type:"RailroadNonTerminalExpr",name:"name"},Ine={$type:"RailroadOneOrMoreExpr",element:"element"},Nne={$type:"RailroadOptionalExpr",element:"element"},Om={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function r3t(t){return Pi.isInstance(t,Om.$type)}A(r3t,"isRailroadPeg");var DN={$type:"RailroadRule",definition:"definition",name:"name"},Dne={$type:"RailroadSequenceExpr",elements:"elements"},One={$type:"RailroadSpecialExpr",text:"text"},$ne={$type:"RailroadTerminalExpr",value:"value"},Pne={$type:"RailroadZeroOrMoreExpr",element:"element"},ON={$type:"Section",classSelector:"classSelector",name:"name"},sm={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},$N={$type:"Size",height:"height",width:"width"},om={$type:"Statement"},pw={$type:"Transition",from:"from",label:"label",to:"to"};function n3t(t){return Pi.isInstance(t,pw.$type)}A(n3t,"isTransition");var $m={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function i3t(t){return Pi.isInstance(t,$m.$type)}A(i3t,"isTreemap");var PN={$type:"TreemapRow",indent:"indent",item:"item"},lm={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},MT={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},Fa={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};function a3t(t){return Pi.isInstance(t,Fa.$type)}A(a3t,"isWardley");var d2,tAe=(d2=class extends _W{constructor(){super(...arguments),this.types={AbnfAlternation:{name:tne.$type,properties:{alternatives:{name:tne.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:rne.$type,properties:{elements:{name:rne.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:vN.$type,properties:{primary:{name:vN.primary},repeat:{name:vN.repeat}},superTypes:[]},AbnfGroup:{name:nne.$type,properties:{element:{name:nne.element}},superTypes:[nm.$type]},AbnfNumVal:{name:ine.$type,properties:{value:{name:ine.value}},superTypes:[nm.$type]},AbnfOptionalGroup:{name:ane.$type,properties:{element:{name:ane.element}},superTypes:[nm.$type]},AbnfPrimary:{name:nm.$type,properties:{},superTypes:[]},AbnfRule:{name:bN.$type,properties:{definition:{name:bN.definition},name:{name:bN.name}},superTypes:[]},AbnfRuleName:{name:sne.$type,properties:{name:{name:sne.name}},superTypes:[nm.$type]},AbnfStringLiteral:{name:one.$type,properties:{value:{name:one.value}},superTypes:[nm.$type]},Accelerator:{name:h4.$type,properties:{name:{name:h4.name},x:{name:h4.x},y:{name:h4.y}},superTypes:[]},Alignment:{name:xN.$type,properties:{direction:{name:xN.direction},members:{name:xN.members,defaultValue:[]}},superTypes:[]},Anchor:{name:d4.$type,properties:{evolution:{name:d4.evolution},name:{name:d4.name},visibility:{name:d4.visibility}},superTypes:[]},Annotation:{name:kT.$type,properties:{number:{name:kT.number},text:{name:kT.text},x:{name:kT.x},y:{name:kT.y}},superTypes:[]},Annotations:{name:TN.$type,properties:{x:{name:TN.x},y:{name:TN.y}},superTypes:[]},Architecture:{name:Sc.$type,properties:{accDescr:{name:Sc.accDescr},accTitle:{name:Sc.accTitle},alignments:{name:Sc.alignments,defaultValue:[]},edges:{name:Sc.edges,defaultValue:[]},groups:{name:Sc.groups,defaultValue:[]},junctions:{name:Sc.junctions,defaultValue:[]},services:{name:Sc.services,defaultValue:[]},title:{name:Sc.title}},superTypes:[]},Axis:{name:f4.$type,properties:{label:{name:f4.label},name:{name:f4.name}},superTypes:[]},Branch:{name:G3.$type,properties:{name:{name:G3.name},order:{name:G3.order}},superTypes:[om.$type]},Checkout:{name:lne.$type,properties:{branch:{name:lne.branch}},superTypes:[om.$type]},CherryPicking:{name:p4.$type,properties:{id:{name:p4.id},parent:{name:p4.parent},tags:{name:p4.tags,defaultValue:[]}},superTypes:[om.$type]},ClassDefStatement:{name:wN.$type,properties:{className:{name:wN.className},styleText:{name:wN.styleText}},superTypes:[]},Commit:{name:_m.$type,properties:{id:{name:_m.id},message:{name:_m.message},tags:{name:_m.tags,defaultValue:[]},type:{name:_m.type}},superTypes:[om.$type]},Common:{name:g4.$type,properties:{accDescr:{name:g4.accDescr},accTitle:{name:g4.accTitle},title:{name:g4.title}},superTypes:[]},Component:{name:Qf.$type,properties:{decorator:{name:Qf.decorator},evolution:{name:Qf.evolution},inertia:{name:Qf.inertia,defaultValue:!1},label:{name:Qf.label},name:{name:Qf.name},visibility:{name:Qf.visibility}},superTypes:[]},Curve:{name:m4.$type,properties:{entries:{name:m4.entries,defaultValue:[]},label:{name:m4.label},name:{name:m4.name}},superTypes:[]},Cynefin:{name:yp.$type,properties:{accDescr:{name:yp.accDescr},accTitle:{name:yp.accTitle},domains:{name:yp.domains,defaultValue:[]},title:{name:yp.title},transitions:{name:yp.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:y4.$type,properties:{name:{name:y4.name},x:{name:y4.x},y:{name:y4.y}},superTypes:[]},Decorator:{name:cne.$type,properties:{strategy:{name:cne.strategy}},superTypes:[]},Direction:{name:im.$type,properties:{accDescr:{name:im.accDescr},accTitle:{name:im.accTitle},dir:{name:im.dir},statements:{name:im.statements,defaultValue:[]},title:{name:im.title}},superTypes:[vp.$type]},DomainBlock:{name:W3.$type,properties:{domain:{name:W3.domain},items:{name:W3.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:CB.$type,properties:{label:{name:CB.label}},superTypes:[]},EbnfChoice:{name:une.$type,properties:{alternatives:{name:une.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:hne.$type,properties:{except:{name:hne.except}},superTypes:[ST.$type]},EbnfGroup:{name:dne.$type,properties:{element:{name:dne.element}},superTypes:[Jf.$type]},EbnfNonTerminal:{name:fne.$type,properties:{name:{name:fne.name}},superTypes:[Jf.$type]},EbnfOneOrMorePostfix:{name:pne.$type,properties:{operator:{name:pne.operator}},superTypes:[ST.$type]},EbnfOptional:{name:gne.$type,properties:{element:{name:gne.element}},superTypes:[Jf.$type]},EbnfOptionalPostfix:{name:mne.$type,properties:{operator:{name:mne.operator}},superTypes:[ST.$type]},EbnfPostfix:{name:ST.$type,properties:{},superTypes:[]},EbnfPrimary:{name:Jf.$type,properties:{},superTypes:[]},EbnfRepetition:{name:yne.$type,properties:{element:{name:yne.element}},superTypes:[Jf.$type]},EbnfRule:{name:CN.$type,properties:{definition:{name:CN.definition},name:{name:CN.name}},superTypes:[]},EbnfSequence:{name:vne.$type,properties:{elements:{name:vne.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:bne.$type,properties:{text:{name:bne.text}},superTypes:[Jf.$type]},EbnfTerm:{name:kN.$type,properties:{base:{name:kN.base},postfixes:{name:kN.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:xne.$type,properties:{value:{name:xne.value}},superTypes:[Jf.$type]},EbnfZeroOrMorePostfix:{name:Tne.$type,properties:{operator:{name:Tne.operator}},superTypes:[ST.$type]},Edge:{name:bc.$type,properties:{lhsDir:{name:bc.lhsDir},lhsGroup:{name:bc.lhsGroup,defaultValue:!1},lhsId:{name:bc.lhsId},lhsInto:{name:bc.lhsInto,defaultValue:!1},rhsDir:{name:bc.rhsDir},rhsGroup:{name:bc.rhsGroup,defaultValue:!1},rhsId:{name:bc.rhsId},rhsInto:{name:bc.rhsInto,defaultValue:!1},title:{name:bc.title}},superTypes:[]},EmDataEntity:{name:am.$type,properties:{dataBlockValue:{name:am.dataBlockValue},dataType:{name:am.dataType},name:{name:am.name}},superTypes:[]},EmFrame:{name:ep.$type,properties:{},superTypes:[]},EmGwt:{name:ET.$type,properties:{givenStatements:{name:ET.givenStatements,defaultValue:[]},sourceFrame:{name:ET.sourceFrame,referenceType:ep.$type},thenStatements:{name:ET.thenStatements,defaultValue:[]},whenStatements:{name:ET.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:wne.$type,properties:{entityIdentifier:{name:wne.entityIdentifier,referenceType:SN.$type}},superTypes:[]},EmModelEntity:{name:SN.$type,properties:{name:{name:SN.name}},superTypes:[]},EmNoteEntity:{name:v4.$type,properties:{dataBlockValue:{name:v4.dataBlockValue},dataType:{name:v4.dataType},sourceFrame:{name:v4.sourceFrame,referenceType:ep.$type}},superTypes:[]},EmResetFrame:{name:zu.$type,properties:{dataInlineValue:{name:zu.dataInlineValue},dataReference:{name:zu.dataReference,referenceType:am.$type},dataType:{name:zu.dataType},entityIdentifier:{name:zu.entityIdentifier},modelEntityType:{name:zu.modelEntityType},name:{name:zu.name},sourceFrames:{name:zu.sourceFrames,defaultValue:[],referenceType:ep.$type}},superTypes:[ep.$type]},EmTimeFrame:{name:od.$type,properties:{dataInlineValue:{name:od.dataInlineValue},dataReference:{name:od.dataReference,referenceType:am.$type},dataType:{name:od.dataType},entityIdentifier:{name:od.entityIdentifier},modelEntityType:{name:od.modelEntityType},name:{name:od.name},sourceFrames:{name:od.sourceFrames,defaultValue:[],referenceType:ep.$type}},superTypes:[ep.$type]},Entry:{name:EN.$type,properties:{axis:{name:EN.axis,referenceType:f4.$type},value:{name:EN.value}},superTypes:[]},EventModel:{name:Mu.$type,properties:{accDescr:{name:Mu.accDescr},accTitle:{name:Mu.accTitle},dataEntities:{name:Mu.dataEntities,defaultValue:[]},frames:{name:Mu.frames,defaultValue:[]},gwtEntities:{name:Mu.gwtEntities,defaultValue:[]},modelEntities:{name:Mu.modelEntities,defaultValue:[]},noteEntities:{name:Mu.noteEntities,defaultValue:[]},title:{name:Mu.title}},superTypes:[]},Evolution:{name:Cne.$type,properties:{stages:{name:Cne.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:b4.$type,properties:{boundary:{name:b4.boundary},name:{name:b4.name},secondName:{name:b4.secondName}},superTypes:[]},Evolve:{name:AN.$type,properties:{component:{name:AN.component},target:{name:AN.target}},superTypes:[]},GitGraph:{name:vp.$type,properties:{accDescr:{name:vp.accDescr},accTitle:{name:vp.accTitle},statements:{name:vp.statements,defaultValue:[]},title:{name:vp.title}},superTypes:[]},Group:{name:AT.$type,properties:{icon:{name:AT.icon},id:{name:AT.id},in:{name:AT.in},title:{name:AT.title}},superTypes:[]},Info:{name:fw.$type,properties:{accDescr:{name:fw.accDescr},accTitle:{name:fw.accTitle},title:{name:fw.title}},superTypes:[]},Item:{name:_T.$type,properties:{classSelector:{name:_T.classSelector},name:{name:_T.name}},superTypes:[]},Junction:{name:_N.$type,properties:{id:{name:_N.id},in:{name:_N.in}},superTypes:[]},Label:{name:RT.$type,properties:{negX:{name:RT.negX,defaultValue:!1},negY:{name:RT.negY,defaultValue:!1},offsetX:{name:RT.offsetX},offsetY:{name:RT.offsetY}},superTypes:[]},Leaf:{name:x4.$type,properties:{classSelector:{name:x4.classSelector},name:{name:x4.name},value:{name:x4.value}},superTypes:[_T.$type]},Link:{name:tp.$type,properties:{arrow:{name:tp.arrow},from:{name:tp.from},fromPort:{name:tp.fromPort},linkLabel:{name:tp.linkLabel},to:{name:tp.to},toPort:{name:tp.toPort}},superTypes:[]},Merge:{name:Rm.$type,properties:{branch:{name:Rm.branch},id:{name:Rm.id},tags:{name:Rm.tags,defaultValue:[]},type:{name:Rm.type}},superTypes:[om.$type]},Note:{name:T4.$type,properties:{evolution:{name:T4.evolution},text:{name:T4.text},visibility:{name:T4.visibility}},superTypes:[]},Option:{name:RN.$type,properties:{name:{name:RN.name},value:{name:RN.value,defaultValue:!1}},superTypes:[]},Packet:{name:Lm.$type,properties:{accDescr:{name:Lm.accDescr},accTitle:{name:Lm.accTitle},blocks:{name:Lm.blocks,defaultValue:[]},title:{name:Lm.title}},superTypes:[]},PacketBlock:{name:Mm.$type,properties:{bits:{name:Mm.bits},end:{name:Mm.end},label:{name:Mm.label},start:{name:Mm.start}},superTypes:[]},PegAny:{name:kne.$type,properties:{dot:{name:kne.dot}},superTypes:[LT.$type]},PegGroup:{name:Sne.$type,properties:{element:{name:Sne.element}},superTypes:[LT.$type]},PegIdentifier:{name:Ene.$type,properties:{name:{name:Ene.name}},superTypes:[LT.$type]},PegLiteral:{name:Ane.$type,properties:{value:{name:Ane.value}},superTypes:[LT.$type]},PegOrderedChoice:{name:_ne.$type,properties:{alternatives:{name:_ne.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:LN.$type,properties:{operator:{name:LN.operator},suffix:{name:LN.suffix}},superTypes:[]},PegPrimary:{name:LT.$type,properties:{},superTypes:[]},PegRule:{name:MN.$type,properties:{definition:{name:MN.definition},name:{name:MN.name}},superTypes:[]},PegSequence:{name:Rne.$type,properties:{elements:{name:Rne.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:IN.$type,properties:{operator:{name:IN.operator},primary:{name:IN.primary}},superTypes:[]},Pie:{name:bp.$type,properties:{accDescr:{name:bp.accDescr},accTitle:{name:bp.accTitle},sections:{name:bp.sections,defaultValue:[]},showData:{name:bp.showData,defaultValue:!1},title:{name:bp.title}},superTypes:[]},PieSection:{name:H3.$type,properties:{label:{name:H3.label},value:{name:H3.value}},superTypes:[]},Pipeline:{name:NN.$type,properties:{components:{name:NN.components,defaultValue:[]},parent:{name:NN.parent}},superTypes:[]},PipelineComponent:{name:w4.$type,properties:{evolution:{name:w4.evolution},label:{name:w4.label},name:{name:w4.name}},superTypes:[]},Radar:{name:rp.$type,properties:{accDescr:{name:rp.accDescr},accTitle:{name:rp.accTitle},axes:{name:rp.axes,defaultValue:[]},curves:{name:rp.curves,defaultValue:[]},options:{name:rp.options,defaultValue:[]},title:{name:rp.title}},superTypes:[]},Railroad:{name:Im.$type,properties:{accDescr:{name:Im.accDescr},accTitle:{name:Im.accTitle},rules:{name:Im.rules,defaultValue:[]},title:{name:Im.title}},superTypes:[]},RailroadAbnf:{name:Nm.$type,properties:{accDescr:{name:Nm.accDescr},accTitle:{name:Nm.accTitle},rules:{name:Nm.rules,defaultValue:[]},title:{name:Nm.title}},superTypes:[]},RailroadChoiceExpr:{name:Lne.$type,properties:{alternatives:{name:Lne.alternatives,defaultValue:[]}},superTypes:[Iu.$type]},RailroadEbnf:{name:Dm.$type,properties:{accDescr:{name:Dm.accDescr},accTitle:{name:Dm.accTitle},rules:{name:Dm.rules,defaultValue:[]},title:{name:Dm.title}},superTypes:[]},RailroadExpression:{name:Iu.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:Mne.$type,properties:{name:{name:Mne.name}},superTypes:[Iu.$type]},RailroadOneOrMoreExpr:{name:Ine.$type,properties:{element:{name:Ine.element}},superTypes:[Iu.$type]},RailroadOptionalExpr:{name:Nne.$type,properties:{element:{name:Nne.element}},superTypes:[Iu.$type]},RailroadPeg:{name:Om.$type,properties:{accDescr:{name:Om.accDescr},accTitle:{name:Om.accTitle},rules:{name:Om.rules,defaultValue:[]},title:{name:Om.title}},superTypes:[]},RailroadRule:{name:DN.$type,properties:{definition:{name:DN.definition},name:{name:DN.name}},superTypes:[]},RailroadSequenceExpr:{name:Dne.$type,properties:{elements:{name:Dne.elements,defaultValue:[]}},superTypes:[Iu.$type]},RailroadSpecialExpr:{name:One.$type,properties:{text:{name:One.text}},superTypes:[Iu.$type]},RailroadTerminalExpr:{name:$ne.$type,properties:{value:{name:$ne.value}},superTypes:[Iu.$type]},RailroadZeroOrMoreExpr:{name:Pne.$type,properties:{element:{name:Pne.element}},superTypes:[Iu.$type]},Section:{name:ON.$type,properties:{classSelector:{name:ON.classSelector},name:{name:ON.name}},superTypes:[_T.$type]},Service:{name:sm.$type,properties:{icon:{name:sm.icon},iconText:{name:sm.iconText},id:{name:sm.id},in:{name:sm.in},title:{name:sm.title}},superTypes:[]},Size:{name:$N.$type,properties:{height:{name:$N.height},width:{name:$N.width}},superTypes:[]},Statement:{name:om.$type,properties:{},superTypes:[]},Transition:{name:pw.$type,properties:{from:{name:pw.from},label:{name:pw.label},to:{name:pw.to}},superTypes:[]},TreeNode:{name:lm.$type,properties:{classAnnotation:{name:lm.classAnnotation},descAnnotation:{name:lm.descAnnotation},iconAnnotation:{name:lm.iconAnnotation},indent:{name:lm.indent},name:{name:lm.name}},superTypes:[]},TreeView:{name:MT.$type,properties:{accDescr:{name:MT.accDescr},accTitle:{name:MT.accTitle},nodes:{name:MT.nodes,defaultValue:[]},title:{name:MT.title}},superTypes:[]},Treemap:{name:$m.$type,properties:{accDescr:{name:$m.accDescr},accTitle:{name:$m.accTitle},title:{name:$m.title},TreemapRows:{name:$m.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:PN.$type,properties:{indent:{name:PN.indent},item:{name:PN.item}},superTypes:[]},Wardley:{name:Fa.$type,properties:{accDescr:{name:Fa.accDescr},accelerators:{name:Fa.accelerators,defaultValue:[]},accTitle:{name:Fa.accTitle},anchors:{name:Fa.anchors,defaultValue:[]},annotation:{name:Fa.annotation,defaultValue:[]},annotations:{name:Fa.annotations,defaultValue:[]},components:{name:Fa.components,defaultValue:[]},deaccelerators:{name:Fa.deaccelerators,defaultValue:[]},evolution:{name:Fa.evolution},evolves:{name:Fa.evolves,defaultValue:[]},links:{name:Fa.links,defaultValue:[]},notes:{name:Fa.notes,defaultValue:[]},pipelines:{name:Fa.pipelines,defaultValue:[]},size:{name:Fa.size},title:{name:Fa.title}},superTypes:[]}}}},A(d2,"MermaidAstReflection"),d2),Pi=new tAe,Bne,s3t=A(()=>Bne??(Bne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[\\\\w ]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),Fne,o3t=A(()=>Fne??(Fne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"CynefinGrammarGrammar"),zne,l3t=A(()=>zne??(zne=Ia('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar"),Vne,c3t=A(()=>Vne??(Vne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),Gne,u3t=A(()=>Gne??(Gne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),Wne,h3t=A(()=>Wne??(Wne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),Hne,d3t=A(()=>Hne??(Hne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),qne,f3t=A(()=>qne??(qne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),Une,p3t=A(()=>Une??(Une=Ia('{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}')),"RailroadAbnfGrammarGrammar"),Yne,g3t=A(()=>Yne??(Yne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadEbnfGrammarGrammar"),Xne,m3t=A(()=>Xne??(Xne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadGrammarGrammar"),jne,y3t=A(()=>jne??(jne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadPegGrammarGrammar"),Kne,v3t=A(()=>Kne??(Kne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),Zne,b3t=A(()=>Zne??(Zne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar"),Qne,x3t=A(()=>Qne??(Qne=Ia(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'</","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'>/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar"),T3t={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},w3t={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},C3t={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},k3t={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},S3t={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},E3t={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},A3t={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},_3t={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},R3t={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},L3t={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},M3t={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},I3t={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},N3t={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},D3t={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},O3t={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ro={AstReflection:A(()=>new tAe,"AstReflection")},$3t={Grammar:A(()=>s3t(),"Grammar"),LanguageMetaData:A(()=>T3t,"LanguageMetaData"),parser:{}},P3t={Grammar:A(()=>o3t(),"Grammar"),LanguageMetaData:A(()=>w3t,"LanguageMetaData"),parser:{}},B3t={Grammar:A(()=>l3t(),"Grammar"),LanguageMetaData:A(()=>C3t,"LanguageMetaData"),parser:{}},F3t={Grammar:A(()=>c3t(),"Grammar"),LanguageMetaData:A(()=>k3t,"LanguageMetaData"),parser:{}},z3t={Grammar:A(()=>u3t(),"Grammar"),LanguageMetaData:A(()=>S3t,"LanguageMetaData"),parser:{}},V3t={Grammar:A(()=>h3t(),"Grammar"),LanguageMetaData:A(()=>E3t,"LanguageMetaData"),parser:{}},G3t={Grammar:A(()=>d3t(),"Grammar"),LanguageMetaData:A(()=>A3t,"LanguageMetaData"),parser:{}},W3t={Grammar:A(()=>f3t(),"Grammar"),LanguageMetaData:A(()=>_3t,"LanguageMetaData"),parser:{}},H3t={Grammar:A(()=>p3t(),"Grammar"),LanguageMetaData:A(()=>R3t,"LanguageMetaData"),parser:{}},q3t={Grammar:A(()=>g3t(),"Grammar"),LanguageMetaData:A(()=>L3t,"LanguageMetaData"),parser:{}},U3t={Grammar:A(()=>m3t(),"Grammar"),LanguageMetaData:A(()=>M3t,"LanguageMetaData"),parser:{}},Y3t={Grammar:A(()=>y3t(),"Grammar"),LanguageMetaData:A(()=>I3t,"LanguageMetaData"),parser:{}},X3t={Grammar:A(()=>v3t(),"Grammar"),LanguageMetaData:A(()=>N3t,"LanguageMetaData"),parser:{}},j3t={Grammar:A(()=>b3t(),"Grammar"),LanguageMetaData:A(()=>D3t,"LanguageMetaData"),parser:{}},K3t={Grammar:A(()=>x3t(),"Grammar"),LanguageMetaData:A(()=>O3t,"LanguageMetaData"),parser:{}},Z3t=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,Q3t=/accTitle[\t ]*:([^\n\r]*)/,J3t=/title([\t ][^\n\r]*|)/,e5t={ACC_DESCR:Z3t,ACC_TITLE:Q3t,TITLE:J3t},f2,vu=(f2=class extends Fq{runConverter(e,r,n){let i=this.runCommonConverter(e,r,n);return i===void 0&&(i=this.runCustomConverter(e,r,n)),i===void 0?super.runConverter(e,r,n):i}runCommonConverter(e,r,n){const i=e5t[e.name];if(i===void 0)return;const a=i.exec(r);if(a!==null){if(a[1]!==void 0)return a[1].trim().replace(/[\t ]{2,}/gm," ");if(a[2]!==void 0)return a[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,`
`)}}},A(f2,"AbstractMermaidValueConverter"),f2),p2,Ux=(p2=class extends vu{runCustomConverter(e,r,n){}},A(p2,"CommonValueConverter"),p2),g2,no=(g2=class extends w7{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,r,n){const i=super.buildKeywordTokens(e,r,n);return i.forEach(a=>{this.keywords.has(a.name)&&a.PATTERN!==void 0&&(a.PATTERN=new RegExp(a.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},A(g2,"AbstractMermaidTokenBuilder"),g2),m2;m2=class extends no{},A(m2,"CommonTokenBuilder");/*! Bundled license information:
lodash-es/lodash.js:
(**
* @license
* Lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="es" -o ./`
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*)
*/var y2,t5t=(y2=class extends no{constructor(){super(["radar-beta"])}},A(y2,"RadarTokenBuilder"),y2),rAe={parser:{TokenBuilder:A(()=>new t5t,"TokenBuilder"),ValueConverter:A(()=>new Ux,"ValueConverter")}};function nAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),W3t,rAe);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}A(nAe,"createRadarServices");var v2,r5t=(v2=class extends no{constructor(){super(["railroad-beta"])}},A(v2,"RailroadTokenBuilder"),v2),Jne=A(t=>{const e=t.slice(1,-1);let r="";for(let n=0;n<e.length;n++){const i=e[n];if(i==="\\"&&n+1<e.length){n++;const a=e[n];switch(a){case"n":r+=`
`;break;case"r":r+="\r";break;case"t":r+=" ";break;default:r+=a}continue}r+=i}return r},"decodeEscapedString"),b2,n5t=(b2=class extends vu{runConverter(e,r,n){const i=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof i=="string"){const a=i.trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))return Jne(a)}return i}runCustomConverter(e,r,n){if(e.name==="RR_STRING")return Jne(r)}},A(b2,"RailroadValueConverter"),b2),iAe={parser:{TokenBuilder:A(()=>new r5t,"TokenBuilder"),ValueConverter:A(()=>new n5t,"ValueConverter")}};function oU(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),U3t,iAe);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}A(oU,"createRailroadServices");var x2,i5t=(x2=class extends no{constructor(){super(["railroad-ebnf-beta"])}},A(x2,"RailroadEbnfTokenBuilder"),x2),eie=A(t=>{const e=t.slice(1,-1);let r="";for(let n=0;n<e.length;n++){const i=e[n];if(i==="\\"&&n+1<e.length){n++;const a=e[n];switch(a){case"n":r+=`
`;break;case"r":r+="\r";break;case"t":r+=" ";break;default:r+=a}continue}r+=i}return r},"decodeEscapedString"),T2,a5t=(T2=class extends vu{runConverter(e,r,n){const i=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof i=="string"){const a=i.trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))return eie(a)}return i}runCustomConverter(e,r,n){if(e.name==="EBNF_STRING")return eie(r);if(e.name==="EBNF_SPECIAL_SEQUENCE")return r.slice(1,-1).trim()}},A(T2,"RailroadEbnfValueConverter"),T2),aAe={parser:{TokenBuilder:A(()=>new i5t,"TokenBuilder"),ValueConverter:A(()=>new a5t,"ValueConverter")}};function lU(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),q3t,aAe);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}A(lU,"createRailroadEbnfServices");var w2,s5t=(w2=class extends no{constructor(){super(["railroad-abnf-beta"])}},A(w2,"RailroadAbnfTokenBuilder"),w2),C2,o5t=(C2=class extends vu{runConverter(e,r,n){const i=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof i=="string"){const a=i.trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))return a.slice(1,-1)}return i}runCustomConverter(e,r,n){if(e.name==="ABNF_STRING")return r.slice(1,-1)}},A(C2,"RailroadAbnfValueConverter"),C2),sAe={parser:{TokenBuilder:A(()=>new s5t,"TokenBuilder"),ValueConverter:A(()=>new o5t,"ValueConverter")}};function cU(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),H3t,sAe);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}A(cU,"createRailroadAbnfServices");var k2,l5t=(k2=class extends no{constructor(){super(["railroad-peg-beta"])}},A(k2,"RailroadPegTokenBuilder"),k2),tie=A(t=>{const e=t.slice(1,-1);let r="";for(let n=0;n<e.length;n++){const i=e[n];if(i==="\\"&&n+1<e.length){n++;const a=e[n];switch(a){case"n":r+=`
`;break;case"r":r+="\r";break;case"t":r+=" ";break;default:r+=a}continue}r+=i}return r},"decodeEscapedString"),S2,c5t=(S2=class extends vu{runConverter(e,r,n){const i=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof i=="string"){const a=i.trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))return tie(a)}return i}runCustomConverter(e,r,n){if(e.name==="PEG_STRING")return tie(r)}},A(S2,"RailroadPegValueConverter"),S2),oAe={parser:{TokenBuilder:A(()=>new l5t,"TokenBuilder"),ValueConverter:A(()=>new c5t,"ValueConverter")}};function uU(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),Y3t,oAe);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}A(uU,"createRailroadPegServices");var E2,u5t=(E2=class extends no{constructor(){super(["treemap"])}},A(E2,"TreemapTokenBuilder"),E2),h5t=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,A2,d5t=(A2=class extends vu{runCustomConverter(e,r,n){if(e.name==="NUMBER2")return parseFloat(r.replace(/,/g,""));if(e.name==="SEPARATOR")return r.substring(1,r.length-1);if(e.name==="STRING2")return r.substring(1,r.length-1);if(e.name==="INDENTATION")return r.length;if(e.name==="ClassDef"){if(typeof r!="string")return r;const i=h5t.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},A(A2,"TreemapValueConverter"),A2);function lAe(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}A(lAe,"registerValidationChecks");var _2,f5t=(_2=class{checkSingleRoot(e,r){let n;for(const i of e.TreemapRows)i.item&&(n===void 0&&i.indent===void 0?n=0:i.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):n!==void 0&&n>=parseInt(i.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},A(_2,"TreemapValidator"),_2),cAe={parser:{TokenBuilder:A(()=>new u5t,"TokenBuilder"),ValueConverter:A(()=>new d5t,"ValueConverter")},validation:{TreemapValidator:A(()=>new f5t,"TreemapValidator")}};function uAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),X3t,cAe);return e.ServiceRegistry.register(r),lAe(r),{shared:e,Treemap:r}}A(uAe,"createTreemapServices");var R2,p5t=(R2=class extends vu{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},A(R2,"WardleyValueConverter"),R2),hAe={parser:{ValueConverter:A(()=>new p5t,"ValueConverter")}};function dAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),K3t,hAe);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}A(dAe,"createWardleyServices");var L2,g5t=(L2=class extends no{constructor(){super(["cynefin-beta"])}},A(L2,"CynefinTokenBuilder"),L2),fAe={parser:{TokenBuilder:A(()=>new g5t,"TokenBuilder"),ValueConverter:A(()=>new Ux,"ValueConverter")}};function pAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),P3t,fAe);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}A(pAe,"createCynefinServices");var M2,m5t=(M2=class extends no{constructor(){super(["gitGraph"])}},A(M2,"GitGraphTokenBuilder"),M2),gAe={parser:{TokenBuilder:A(()=>new m5t,"TokenBuilder"),ValueConverter:A(()=>new Ux,"ValueConverter")}};function mAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),F3t,gAe);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}A(mAe,"createGitGraphServices");var I2,y5t=(I2=class extends no{constructor(){super(["info","showInfo"])}},A(I2,"InfoTokenBuilder"),I2),yAe={parser:{TokenBuilder:A(()=>new y5t,"TokenBuilder"),ValueConverter:A(()=>new Ux,"ValueConverter")}};function vAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),z3t,yAe);return e.ServiceRegistry.register(r),{shared:e,Info:r}}A(vAe,"createInfoServices");var N2,v5t=(N2=class extends no{constructor(){super(["packet"])}},A(N2,"PacketTokenBuilder"),N2),bAe={parser:{TokenBuilder:A(()=>new v5t,"TokenBuilder"),ValueConverter:A(()=>new Ux,"ValueConverter")}};function xAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),V3t,bAe);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}A(xAe,"createPacketServices");var D2,b5t=(D2=class extends no{constructor(){super(["pie","showData"])}},A(D2,"PieTokenBuilder"),D2),O2,x5t=(O2=class extends vu{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},A(O2,"PieValueConverter"),O2),TAe={parser:{TokenBuilder:A(()=>new b5t,"TokenBuilder"),ValueConverter:A(()=>new x5t,"ValueConverter")}};function wAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),G3t,TAe);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}A(wAe,"createPieServices");var $2,T5t=($2=class extends vu{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return(r==null?void 0:r.length)||0;if(e.name==="QUOTED_NAME")return r.substring(1,r.length-1);if(e.name==="BARE_NAME")return r.replace(/[\t ]+$/,"");if(e.name==="CLASS_ANNOTATION")return r.trim().substring(3).trim();if(e.name==="ICON_ANNOTATION"){const i=r.trim();return i.substring(5,i.length-1)}if(e.name==="DESC_ANNOTATION")return r.trim().substring(2).trim()}},A($2,"TreeViewValueConverter"),$2),P2,w5t=(P2=class extends no{constructor(){super(["treeView-beta"])}},A(P2,"TreeViewTokenBuilder"),P2),CAe={parser:{TokenBuilder:A(()=>new w5t,"TokenBuilder"),ValueConverter:A(()=>new T5t,"ValueConverter")}};function kAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),j3t,CAe);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}A(kAe,"createTreeViewServices");var B2,C5t=(B2=class extends no{constructor(){super(["architecture"])}},A(B2,"ArchitectureTokenBuilder"),B2),F2,k5t=(F2=class extends vu{runCustomConverter(e,r,n){if(e.name==="ARCH_ICON")return r.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return r.replace(/["()]/g,"");if(e.name==="ARCH_TITLE"){let i=r.replace(/^\[|]$/g,"").trim();return(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1),i=i.replace(/\\"/g,'"').replace(/\\'/g,"'")),i.trim()}}},A(F2,"ArchitectureValueConverter"),F2),SAe={parser:{TokenBuilder:A(()=>new C5t,"TokenBuilder"),ValueConverter:A(()=>new k5t,"ValueConverter")}};function EAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),$3t,SAe);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}A(EAe,"createArchitectureServices");var z2,S5t=(z2=class extends no{constructor(){super(["eventmodeling"])}},A(z2,"EventModelingTokenBuilder"),z2),rie=new Set(["cmd","command"]),nie=new Set(["evt","event"]),BN=new Set(["rmo","readmodel"]),iie=new Set(["pcr","processor"]),aie=new Set(["ui"]);function AAe(t){const e=t.validation.EventModelingValidator,r=t.validation.ValidationRegistry;if(r){const n={EmTimeFrame:e.checkSourceFrameTypes.bind(e),EmResetFrame:e.checkSourceFrameTypes.bind(e)};r.register(n,e)}}A(AAe,"registerValidationChecks");var V2,E5t=(V2=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(rie.has(e.modelEntityType)?this.validateSources(e,new Set([...aie,...iie]),"command","ui or processor",r):nie.has(e.modelEntityType)?this.validateSources(e,rie,"event","command",r):BN.has(e.modelEntityType)?this.validateSources(e,nie,"read model","event",r):iie.has(e.modelEntityType)?this.validateSources(e,BN,"processor","read model",r):aie.has(e.modelEntityType)&&this.validateSources(e,BN,"ui","read model",r))}validateSources(e,r,n,i,a){for(const s of e.sourceFrames){const o=s.ref;o!==void 0&&!r.has(o.modelEntityType)&&a("error",`A ${n} can only receive input from a ${i}, not from '${o.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},A(V2,"EventModelingValidator"),V2),_Ae={parser:{TokenBuilder:A(()=>new S5t,"TokenBuilder"),ValueConverter:A(()=>new Ux,"ValueConverter")},validation:{EventModelingValidator:A(()=>new E5t,"EventModelingValidator")}};function RAe(t=ns){const e=tn(Ma(t),ro),r=tn(La({shared:e}),B3t,_Ae);return e.ServiceRegistry.register(r),AAe(r),{shared:e,EventModel:r}}A(RAe,"createEventModelingServices");var Va={},A5t={info:A(async()=>{const{createInfoServices:t}=await tr(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>oPt);return{createInfoServices:r}},void 0,import.meta.url),e=t().Info.parser.LangiumParser;Va.info=e},"info"),packet:A(async()=>{const{createPacketServices:t}=await tr(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>lPt);return{createPacketServices:r}},void 0,import.meta.url),e=t().Packet.parser.LangiumParser;Va.packet=e},"packet"),pie:A(async()=>{const{createPieServices:t}=await tr(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>cPt);return{createPieServices:r}},void 0,import.meta.url),e=t().Pie.parser.LangiumParser;Va.pie=e},"pie"),treeView:A(async()=>{const{createTreeViewServices:t}=await tr(async()=>{const{createTreeViewServices:r}=await Promise.resolve().then(()=>uPt);return{createTreeViewServices:r}},void 0,import.meta.url),e=t().TreeView.parser.LangiumParser;Va.treeView=e},"treeView"),architecture:A(async()=>{const{createArchitectureServices:t}=await tr(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>hPt);return{createArchitectureServices:r}},void 0,import.meta.url),e=t().Architecture.parser.LangiumParser;Va.architecture=e},"architecture"),gitGraph:A(async()=>{const{createGitGraphServices:t}=await tr(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>dPt);return{createGitGraphServices:r}},void 0,import.meta.url),e=t().GitGraph.parser.LangiumParser;Va.gitGraph=e},"gitGraph"),eventmodeling:A(async()=>{const{createEventModelingServices:t}=await tr(async()=>{const{createEventModelingServices:r}=await Promise.resolve().then(()=>fPt);return{createEventModelingServices:r}},void 0,import.meta.url),e=t().EventModel.parser.LangiumParser;Va.eventmodeling=e},"eventmodeling"),radar:A(async()=>{const{createRadarServices:t}=await tr(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>pPt);return{createRadarServices:r}},void 0,import.meta.url),e=t().Radar.parser.LangiumParser;Va.radar=e},"radar"),railroad:A(async()=>{const{createRailroadServices:t}=await tr(async()=>{const{createRailroadServices:r}=await Promise.resolve().then(()=>gPt);return{createRailroadServices:r}},void 0,import.meta.url),e=t().Railroad.parser.LangiumParser;Va.railroad=e},"railroad"),railroadEbnf:A(async()=>{const{createRailroadEbnfServices:t}=await tr(async()=>{const{createRailroadEbnfServices:r}=await Promise.resolve().then(()=>mPt);return{createRailroadEbnfServices:r}},void 0,import.meta.url),e=t().RailroadEbnf.parser.LangiumParser;Va.railroadEbnf=e},"railroadEbnf"),railroadAbnf:A(async()=>{const{createRailroadAbnfServices:t}=await tr(async()=>{const{createRailroadAbnfServices:r}=await Promise.resolve().then(()=>yPt);return{createRailroadAbnfServices:r}},void 0,import.meta.url),e=t().RailroadAbnf.parser.LangiumParser;Va.railroadAbnf=e},"railroadAbnf"),railroadPeg:A(async()=>{const{createRailroadPegServices:t}=await tr(async()=>{const{createRailroadPegServices:r}=await Promise.resolve().then(()=>vPt);return{createRailroadPegServices:r}},void 0,import.meta.url),e=t().RailroadPeg.parser.LangiumParser;Va.railroadPeg=e},"railroadPeg"),treemap:A(async()=>{const{createTreemapServices:t}=await tr(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>bPt);return{createTreemapServices:r}},void 0,import.meta.url),e=t().Treemap.parser.LangiumParser;Va.treemap=e},"treemap"),wardley:A(async()=>{const{createWardleyServices:t}=await tr(async()=>{const{createWardleyServices:r}=await Promise.resolve().then(()=>xPt);return{createWardleyServices:r}},void 0,import.meta.url),e=t().Wardley.parser.LangiumParser;Va.wardley=e},"wardley"),cynefin:A(async()=>{const{createCynefinServices:t}=await tr(async()=>{const{createCynefinServices:r}=await Promise.resolve().then(()=>TPt);return{createCynefinServices:r}},void 0,import.meta.url),e=t().Cynefin.parser.LangiumParser;Va.cynefin=e},"cynefin")};async function Al(t,e){const r=A5t[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);Va[t]||await r();const i=Va[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new US(i);return i.value}A(Al,"parse");var G2,US=(G2=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const a=i.line!==void 0&&!isNaN(i.line)?i.line:"?",s=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${a}, column ${s}: ${i.message}`}).join(`
`),n=e.parserErrors.map(i=>{const a=i.token.startLine!==void 0&&!isNaN(i.token.startLine)?i.token.startLine:"?",s=i.token.startColumn!==void 0&&!isNaN(i.token.startColumn)?i.token.startColumn:"?";return`Parse error on line ${a}, column ${s}: ${i.message}`}).join(`
`);super(`Parsing failed: ${r} ${n}`),this.result=e}},A(G2,"MermaidParseError"),G2),Mn={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},_5t=Vr.gitGraph,Bg=x(()=>ri({..._5t,...Xt().gitGraph}),"getConfig"),Ot=new xW(()=>{const t=Bg(),e=t.mainBranchName,r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function M7(){return Ide({length:7})}x(M7,"getID");function LAe(t,e){const r=Object.create(null);return t.reduce((n,i)=>{const a=e(i);return r[a]||(r[a]=!0,n.push(i)),n},[])}x(LAe,"uniqBy");var R5t=x(function(t){Ot.records.direction=t},"setDirection"),L5t=x(function(t){le.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{Ot.records.options=JSON.parse(t)}catch(e){le.error("error while parsing gitGraph options",e.message)}},"setOptions"),M5t=x(function(){return Ot.records.options},"getOptions"),I5t=x(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;le.info("commit",e,r,n,i),le.debug("Entering commit:",e,r,n,i);const a=Bg();r=At.sanitizeText(r,a),e=At.sanitizeText(e,a),i=i==null?void 0:i.map(o=>At.sanitizeText(o,a));const s={id:r||Ot.records.seq+"-"+M7(),message:e,seq:Ot.records.seq++,type:n??Mn.NORMAL,tags:i??[],parents:Ot.records.head==null?[]:[Ot.records.head.id],branch:Ot.records.currBranch};Ot.records.head=s,le.info("main branch",a.mainBranchName),Ot.records.commits.has(s.id)&&le.warn(`Commit ID ${s.id} already exists`),Ot.records.commits.set(s.id,s),Ot.records.branches.set(Ot.records.currBranch,s.id),le.debug("in pushCommit "+s.id)},"commit"),N5t=x(function(t){let e=t.name;const r=t.order;if(e=At.sanitizeText(e,Bg()),Ot.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);Ot.records.branches.set(e,Ot.records.head!=null?Ot.records.head.id:null),Ot.records.branchConfig.set(e,{name:e,order:r}),MAe(e),le.debug("in createBranch")},"branch"),D5t=x(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,a=Bg();e=At.sanitizeText(e,a),r&&(r=At.sanitizeText(r,a));const s=Ot.records.branches.get(Ot.records.currBranch),o=Ot.records.branches.get(e),l=s?Ot.records.commits.get(s):void 0,u=o?Ot.records.commits.get(o):void 0;if(l&&u&&l.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(Ot.records.currBranch===e){const f=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(l===void 0||!l){const f=new Error(`Incorrect usage of "merge". Current branch (${Ot.records.currBranch})has no commits`);throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},f}if(!Ot.records.branches.has(e)){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},f}if(u===void 0||!u){const f=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},f}if(l===u){const f=new Error('Incorrect usage of "merge". Both branches have same head');throw f.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},f}if(r&&Ot.records.commits.has(r)){const f=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom id");throw f.hash={text:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,token:`merge ${e} ${r} ${n} ${i==null?void 0:i.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${n} ${i==null?void 0:i.join(" ")}`]},f}const h=o||"",d={id:r||`${Ot.records.seq}-${M7()}`,message:`merged branch ${e} into ${Ot.records.currBranch}`,seq:Ot.records.seq++,parents:Ot.records.head==null?[]:[Ot.records.head.id,h],branch:Ot.records.currBranch,type:Mn.MERGE,customType:n,customId:!!r,tags:i??[]};Ot.records.head=d,Ot.records.commits.set(d.id,d),Ot.records.branches.set(Ot.records.currBranch,d.id),le.debug(Ot.records.branches),le.debug("in mergeBranch")},"merge"),O5t=x(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;le.debug("Entering cherryPick:",e,r,n);const a=Bg();if(e=At.sanitizeText(e,a),r=At.sanitizeText(r,a),n=n==null?void 0:n.map(l=>At.sanitizeText(l,a)),i=At.sanitizeText(i,a),!e||!Ot.records.commits.has(e)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},l}const s=Ot.records.commits.get(e);if(s===void 0||!s)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(s.parents)&&s.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=s.branch;if(s.type===Mn.MERGE&&!i)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!r||!Ot.records.commits.has(r)){if(o===Ot.records.currBranch){const d=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const l=Ot.records.branches.get(Ot.records.currBranch);if(l===void 0||!l){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Ot.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const u=Ot.records.commits.get(l);if(u===void 0||!u){const d=new Error(`Incorrect usage of "cherry-pick". Current branch (${Ot.records.currBranch})has no commits`);throw d.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]},d}const h={id:Ot.records.seq+"-"+M7(),message:`cherry-picked ${s==null?void 0:s.message} into ${Ot.records.currBranch}`,seq:Ot.records.seq++,parents:Ot.records.head==null?[]:[Ot.records.head.id,s.id],branch:Ot.records.currBranch,type:Mn.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${s.id}${s.type===Mn.MERGE?`|parent:${i}`:""}`]};Ot.records.head=h,Ot.records.commits.set(h.id,h),Ot.records.branches.set(Ot.records.currBranch,h.id),le.debug(Ot.records.branches),le.debug("in cherryPick")}},"cherryPick"),MAe=x(function(t){if(t=At.sanitizeText(t,Bg()),Ot.records.branches.has(t)){Ot.records.currBranch=t;const e=Ot.records.branches.get(Ot.records.currBranch);e===void 0||!e?Ot.records.head=null:Ot.records.head=Ot.records.commits.get(e)??null}else{const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},e}},"checkout");function kB(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}x(kB,"upsert");function hU(t){const e=t.reduce((i,a)=>i.seq>a.seq?i:a,t[0]);let r="";t.forEach(function(i){i===e?r+=" *":r+=" |"});const n=[r,e.id,e.seq];for(const i in Ot.records.branches)Ot.records.branches.get(i)===e.id&&n.push(i);if(le.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=Ot.records.commits.get(e.parents[0]);kB(t,e,i),e.parents[1]&&t.push(Ot.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){const i=Ot.records.commits.get(e.parents[0]);kB(t,e,i)}}t=LAe(t,i=>i.id),hU(t)}x(hU,"prettyPrintCommitHistory");var $5t=x(function(){le.debug(Ot.records.commits);const t=IAe()[0];hU([t])},"prettyPrint"),P5t=x(function(){Ot.reset(),On()},"clear"),B5t=x(function(){return[...Ot.records.branchConfig.values()].map((e,r)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${r}`)}).sort((e,r)=>(e.order??0)-(r.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),F5t=x(function(){return Ot.records.branches},"getBranches"),z5t=x(function(){return Ot.records.commits},"getCommits"),IAe=x(function(){const t=[...Ot.records.commits.values()];return t.forEach(function(e){le.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),V5t=x(function(){return Ot.records.currBranch},"getCurrentBranch"),G5t=x(function(){return Ot.records.direction},"getDirection"),W5t=x(function(){return Ot.records.head},"getHead"),NAe={commitType:Mn,getConfig:Bg,setDirection:R5t,setOptions:L5t,getOptions:M5t,commit:I5t,branch:N5t,merge:D5t,cherryPick:O5t,checkout:MAe,prettyPrint:$5t,clear:P5t,getBranchesAsObjArray:B5t,getBranches:F5t,getCommits:z5t,getCommitsArray:IAe,getCurrentBranch:V5t,getDirection:G5t,getHead:W5t,setAccTitle:Hn,getAccTitle:ni,getAccDescription:ai,setAccDescription:ii,setDiagramTitle:ti,getDiagramTitle:Yn},H5t=x((t,e)=>{eo(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)q5t(r,e)},"populate"),q5t=x((t,e)=>{const n={Commit:x(i=>e.commit(U5t(i)),"Commit"),Branch:x(i=>e.branch(Y5t(i)),"Branch"),Merge:x(i=>e.merge(X5t(i)),"Merge"),Checkout:x(i=>e.checkout(j5t(i)),"Checkout"),CherryPicking:x(i=>e.cherryPick(K5t(i)),"CherryPicking")}[t.$type];n?n(t):le.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),U5t=x(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?Mn[t.type]:Mn.NORMAL,tags:t.tags??void 0}),"parseCommit"),Y5t=x(t=>({name:t.name,order:t.order??0}),"parseBranch"),X5t=x(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?Mn[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),j5t=x(t=>t.branch,"parseCheckout"),K5t=x(t=>{var r;return{id:t.id,targetId:"",tags:((r=t.tags)==null?void 0:r.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),Z5t={parse:x(async t=>{const e=await Al("gitGraph",t);le.debug(e),H5t(e,NAe)},"parse")},$d=10,Pd=40,Rc=4,qu=2,zp=8,I7=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),SB=12,dU=new Set(["redux-color","redux-dark-color"]),Q5t=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Vp=x((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),go=new Map,bo=new Map,m6=30,gw=new Map,y6=[],Uu=0,Hr="LR",J5t=x(()=>{go.clear(),bo.clear(),gw.clear(),Uu=0,y6=[],Hr="LR"},"clear"),DAe=x(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach(n=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),i.setAttribute("dy","1em"),i.setAttribute("x","0"),i.setAttribute("class","row"),i.textContent=n.trim(),e.appendChild(i)}),e},"drawText"),OAe=x(t=>{let e,r,n;return Hr==="BT"?(r=x((i,a)=>i<=a,"comparisonFunc"),n=1/0):(r=x((i,a)=>i>=a,"comparisonFunc"),n=0),t.forEach(i=>{var s,o;const a=Hr==="TB"||Hr=="BT"?(s=bo.get(i))==null?void 0:s.y:(o=bo.get(i))==null?void 0:o.x;a!==void 0&&r(a,n)&&(e=i,n=a)}),e},"findClosestParent"),eAt=x(t=>{let e="",r=1/0;return t.forEach(n=>{const i=bo.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),tAt=x((t,e,r)=>{let n=r,i=r;const a=[];t.forEach(s=>{const o=e.get(s);if(!o)throw new Error(`Commit not found for key ${s}`);o.parents.length?(n=nAt(o),i=Math.max(n,i)):a.push(o),iAt(o,n)}),n=i,a.forEach(s=>{aAt(s,n,r)}),t.forEach(s=>{const o=e.get(s);if(o!=null&&o.parents.length){const l=eAt(o.parents);n=bo.get(l).y-Pd,n<=i&&(i=n);const u=go.get(o.branch).pos,h=n-$d;bo.set(o.id,{x:u,y:h})}})},"setParallelBTPos"),rAt=x(t=>{var n;const e=OAe(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=bo.get(e))==null?void 0:n.y;if(r===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return r},"findClosestParentPos"),nAt=x(t=>rAt(t)+Pd,"calculateCommitPosition"),iAt=x((t,e)=>{const r=go.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+$d;return bo.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),aAt=x((t,e,r)=>{const n=go.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,a=n.pos;bo.set(t.id,{x:a,y:i})},"setRootPosition"),sAt=x((t,e,r,n,i,a)=>{const{theme:s}=Fe(),o=I7.has(s??""),l=dU.has(s??""),u=Q5t.has(s??"");if(a===Mn.HIGHLIGHT)t.append("rect").attr("x",r.x-10+(o?3:0)).attr("y",r.y-10+(o?3:0)).attr("width",o?14:20).attr("height",o?14:20).attr("class",`commit ${e.id} commit-highlight${Vp(i,zp,l)} ${n}-outer`),t.append("rect").attr("x",r.x-6+(o?2:0)).attr("y",r.y-6+(o?2:0)).attr("width",o?8:12).attr("height",o?8:12).attr("class",`commit ${e.id} commit${Vp(i,zp,l)} ${n}-inner`);else if(a===Mn.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",o?7:10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",o?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`),t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${e.id} ${n}`);else{const h=t.append("circle");if(h.attr("cx",r.x),h.attr("cy",r.y),h.attr("r",o?7:10),h.attr("class",`commit ${e.id} commit${Vp(i,zp,l)}`),a===Mn.MERGE){const d=t.append("circle");d.attr("cx",r.x),d.attr("cy",r.y),d.attr("r",o?5:6),d.attr("class",`commit ${n} ${e.id} commit${Vp(i,zp,l)}`)}if(a===Mn.REVERSE){const d=t.append("path"),f=o?4:5;d.attr("d",`M ${r.x-f},${r.y-f}L${r.x+f},${r.y+f}M${r.x-f},${r.y+f}L${r.x+f},${r.y-f}`).attr("class",`commit ${n} ${e.id} commit${Vp(i,zp,l)}`)}}},"drawCommitBullet"),oAt=x((t,e,r,n,i)=>{var a;if(e.type!==Mn.CHERRY_PICK&&(e.customId&&e.type===Mn.MERGE||e.type!==Mn.MERGE)&&i.showCommitLabel){const s=t.append("g"),o=s.insert("rect").attr("class","commit-label-bkg"),l=s.append("text").attr("x",n).attr("y",r.y+25).attr("class","commit-label").text(e.id),u=(a=l.node())==null?void 0:a.getBBox();if(u&&(o.attr("x",r.posWithOffset-u.width/2-qu).attr("y",r.y+13.5).attr("width",u.width+2*qu).attr("height",u.height+2*qu),Hr==="TB"||Hr==="BT"?(o.attr("x",r.x-(u.width+4*Rc+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*Rc)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(Hr==="TB"||Hr==="BT")l.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),o.attr("transform","rotate(-45, "+r.x+", "+r.y+")");else{const h=-7.5-(u.width+10)/25*9.5,d=10+u.width/25*8.5;s.attr("transform","translate("+h+", "+d+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),lAt=x((t,e,r,n)=>{var i;if(e.tags.length>0){let a=0,s=0,o=0;const l=[];for(const u of e.tags.reverse()){const h=t.insert("polygon"),d=t.append("circle"),f=t.append("text").attr("y",r.y-16-a).attr("class","tag-label").text(u),p=(i=f.node())==null?void 0:i.getBBox();if(!p)throw new Error("Tag bbox not found");s=Math.max(s,p.width),o=Math.max(o,p.height),f.attr("x",r.posWithOffset-p.width/2),l.push({tag:f,hole:d,rect:h,yOffset:a}),a+=20}for(const{tag:u,hole:h,rect:d,yOffset:f}of l){const p=o/2,g=r.y-19.2-f;if(d.attr("class","tag-label-bkg").attr("points",`
${n-s/2-Rc/2},${g+qu}
${n-s/2-Rc/2},${g-qu}
${r.posWithOffset-s/2-Rc},${g-p-qu}
${r.posWithOffset+s/2+Rc},${g-p-qu}
${r.posWithOffset+s/2+Rc},${g+p+qu}
${r.posWithOffset-s/2-Rc},${g+p+qu}`),h.attr("cy",g).attr("cx",n-s/2+Rc/2).attr("r",1.5).attr("class","tag-hole"),Hr==="TB"||Hr==="BT"){const m=n+f;d.attr("class","tag-label-bkg").attr("points",`
${r.x},${m+2}
${r.x},${m-2}
${r.x+$d},${m-p-2}
${r.x+$d+s+4},${m-p-2}
${r.x+$d+s+4},${m+p+2}
${r.x+$d},${m+p+2}`).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),h.attr("cx",r.x+Rc/2).attr("cy",m).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),u.attr("x",r.x+5).attr("y",m+3).attr("transform","translate(14,14) rotate(45, "+r.x+","+n+")")}}}},"drawCommitTags"),cAt=x(t=>{switch(t.customType??t.type){case Mn.NORMAL:return"commit-normal";case Mn.REVERSE:return"commit-reverse";case Mn.HIGHLIGHT:return"commit-highlight";case Mn.MERGE:return"commit-merge";case Mn.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),uAt=x((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const a=OAe(t.parents);if(a){const s=n.get(a)??i;return e==="TB"?s.y+Pd:e==="BT"?(n.get(t.id)??i).y-Pd:s.x+Pd}}else return e==="TB"?m6:e==="BT"?(n.get(t.id)??i).y-Pd:0;return 0},"calculatePosition"),hAt=x((t,e,r)=>{var l,u;const n=Hr==="BT"&&r?e:e+$d,i=(l=go.get(t.branch))==null?void 0:l.pos,a=Hr==="TB"||Hr==="BT"?(u=go.get(t.branch))==null?void 0:u.pos:n;if(a===void 0||i===void 0)throw new Error(`Position were undefined for commit ${t.id}`);const s=I7.has(Fe().theme??""),o=Hr==="TB"||Hr==="BT"?n:i+(s?SB/2+1:-2);return{x:a,y:o,posWithOffset:n}},"getCommitPosition"),sie=x((t,e,r,n)=>{const i=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let s=Hr==="TB"||Hr==="BT"?m6:0;const o=[...e.keys()],l=n.parallelCommits??!1,u=x((d,f)=>{var m,y;const p=(m=e.get(d))==null?void 0:m.seq,g=(y=e.get(f))==null?void 0:y.seq;return p!==void 0&&g!==void 0?p-g:0},"sortKeys");let h=o.sort(u);Hr==="BT"&&(l&&tAt(h,e,s),h=h.reverse()),h.forEach(d=>{var g;const f=e.get(d);if(!f)throw new Error(`Commit not found for key ${d}`);l&&(s=uAt(f,Hr,s,bo));const p=hAt(f,s,l);if(r){const m=cAt(f),y=f.customType??f.type,v=((g=go.get(f.branch))==null?void 0:g.index)??0;sAt(i,f,p,m,v,y),oAt(a,f,p,s,n),lAt(a,f,p,s)}Hr==="TB"||Hr==="BT"?bo.set(f.id,{x:p.x,y:p.posWithOffset}):bo.set(f.id,{x:p.posWithOffset,y:p.y}),s=Hr==="BT"&&l?s+Pd:s+Pd+$d,s>Uu&&(Uu=s)})},"drawCommits"),dAt=x((t,e,r,n,i)=>{const s=(Hr==="TB"||Hr==="BT"?r.x<n.x:r.y<n.y)?e.branch:t.branch,o=x(u=>u.branch===s,"isOnBranchToGetCurve"),l=x(u=>u.seq>t.seq&&u.seq<e.seq,"isBetweenCommits");return[...i.values()].some(u=>l(u)&&o(u))},"shouldRerouteArrow"),mw=x((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(y6.every(s=>Math.abs(s-n)>=10))return y6.push(n),n;const a=Math.abs(t-e);return mw(t,e-a/5,r+1)},"findLane"),fAt=x((t,e,r,n)=>{var m,y,v,T,b;const{theme:i}=Fe(),a=dU.has(i??""),s=bo.get(e.id),o=bo.get(r.id);if(s===void 0||o===void 0)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);const l=dAt(e,r,s,o,n);let u="",h="",d=0,f=0,p=(m=go.get(r.branch))==null?void 0:m.index;r.type===Mn.MERGE&&e.id!==r.parents[0]&&(p=(y=go.get(e.branch))==null?void 0:y.index);let g;if(l){u="A 10 10, 0, 0, 0,",h="A 10 10, 0, 0, 1,",d=10,f=10;const w=s.y<o.y?mw(s.y,o.y):mw(o.y,s.y),C=s.x<o.x?mw(s.x,o.x):mw(o.x,s.x);Hr==="TB"?s.x<o.x?g=`M ${s.x} ${s.y} L ${C-d} ${s.y} ${h} ${C} ${s.y+f} L ${C} ${o.y-d} ${u} ${C+f} ${o.y} L ${o.x} ${o.y}`:(p=(v=go.get(e.branch))==null?void 0:v.index,g=`M ${s.x} ${s.y} L ${C+d} ${s.y} ${u} ${C} ${s.y+f} L ${C} ${o.y-d} ${h} ${C-f} ${o.y} L ${o.x} ${o.y}`):Hr==="BT"?s.x<o.x?g=`M ${s.x} ${s.y} L ${C-d} ${s.y} ${u} ${C} ${s.y-f} L ${C} ${o.y+d} ${h} ${C+f} ${o.y} L ${o.x} ${o.y}`:(p=(T=go.get(e.branch))==null?void 0:T.index,g=`M ${s.x} ${s.y} L ${C+d} ${s.y} ${h} ${C} ${s.y-f} L ${C} ${o.y+d} ${u} ${C-f} ${o.y} L ${o.x} ${o.y}`):s.y<o.y?g=`M ${s.x} ${s.y} L ${s.x} ${w-d} ${u} ${s.x+f} ${w} L ${o.x-d} ${w} ${h} ${o.x} ${w+f} L ${o.x} ${o.y}`:(p=(b=go.get(e.branch))==null?void 0:b.index,g=`M ${s.x} ${s.y} L ${s.x} ${w+d} ${h} ${s.x+f} ${w} L ${o.x-d} ${w} ${u} ${o.x} ${w-f} L ${o.x} ${o.y}`)}else u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,Hr==="TB"?(s.x<o.x&&(r.type===Mn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y-d} ${u} ${s.x+f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x-d} ${s.y} ${h} ${o.x} ${s.y+f} L ${o.x} ${o.y}`),s.x>o.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Mn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y-d} ${h} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${u} ${o.x} ${s.y+f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):Hr==="BT"?(s.x<o.x&&(r.type===Mn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${h} ${s.x+f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x-d} ${s.y} ${u} ${o.x} ${s.y-f} L ${o.x} ${o.y}`),s.x>o.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Mn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${u} ${s.x-f} ${o.y} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${o.x+d} ${s.y} ${h} ${o.x} ${s.y-f} L ${o.x} ${o.y}`),s.x===o.x&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`)):(s.y<o.y&&(r.type===Mn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${o.x-d} ${s.y} ${h} ${o.x} ${s.y+f} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${s.x} ${o.y-d} ${u} ${s.x+f} ${o.y} L ${o.x} ${o.y}`),s.y>o.y&&(r.type===Mn.MERGE&&e.id!==r.parents[0]?g=`M ${s.x} ${s.y} L ${o.x-d} ${s.y} ${u} ${o.x} ${s.y-f} L ${o.x} ${o.y}`:g=`M ${s.x} ${s.y} L ${s.x} ${o.y+d} ${h} ${s.x+f} ${o.y} L ${o.x} ${o.y}`),s.y===o.y&&(g=`M ${s.x} ${s.y} L ${o.x} ${o.y}`));if(g===void 0)throw new Error("Line definition not found");t.append("path").attr("d",g).attr("class","arrow arrow"+Vp(p,zp,a))},"drawArrow"),pAt=x((t,e)=>{const r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach(n=>{const i=e.get(n);i.parents&&i.parents.length>0&&i.parents.forEach(a=>{fAt(r,e.get(a),i,e)})})},"drawArrows"),gAt=x((t,e,r,n)=>{const{look:i,theme:a,themeVariables:s}=Fe(),{dropShadow:o,THEME_COLOR_LIMIT:l}=s,u=I7.has(a??""),h=dU.has(a??""),d=t.append("g");e.forEach((f,p)=>{var L;const g=Vp(p,u?l:zp,h),m=(L=go.get(f.name))==null?void 0:L.pos;if(m===void 0)throw new Error(`Position not found for branch ${f.name}`);const y=Hr==="TB"||Hr==="BT"?m:u?m+SB/2+1:m-2,v=d.append("line");v.attr("x1",0),v.attr("y1",y),v.attr("x2",Uu),v.attr("y2",y),v.attr("class","branch branch"+g),Hr==="TB"?(v.attr("y1",m6),v.attr("x1",m),v.attr("y2",Uu),v.attr("x2",m)):Hr==="BT"&&(v.attr("y1",Uu),v.attr("x1",m),v.attr("y2",m6),v.attr("x2",m)),y6.push(y);const T=f.name,b=DAe(T),w=d.insert("rect"),S=d.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+g);S.node().appendChild(b);const k=b.getBBox(),E=u?0:4,_=u?16:0,M=u?SB:0;i==="neo"&&w.attr("data-look","neo"),w.attr("class","branchLabelBkg label"+g).attr("style",i==="neo"?`filter:${u?`url(#${n}-drop-shadow)`:o}`:"").attr("rx",E).attr("ry",E).attr("x",-k.width-4-(r.rotateCommitLabel===!0?30:0)).attr("y",-k.height/2+10).attr("width",k.width+18+_).attr("height",k.height+4+M),S.attr("transform","translate("+(-k.width-14-(r.rotateCommitLabel===!0?30:0)+_/2)+", "+(y-k.height/2-2)+")"),Hr==="TB"?(w.attr("x",m-k.width/2-10).attr("y",0),S.attr("transform","translate("+(m-k.width/2-5)+", 0)"),u&&(w.attr("transform",`translate(${-_/2-3}, ${-M-10})`),S.attr("transform","translate("+(m-k.width/2-5)+", "+(-M*2+7)+")"))):Hr==="BT"?(w.attr("x",m-k.width/2-10).attr("y",Uu),S.attr("transform","translate("+(m-k.width/2-5)+", "+Uu+")"),u&&(w.attr("transform",`translate(${-_/2-3}, ${M+10})`),S.attr("transform","translate("+(m-k.width/2-5)+", "+(Uu+M*2+4)+")"))):w.attr("transform","translate(-19, "+(y-12-M/2)+")")})},"drawBranches"),mAt=x(function(t,e,r,n,i){return go.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(Hr==="TB"||Hr==="BT"?n.width/2:0),e},"setBranchPosition"),yAt=x(function(t,e,r,n){J5t(),le.debug("in gitgraph renderer",t+`
`,"id:",e,r);const i=n.db;if(!i.getConfig){le.error("getConfig method is not available on db");return}const a=i.getConfig(),s=a.rotateCommitLabel??!1;gw=i.getCommits();const o=i.getBranchesAsObjArray();Hr=i.getDirection();const l=ut(`[id="${e}"]`),{look:u,theme:h,themeVariables:d}=Fe(),{useGradient:f,gradientStart:p,gradientStop:g,filterColor:m}=d;if(f){const v=l.append("defs").append("linearGradient").attr("id",e+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");v.append("stop").attr("offset","0%").attr("stop-color",p).attr("stop-opacity",1),v.append("stop").attr("offset","100%").attr("stop-color",g).attr("stop-opacity",1)}u==="neo"&&I7.has(h??"")&&l.append("defs").append("filter").attr("id",e+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",m);let y=0;o.forEach((v,T)=>{var E;const b=DAe(v.name),w=l.append("g"),C=w.insert("g").attr("class","branchLabel"),S=C.insert("g").attr("class","label branch-label");(E=S.node())==null||E.appendChild(b);const k=b.getBBox();y=mAt(v.name,y,T,k,s),S.remove(),C.remove(),w.remove()}),sie(l,gw,!1,a),a.showBranches&&gAt(l,o,a,e),pAt(l,gw),sie(l,gw,!0,a),yr.insertTitle(l,"gitTitleText",a.titleTopMargin??0,i.getDiagramTitle()),Mz(void 0,l,a.diagramPadding,a.useMaxWidth)},"draw"),vAt={draw:yAt},$Ae=8,PAe=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),bAt=new Set(["redux-color","redux-dark-color"]),xAt=new Set(["neo","neo-dark"]),TAt=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),wAt=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),CAt=x(t=>{const{svgId:e}=t;let r="";if(t.useGradient&&e)for(let n=0;n<t.THEME_COLOR_LIMIT;n++)r+=`
.label${n} { fill: ${t.mainBkg}; stroke: url(${e}-gradient); stroke-width: ${t.strokeWidth};}
`;return r},"genGitGraphGradient"),kAt=x(t=>{const e=Xt(),{theme:r,themeVariables:n}=e,{borderColorArray:i}=n,a=PAe.has(r);if(xAt.has(r)){let s="";for(let o=0;o<t.THEME_COLOR_LIMIT;o++)if(o===0)s+=`
.branch-label${o} { fill: ${t.nodeBorder};}
.commit${o} { stroke: ${t.nodeBorder}; }
.commit-highlight${o} { stroke: ${t.nodeBorder}; fill: ${t.nodeBorder}; }
.arrow${o} { stroke: ${t.nodeBorder}; }
.commit-bullets { fill: ${t.nodeBorder}; }
.commit-cherry-pick${o} { stroke: ${t.nodeBorder}; }
${CAt(t)}`;else{const l=o%$Ae;s+=`
.branch-label${o} { fill: ${t["gitBranchLabel"+l]}; }
.commit${o} { stroke: ${t["git"+l]}; fill: ${t["git"+l]}; }
.commit-highlight${o} { stroke: ${t["gitInv"+l]}; fill: ${t["gitInv"+l]}; }
.arrow${o} { stroke: ${t["git"+l]}; }
`}return s}else if(bAt.has(r)){let s="";for(let o=0;o<t.THEME_COLOR_LIMIT;o++)if(o===0)s+=`
.branch-label${o} { fill: ${t.nodeBorder}; ${a?`font-weight:${t.noteFontWeight}`:""} }
.commit${o} { stroke: ${t.nodeBorder}; }
.commit-highlight${o} { stroke: ${t.nodeBorder}; fill: ${t.mainBkg}; }
.label${o} { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${t.strokeWidth}; ${a?`font-weight:${t.noteFontWeight}`:""} }
.arrow${o} { stroke: ${t.nodeBorder}; }
.commit-bullets { fill: ${t.nodeBorder}; }
`;else{const l=o%i.length;s+=`
.branch-label${o} { fill: ${t.nodeBorder}; ${a?`font-weight:${t.noteFontWeight}`:""} }
.commit${o} { stroke: ${i[l]}; fill: ${i[l]}; }
.commit-highlight${o} { stroke: ${i[l]}; fill: ${i[l]}; }
.label${o} { fill: ${TAt.has(r)?t.mainBkg:i[l]}; stroke: ${i[l]}; stroke-width: ${t.strokeWidth}; }
.arrow${o} { stroke: ${i[l]}; }
`}return s}else{let s="";for(let o=0;o<t.THEME_COLOR_LIMIT;o++)s+=`
.branch-label${o} { fill: ${t.nodeBorder}; ${a?`font-weight:${t.noteFontWeight}`:""} }
.commit${o} { stroke: ${t.nodeBorder}; }
.commit-highlight${o} { stroke: ${t.nodeBorder}; fill: ${t.nodeBorder}; }
.label${o} { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${t.strokeWidth}; ${a?`font-weight:${t.noteFontWeight}`:""}}
.arrow${o} { stroke: ${t.nodeBorder}; }
.commit-bullets { fill: ${t.nodeBorder}; }
.commit-cherry-pick${o} { stroke: ${t.nodeBorder}; }
`;return s}},"genColor"),SAt=x(t=>`${Array.from({length:t.THEME_COLOR_LIMIT},(e,r)=>r).map(e=>{const r=e%$Ae;return`
.branch-label${e} { fill: ${t["gitBranchLabel"+r]}; }
.commit${e} { stroke: ${t["git"+r]}; fill: ${t["git"+r]}; }
.commit-highlight${e} { stroke: ${t["gitInv"+r]}; fill: ${t["gitInv"+r]}; }
.label${e} { fill: ${t["git"+r]}; }
.arrow${e} { stroke: ${t["git"+r]}; }
`}).join(`
`)}`,"normalTheme"),EAt=x(t=>{const e=Xt(),{theme:r}=e,n=wAt.has(r);return`
.commit-id,
.commit-msg,
.branch-label {
fill: lightgrey;
color: lightgrey;
font-family: 'trebuchet ms', verdana, arial, sans-serif;
font-family: var(--mermaid-font-family);
}
${n?kAt(t):SAt(t)}
.branch {
stroke-width: ${t.strokeWidth};
stroke: ${t.commitLineColor??t.lineColor};
stroke-dasharray: ${n?"4 2":"2"};
}
.commit-label { font-size: ${t.commitLabelFontSize}; fill: ${n?t.nodeBorder:t.commitLabelColor}; ${n?`font-weight:${t.noteFontWeight};`:""}}
.commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${n?"transparent":t.commitLabelBackground}; opacity: ${n?"":.5}; }
.tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}
.tag-label-bkg { fill: ${n?t.mainBkg:t.tagLabelBackground}; stroke: ${n?t.nodeBorder:t.tagLabelBorder}; ${n?`filter:${t.dropShadow}`:""} }
.tag-hole { fill: ${t.textColor}; }
.commit-merge {
stroke: ${n?t.mainBkg:t.primaryColor};
fill: ${n?t.mainBkg:t.primaryColor};
}
.commit-reverse {
stroke: ${n?t.mainBkg:t.primaryColor};
fill: ${n?t.mainBkg:t.primaryColor};
stroke-width: ${n?t.strokeWidth:3};
}
.commit-highlight-outer {
}
.commit-highlight-inner {
stroke: ${n?t.mainBkg:t.primaryColor};
fill: ${n?t.mainBkg:t.primaryColor};
}
.arrow {
/* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */
stroke-width: ${PAe.has(r)?t.strokeWidth:8};
stroke-linecap: round;
fill: none
}
.gitTitleText {
text-anchor: middle;
font-size: 18px;
fill: ${t.textColor};
}
`},"getStyles"),AAt=EAt,_At={parser:Z5t,db:NAe,renderer:vAt,styles:AAt};const RAt=Object.freeze(Object.defineProperty({__proto__:null,diagram:_At},Symbol.toStringTag,{value:"Module"}));var q3={exports:{}},LAt=q3.exports,oie;function MAt(){return oie||(oie=1,(function(t,e){(function(r,n){t.exports=n()})(LAt,(function(){var r="day";return function(n,i,a){var s=function(u){return u.add(4-u.isoWeekday(),r)},o=i.prototype;o.isoWeekYear=function(){return s(this).year()},o.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),r);var h,d,f,p,g=s(this),m=(h=this.isoWeekYear(),d=this.$u,f=(d?a.utc:a)().year(h).startOf("year"),p=4-f.isoWeekday(),f.isoWeekday()>4&&(p+=7),f.add(p,r));return g.diff(m,"week")+1},o.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=o.startOf;o.startOf=function(u,h){var d=this.$utils(),f=!!d.u(h)||h;return d.p(u)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):l.bind(this)(u,h)}}}))})(q3)),q3.exports}var IAt=MAt();const NAt=eg(IAt);var U3={exports:{}},DAt=U3.exports,lie;function OAt(){return lie||(lie=1,(function(t,e){(function(r,n){t.exports=n()})(DAt,(function(){var r={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"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,a=/\d\d/,s=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,l={},u=function(y){return(y=+y)+(y>68?1900:2e3)},h=function(y){return function(v){this[y]=+v}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(y){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var T=v.match(/([+-]|\d\d)/g),b=60*T[1]+(+T[2]||0);return b===0?0:T[0]==="+"?-b:b})(y)}],f=function(y){var v=l[y];return v&&(v.indexOf?v:v.s.concat(v.f))},p=function(y,v){var T,b=l.meridiem;if(b){for(var w=1;w<=24;w+=1)if(y.indexOf(b(w,0,v))>-1){T=w>12;break}}else T=y===(v?"pm":"PM");return T},g={A:[o,function(y){this.afternoon=p(y,!1)}],a:[o,function(y){this.afternoon=p(y,!0)}],Q:[i,function(y){this.month=3*(y-1)+1}],S:[i,function(y){this.milliseconds=100*+y}],SS:[a,function(y){this.milliseconds=10*+y}],SSS:[/\d{3}/,function(y){this.milliseconds=+y}],s:[s,h("seconds")],ss:[s,h("seconds")],m:[s,h("minutes")],mm:[s,h("minutes")],H:[s,h("hours")],h:[s,h("hours")],HH:[s,h("hours")],hh:[s,h("hours")],D:[s,h("day")],DD:[a,h("day")],Do:[o,function(y){var v=l.ordinal,T=y.match(/\d+/);if(this.day=T[0],v)for(var b=1;b<=31;b+=1)v(b).replace(/\[|\]/g,"")===y&&(this.day=b)}],w:[s,h("week")],ww:[a,h("week")],M:[s,h("month")],MM:[a,h("month")],MMM:[o,function(y){var v=f("months"),T=(f("monthsShort")||v.map((function(b){return b.slice(0,3)}))).indexOf(y)+1;if(T<1)throw new Error;this.month=T%12||T}],MMMM:[o,function(y){var v=f("months").indexOf(y)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,h("year")],YY:[a,function(y){this.year=u(y)}],YYYY:[/\d{4}/,h("year")],Z:d,ZZ:d};function m(y){var v,T;v=y,T=l&&l.formats;for(var b=(y=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(M,L,P){var D=P&&P.toUpperCase();return L||T[P]||r[P]||T[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(R,I,$){return I||$.slice(1)}))}))).match(n),w=b.length,C=0;C<w;C+=1){var S=b[C],k=g[S],E=k&&k[0],_=k&&k[1];b[C]=_?{regex:E,parser:_}:S.replace(/^\[|\]$/g,"")}return function(M){for(var L={},P=0,D=0;P<w;P+=1){var R=b[P];if(typeof R=="string")D+=R.length;else{var I=R.regex,$=R.parser,O=M.slice(D),N=I.exec(O)[0];$.call(L,N),M=M.replace(N,"")}}return(function(F){var z=F.afternoon;if(z!==void 0){var V=F.hours;z?V<12&&(F.hours+=12):V===12&&(F.hours=0),delete F.afternoon}})(L),L}}return function(y,v,T){T.p.customParseFormat=!0,y&&y.parseTwoDigitYear&&(u=y.parseTwoDigitYear);var b=v.prototype,w=b.parse;b.parse=function(C){var S=C.date,k=C.utc,E=C.args;this.$u=k;var _=E[1];if(typeof _=="string"){var M=E[2]===!0,L=E[3]===!0,P=M||L,D=E[2];L&&(D=E[2]),l=this.$locale(),!M&&D&&(l=T.Ls[D]),this.$d=(function(O,N,F,z){try{if(["x","X"].indexOf(N)>-1)return new Date((N==="X"?1e3:1)*O);var V=m(N)(O),B=V.year,G=V.month,H=V.day,q=V.hours,Z=V.minutes,Y=V.seconds,ie=V.milliseconds,K=V.zone,Q=V.week,te=new Date,J=H||(B||G?1:te.getDate()),ge=B||te.getFullYear(),ee=0;B&&!G||(ee=G>0?G-1:te.getMonth());var Re,Ie=q||0,Be=Z||0,ce=Y||0,oe=ie||0;return K?new Date(Date.UTC(ge,ee,J,Ie,Be,ce,oe+60*K.offset*1e3)):F?new Date(Date.UTC(ge,ee,J,Ie,Be,ce,oe)):(Re=new Date(ge,ee,J,Ie,Be,ce,oe),Q&&(Re=z(Re).week(Q).toDate()),Re)}catch{return new Date("")}})(S,_,k,T),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),P&&S!=this.format(_)&&(this.$d=new Date("")),l={}}else if(_ instanceof Array)for(var R=_.length,I=1;I<=R;I+=1){E[1]=_[I-1];var $=T.apply(this,E);if($.isValid()){this.$d=$.$d,this.$L=$.$L,this.init();break}I===R&&(this.$d=new Date(""))}else w.call(this,C)}}}))})(U3)),U3.exports}var $At=OAt();const PAt=eg($At);var Y3={exports:{}},BAt=Y3.exports,cie;function FAt(){return cie||(cie=1,(function(t,e){(function(r,n){t.exports=n()})(BAt,(function(){return function(r,n){var i=n.prototype,a=i.format;i.format=function(s){var o=this,l=this.$locale();if(!this.isValid())return a.bind(this)(s);var u=this.$utils(),h=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(d){switch(d){case"Q":return Math.ceil((o.$M+1)/3);case"Do":return l.ordinal(o.$D);case"gggg":return o.weekYear();case"GGGG":return o.isoWeekYear();case"wo":return l.ordinal(o.week(),"W");case"w":case"ww":return u.s(o.week(),d==="w"?1:2,"0");case"W":case"WW":return u.s(o.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return u.s(String(o.$H===0?24:o.$H),d==="k"?1:2,"0");case"X":return Math.floor(o.$d.getTime()/1e3);case"x":return o.$d.getTime();case"z":return"["+o.offsetName()+"]";case"zzz":return"["+o.offsetName("long")+"]";default:return d}}));return a.bind(this)(h)}}}))})(Y3)),Y3.exports}var zAt=FAt();const VAt=eg(zAt);var X3={exports:{}},GAt=X3.exports,uie;function WAt(){return uie||(uie=1,(function(t,e){(function(r,n){t.exports=n()})(GAt,(function(){var r,n,i=1e3,a=6e4,s=36e5,o=864e5,l=31536e6,u=2628e6,h=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,d=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,f={years:l,months:u,days:o,hours:s,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},p=function(S){return S instanceof w},g=function(S,k,E){return new w(S,E,k.$l)},m=function(S){return n.p(S)+"s"},y=function(S){return S<0},v=function(S){return y(S)?Math.ceil(S):Math.floor(S)},T=function(S){return Math.abs(S)},b=function(S,k){return S?y(S)?{negative:!0,format:""+T(S)+k}:{negative:!1,format:""+S+k}:{negative:!1,format:""}},w=(function(){function S(E,_,M){var L=this;if(this.$d={},this.$l=M,E===void 0&&(this.$ms=0,this.parseFromMilliseconds()),_)return g(E*f[m(_)],this);if(typeof E=="number")return this.$ms=E,this.parseFromMilliseconds(),this;if(typeof E=="object")return Object.keys(E).forEach((function(R){L.$d[m(R)]=E[R]})),this.calMilliseconds(),this;if(typeof E=="string"){var P=E.match(h);if(P){var D=P.slice(2).map((function(R){return R!=null?Number(R):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=S.prototype;return k.calMilliseconds=function(){var E=this;this.$ms=Object.keys(this.$d).reduce((function(_,M){return _+(E.$d[M]||0)*f[M]}),0)},k.parseFromMilliseconds=function(){var E=this.$ms;this.$d.years=v(E/l),E%=l,this.$d.months=v(E/u),E%=u,this.$d.days=v(E/o),E%=o,this.$d.hours=v(E/s),E%=s,this.$d.minutes=v(E/a),E%=a,this.$d.seconds=v(E/i),E%=i,this.$d.milliseconds=E},k.toISOString=function(){var E=b(this.$d.years,"Y"),_=b(this.$d.months,"M"),M=+this.$d.days||0;this.$d.weeks&&(M+=7*this.$d.weeks);var L=b(M,"D"),P=b(this.$d.hours,"H"),D=b(this.$d.minutes,"M"),R=this.$d.seconds||0;this.$d.milliseconds&&(R+=this.$d.milliseconds/1e3,R=Math.round(1e3*R)/1e3);var I=b(R,"S"),$=E.negative||_.negative||L.negative||P.negative||D.negative||I.negative,O=P.format||D.format||I.format?"T":"",N=($?"-":"")+"P"+E.format+_.format+L.format+O+P.format+D.format+I.format;return N==="P"||N==="-P"?"P0D":N},k.toJSON=function(){return this.toISOString()},k.format=function(E){var _=E||"YYYY-MM-DDTHH:mm:ss",M={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return _.replace(d,(function(L,P){return P||String(M[L])}))},k.as=function(E){return this.$ms/f[m(E)]},k.get=function(E){var _=this.$ms,M=m(E);return M==="milliseconds"?_%=1e3:_=M==="weeks"?v(_/f[M]):this.$d[M],_||0},k.add=function(E,_,M){var L;return L=_?E*f[m(_)]:p(E)?E.$ms:g(E,this).$ms,g(this.$ms+L*(M?-1:1),this)},k.subtract=function(E,_){return this.add(E,_,!0)},k.locale=function(E){var _=this.clone();return _.$l=E,_},k.clone=function(){return g(this.$ms,this)},k.humanize=function(E){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!E)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},S})(),C=function(S,k,E){return S.add(k.years()*E,"y").add(k.months()*E,"M").add(k.days()*E,"d").add(k.hours()*E,"h").add(k.minutes()*E,"m").add(k.seconds()*E,"s").add(k.milliseconds()*E,"ms")};return function(S,k,E){r=E,n=E().$utils(),E.duration=function(L,P){var D=E.locale();return g(L,{$l:D},P)},E.isDuration=p;var _=k.prototype.add,M=k.prototype.subtract;k.prototype.add=function(L,P){return p(L)?C(this,L,1):_.bind(this)(L,P)},k.prototype.subtract=function(L,P){return p(L)?C(this,L,-1):M.bind(this)(L,P)}}}))})(X3)),X3.exports}var HAt=WAt();const qAt=eg(HAt);var EB=(function(){var t=x(function(D,R,I,$){for(I=I||{},$=D.length;$--;I[D[$]]=R);return I},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],r=[1,26],n=[1,27],i=[1,28],a=[1,29],s=[1,30],o=[1,31],l=[1,32],u=[1,33],h=[1,34],d=[1,9],f=[1,10],p=[1,11],g=[1,12],m=[1,13],y=[1,14],v=[1,15],T=[1,16],b=[1,19],w=[1,20],C=[1,21],S=[1,22],k=[1,23],E=[1,25],_=[1,35],M={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:x(function(R,I,$,O,N,F,z){var V=F.length-1;switch(N){case 1:return F[V-1];case 2:this.$=[];break;case 3:F[V-1].push(F[V]),this.$=F[V-1];break;case 4:case 5:this.$=F[V];break;case 6:case 7:this.$=[];break;case 8:O.setWeekday("monday");break;case 9:O.setWeekday("tuesday");break;case 10:O.setWeekday("wednesday");break;case 11:O.setWeekday("thursday");break;case 12:O.setWeekday("friday");break;case 13:O.setWeekday("saturday");break;case 14:O.setWeekday("sunday");break;case 15:O.setWeekend("friday");break;case 16:O.setWeekend("saturday");break;case 17:O.setDateFormat(F[V].substr(11)),this.$=F[V].substr(11);break;case 18:O.enableInclusiveEndDates(),this.$=F[V].substr(18);break;case 19:O.TopAxis(),this.$=F[V].substr(8);break;case 20:O.setAxisFormat(F[V].substr(11)),this.$=F[V].substr(11);break;case 21:O.setTickInterval(F[V].substr(13)),this.$=F[V].substr(13);break;case 22:O.setExcludes(F[V].substr(9)),this.$=F[V].substr(9);break;case 23:O.setIncludes(F[V].substr(9)),this.$=F[V].substr(9);break;case 24:O.setTodayMarker(F[V].substr(12)),this.$=F[V].substr(12);break;case 27:O.setDiagramTitle(F[V].substr(6)),this.$=F[V].substr(6);break;case 28:this.$=F[V].trim(),O.setAccTitle(this.$);break;case 29:case 30:this.$=F[V].trim(),O.setAccDescription(this.$);break;case 31:O.addSection(F[V].substr(8)),this.$=F[V].substr(8);break;case 33:O.addTask(F[V-1],F[V]),this.$="task";break;case 34:this.$=F[V-1],O.setClickEvent(F[V-1],F[V],null);break;case 35:this.$=F[V-2],O.setClickEvent(F[V-2],F[V-1],F[V]);break;case 36:this.$=F[V-2],O.setClickEvent(F[V-2],F[V-1],null),O.setLink(F[V-2],F[V]);break;case 37:this.$=F[V-3],O.setClickEvent(F[V-3],F[V-2],F[V-1]),O.setLink(F[V-3],F[V]);break;case 38:this.$=F[V-2],O.setClickEvent(F[V-2],F[V],null),O.setLink(F[V-2],F[V-1]);break;case 39:this.$=F[V-3],O.setClickEvent(F[V-3],F[V-1],F[V]),O.setLink(F[V-3],F[V-2]);break;case 40:this.$=F[V-1],O.setLink(F[V-1],F[V]);break;case 41:case 47:this.$=F[V-1]+" "+F[V];break;case 42:case 43:case 45:this.$=F[V-2]+" "+F[V-1]+" "+F[V];break;case 44:case 46:this.$=F[V-3]+" "+F[V-2]+" "+F[V-1]+" "+F[V];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:T,30:b,31:w,33:C,35:S,36:k,37:24,38:E,40:_},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:r,13:n,14:i,15:a,16:s,17:o,18:l,19:18,20:u,21:h,22:d,23:f,24:p,25:g,26:m,27:y,28:v,29:T,30:b,31:w,33:C,35:S,36:k,37:24,38:E,40:_},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:x(function(R,I){if(I.recoverable)this.trace(R);else{var $=new Error(R);throw $.hash=I,$}},"parseError"),parse:x(function(R){var I=this,$=[0],O=[],N=[null],F=[],z=this.table,V="",B=0,G=0,H=2,q=1,Z=F.slice.call(arguments,1),Y=Object.create(this.lexer),ie={yy:{}};for(var K in this.yy)Object.prototype.hasOwnProperty.call(this.yy,K)&&(ie.yy[K]=this.yy[K]);Y.setInput(R,ie.yy),ie.yy.lexer=Y,ie.yy.parser=this,typeof Y.yylloc>"u"&&(Y.yylloc={});var Q=Y.yylloc;F.push(Q);var te=Y.options&&Y.options.ranges;typeof ie.yy.parseError=="function"?this.parseError=ie.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function J(Ce){$.length=$.length-2*Ce,N.length=N.length-Ce,F.length=F.length-Ce}x(J,"popStack");function ge(){var Ce;return Ce=O.pop()||Y.lex()||q,typeof Ce!="number"&&(Ce instanceof Array&&(O=Ce,Ce=O.pop()),Ce=I.symbols_[Ce]||Ce),Ce}x(ge,"lex");for(var ee,Re,Ie,Be,ce={},oe,be,fe,Pe;;){if(Re=$[$.length-1],this.defaultActions[Re]?Ie=this.defaultActions[Re]:((ee===null||typeof ee>"u")&&(ee=ge()),Ie=z[Re]&&z[Re][ee]),typeof Ie>"u"||!Ie.length||!Ie[0]){var ve="";Pe=[];for(oe in z[Re])this.terminals_[oe]&&oe>H&&Pe.push("'"+this.terminals_[oe]+"'");Y.showPosition?ve="Parse error on line "+(B+1)+`:
`+Y.showPosition()+`
Expecting `+Pe.join(", ")+", got '"+(this.terminals_[ee]||ee)+"'":ve="Parse error on line "+(B+1)+": Unexpected "+(ee==q?"end of input":"'"+(this.terminals_[ee]||ee)+"'"),this.parseError(ve,{text:Y.match,token:this.terminals_[ee]||ee,line:Y.yylineno,loc:Q,expected:Pe})}if(Ie[0]instanceof Array&&Ie.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Re+", token: "+ee);switch(Ie[0]){case 1:$.push(ee),N.push(Y.yytext),F.push(Y.yylloc),$.push(Ie[1]),ee=null,G=Y.yyleng,V=Y.yytext,B=Y.yylineno,Q=Y.yylloc;break;case 2:if(be=this.productions_[Ie[1]][1],ce.$=N[N.length-be],ce._$={first_line:F[F.length-(be||1)].first_line,last_line:F[F.length-1].last_line,first_column:F[F.length-(be||1)].first_column,last_column:F[F.length-1].last_column},te&&(ce._$.range=[F[F.length-(be||1)].range[0],F[F.length-1].range[1]]),Be=this.performAction.apply(ce,[V,G,B,ie.yy,Ie[1],N,F].concat(Z)),typeof Be<"u")return Be;be&&($=$.slice(0,-1*be*2),N=N.slice(0,-1*be),F=F.slice(0,-1*be)),$.push(this.productions_[Ie[1]][0]),N.push(ce.$),F.push(ce._$),fe=z[$[$.length-2]][$[$.length-1]],$.push(fe);break;case 3:return!0}}return!0},"parse")},L=(function(){var D={EOF:1,parseError:x(function(I,$){if(this.yy.parser)this.yy.parser.parseError(I,$);else throw new Error(I)},"parseError"),setInput:x(function(R,I){return this.yy=I||this.yy||{},this._input=R,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var R=this._input[0];this.yytext+=R,this.yyleng++,this.offset++,this.match+=R,this.matched+=R;var I=R.match(/(?:\r\n?|\n).*/g);return I?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),R},"input"),unput:x(function(R){var I=R.length,$=R.split(/(?:\r\n?|\n)/g);this._input=R+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-I),this.offset-=I;var O=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),$.length-1&&(this.yylineno-=$.length-1);var N=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:$?($.length===O.length?this.yylloc.first_column:0)+O[O.length-$.length].length-$[0].length:this.yylloc.first_column-I},this.options.ranges&&(this.yylloc.range=[N[0],N[0]+this.yyleng-I]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(R){this.unput(this.match.slice(R))},"less"),pastInput:x(function(){var R=this.matched.substr(0,this.matched.length-this.match.length);return(R.length>20?"...":"")+R.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var R=this.match;return R.length<20&&(R+=this._input.substr(0,20-R.length)),(R.substr(0,20)+(R.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var R=this.pastInput(),I=new Array(R.length+1).join("-");return R+this.upcomingInput()+`
`+I+"^"},"showPosition"),test_match:x(function(R,I){var $,O,N;if(this.options.backtrack_lexer&&(N={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(N.yylloc.range=this.yylloc.range.slice(0))),O=R[0].match(/(?:\r\n?|\n).*/g),O&&(this.yylineno+=O.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:O?O[O.length-1].length-O[O.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+R[0].length},this.yytext+=R[0],this.match+=R[0],this.matches=R,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(R[0].length),this.matched+=R[0],$=this.performAction.call(this,this.yy,this,I,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),$)return $;if(this._backtrack){for(var F in N)this[F]=N[F];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var R,I,$,O;this._more||(this.yytext="",this.match="");for(var N=this._currentRules(),F=0;F<N.length;F++)if($=this._input.match(this.rules[N[F]]),$&&(!I||$[0].length>I[0].length)){if(I=$,O=F,this.options.backtrack_lexer){if(R=this.test_match($,N[F]),R!==!1)return R;if(this._backtrack){I=!1;continue}else return!1}else if(!this.options.flex)break}return I?(R=this.test_match(I,N[O]),R!==!1?R:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var I=this.next();return I||this.lex()},"lex"),begin:x(function(I){this.conditionStack.push(I)},"begin"),popState:x(function(){var I=this.conditionStack.length-1;return I>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(I){return I=this.conditionStack.length-1-Math.abs(I||0),I>=0?this.conditionStack[I]:"INITIAL"},"topState"),pushState:x(function(I){this.begin(I)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(I,$,O,N){switch(O){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return D})();M.lexer=L;function P(){this.yy={}}return x(P,"Parser"),P.prototype=M,M.Parser=P,new P})();EB.parser=EB;var UAt=EB;xa.extend(NAt);xa.extend(PAt);xa.extend(VAt);var hie={friday:5,saturday:6},Gc="",fU="",pU=void 0,gU="",ax=[],sx=[],mU=new Map,yU=[],v6=[],ox="",vU="",BAe=["active","done","crit","milestone","vert"],bU=[],ay="",YS=!1,xU=!1,TU="sunday",b6="saturday",AB=0,YAt=x(function(){yU=[],v6=[],ox="",bU=[],j3=0,RB=void 0,K3=void 0,ea=[],Gc="",fU="",vU="",pU=void 0,gU="",ax=[],sx=[],YS=!1,xU=!1,AB=0,mU=new Map,ay="",On(),TU="sunday",b6="saturday"},"clear"),XAt=x(function(t){ay=t},"setDiagramId"),jAt=x(function(t){fU=t},"setAxisFormat"),KAt=x(function(){return fU},"getAxisFormat"),ZAt=x(function(t){pU=t},"setTickInterval"),QAt=x(function(){return pU},"getTickInterval"),JAt=x(function(t){gU=t},"setTodayMarker"),e_t=x(function(){return gU},"getTodayMarker"),t_t=x(function(t){Gc=t},"setDateFormat"),r_t=x(function(){YS=!0},"enableInclusiveEndDates"),n_t=x(function(){return YS},"endDatesAreInclusive"),i_t=x(function(){xU=!0},"enableTopAxis"),a_t=x(function(){return xU},"topAxisEnabled"),s_t=x(function(t){vU=t},"setDisplayMode"),o_t=x(function(){return vU},"getDisplayMode"),l_t=x(function(){return Gc},"getDateFormat"),FAe=x((t,e)=>{const r=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return[...new Set([...t,...r])]},"mergeTokens"),c_t=x(function(t){ax=FAe(ax,t)},"setIncludes"),u_t=x(function(){return ax},"getIncludes"),h_t=x(function(t){sx=FAe(sx,t)},"setExcludes"),d_t=x(function(){return sx},"getExcludes"),f_t=x(function(){return mU},"getLinks"),p_t=x(function(t){ox=t,yU.push(t)},"addSection"),g_t=x(function(){return yU},"getSections"),m_t=x(function(){let t=die();const e=10;let r=0;for(;!t&&r<e;)t=die(),r++;return v6=ea,v6},"getTasks"),zAe=x(function(t,e,r,n){const i=t.format(e.trim()),a=t.format("YYYY-MM-DD");return n.includes(i)||n.includes(a)?!1:r.includes("weekends")&&(t.isoWeekday()===hie[b6]||t.isoWeekday()===hie[b6]+1)||r.includes(t.format("dddd").toLowerCase())?!0:r.includes(i)||r.includes(a)},"isInvalidDate"),y_t=x(function(t){TU=t},"setWeekday"),v_t=x(function(){return TU},"getWeekday"),b_t=x(function(t){b6=t},"setWeekend"),VAe=x(function(t,e,r,n){if(!r.length||t.manualEndTime)return;let i;t.startTime instanceof Date?i=xa(t.startTime):i=xa(t.startTime,e,!0),i=i.add(1,"d");let a;t.endTime instanceof Date?a=xa(t.endTime):a=xa(t.endTime,e,!0);const[s,o]=x_t(i,a,e,r,n);t.endTime=s.toDate(),t.renderEndTime=o},"checkTaskDates"),x_t=x(function(t,e,r,n,i){let a=!1,s=null;const o=e.add(1e4,"d");for(;t<=e;){if(a||(s=e.toDate()),a=zAe(t,r,n,i),a&&(e=e.add(1,"d"),e>o))throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");t=t.add(1,"d")}return[e,s]},"fixTaskDates"),_B=x(function(t,e,r){if(r=r.trim(),x(o=>{const l=o.trim();return l==="x"||l==="X"},"isTimestampFormat")(e)&&/^\d+$/.test(r))return new Date(Number(r));const a=/^after\s+(?<ids>[\d\w- ]+)/.exec(r);if(a!==null){let o=null;for(const u of a.groups.ids.split(" ")){let h=Fg(u);h!==void 0&&(!o||h.endTime>o.endTime)&&(o=h)}if(o)return o.endTime;const l=new Date;return l.setHours(0,0,0,0),l}let s=xa(r,e.trim(),!0);if(s.isValid())return s.toDate();{le.debug("Invalid date:"+r),le.debug("With date format:"+e.trim());const o=new Date(r);if(o===void 0||isNaN(o.getTime())||o.getFullYear()<-1e4||o.getFullYear()>1e4)throw new Error("Invalid date:"+r);return o}},"getStartDate"),GAe=x(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),WAe=x(function(t,e,r,n=!1){r=r.trim();const a=/^until\s+(?<ids>[\d\w- ]+)/.exec(r);if(a!==null){let h=null;for(const f of a.groups.ids.split(" ")){let p=Fg(f);p!==void 0&&(!h||p.startTime<h.startTime)&&(h=p)}if(h)return h.startTime;const d=new Date;return d.setHours(0,0,0,0),d}let s=xa(r,e.trim(),!0);if(s.isValid())return n&&(s=s.add(1,"d")),s.toDate();let o=xa(t);const[l,u]=GAe(r);if(!Number.isNaN(l)){const h=o.add(l,u);h.isValid()&&(o=h)}return o.toDate()},"getEndDate"),j3=0,Ay=x(function(t){return t===void 0?(j3=j3+1,"task"+j3):t},"parseId"),T_t=x(function(t,e){let r;e.substr(0,1)===":"?r=e.substr(1,e.length):r=e;const n=r.split(","),i={};wU(n,i,BAe);for(let s=0;s<n.length;s++)n[s]=n[s].trim();let a="";switch(n.length){case 1:i.id=Ay(),i.startTime=t.endTime,a=n[0];break;case 2:i.id=Ay(),i.startTime=_B(void 0,Gc,n[0]),a=n[1];break;case 3:i.id=Ay(n[0]),i.startTime=_B(void 0,Gc,n[1]),a=n[2];break}return a&&(i.endTime=WAe(i.startTime,Gc,a,YS),i.manualEndTime=xa(a,"YYYY-MM-DD",!0).isValid(),VAe(i,Gc,sx,ax)),i},"compileData"),w_t=x(function(t,e){let r;e.substr(0,1)===":"?r=e.substr(1,e.length):r=e;const n=r.split(","),i={};wU(n,i,BAe);for(let a=0;a<n.length;a++)n[a]=n[a].trim();switch(n.length){case 1:i.id=Ay(),i.startTime={type:"prevTaskEnd",id:t},i.endTime={data:n[0]};break;case 2:i.id=Ay(),i.startTime={type:"getStartDate",startData:n[0]},i.endTime={data:n[1]};break;case 3:i.id=Ay(n[0]),i.startTime={type:"getStartDate",startData:n[1]},i.endTime={data:n[2]};break}return i},"parseData"),RB,K3,ea=[],HAe={},C_t=x(function(t,e){const r={section:ox,type:ox,processed:!1,manualEndTime:!1,renderEndTime:null,raw:{data:e},task:t,classes:[]},n=w_t(K3,e);r.raw.startTime=n.startTime,r.raw.endTime=n.endTime,r.id=n.id,r.prevTaskId=K3,r.active=n.active,r.done=n.done,r.crit=n.crit,r.milestone=n.milestone,r.vert=n.vert,r.vert?r.order=-1:(r.order=AB,AB++);const i=ea.push(r);K3=r.id,HAe[r.id]=i-1},"addTask"),Fg=x(function(t){const e=HAe[t];return ea[e]},"findTaskById"),k_t=x(function(t,e){const r={section:ox,type:ox,description:t,task:t,classes:[]},n=T_t(RB,e);r.startTime=n.startTime,r.endTime=n.endTime,r.id=n.id,r.active=n.active,r.done=n.done,r.crit=n.crit,r.milestone=n.milestone,r.vert=n.vert,RB=r,v6.push(r)},"addTaskOrg"),die=x(function(){const t=x(function(r){const n=ea[r];let i="";switch(ea[r].raw.startTime.type){case"prevTaskEnd":{const a=Fg(n.prevTaskId);n.startTime=a.endTime;break}case"getStartDate":i=_B(void 0,Gc,ea[r].raw.startTime.startData),i&&(ea[r].startTime=i);break}return ea[r].startTime&&(ea[r].endTime=WAe(ea[r].startTime,Gc,ea[r].raw.endTime.data,YS),ea[r].endTime&&(ea[r].processed=!0,ea[r].manualEndTime=xa(ea[r].raw.endTime.data,"YYYY-MM-DD",!0).isValid(),VAe(ea[r],Gc,sx,ax))),ea[r].processed},"compileTask");let e=!0;for(const[r,n]of ea.entries())t(r),e=e&&n.processed;return e},"compileTasks"),S_t=x(function(t,e){let r=e;Fe().securityLevel!=="loose"&&(r=ig.sanitizeUrl(e)),t.split(",").forEach(function(n){Fg(n)!==void 0&&(UAe(n,()=>{window.open(r,"_self")}),mU.set(n,r))}),qAe(t,"clickable")},"setLink"),qAe=x(function(t,e){t.split(",").forEach(function(r){let n=Fg(r);n!==void 0&&n.classes.push(e)})},"setClass"),E_t=x(function(t,e,r){if(Fe().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a<n.length;a++){let s=n[a].trim();s.startsWith('"')&&s.endsWith('"')&&(s=s.substr(1,s.length-2)),n[a]=s}}n.length===0&&n.push(t),Fg(t)!==void 0&&UAe(t,()=>{yr.runFunc(e,...n)})},"setClickFun"),UAe=x(function(t,e){bU.push(function(){const r=ay?`${ay}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=ay?`${ay}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),A_t=x(function(t,e,r){t.split(",").forEach(function(n){E_t(n,e,r)}),qAe(t,"clickable")},"setClickEvent"),__t=x(function(t){bU.forEach(function(e){e(t)})},"bindFunctions"),R_t={getConfig:x(()=>Fe().gantt,"getConfig"),clear:YAt,setDateFormat:t_t,getDateFormat:l_t,enableInclusiveEndDates:r_t,endDatesAreInclusive:n_t,enableTopAxis:i_t,topAxisEnabled:a_t,setAxisFormat:jAt,getAxisFormat:KAt,setTickInterval:ZAt,getTickInterval:QAt,setTodayMarker:JAt,getTodayMarker:e_t,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,setDiagramId:XAt,setDisplayMode:s_t,getDisplayMode:o_t,setAccDescription:ii,getAccDescription:ai,addSection:p_t,getSections:g_t,getTasks:m_t,addTask:C_t,findTaskById:Fg,addTaskOrg:k_t,setIncludes:c_t,getIncludes:u_t,setExcludes:h_t,getExcludes:d_t,setClickEvent:A_t,setLink:S_t,getLinks:f_t,bindFunctions:__t,parseDuration:GAe,isInvalidDate:zAe,setWeekday:y_t,getWeekday:v_t,setWeekend:b_t};function wU(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){const a="^\\s*"+i+"\\s*$",s=new RegExp(a);t[0].match(s)&&(e[i]=!0,t.shift(1),n=!0)})}x(wU,"getTaskTags");xa.extend(qAt);var L_t=x(function(){le.debug("Something is calling, setConf, remove the call")},"setConf"),fie={monday:LC,tuesday:Wce,wednesday:Hce,thursday:M0,friday:qce,saturday:Uce,sunday:Kk},M_t=x((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((a,s)=>a.startTime-s.startTime||a.order-s.order),i=0;for(const a of n)for(let s=0;s<r.length;s++)if(a.startTime>=r[s]){r[s]=a.endTime,a.order=s+e,s>i&&(i=s);break}return i},"getMaxIntersections"),Nu,FN=1e4,I_t=x(function(t,e,r,n){const i=Fe().gantt;n.db.setDiagramId(e);const a=Fe().securityLevel;let s;a==="sandbox"&&(s=ut("#i"+e));const o=ut(a==="sandbox"?s.nodes()[0].contentDocument.body:"body"),l=a==="sandbox"?s.nodes()[0].contentDocument:document,u=l.getElementById(e);Nu=u.parentElement.offsetWidth,Nu===void 0&&(Nu=1200),i.useWidth!==void 0&&(Nu=i.useWidth);const h=n.db.getTasks(),d=h.filter(M=>!M.vert);let f=[];for(const M of d)f.push(M.type);f=_(f);const p={};let g=2*i.topPadding;if(n.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const M={};for(const P of d)M[P.section]===void 0?M[P.section]=[P]:M[P.section].push(P);let L=0;for(const P of Object.keys(M)){const D=M_t(M[P],L)+1;L+=D,g+=D*(i.barHeight+i.barGap),p[P]=D}}else{g+=d.length*(i.barHeight+i.barGap);for(const M of f)p[M]=d.filter(L=>L.type===M).length}u.setAttribute("viewBox","0 0 "+Nu+" "+g);const m=o.select(`[id="${e}"]`),y=Kqe().domain([nze(h,function(M){return M.startTime}),rze(h,function(M){return M.endTime})]).rangeRound([0,Nu-i.leftPadding-i.rightPadding]);function v(M,L){const P=M.startTime,D=L.startTime;let R=0;return P>D?R=1:P<D&&(R=-1),R}x(v,"taskCompare"),h.sort(v),T(h,Nu,g),Ai(m,g,Nu,i.useMaxWidth),m.append("text").text(n.db.getDiagramTitle()).attr("x",Nu/2).attr("y",i.titleTopMargin).attr("class","titleText");function T(M,L,P){const D=i.barHeight,R=D+i.barGap,I=i.topPadding,$=i.leftPadding,O=Sb().domain([0,f.length]).range(["#00B9FA","#F95002"]).interpolate(EGe);w(R,I,$,L,P,M,n.db.getExcludes(),n.db.getIncludes()),S($,I,L,P),b(M,R,I,$,D,O,L),k(R,I),E($,I,L,P)}x(T,"makeGantt");function b(M,L,P,D,R,I,$){M.sort((G,H)=>G.vert===H.vert?0:G.vert?1:-1);const O=M.filter(G=>!G.vert),F=[...new Set(O.map(G=>G.order))].map(G=>O.find(H=>H.order===G));m.append("g").selectAll("rect").data(F).enter().append("rect").attr("x",0).attr("y",function(G,H){return H=G.order,H*L+P-2}).attr("width",function(){return $-i.rightPadding/2}).attr("height",L).attr("class",function(G){for(const[H,q]of f.entries())if(G.type===q)return"section section"+H%i.numberSectionStyles;return"section section0"}).enter();const z=m.append("g").selectAll("rect").data(M).enter(),V=n.db.getLinks();if(z.append("rect").attr("id",function(G){return e+"-"+G.id}).attr("rx",3).attr("ry",3).attr("x",function(G){return G.milestone?y(G.startTime)+D+.5*(y(G.endTime)-y(G.startTime))-.5*R:y(G.startTime)+D}).attr("y",function(G,H){return H=G.order,G.vert?i.gridLineStartPadding:H*L+P}).attr("width",function(G){return G.milestone?R:G.vert?.08*R:y(G.renderEndTime||G.endTime)-y(G.startTime)}).attr("height",function(G){return G.vert?O.length*(i.barHeight+i.barGap)+i.barHeight*2:R}).attr("transform-origin",function(G,H){return H=G.order,(y(G.startTime)+D+.5*(y(G.endTime)-y(G.startTime))).toString()+"px "+(H*L+P+.5*R).toString()+"px"}).attr("class",function(G){const H="task";let q="";G.classes.length>0&&(q=G.classes.join(" "));let Z=0;for(const[ie,K]of f.entries())G.type===K&&(Z=ie%i.numberSectionStyles);let Y="";return G.active?G.crit?Y+=" activeCrit":Y=" active":G.done?G.crit?Y=" doneCrit":Y=" done":G.crit&&(Y+=" crit"),Y.length===0&&(Y=" task"),G.milestone&&(Y=" milestone "+Y),G.vert&&(Y=" vert "+Y),Y+=Z,Y+=" "+q,H+Y}),z.append("text").attr("id",function(G){return e+"-"+G.id+"-text"}).text(function(G){return G.task}).attr("font-size",i.fontSize).attr("x",function(G){let H=y(G.startTime),q=y(G.renderEndTime||G.endTime);if(G.milestone&&(H+=.5*(y(G.endTime)-y(G.startTime))-.5*R,q=H+R),G.vert)return y(G.startTime)+D;const Z=this.getBBox().width;return Z>q-H?q+Z+1.5*i.leftPadding>$?H+D-5:q+D+5:(q-H)/2+H+D}).attr("y",function(G,H){return G.vert?i.gridLineStartPadding+O.length*(i.barHeight+i.barGap)+60:(H=G.order,H*L+i.barHeight/2+(i.fontSize/2-2)+P)}).attr("text-height",R).attr("class",function(G){const H=y(G.startTime);let q=y(G.endTime);G.milestone&&(q=H+R);const Z=this.getBBox().width;let Y="";G.classes.length>0&&(Y=G.classes.join(" "));let ie=0;for(const[Q,te]of f.entries())G.type===te&&(ie=Q%i.numberSectionStyles);let K="";return G.active&&(G.crit?K="activeCritText"+ie:K="activeText"+ie),G.done?G.crit?K=K+" doneCritText"+ie:K=K+" doneText"+ie:G.crit&&(K=K+" critText"+ie),G.milestone&&(K+=" milestoneText"),G.vert&&(K+=" vertText"),Z>q-H?q+Z+1.5*i.leftPadding>$?Y+" taskTextOutsideLeft taskTextOutside"+ie+" "+K:Y+" taskTextOutsideRight taskTextOutside"+ie+" "+K+" width-"+Z:Y+" taskText taskText"+ie+" "+K+" width-"+Z}),Fe().securityLevel==="sandbox"){let G;G=ut("#i"+e);const H=G.nodes()[0].contentDocument;z.filter(function(q){return V.has(q.id)}).each(function(q){var Z=H.querySelector("#"+CSS.escape(e+"-"+q.id)),Y=H.querySelector("#"+CSS.escape(e+"-"+q.id+"-text"));const ie=Z.parentNode;var K=H.createElement("a");K.setAttribute("xlink:href",V.get(q.id)),K.setAttribute("target","_top"),ie.appendChild(K),K.appendChild(Z),K.appendChild(Y)})}}x(b,"drawRects");function w(M,L,P,D,R,I,$,O){if($.length===0&&O.length===0)return;let N,F;for(const{startTime:q,endTime:Z}of I)(N===void 0||q<N)&&(N=q),(F===void 0||Z>F)&&(F=Z);if(!N||!F)return;if(xa(F).diff(xa(N),"year")>5){le.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const z=n.db.getDateFormat(),V=[];let B=null,G=xa(N);for(;G.valueOf()<=F;)n.db.isInvalidDate(G,z,$,O)?B?B.end=G:B={start:G,end:G}:B&&(V.push(B),B=null),G=G.add(1,"d");m.append("g").selectAll("rect").data(V).enter().append("rect").attr("id",q=>e+"-exclude-"+q.start.format("YYYY-MM-DD")).attr("x",q=>y(q.start.startOf("day"))+P).attr("y",i.gridLineStartPadding).attr("width",q=>y(q.end.endOf("day"))-y(q.start.startOf("day"))).attr("height",R-L-i.gridLineStartPadding).attr("transform-origin",function(q,Z){return(y(q.start)+P+.5*(y(q.end)-y(q.start))).toString()+"px "+(Z*M+.5*R).toString()+"px"}).attr("class","exclude-range")}x(w,"drawExcludeDays");function C(M,L,P,D){if(P<=0||M>L)return 1/0;const R=L-M,I=xa.duration({[D??"day"]:P}).asMilliseconds();return I<=0?1/0:Math.ceil(R/I)}x(C,"getEstimatedTickCount");function S(M,L,P,D){const R=n.db.getDateFormat(),I=n.db.getAxisFormat();let $;I?$=I:R==="D"?$="%d":$=i.axisFormat??"%Y-%m-%d";let O=dze(y).tickSize(-D+L+i.gridLineStartPadding).tickFormat(vA($));const F=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||i.tickInterval);if(F!==null){const z=parseInt(F[1],10);if(isNaN(z)||z<=0)le.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const V=F[2],B=n.db.getWeekday()||i.weekday,G=y.domain(),H=G[0],q=G[1],Z=C(H,q,z,V);if(Z>FN)le.warn(`The tick interval "${z}${V}" would generate ${Z} ticks, which exceeds the maximum allowed (${FN}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(V){case"millisecond":O.ticks(Eb.every(z));break;case"second":O.ticks(_d.every(z));break;case"minute":O.ticks(_C.every(z));break;case"hour":O.ticks(RC.every(z));break;case"day":O.ticks(L0.every(z));break;case"week":O.ticks(fie[B].every(z));break;case"month":O.ticks(MC.every(z));break}}}if(m.append("g").attr("class","grid").attr("transform","translate("+M+", "+(D-50)+")").call(O).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||i.topAxis){let z=hze(y).tickSize(-D+L+i.gridLineStartPadding).tickFormat(vA($));if(F!==null){const V=parseInt(F[1],10);if(isNaN(V)||V<=0)le.warn(`Invalid tick interval value: "${F[1]}". Skipping custom tick interval.`);else{const B=F[2],G=n.db.getWeekday()||i.weekday,H=y.domain(),q=H[0],Z=H[1];if(C(q,Z,V,B)<=FN)switch(B){case"millisecond":z.ticks(Eb.every(V));break;case"second":z.ticks(_d.every(V));break;case"minute":z.ticks(_C.every(V));break;case"hour":z.ticks(RC.every(V));break;case"day":z.ticks(L0.every(V));break;case"week":z.ticks(fie[G].every(V));break;case"month":z.ticks(MC.every(V));break}}}m.append("g").attr("class","grid").attr("transform","translate("+M+", "+L+")").call(z).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}x(S,"makeGrid");function k(M,L){let P=0;const D=Object.keys(p).map(R=>[R,p[R]]);m.append("g").selectAll("text").data(D).enter().append(function(R){const I=R[0].split(At.lineBreakRegex),$=-(I.length-1)/2,O=l.createElementNS("http://www.w3.org/2000/svg","text");O.setAttribute("dy",$+"em");for(const[N,F]of I.entries()){const z=l.createElementNS("http://www.w3.org/2000/svg","tspan");z.setAttribute("alignment-baseline","central"),z.setAttribute("x","10"),N>0&&z.setAttribute("dy","1em"),z.textContent=F,O.appendChild(z)}return O}).attr("x",10).attr("y",function(R,I){if(I>0)for(let $=0;$<I;$++)return P+=D[I-1][1],R[1]*M/2+P*M+L;else return R[1]*M/2+L}).attr("font-size",i.sectionFontSize).attr("class",function(R){for(const[I,$]of f.entries())if(R[0]===$)return"sectionTitle sectionTitle"+I%i.numberSectionStyles;return"sectionTitle"})}x(k,"vertLabels");function E(M,L,P,D){const R=n.db.getTodayMarker();if(R==="off")return;const I=m.append("g").attr("class","today"),$=new Date,O=I.append("line");O.attr("x1",y($)+M).attr("x2",y($)+M).attr("y1",i.titleTopMargin).attr("y2",D-i.titleTopMargin).attr("class","today"),R!==""&&O.attr("style",R.replace(/,/g,";"))}x(E,"drawToday");function _(M){const L={},P=[];for(let D=0,R=M.length;D<R;++D)Object.prototype.hasOwnProperty.call(L,M[D])||(L[M[D]]=!0,P.push(M[D]));return P}x(_,"checkUnique")},"draw"),N_t={setConf:L_t,draw:I_t},D_t=x(t=>`
.mermaid-main-font {
font-family: ${t.fontFamily};
}
.exclude-range {
fill: ${t.excludeBkgColor};
}
.section {
stroke: none;
opacity: 0.2;
}
.section0 {
fill: ${t.sectionBkgColor};
}
.section2 {
fill: ${t.sectionBkgColor2};
}
.section1,
.section3 {
fill: ${t.altSectionBkgColor};
opacity: 0.2;
}
.sectionTitle0 {
fill: ${t.titleColor};
}
.sectionTitle1 {
fill: ${t.titleColor};
}
.sectionTitle2 {
fill: ${t.titleColor};
}
.sectionTitle3 {
fill: ${t.titleColor};
}
.sectionTitle {
text-anchor: start;
font-family: ${t.fontFamily};
}
/* Grid and axis */
.grid .tick {
stroke: ${t.gridColor};
opacity: 0.8;
shape-rendering: crispEdges;
}
.grid .tick text {
font-family: ${t.fontFamily};
fill: ${t.textColor};
}
.grid path {
stroke-width: 0;
}
/* Today line */
.today {
fill: none;
stroke: ${t.todayLineColor};
stroke-width: 2px;
}
/* Task styling */
/* Default task */
.task {
stroke-width: 2;
}
.taskText {
text-anchor: middle;
font-family: ${t.fontFamily};
}
.taskTextOutsideRight {
fill: ${t.taskTextDarkColor};
text-anchor: start;
font-family: ${t.fontFamily};
}
.taskTextOutsideLeft {
fill: ${t.taskTextDarkColor};
text-anchor: end;
}
/* Special case clickable */
.task.clickable {
cursor: pointer;
}
.taskText.clickable {
cursor: pointer;
fill: ${t.taskTextClickableColor} !important;
font-weight: bold;
}
.taskTextOutsideLeft.clickable {
cursor: pointer;
fill: ${t.taskTextClickableColor} !important;
font-weight: bold;
}
.taskTextOutsideRight.clickable {
cursor: pointer;
fill: ${t.taskTextClickableColor} !important;
font-weight: bold;
}
/* Specific task settings for the sections*/
.taskText0,
.taskText1,
.taskText2,
.taskText3 {
fill: ${t.taskTextColor};
}
.task0,
.task1,
.task2,
.task3 {
fill: ${t.taskBkgColor};
stroke: ${t.taskBorderColor};
}
.taskTextOutside0,
.taskTextOutside2
{
fill: ${t.taskTextOutsideColor};
}
.taskTextOutside1,
.taskTextOutside3 {
fill: ${t.taskTextOutsideColor};
}
/* Active task */
.active0,
.active1,
.active2,
.active3 {
fill: ${t.activeTaskBkgColor};
stroke: ${t.activeTaskBorderColor};
}
.activeText0,
.activeText1,
.activeText2,
.activeText3 {
fill: ${t.taskTextDarkColor} !important;
}
/* Completed task */
.done0,
.done1,
.done2,
.done3 {
stroke: ${t.doneTaskBorderColor};
fill: ${t.doneTaskBkgColor};
stroke-width: 2;
}
.doneText0,
.doneText1,
.doneText2,
.doneText3 {
fill: ${t.taskTextDarkColor} !important;
}
/* Done task text displayed outside the bar sits against the diagram background,
not against the done-task bar, so it must use the outside/contrast color. */
.doneText0.taskTextOutsideLeft,
.doneText0.taskTextOutsideRight,
.doneText1.taskTextOutsideLeft,
.doneText1.taskTextOutsideRight,
.doneText2.taskTextOutsideLeft,
.doneText2.taskTextOutsideRight,
.doneText3.taskTextOutsideLeft,
.doneText3.taskTextOutsideRight {
fill: ${t.taskTextOutsideColor} !important;
}
/* Tasks on the critical line */
.crit0,
.crit1,
.crit2,
.crit3 {
stroke: ${t.critBorderColor};
fill: ${t.critBkgColor};
stroke-width: 2;
}
.activeCrit0,
.activeCrit1,
.activeCrit2,
.activeCrit3 {
stroke: ${t.critBorderColor};
fill: ${t.activeTaskBkgColor};
stroke-width: 2;
}
.doneCrit0,
.doneCrit1,
.doneCrit2,
.doneCrit3 {
stroke: ${t.critBorderColor};
fill: ${t.doneTaskBkgColor};
stroke-width: 2;
cursor: pointer;
shape-rendering: crispEdges;
}
.milestone {
transform: rotate(45deg) scale(0.8,0.8);
}
.milestoneText {
font-style: italic;
}
.doneCritText0,
.doneCritText1,
.doneCritText2,
.doneCritText3 {
fill: ${t.taskTextDarkColor} !important;
}
/* Done-crit task text outside the bar — same reasoning as doneText above. */
.doneCritText0.taskTextOutsideLeft,
.doneCritText0.taskTextOutsideRight,
.doneCritText1.taskTextOutsideLeft,
.doneCritText1.taskTextOutsideRight,
.doneCritText2.taskTextOutsideLeft,
.doneCritText2.taskTextOutsideRight,
.doneCritText3.taskTextOutsideLeft,
.doneCritText3.taskTextOutsideRight {
fill: ${t.taskTextOutsideColor} !important;
}
.vert {
stroke: ${t.vertLineColor};
}
.vertText {
font-size: 15px;
text-anchor: middle;
fill: ${t.vertLineColor} !important;
}
.activeCritText0,
.activeCritText1,
.activeCritText2,
.activeCritText3 {
fill: ${t.taskTextDarkColor} !important;
}
.titleText {
text-anchor: middle;
font-size: 18px;
fill: ${t.titleColor||t.textColor};
font-family: ${t.fontFamily};
}
`,"getStyles"),O_t=D_t,$_t={parser:UAt,db:R_t,renderer:N_t,styles:O_t};const P_t=Object.freeze(Object.defineProperty({__proto__:null,diagram:$_t},Symbol.toStringTag,{value:"Module"}));var B_t={parse:x(async t=>{const e=await Al("info",t);le.debug(e)},"parse")},F_t={version:"11.16.1"},z_t=x(()=>F_t.version,"getVersion"),V_t={getVersion:z_t},G_t=x((t,e,r)=>{le.debug(`rendering info diagram
`+t);const n=xs(e);Ai(n,100,400,!0),n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)},"draw"),W_t={draw:G_t},H_t={parser:B_t,db:V_t,renderer:W_t};const q_t=Object.freeze(Object.defineProperty({__proto__:null,diagram:H_t},Symbol.toStringTag,{value:"Module"}));var U_t=Vr.pie,CU={sections:new Map,showData:!1},x6=CU.sections,kU=CU.showData,Y_t=structuredClone(U_t),X_t=x(()=>structuredClone(Y_t),"getConfig"),j_t=x(()=>{x6=new Map,kU=CU.showData,On()},"clear"),K_t=x(({label:t,value:e})=>{if(e<0)throw new Error(`"${t}" has invalid value: ${e}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);x6.has(t)||(x6.set(t,e),le.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),Z_t=x(()=>x6,"getSections"),Q_t=x(t=>{kU=t},"setShowData"),J_t=x(()=>kU,"getShowData"),YAe={getConfig:X_t,clear:j_t,setDiagramTitle:ti,getDiagramTitle:Yn,setAccTitle:Hn,getAccTitle:ni,setAccDescription:ii,getAccDescription:ai,addSection:K_t,getSections:Z_t,setShowData:Q_t,getShowData:J_t},e6t=x((t,e)=>{eo(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),t6t={parse:x(async t=>{const e=await Al("pie",t);le.debug(e),e6t(e,YAe)},"parse")},r6t=x(t=>`
.pieCircle{
stroke: ${t.pieStrokeColor};
stroke-width : ${t.pieStrokeWidth};
opacity : ${t.pieOpacity};
}
.pieCircle.highlighted{
scale: 1.05;
opacity: 1;
}
.pieCircle.highlightedOnHover:hover{
transition-duration: 250ms;
scale: 1.05;
opacity: 1;
}
.pieOuterCircle{
stroke: ${t.pieOuterStrokeColor};
stroke-width: ${t.pieOuterStrokeWidth};
fill: none;
}
.pieTitleText {
text-anchor: middle;
font-size: ${t.pieTitleTextSize};
fill: ${t.pieTitleTextColor};
font-family: ${t.fontFamily};
}
.slice {
font-family: ${t.fontFamily};
fill: ${t.pieSectionTextColor};
font-size:${t.pieSectionTextSize};
// fill: white;
}
.legend text {
fill: ${t.pieLegendTextColor};
font-family: ${t.fontFamily};
font-size: ${t.pieLegendTextSize};
}
`,"getStyles"),n6t=r6t,i6t=x(t=>{const e=[...t.values()].reduce((i,a)=>i+a,0),r=[...t.entries()].map(([i,a])=>({label:i,value:a})).filter(i=>i.value/e*100>=1);return hUe().value(i=>i.value).sort(null)(r)},"createPieArcs"),a6t=x((t,e,r,n)=>{var Y;le.debug(`rendering pie chart
`+t);const i=n.db,a=Fe(),s=ri(i.getConfig(),a.pie),o=40,l=18,u=4,h=450,d=h,f=xs(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=a;let[m]=Oh(g.pieOuterStrokeWidth);m??(m=2);const y=s.legendPosition,v=s.textPosition,T=s.donutHole>0&&s.donutHole<=.9?s.donutHole:0,b=Math.min(d,h)/2-o,w=_b().innerRadius(T*b).outerRadius(b),C=_b().innerRadius(b*v).outerRadius(b*v),S=p.append("g");S.append("circle").attr("cx",0).attr("cy",0).attr("r",b+m/2).attr("class","pieOuterCircle");const k=i.getSections(),E=i6t(k),_=[g.pie1,g.pie2,g.pie3,g.pie4,g.pie5,g.pie6,g.pie7,g.pie8,g.pie9,g.pie10,g.pie11,g.pie12];let M=0;k.forEach(ie=>{M+=ie});const L=E.filter(ie=>(ie.data.value/M*100).toFixed(0)!=="0"),P=h0(_).domain([...k.keys()]);S.selectAll("mySlices").data(L).enter().append("path").attr("d",w).attr("fill",ie=>P(ie.data.label)).attr("class",ie=>{let K="pieCircle";return s.highlightSlice==="hover"?K+=" highlightedOnHover":s.highlightSlice===ie.data.label&&(K+=" highlighted"),K}),S.selectAll("mySlices").data(L).enter().append("text").text(ie=>(ie.data.value/M*100).toFixed(0)+"%").attr("transform",ie=>"translate("+C.centroid(ie)+")").style("text-anchor","middle").attr("class","slice");const D=p.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),R=[...k.entries()].map(([ie,K])=>({label:ie,value:K})),I=p.selectAll(".legend").data(R).enter().append("g").attr("class","legend");I.append("rect").attr("width",l).attr("height",l).style("fill",ie=>P(ie.label)).style("stroke",ie=>P(ie.label)),I.append("text").attr("x",l+u).attr("y",l-u).text(ie=>i.getShowData()?`${ie.label} [${ie.value}]`:ie.label);const $=Math.max(...I.selectAll("text").nodes().map(ie=>(ie==null?void 0:ie.getBoundingClientRect().width)??0));let O=h,N=d+o;const F=l+u,z=R.length*F;switch(y){case"center":I.attr("transform",(ie,K)=>{const Q=F*R.length/2,te=-$/2-(l+u),J=K*F-Q;return"translate("+te+","+J+")"});break;case"top":O+=z,I.attr("transform",(ie,K)=>{const Q=b,te=-$/2-(l+u),J=K*F-Q;return`translate(${te}, ${J})`}),S.attr("transform",()=>`translate(0, ${z+F})`);break;case"bottom":O+=z,I.attr("transform",(ie,K)=>{const Q=-b-F,te=-$/2-(l+u),J=K*F-Q;return"translate("+te+","+J+")"});break;case"left":N+=l+u+$,I.attr("transform",(ie,K)=>{const Q=F*R.length/2,te=-b-(l+u),J=K*F-Q;return"translate("+te+","+J+")"}),S.attr("transform",()=>`translate(${$+l+u}, 0)`);break;case"right":default:N+=l+u+$,I.attr("transform",(ie,K)=>{const Q=F*R.length/2,te=12*l,J=K*F-Q;return"translate("+te+","+J+")"});break}const V=((Y=D.node())==null?void 0:Y.getBoundingClientRect().width)??0,B=d/2-V/2,G=d/2+V/2,H=Math.min(0,B),Z=Math.max(N,G)-H;f.attr("viewBox",`${H} 0 ${Z} ${O}`),Ai(f,O,Z,s.useMaxWidth)},"draw"),s6t={draw:a6t},o6t={parser:t6t,db:YAe,renderer:s6t,styles:n6t};const l6t=Object.freeze(Object.defineProperty({__proto__:null,diagram:o6t},Symbol.toStringTag,{value:"Module"}));var LB=(function(){var t=x(function(j,ue,X,Oe){for(X=X||{},Oe=j.length;Oe--;X[j[Oe]]=ue);return X},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[1,7],s=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],o=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],h=[1,37],d=[1,36],f=[1,38],p=[1,35],g=[1,43],m=[1,41],y=[1,45],v=[1,14],T=[1,23],b=[1,18],w=[1,19],C=[1,20],S=[1,21],k=[1,22],E=[1,24],_=[1,25],M=[1,26],L=[1,27],P=[1,28],D=[1,29],R=[1,32],I=[1,33],$=[1,34],O=[1,39],N=[1,40],F=[1,42],z=[1,44],V=[1,63],B=[1,62],G=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],H=[1,66],q=[1,67],Z=[1,68],Y=[1,69],ie=[1,70],K=[1,71],Q=[1,72],te=[1,73],J=[1,74],ge=[1,75],ee=[1,76],Re=[1,77],Ie=[4,5,6,7,8,9,10,11,12,13,14,15,18],Be=[1,91],ce=[1,92],oe=[1,93],be=[1,100],fe=[1,94],Pe=[1,97],ve=[1,95],Ce=[1,96],Ve=[1,98],se=[1,99],de=[1,103],Te=[10,55,56,57],ae=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],he={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:x(function(ue,X,Oe,xe,Ge,_e,$e){var Me=_e.length-1;switch(Ge){case 23:this.$=_e[Me];break;case 24:this.$=_e[Me-1]+""+_e[Me];break;case 26:this.$=_e[Me-1]+_e[Me];break;case 27:this.$=[_e[Me].trim()];break;case 28:_e[Me-2].push(_e[Me].trim()),this.$=_e[Me-2];break;case 29:this.$=_e[Me-4],xe.addClass(_e[Me-2],_e[Me]);break;case 37:this.$=[];break;case 42:this.$=_e[Me].trim(),xe.setDiagramTitle(this.$);break;case 43:this.$=_e[Me].trim(),xe.setAccTitle(this.$);break;case 44:case 45:this.$=_e[Me].trim(),xe.setAccDescription(this.$);break;case 46:xe.addSection(_e[Me].substr(8)),this.$=_e[Me].substr(8);break;case 47:xe.addPoint(_e[Me-3],"",_e[Me-1],_e[Me],[]);break;case 48:xe.addPoint(_e[Me-4],_e[Me-3],_e[Me-1],_e[Me],[]);break;case 49:xe.addPoint(_e[Me-4],"",_e[Me-2],_e[Me-1],_e[Me]);break;case 50:xe.addPoint(_e[Me-5],_e[Me-4],_e[Me-2],_e[Me-1],_e[Me]);break;case 51:xe.setXAxisLeftText(_e[Me-2]),xe.setXAxisRightText(_e[Me]);break;case 52:_e[Me-1].text+=" ⟶ ",xe.setXAxisLeftText(_e[Me-1]);break;case 53:xe.setXAxisLeftText(_e[Me]);break;case 54:xe.setYAxisBottomText(_e[Me-2]),xe.setYAxisTopText(_e[Me]);break;case 55:_e[Me-1].text+=" ⟶ ",xe.setYAxisBottomText(_e[Me-1]);break;case 56:xe.setYAxisBottomText(_e[Me]);break;case 57:xe.setQuadrant1Text(_e[Me]);break;case 58:xe.setQuadrant2Text(_e[Me]);break;case 59:xe.setQuadrant3Text(_e[Me]);break;case 60:xe.setQuadrant4Text(_e[Me]);break;case 64:this.$={text:_e[Me],type:"text"};break;case 65:this.$={text:_e[Me-1].text+""+_e[Me],type:_e[Me-1].type};break;case 66:this.$={text:_e[Me],type:"text"};break;case 67:this.$={text:_e[Me],type:"markdown"};break;case 68:this.$=_e[Me];break;case 69:this.$=_e[Me-1]+""+_e[Me];break}},"anonymous"),table:[{18:e,26:1,27:2,28:r,55:n,56:i,57:a},{1:[3]},{18:e,26:8,27:2,28:r,55:n,56:i,57:a},{18:e,26:9,27:2,28:r,55:n,56:i,57:a},t(s,[2,33],{29:10}),t(o,[2,61]),t(o,[2,62]),t(o,[2,63]),{1:[2,30]},{1:[2,31]},t(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:T,35:b,37:w,39:C,41:S,42:k,48:E,50:_,51:M,52:L,53:P,54:D,60:R,61:I,63:$,64:O,65:N,66:F,67:z}),t(s,[2,34]),{27:46,55:n,56:i,57:a},t(l,[2,37]),t(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:h,5:d,10:f,12:p,13:g,14:m,15:y,18:v,25:T,35:b,37:w,39:C,41:S,42:k,48:E,50:_,51:M,52:L,53:P,54:D,60:R,61:I,63:$,64:O,65:N,66:F,67:z}),t(l,[2,39]),t(l,[2,40]),t(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(l,[2,45]),t(l,[2,46]),{18:[1,51]},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:52,58:31,60:R,61:I,63:$,64:O,65:N,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:53,58:31,60:R,61:I,63:$,64:O,65:N,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:54,58:31,60:R,61:I,63:$,64:O,65:N,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:55,58:31,60:R,61:I,63:$,64:O,65:N,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:56,58:31,60:R,61:I,63:$,64:O,65:N,66:F,67:z},{4:h,5:d,10:f,12:p,13:g,14:m,15:y,43:57,58:31,60:R,61:I,63:$,64:O,65:N,66:F,67:z},{4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,44:[1,58],47:[1,59],58:61,59:60,63:$,64:O,65:N,66:F,67:z},t(G,[2,64]),t(G,[2,66]),t(G,[2,67]),t(G,[2,70]),t(G,[2,71]),t(G,[2,72]),t(G,[2,73]),t(G,[2,74]),t(G,[2,75]),t(G,[2,76]),t(G,[2,77]),t(G,[2,78]),t(G,[2,79]),t(G,[2,80]),t(G,[2,81]),t(s,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:65,4:H,5:q,6:Z,7:Y,8:ie,9:K,10:Q,11:te,12:J,13:ge,14:ee,15:Re,21:64},t(l,[2,53],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,49:[1,78],63:$,64:O,65:N,66:F,67:z}),t(l,[2,56],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,49:[1,79],63:$,64:O,65:N,66:F,67:z}),t(l,[2,57],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:N,66:F,67:z}),t(l,[2,58],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:N,66:F,67:z}),t(l,[2,59],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:N,66:F,67:z}),t(l,[2,60],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:N,66:F,67:z}),{45:[1,80]},{44:[1,81]},t(G,[2,65]),t(G,[2,82]),t(G,[2,83]),t(G,[2,84]),{3:83,4:H,5:q,6:Z,7:Y,8:ie,9:K,10:Q,11:te,12:J,13:ge,14:ee,15:Re,18:[1,82]},t(Ie,[2,23]),t(Ie,[2,1]),t(Ie,[2,2]),t(Ie,[2,3]),t(Ie,[2,4]),t(Ie,[2,5]),t(Ie,[2,6]),t(Ie,[2,7]),t(Ie,[2,8]),t(Ie,[2,9]),t(Ie,[2,10]),t(Ie,[2,11]),t(Ie,[2,12]),t(l,[2,52],{58:31,43:84,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:R,61:I,63:$,64:O,65:N,66:F,67:z}),t(l,[2,55],{58:31,43:85,4:h,5:d,10:f,12:p,13:g,14:m,15:y,60:R,61:I,63:$,64:O,65:N,66:F,67:z}),{46:[1,86]},{45:[1,87]},{4:Be,5:ce,6:oe,8:be,11:fe,13:Pe,16:90,17:ve,18:Ce,19:Ve,20:se,22:89,23:88},t(Ie,[2,24]),t(l,[2,51],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:N,66:F,67:z}),t(l,[2,54],{59:60,58:61,4:h,5:d,8:V,10:f,12:p,13:g,14:m,15:y,18:B,63:$,64:O,65:N,66:F,67:z}),t(l,[2,47],{22:89,16:90,23:101,4:Be,5:ce,6:oe,8:be,11:fe,13:Pe,17:ve,18:Ce,19:Ve,20:se}),{46:[1,102]},t(l,[2,29],{10:de}),t(Te,[2,27],{16:104,4:Be,5:ce,6:oe,8:be,11:fe,13:Pe,17:ve,18:Ce,19:Ve,20:se}),t(ae,[2,25]),t(ae,[2,13]),t(ae,[2,14]),t(ae,[2,15]),t(ae,[2,16]),t(ae,[2,17]),t(ae,[2,18]),t(ae,[2,19]),t(ae,[2,20]),t(ae,[2,21]),t(ae,[2,22]),t(l,[2,49],{10:de}),t(l,[2,48],{22:89,16:90,23:105,4:Be,5:ce,6:oe,8:be,11:fe,13:Pe,17:ve,18:Ce,19:Ve,20:se}),{4:Be,5:ce,6:oe,8:be,11:fe,13:Pe,16:90,17:ve,18:Ce,19:Ve,20:se,22:106},t(ae,[2,26]),t(l,[2,50],{10:de}),t(Te,[2,28],{16:104,4:Be,5:ce,6:oe,8:be,11:fe,13:Pe,17:ve,18:Ce,19:Ve,20:se})],defaultActions:{8:[2,30],9:[2,31]},parseError:x(function(ue,X){if(X.recoverable)this.trace(ue);else{var Oe=new Error(ue);throw Oe.hash=X,Oe}},"parseError"),parse:x(function(ue){var X=this,Oe=[0],xe=[],Ge=[null],_e=[],$e=this.table,Me="",He=0,De=0,Ke=2,Ae=1,at=_e.slice.call(arguments,1),Ee=Object.create(this.lexer),pt={yy:{}};for(var ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ht)&&(pt.yy[ht]=this.yy[ht]);Ee.setInput(ue,pt.yy),pt.yy.lexer=Ee,pt.yy.parser=this,typeof Ee.yylloc>"u"&&(Ee.yylloc={});var rt=Ee.yylloc;_e.push(rt);var Et=Ee.options&&Ee.options.ranges;typeof pt.yy.parseError=="function"?this.parseError=pt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function vt(Nt){Oe.length=Oe.length-2*Nt,Ge.length=Ge.length-Nt,_e.length=_e.length-Nt}x(vt,"popStack");function ot(){var Nt;return Nt=xe.pop()||Ee.lex()||Ae,typeof Nt!="number"&&(Nt instanceof Array&&(xe=Nt,Nt=xe.pop()),Nt=X.symbols_[Nt]||Nt),Nt}x(ot,"lex");for(var pe,Ct,lt,st,mt={},_r,Se,Ue,tt;;){if(Ct=Oe[Oe.length-1],this.defaultActions[Ct]?lt=this.defaultActions[Ct]:((pe===null||typeof pe>"u")&&(pe=ot()),lt=$e[Ct]&&$e[Ct][pe]),typeof lt>"u"||!lt.length||!lt[0]){var kt="";tt=[];for(_r in $e[Ct])this.terminals_[_r]&&_r>Ke&&tt.push("'"+this.terminals_[_r]+"'");Ee.showPosition?kt="Parse error on line "+(He+1)+`:
`+Ee.showPosition()+`
Expecting `+tt.join(", ")+", got '"+(this.terminals_[pe]||pe)+"'":kt="Parse error on line "+(He+1)+": Unexpected "+(pe==Ae?"end of input":"'"+(this.terminals_[pe]||pe)+"'"),this.parseError(kt,{text:Ee.match,token:this.terminals_[pe]||pe,line:Ee.yylineno,loc:rt,expected:tt})}if(lt[0]instanceof Array&&lt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ct+", token: "+pe);switch(lt[0]){case 1:Oe.push(pe),Ge.push(Ee.yytext),_e.push(Ee.yylloc),Oe.push(lt[1]),pe=null,De=Ee.yyleng,Me=Ee.yytext,He=Ee.yylineno,rt=Ee.yylloc;break;case 2:if(Se=this.productions_[lt[1]][1],mt.$=Ge[Ge.length-Se],mt._$={first_line:_e[_e.length-(Se||1)].first_line,last_line:_e[_e.length-1].last_line,first_column:_e[_e.length-(Se||1)].first_column,last_column:_e[_e.length-1].last_column},Et&&(mt._$.range=[_e[_e.length-(Se||1)].range[0],_e[_e.length-1].range[1]]),st=this.performAction.apply(mt,[Me,De,He,pt.yy,lt[1],Ge,_e].concat(at)),typeof st<"u")return st;Se&&(Oe=Oe.slice(0,-1*Se*2),Ge=Ge.slice(0,-1*Se),_e=_e.slice(0,-1*Se)),Oe.push(this.productions_[lt[1]][0]),Ge.push(mt.$),_e.push(mt._$),Ue=$e[Oe[Oe.length-2]][Oe[Oe.length-1]],Oe.push(Ue);break;case 3:return!0}}return!0},"parse")},W=(function(){var j={EOF:1,parseError:x(function(X,Oe){if(this.yy.parser)this.yy.parser.parseError(X,Oe);else throw new Error(X)},"parseError"),setInput:x(function(ue,X){return this.yy=X||this.yy||{},this._input=ue,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var ue=this._input[0];this.yytext+=ue,this.yyleng++,this.offset++,this.match+=ue,this.matched+=ue;var X=ue.match(/(?:\r\n?|\n).*/g);return X?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ue},"input"),unput:x(function(ue){var X=ue.length,Oe=ue.split(/(?:\r\n?|\n)/g);this._input=ue+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-X),this.offset-=X;var xe=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Oe.length-1&&(this.yylineno-=Oe.length-1);var Ge=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Oe?(Oe.length===xe.length?this.yylloc.first_column:0)+xe[xe.length-Oe.length].length-Oe[0].length:this.yylloc.first_column-X},this.options.ranges&&(this.yylloc.range=[Ge[0],Ge[0]+this.yyleng-X]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(ue){this.unput(this.match.slice(ue))},"less"),pastInput:x(function(){var ue=this.matched.substr(0,this.matched.length-this.match.length);return(ue.length>20?"...":"")+ue.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var ue=this.match;return ue.length<20&&(ue+=this._input.substr(0,20-ue.length)),(ue.substr(0,20)+(ue.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var ue=this.pastInput(),X=new Array(ue.length+1).join("-");return ue+this.upcomingInput()+`
`+X+"^"},"showPosition"),test_match:x(function(ue,X){var Oe,xe,Ge;if(this.options.backtrack_lexer&&(Ge={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Ge.yylloc.range=this.yylloc.range.slice(0))),xe=ue[0].match(/(?:\r\n?|\n).*/g),xe&&(this.yylineno+=xe.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:xe?xe[xe.length-1].length-xe[xe.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+ue[0].length},this.yytext+=ue[0],this.match+=ue[0],this.matches=ue,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(ue[0].length),this.matched+=ue[0],Oe=this.performAction.call(this,this.yy,this,X,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Oe)return Oe;if(this._backtrack){for(var _e in Ge)this[_e]=Ge[_e];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var ue,X,Oe,xe;this._more||(this.yytext="",this.match="");for(var Ge=this._currentRules(),_e=0;_e<Ge.length;_e++)if(Oe=this._input.match(this.rules[Ge[_e]]),Oe&&(!X||Oe[0].length>X[0].length)){if(X=Oe,xe=_e,this.options.backtrack_lexer){if(ue=this.test_match(Oe,Ge[_e]),ue!==!1)return ue;if(this._backtrack){X=!1;continue}else return!1}else if(!this.options.flex)break}return X?(ue=this.test_match(X,Ge[xe]),ue!==!1?ue:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var X=this.next();return X||this.lex()},"lex"),begin:x(function(X){this.conditionStack.push(X)},"begin"),popState:x(function(){var X=this.conditionStack.length-1;return X>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(X){return X=this.conditionStack.length-1-Math.abs(X||0),X>=0?this.conditionStack[X]:"INITIAL"},"topState"),pushState:x(function(X){this.begin(X)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(X,Oe,xe,Ge){switch(xe){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return j})();he.lexer=W;function ne(){this.yy={}}return x(ne,"Parser"),ne.prototype=he,he.Parser=ne,new ne})();LB.parser=LB;var c6t=LB,As=Dh(),W2,u6t=(W2=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){var e,r,n,i,a,s,o,l,u,h,d,f,p,g,m,y,v,T;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((e=Vr.quadrantChart)==null?void 0:e.chartWidth)||500,chartWidth:((r=Vr.quadrantChart)==null?void 0:r.chartHeight)||500,titlePadding:((n=Vr.quadrantChart)==null?void 0:n.titlePadding)||10,titleFontSize:((i=Vr.quadrantChart)==null?void 0:i.titleFontSize)||20,quadrantPadding:((a=Vr.quadrantChart)==null?void 0:a.quadrantPadding)||5,xAxisLabelPadding:((s=Vr.quadrantChart)==null?void 0:s.xAxisLabelPadding)||5,yAxisLabelPadding:((o=Vr.quadrantChart)==null?void 0:o.yAxisLabelPadding)||5,xAxisLabelFontSize:((l=Vr.quadrantChart)==null?void 0:l.xAxisLabelFontSize)||16,yAxisLabelFontSize:((u=Vr.quadrantChart)==null?void 0:u.yAxisLabelFontSize)||16,quadrantLabelFontSize:((h=Vr.quadrantChart)==null?void 0:h.quadrantLabelFontSize)||16,quadrantTextTopPadding:((d=Vr.quadrantChart)==null?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:((f=Vr.quadrantChart)==null?void 0:f.pointTextPadding)||5,pointLabelFontSize:((p=Vr.quadrantChart)==null?void 0:p.pointLabelFontSize)||12,pointRadius:((g=Vr.quadrantChart)==null?void 0:g.pointRadius)||5,xAxisPosition:((m=Vr.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((y=Vr.quadrantChart)==null?void 0:y.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((v=Vr.quadrantChart)==null?void 0:v.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((T=Vr.quadrantChart)==null?void 0:T.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:As.quadrant1Fill,quadrant2Fill:As.quadrant2Fill,quadrant3Fill:As.quadrant3Fill,quadrant4Fill:As.quadrant4Fill,quadrant1TextFill:As.quadrant1TextFill,quadrant2TextFill:As.quadrant2TextFill,quadrant3TextFill:As.quadrant3TextFill,quadrant4TextFill:As.quadrant4TextFill,quadrantPointFill:As.quadrantPointFill,quadrantPointTextFill:As.quadrantPointTextFill,quadrantXAxisTextFill:As.quadrantXAxisTextFill,quadrantYAxisTextFill:As.quadrantYAxisTextFill,quadrantTitleFill:As.quadrantTitleFill,quadrantInternalBorderStrokeFill:As.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:As.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,le.info("clear called")}setData(e){this.data={...this.data,...e}}addPoints(e){this.data.points=[...e,...this.data.points]}addClass(e,r){this.classes.set(e,r)}setConfig(e){le.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){le.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,r,n,i){const a=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,s={top:e==="top"&&r?a:0,bottom:e==="bottom"&&r?a:0},o=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,l={left:this.config.yAxisPosition==="left"&&n?o:0,right:this.config.yAxisPosition==="right"&&n?o:0},u=this.config.titleFontSize+this.config.titlePadding*2,h={top:i?u:0},d=this.config.quadrantPadding+l.left,f=this.config.quadrantPadding+s.top+h.top,p=this.config.chartWidth-this.config.quadrantPadding*2-l.left-l.right,g=this.config.chartHeight-this.config.quadrantPadding*2-s.top-s.bottom-h.top,m=p/2,y=g/2;return{xAxisSpace:s,yAxisSpace:l,titleSpace:h,quadrantSpace:{quadrantLeft:d,quadrantTop:f,quadrantWidth:p,quadrantHalfWidth:m,quadrantHeight:g,quadrantHalfHeight:y}}}getAxisLabels(e,r,n,i){const{quadrantSpace:a,titleSpace:s}=i,{quadrantHalfHeight:o,quadrantHeight:l,quadrantLeft:u,quadrantHalfWidth:h,quadrantTop:d,quadrantWidth:f}=a,p=!!this.data.xAxisRightText,g=!!this.data.yAxisTopText,m=[];return this.data.xAxisLeftText&&r&&m.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&r&&m.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:u+h+(p?h/2:0),y:e==="top"?this.config.xAxisLabelPadding+s.top:this.config.xAxisLabelPadding+d+l+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&n&&m.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+l-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&n&&m.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+u+f+this.config.quadrantPadding,y:d+o-(g?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:g?"center":"left",horizontalPos:"top",rotation:-90}),m}getQuadrants(e){const{quadrantSpace:r}=e,{quadrantHalfHeight:n,quadrantLeft:i,quadrantHalfWidth:a,quadrantTop:s}=r,o=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s,width:a,height:n,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:s,width:a,height:n,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:i+a,y:s+n,width:a,height:n,fill:this.themeConfig.quadrant4Fill}];for(const l of o)l.text.x=l.x+l.width/2,this.data.points.length===0?(l.text.y=l.y+l.height/2,l.text.horizontalPos="middle"):(l.text.y=l.y+this.config.quadrantTextTopPadding,l.text.horizontalPos="top");return o}getQuadrantPoints(e){const{quadrantSpace:r}=e,{quadrantHeight:n,quadrantLeft:i,quadrantTop:a,quadrantWidth:s}=r,o=Sb().domain([0,1]).range([i,s+i]),l=Sb().domain([0,1]).range([n+a,a]);return this.data.points.map(h=>{const d=this.classes.get(h.className);return d&&(h={...d,...h}),{x:o(h.x),y:l(h.y),fill:h.color??this.themeConfig.quadrantPointFill,radius:h.radius??this.config.pointRadius,text:{text:h.text,fill:this.themeConfig.quadrantPointTextFill,x:o(h.x),y:l(h.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:h.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:h.strokeWidth??"0px"}})}getBorders(e){const r=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=e,{quadrantHalfHeight:i,quadrantHeight:a,quadrantLeft:s,quadrantHalfWidth:o,quadrantTop:l,quadrantWidth:u}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l,x2:s+u+r,y2:l},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s+u,y1:l+r,x2:s+u,y2:l+a-r},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s-r,y1:l+a,x2:s+u+r,y2:l+a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:s,y1:l+r,x2:s,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+o,y1:l+r,x2:s+o,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:s+r,y1:l+i,x2:s+u-r,y2:l+i}]}getTitle(e){if(e)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const e=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),r=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),n=this.config.showTitle&&!!this.data.titleText,i=this.data.points.length>0?"bottom":this.config.xAxisPosition,a=this.calculateSpace(i,e,r,n);return{points:this.getQuadrantPoints(a),quadrants:this.getQuadrants(a),axisLabels:this.getAxisLabels(i,e,r,a),borderLines:this.getBorders(a),title:this.getTitle(n)}}},x(W2,"QuadrantBuilder"),W2),H2,C4=(H2=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},x(H2,"InvalidStyleError"),H2);function MB(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}x(MB,"validateHexCode");function XAe(t){return!/^\d+$/.test(t)}x(XAe,"validateNumber");function jAe(t){return!/^\d+px$/.test(t)}x(jAe,"validateSizeInPixels");function bu(t){return Wr(t.trim(),Fe())}x(bu,"textSanitizer");var ja=new u6t;function KAe(t){ja.setData({quadrant1Text:bu(t.text)})}x(KAe,"setQuadrant1Text");function ZAe(t){ja.setData({quadrant2Text:bu(t.text)})}x(ZAe,"setQuadrant2Text");function QAe(t){ja.setData({quadrant3Text:bu(t.text)})}x(QAe,"setQuadrant3Text");function JAe(t){ja.setData({quadrant4Text:bu(t.text)})}x(JAe,"setQuadrant4Text");function e_e(t){ja.setData({xAxisLeftText:bu(t.text)})}x(e_e,"setXAxisLeftText");function t_e(t){ja.setData({xAxisRightText:bu(t.text)})}x(t_e,"setXAxisRightText");function r_e(t){ja.setData({yAxisTopText:bu(t.text)})}x(r_e,"setYAxisTopText");function n_e(t){ja.setData({yAxisBottomText:bu(t.text)})}x(n_e,"setYAxisBottomText");function N7(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(XAe(i))throw new C4(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(MB(i))throw new C4(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(MB(i))throw new C4(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(jAe(i))throw new C4(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}x(N7,"parseStyles");function i_e(t,e,r,n,i){const a=N7(i);ja.addPoints([{x:r,y:n,text:bu(t.text),className:e,...a}])}x(i_e,"addPoint");function a_e(t,e){ja.addClass(t,N7(e))}x(a_e,"addClass");function s_e(t){ja.setConfig({chartWidth:t})}x(s_e,"setWidth");function o_e(t){ja.setConfig({chartHeight:t})}x(o_e,"setHeight");function l_e(){const t=Fe(),{themeVariables:e,quadrantChart:r}=t;return r&&ja.setConfig(r),ja.setThemeConfig({quadrant1Fill:e.quadrant1Fill,quadrant2Fill:e.quadrant2Fill,quadrant3Fill:e.quadrant3Fill,quadrant4Fill:e.quadrant4Fill,quadrant1TextFill:e.quadrant1TextFill,quadrant2TextFill:e.quadrant2TextFill,quadrant3TextFill:e.quadrant3TextFill,quadrant4TextFill:e.quadrant4TextFill,quadrantPointFill:e.quadrantPointFill,quadrantPointTextFill:e.quadrantPointTextFill,quadrantXAxisTextFill:e.quadrantXAxisTextFill,quadrantYAxisTextFill:e.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:e.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:e.quadrantInternalBorderStrokeFill,quadrantTitleFill:e.quadrantTitleFill}),ja.setData({titleText:Yn()}),ja.build()}x(l_e,"getQuadrantData");var h6t=x(function(){ja.clear(),On()},"clear"),d6t={setWidth:s_e,setHeight:o_e,setQuadrant1Text:KAe,setQuadrant2Text:ZAe,setQuadrant3Text:QAe,setQuadrant4Text:JAe,setXAxisLeftText:e_e,setXAxisRightText:t_e,setYAxisTopText:r_e,setYAxisBottomText:n_e,parseStyles:N7,addPoint:i_e,addClass:a_e,getQuadrantData:l_e,clear:h6t,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,getAccDescription:ai,setAccDescription:ii},f6t=x((t,e,r,n)=>{var E,_,M;function i(L){return L==="top"?"hanging":"middle"}x(i,"getDominantBaseLine");function a(L){return L==="left"?"start":"middle"}x(a,"getTextAnchor");function s(L){return`translate(${L.x}, ${L.y}) rotate(${L.rotation||0})`}x(s,"getTransformation");const o=Fe();le.debug(`Rendering quadrant chart
`+t);const l=o.securityLevel;let u;l==="sandbox"&&(u=ut("#i"+e));const d=ut(l==="sandbox"?u.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),f=d.append("g").attr("class","main"),p=((E=o.quadrantChart)==null?void 0:E.chartWidth)??500,g=((_=o.quadrantChart)==null?void 0:_.chartHeight)??500;Ai(d,g,p,((M=o.quadrantChart)==null?void 0:M.useMaxWidth)??!0),d.attr("viewBox","0 0 "+p+" "+g),n.db.setHeight(g),n.db.setWidth(p);const m=n.db.getQuadrantData(),y=f.append("g").attr("class","quadrants"),v=f.append("g").attr("class","border"),T=f.append("g").attr("class","data-points"),b=f.append("g").attr("class","labels"),w=f.append("g").attr("class","title");m.title&&w.append("text").attr("x",0).attr("y",0).attr("fill",m.title.fill).attr("font-size",m.title.fontSize).attr("dominant-baseline",i(m.title.horizontalPos)).attr("text-anchor",a(m.title.verticalPos)).attr("transform",s(m.title)).text(m.title.text),m.borderLines&&v.selectAll("line").data(m.borderLines).enter().append("line").attr("x1",L=>L.x1).attr("y1",L=>L.y1).attr("x2",L=>L.x2).attr("y2",L=>L.y2).style("stroke",L=>L.strokeFill).style("stroke-width",L=>L.strokeWidth);const C=y.selectAll("g.quadrant").data(m.quadrants).enter().append("g").attr("class","quadrant");C.append("rect").attr("x",L=>L.x).attr("y",L=>L.y).attr("width",L=>L.width).attr("height",L=>L.height).attr("fill",L=>L.fill),C.append("text").attr("x",0).attr("y",0).attr("fill",L=>L.text.fill).attr("font-size",L=>L.text.fontSize).attr("dominant-baseline",L=>i(L.text.horizontalPos)).attr("text-anchor",L=>a(L.text.verticalPos)).attr("transform",L=>s(L.text)).text(L=>L.text.text),b.selectAll("g.label").data(m.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(L=>L.text).attr("fill",L=>L.fill).attr("font-size",L=>L.fontSize).attr("dominant-baseline",L=>i(L.horizontalPos)).attr("text-anchor",L=>a(L.verticalPos)).attr("transform",L=>s(L));const k=T.selectAll("g.data-point").data(m.points).enter().append("g").attr("class","data-point");k.append("circle").attr("cx",L=>L.x).attr("cy",L=>L.y).attr("r",L=>L.radius).attr("fill",L=>L.fill).attr("stroke",L=>L.strokeColor).attr("stroke-width",L=>L.strokeWidth),k.append("text").attr("x",0).attr("y",0).text(L=>L.text.text).attr("fill",L=>L.text.fill).attr("font-size",L=>L.text.fontSize).attr("dominant-baseline",L=>i(L.text.horizontalPos)).attr("text-anchor",L=>a(L.text.verticalPos)).attr("transform",L=>s(L.text))},"draw"),p6t={draw:f6t},g6t={parser:c6t,db:d6t,renderer:p6t,styles:x(()=>"","styles")};const m6t=Object.freeze(Object.defineProperty({__proto__:null,diagram:g6t},Symbol.toStringTag,{value:"Module"}));var IB=(function(){var t=x(function($,O,N,F){for(N=N||{},F=$.length;F--;N[$[F]]=O);return N},"o"),e=[1,10,12,14,16,18,19,21,23],r=[2,6],n=[1,3],i=[1,5],a=[1,6],s=[1,7],o=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],h=[1,28],d=[1,29],f=[1,30],p=[1,31],g=[1,32],m=[1,33],y=[1,34],v=[1,35],T=[1,36],b=[1,37],w=[1,43],C=[1,42],S=[1,47],k=[1,50],E=[1,10,12,14,16,18,19,21,23,36,37,38],_=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],M=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],L=[1,65],P=[26,28],D={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:x(function(O,N,F,z,V,B,G){var H=B.length-1;switch(V){case 5:z.setOrientation(B[H]);break;case 9:z.setDiagramTitle(B[H].text.trim());break;case 12:z.setLineData({text:"",type:"text"},B[H]);break;case 13:z.setLineData(B[H-1],B[H]);break;case 14:z.setBarData({text:"",type:"text"},B[H]);break;case 15:z.setBarData(B[H-1],B[H]);break;case 16:this.$=B[H].trim(),z.setAccTitle(this.$);break;case 17:case 18:this.$=B[H].trim(),z.setAccDescription(this.$);break;case 19:this.$=B[H-1];break;case 20:case 30:this.$=[B[H-2],...B[H]];break;case 21:case 31:this.$=[B[H]];break;case 22:this.$={value:Number(B[H-1]),label:B[H]};break;case 23:this.$={value:Number(B[H]),label:""};break;case 24:z.setXAxisTitle(B[H]);break;case 25:z.setXAxisTitle(B[H-1]);break;case 26:z.setXAxisTitle({type:"text",text:""});break;case 27:z.setXAxisBand(B[H]);break;case 28:z.setXAxisRangeData(Number(B[H-2]),Number(B[H]));break;case 29:this.$=B[H-1];break;case 32:z.setYAxisTitle(B[H]);break;case 33:z.setYAxisTitle(B[H-1]);break;case 34:z.setYAxisTitle({type:"text",text:""});break;case 35:z.setYAxisRangeData(Number(B[H-2]),Number(B[H]));break;case 39:this.$={text:B[H],type:"text"};break;case 40:this.$={text:B[H],type:"text"};break;case 41:this.$={text:B[H],type:"markdown"};break;case 42:this.$=B[H];break;case 43:this.$=B[H-1]+""+B[H];break}},"anonymous"),table:[t(e,r,{3:1,4:2,7:4,5:n,36:i,37:a,38:s}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,36:i,37:a,38:s}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:i,37:a,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(o,[2,36]),t(o,[2,37]),t(o,[2,38]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,36:i,37:a,38:s}),{1:[2,3]},t(o,[2,5]),t(e,[2,7],{4:22,36:i,37:a,38:s}),{11:23,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},{11:39,13:38,24:w,29:C,30:l,31:40,32:41,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},{11:45,15:44,29:S,30:l,35:46,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},{11:49,17:48,24:k,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},{11:52,17:51,24:k,30:l,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},{20:[1,53]},{22:[1,54]},t(E,[2,18]),{1:[2,2]},t(E,[2,8]),t(E,[2,9]),t(_,[2,39],{41:55,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b}),t(_,[2,40]),t(_,[2,41]),t(M,[2,42]),t(M,[2,44]),t(M,[2,45]),t(M,[2,46]),t(M,[2,47]),t(M,[2,48]),t(M,[2,49]),t(M,[2,50]),t(M,[2,51]),t(M,[2,52]),t(M,[2,53]),t(E,[2,10]),t(E,[2,24],{32:41,31:56,24:w,29:C}),t(E,[2,26]),t(E,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},t(E,[2,11]),t(E,[2,32],{35:60,29:S}),t(E,[2,34]),{33:[1,61]},t(E,[2,12]),{17:62,24:k},{25:63,27:64,29:L},t(E,[2,14]),{17:66,24:k},t(E,[2,16]),t(E,[2,17]),t(M,[2,43]),t(E,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(E,[2,33]),{29:[1,70]},t(E,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(P,[2,23],{30:[1,73]}),t(E,[2,15]),t(E,[2,28]),t(E,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:h,43:d,44:f,45:p,46:g,47:m,48:y,49:v,50:T,51:b},t(E,[2,35]),t(E,[2,19]),{25:75,27:64,29:L},t(P,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:x(function(O,N){if(N.recoverable)this.trace(O);else{var F=new Error(O);throw F.hash=N,F}},"parseError"),parse:x(function(O){var N=this,F=[0],z=[],V=[null],B=[],G=this.table,H="",q=0,Z=0,Y=2,ie=1,K=B.slice.call(arguments,1),Q=Object.create(this.lexer),te={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(te.yy[J]=this.yy[J]);Q.setInput(O,te.yy),te.yy.lexer=Q,te.yy.parser=this,typeof Q.yylloc>"u"&&(Q.yylloc={});var ge=Q.yylloc;B.push(ge);var ee=Q.options&&Q.options.ranges;typeof te.yy.parseError=="function"?this.parseError=te.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(de){F.length=F.length-2*de,V.length=V.length-de,B.length=B.length-de}x(Re,"popStack");function Ie(){var de;return de=z.pop()||Q.lex()||ie,typeof de!="number"&&(de instanceof Array&&(z=de,de=z.pop()),de=N.symbols_[de]||de),de}x(Ie,"lex");for(var Be,ce,oe,be,fe={},Pe,ve,Ce,Ve;;){if(ce=F[F.length-1],this.defaultActions[ce]?oe=this.defaultActions[ce]:((Be===null||typeof Be>"u")&&(Be=Ie()),oe=G[ce]&&G[ce][Be]),typeof oe>"u"||!oe.length||!oe[0]){var se="";Ve=[];for(Pe in G[ce])this.terminals_[Pe]&&Pe>Y&&Ve.push("'"+this.terminals_[Pe]+"'");Q.showPosition?se="Parse error on line "+(q+1)+`:
`+Q.showPosition()+`
Expecting `+Ve.join(", ")+", got '"+(this.terminals_[Be]||Be)+"'":se="Parse error on line "+(q+1)+": Unexpected "+(Be==ie?"end of input":"'"+(this.terminals_[Be]||Be)+"'"),this.parseError(se,{text:Q.match,token:this.terminals_[Be]||Be,line:Q.yylineno,loc:ge,expected:Ve})}if(oe[0]instanceof Array&&oe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ce+", token: "+Be);switch(oe[0]){case 1:F.push(Be),V.push(Q.yytext),B.push(Q.yylloc),F.push(oe[1]),Be=null,Z=Q.yyleng,H=Q.yytext,q=Q.yylineno,ge=Q.yylloc;break;case 2:if(ve=this.productions_[oe[1]][1],fe.$=V[V.length-ve],fe._$={first_line:B[B.length-(ve||1)].first_line,last_line:B[B.length-1].last_line,first_column:B[B.length-(ve||1)].first_column,last_column:B[B.length-1].last_column},ee&&(fe._$.range=[B[B.length-(ve||1)].range[0],B[B.length-1].range[1]]),be=this.performAction.apply(fe,[H,Z,q,te.yy,oe[1],V,B].concat(K)),typeof be<"u")return be;ve&&(F=F.slice(0,-1*ve*2),V=V.slice(0,-1*ve),B=B.slice(0,-1*ve)),F.push(this.productions_[oe[1]][0]),V.push(fe.$),B.push(fe._$),Ce=G[F[F.length-2]][F[F.length-1]],F.push(Ce);break;case 3:return!0}}return!0},"parse")},R=(function(){var $={EOF:1,parseError:x(function(N,F){if(this.yy.parser)this.yy.parser.parseError(N,F);else throw new Error(N)},"parseError"),setInput:x(function(O,N){return this.yy=N||this.yy||{},this._input=O,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var O=this._input[0];this.yytext+=O,this.yyleng++,this.offset++,this.match+=O,this.matched+=O;var N=O.match(/(?:\r\n?|\n).*/g);return N?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),O},"input"),unput:x(function(O){var N=O.length,F=O.split(/(?:\r\n?|\n)/g);this._input=O+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-N),this.offset-=N;var z=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),F.length-1&&(this.yylineno-=F.length-1);var V=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:F?(F.length===z.length?this.yylloc.first_column:0)+z[z.length-F.length].length-F[0].length:this.yylloc.first_column-N},this.options.ranges&&(this.yylloc.range=[V[0],V[0]+this.yyleng-N]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(O){this.unput(this.match.slice(O))},"less"),pastInput:x(function(){var O=this.matched.substr(0,this.matched.length-this.match.length);return(O.length>20?"...":"")+O.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var O=this.match;return O.length<20&&(O+=this._input.substr(0,20-O.length)),(O.substr(0,20)+(O.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var O=this.pastInput(),N=new Array(O.length+1).join("-");return O+this.upcomingInput()+`
`+N+"^"},"showPosition"),test_match:x(function(O,N){var F,z,V;if(this.options.backtrack_lexer&&(V={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(V.yylloc.range=this.yylloc.range.slice(0))),z=O[0].match(/(?:\r\n?|\n).*/g),z&&(this.yylineno+=z.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:z?z[z.length-1].length-z[z.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+O[0].length},this.yytext+=O[0],this.match+=O[0],this.matches=O,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(O[0].length),this.matched+=O[0],F=this.performAction.call(this,this.yy,this,N,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),F)return F;if(this._backtrack){for(var B in V)this[B]=V[B];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var O,N,F,z;this._more||(this.yytext="",this.match="");for(var V=this._currentRules(),B=0;B<V.length;B++)if(F=this._input.match(this.rules[V[B]]),F&&(!N||F[0].length>N[0].length)){if(N=F,z=B,this.options.backtrack_lexer){if(O=this.test_match(F,V[B]),O!==!1)return O;if(this._backtrack){N=!1;continue}else return!1}else if(!this.options.flex)break}return N?(O=this.test_match(N,V[z]),O!==!1?O:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var N=this.next();return N||this.lex()},"lex"),begin:x(function(N){this.conditionStack.push(N)},"begin"),popState:x(function(){var N=this.conditionStack.length-1;return N>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(N){return N=this.conditionStack.length-1-Math.abs(N||0),N>=0?this.conditionStack[N]:"INITIAL"},"topState"),pushState:x(function(N){this.begin(N)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(N,F,z,V){switch(z){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 33;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return $})();D.lexer=R;function I(){this.yy={}}return x(I,"Parser"),I.prototype=D,D.Parser=I,new I})();IB.parser=IB;var y6t=IB;function NB(t){return t.type==="bar"}x(NB,"isBarPlot");function T6(t){return t.type==="band"}x(T6,"isBandAxisData");function _y(t){return t.type==="linear"}x(_y,"isLinearAxisData");var q2,c_e=(q2=class{constructor(e){this.parentGroup=e}getMaxDimension(e,r){if(!this.parentGroup)return{width:e.reduce((a,s)=>Math.max(s.length,a),0)*r,height:r};const n={width:0,height:0},i=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",r);for(const a of e){const s=sfe(i,1,a),o=s?s.width:a.length*r,l=s?s.height:r;n.width=Math.max(n.width,o),n.height=Math.max(n.height,l)}return i.remove(),n}},x(q2,"TextDimensionCalculatorWithFont"),q2),pie=.7,gie=.2,U2,u_e=(U2=class{constructor(e,r,n,i){this.axisConfig=e,this.title=r,this.textDimensionCalculator=n,this.axisThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}setRange(e){this.range=e,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){const e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){pie*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(pie*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let r=e.height;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=gie*e.width;this.outerPadding=Math.min(n.width/2,i);let a=n.height;this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0&&(a=Math.max(a,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*n.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*n.height))),a+=this.axisConfig.labelPadding*2,this.labelTextHeight=n.height,a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-r}calculateSpaceIfDrawnVertical(e){let r=e.width;if(this.axisConfig.showAxisLine&&r>this.axisConfig.axisLineWidth&&(r-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const n=this.getLabelDimension(),i=gie*e.height;this.outerPadding=Math.min(n.height/2,i);const a=n.width+this.axisConfig.labelPadding*2;a<=r&&(r-=a,this.showLabel=!0)}if(this.axisConfig.showTick&&r>=this.axisConfig.tickLength&&(this.showTick=!0,r-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),i=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height,i<=r&&(r-=i,this.showTitle=!0)}this.boundingRect.width=e.width-r,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){const r=this.normalizedLabelRotationInRad;return r===0?0:Math.sin(r)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${r},${this.boundingRect.y} L ${r},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(r),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const r=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${r},${this.getScaleValue(n)} L ${r-this.axisConfig.tickLength},${this.getScaleValue(n)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForBottomAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r} L ${this.getScaleValue(n)},${r+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElementsForTopAxis(){const e=[];if(this.showAxisLine){const r=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${r} L ${this.boundingRect.x+this.boundingRect.width},${r}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(r=>({text:r.toString(),x:this.getScaleValue(r),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const r=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${r+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(n)},${r+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},x(U2,"BaseAxis"),U2),Y2,v6t=(Y2=class extends u_e{constructor(e,r,n,i,a){super(e,i,a,r),this.categories=n,this.scale=uO().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=uO().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),le.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},x(Y2,"BandAxis"),Y2),X2,b6t=(X2=class extends u_e{constructor(e,r,n,i,a){super(e,i,a,r),this.domain=n,this.scale=Sb().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=Sb().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},x(X2,"LinearAxis"),X2);function DB(t,e,r,n){const i=new c_e(n);return T6(t)?new v6t(e,r,t.categories,t.title,i):new b6t(e,r,[t.min,t.max],t.title,i)}x(DB,"getAxis");var j2,x6t=(j2=class{constructor(e,r,n,i){this.textDimensionCalculator=e,this.chartConfig=r,this.chartData=n,this.chartThemeConfig=i,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){const r=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(r.width,e.width),i=r.height+2*this.chartConfig.titlePadding;return r.width<=n&&r.height<=i&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=i,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const e=[];return this.showChartTitle&&e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}},x(j2,"ChartTitle"),j2);function h_e(t,e,r,n){const i=new c_e(n);return new x6t(i,t,e,r)}x(h_e,"getChartTitleComponent");var K2,T6t=(K2=class{constructor(e,r,n,i,a){this.plotData=e,this.xAxis=r,this.yAxis=n,this.orientation=i,this.plotIndex=a}getDrawableElement(){const e=this.plotData.data.map(i=>[this.xAxis.getScaleValue(i[0]),this.yAxis.getScaleValue(i[1])]);let r;if(this.orientation==="horizontal"?r=NC().y(i=>i[0]).x(i=>i[1])(e):r=NC().x(i=>i[0]).y(i=>i[1])(e),!r)return[];const n=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:r,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const s=[];for(const[o,[l,u]]of e.entries()){const h=this.plotData.pointLabels[o];h&&(this.orientation==="horizontal"?s.push({x:u+10,y:l,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):s.push({x:l,y:u-10,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}s.length>0&&n.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:s})}return n}},x(K2,"LinePlot"),K2),Z2,w6t=(Z2=class{constructor(e,r,n,i,a,s){this.barData=e,this.boundingRect=r,this.xAxis=n,this.yAxis=i,this.orientation=a,this.plotIndex=s}getDrawableElement(){const e=this.barData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),n=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),i=n/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:this.boundingRect.x,y:a[0]-i,height:n,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(a=>({x:a[0]-i,y:a[1],width:n,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},x(Z2,"BarPlot"),Z2),Q2,C6t=(Q2=class{constructor(e,r,n){this.chartConfig=e,this.chartData=r,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(e,r){this.xAxis=e,this.yAxis=r}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const e=[];for(const[r,n]of this.chartData.plots.entries())switch(n.type){case"line":{const i=new T6t(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new w6t(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},x(Q2,"BasePlot"),Q2);function d_e(t,e,r){return new C6t(t,e,r)}x(d_e,"getPlotComponent");var J2,k6t=(J2=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:h_e(e,r,n,i),plot:d_e(e,r,n),xAxis:DB(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:DB(r.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},i)}}calculateVerticalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:a,height:s});e-=o.width,r-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),i=o.height,r-=o.height,this.componentStore.xAxis.setAxisPosition("bottom"),o=this.componentStore.xAxis.calculateSpace({width:e,height:r}),r-=o.height,this.componentStore.yAxis.setAxisPosition("left"),o=this.componentStore.yAxis.calculateSpace({width:e,height:r}),n=o.width,e-=o.width,e>0&&(a+=e,e=0),r>0&&(s+=r,r=0),this.componentStore.plot.calculateSpace({width:a,height:s}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.xAxis.setRange([n,n+a]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:i+s}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(l=>NB(l))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=0,s=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:s,height:o});e-=l.width,r-=l.height,l=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),n=l.height,r-=l.height,this.componentStore.xAxis.setAxisPosition("left"),l=this.componentStore.xAxis.calculateSpace({width:e,height:r}),e-=l.width,i=l.width,this.componentStore.yAxis.setAxisPosition("top"),l=this.componentStore.yAxis.calculateSpace({width:e,height:r}),r-=l.height,a=n+l.height,e>0&&(s+=e,e=0),r>0&&(o+=r,r=0),this.componentStore.plot.calculateSpace({width:s,height:o}),this.componentStore.plot.setBoundingBoxXY({x:i,y:a}),this.componentStore.yAxis.setRange([i,i+s]),this.componentStore.yAxis.setBoundingBoxXY({x:i,y:n}),this.componentStore.xAxis.setRange([a,a+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(u=>NB(u))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const r of Object.values(this.componentStore))e.push(...r.getDrawableElements());return e}},x(J2,"Orchestrator"),J2),eb,S6t=(eb=class{static build(e,r,n,i){return new k6t(e,r,n,i).getDrawableElement()}},x(eb,"XYChartBuilder"),eb),Ak=0,f_e,_k=AU(),Rk=EU(),sn=_U(),OB=Rk.plotColorPalette.split(",").map(t=>t.trim()),D7=!1,SU=!1;function EU(){const t=Dh(),e=Xt();return ri(t.xyChart,e.themeVariables.xyChart)}x(EU,"getChartDefaultThemeConfig");function AU(){const t=Xt();return ri(Vr.xyChart,t.xyChart)}x(AU,"getChartDefaultConfig");function _U(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}x(_U,"getChartDefaultData");function XS(t){const e=Xt();return Wr(t.trim(),e)}x(XS,"textSanitizer");function p_e(t){f_e=t}x(p_e,"setTmpSVGG");function g_e(t){t==="horizontal"?_k.chartOrientation="horizontal":_k.chartOrientation="vertical"}x(g_e,"setOrientation");function m_e(t){sn.xAxis.title=XS(t.text)}x(m_e,"setXAxisTitle");function RU(t,e){sn.xAxis={type:"linear",title:sn.xAxis.title,min:t,max:e},D7=!0}x(RU,"setXAxisRangeData");function y_e(t){sn.xAxis={type:"band",title:sn.xAxis.title,categories:t.map(e=>XS(e.text))},D7=!0}x(y_e,"setXAxisBand");function v_e(t){sn.yAxis.title=XS(t.text)}x(v_e,"setYAxisTitle");function b_e(t,e){sn.yAxis={type:"linear",title:sn.yAxis.title,min:t,max:e},SU=!0}x(b_e,"setYAxisRangeData");function x_e(t){const e=Math.min(...t),r=Math.max(...t),n=_y(sn.yAxis)?sn.yAxis.min:1/0,i=_y(sn.yAxis)?sn.yAxis.max:-1/0;sn.yAxis={type:"linear",title:sn.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}x(x_e,"setYAxisRangeFromPlotData");function LU(t){let e=[];if(t.length===0)return e;if(!D7){const r=_y(sn.xAxis)?sn.xAxis.min:1/0,n=_y(sn.xAxis)?sn.xAxis.max:-1/0;RU(Math.min(r,1),Math.max(n,t.length))}if(T6(sn.xAxis)&&t.length>sn.xAxis.categories.length&&(t=t.slice(0,sn.xAxis.categories.length)),SU||x_e(t),T6(sn.xAxis)&&(e=sn.xAxis.categories.map((r,n)=>[r,t[n]])),_y(sn.xAxis)){const r=sn.xAxis.min,n=sn.xAxis.max;if(t.length===1)e=[[`${r}`,t[0]]];else{const i=(n-r)/(t.length-1);e=t.map((a,s)=>[`${r+s*i}`,a])}}return e}x(LU,"transformDataWithoutCategory");function MU(t){return OB[t===0?0:t%OB.length]}x(MU,"getPlotColorFromPalette");function T_e(t,e){const r=e.map(s=>s.value),n=e.map(s=>s.label?XS(s.label):""),i=LU(r),a=n.some(s=>s!=="");sn.plots.push({type:"line",strokeFill:MU(Ak),strokeWidth:2,data:i,...a?{pointLabels:n}:{}}),Ak++}x(T_e,"setLineData");function w_e(t,e){const r=e.map(i=>i.value),n=LU(r);sn.plots.push({type:"bar",fill:MU(Ak),data:n}),Ak++}x(w_e,"setBarData");function C_e(){if(sn.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return sn.title=Yn(),S6t.build(_k,sn,Rk,f_e)}x(C_e,"getDrawableElem");function k_e(){return Rk}x(k_e,"getChartThemeConfig");function S_e(){return _k}x(S_e,"getChartConfig");function E_e(){return sn}x(E_e,"getXYChartData");var E6t=x(function(){On(),Ak=0,_k=AU(),sn=_U(),Rk=EU(),OB=Rk.plotColorPalette.split(",").map(t=>t.trim()),D7=!1,SU=!1},"clear"),A6t={getDrawableElem:C_e,clear:E6t,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,getAccDescription:ai,setAccDescription:ii,setOrientation:g_e,setXAxisTitle:m_e,setXAxisRangeData:RU,setXAxisBand:y_e,setYAxisTitle:v_e,setYAxisRangeData:b_e,setLineData:T_e,setBarData:w_e,setTmpSVGG:p_e,getChartThemeConfig:k_e,getChartConfig:S_e,getXYChartData:E_e},_6t=x((t,e,r,n)=>{const i=n.db,a=i.getChartThemeConfig(),s=i.getChartConfig(),o=i.getXYChartData().plots[0].data.map(v=>v[1]);function l(v){return v==="top"?"text-before-edge":"middle"}x(l,"getDominantBaseLine");function u(v){return v==="left"?"start":v==="right"?"end":"middle"}x(u,"getTextAnchor");function h(v){return`translate(${v.x}, ${v.y}) rotate(${v.rotation||0})`}x(h,"getTextTransformation"),le.debug(`Rendering xychart chart
`+t);const d=xs(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",s.width).attr("height",s.height).attr("class","background");Ai(d,s.height,s.width,!0),d.attr("viewBox",`0 0 ${s.width} ${s.height}`),p.attr("fill",a.backgroundColor),i.setTmpSVGG(d.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem(),m={};function y(v){let T=f,b="";for(const[w]of v.entries()){let C=f;w>0&&m[b]&&(C=m[b]),b+=v[w],T=m[b],T||(T=m[b]=C.append("g").attr("class",v[w]))}return T}x(y,"getGroup");for(const v of g){if(v.data.length===0)continue;const T=y(v.groupTexts);switch(v.type){case"rect":if(T.selectAll("rect").data(v.data).enter().append("rect").attr("x",b=>b.x).attr("y",b=>b.y).attr("width",b=>b.width).attr("height",b=>b.height).attr("fill",b=>b.fill).attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth),s.showDataLabel){const b=s.showDataLabelOutsideBar;if(s.chartOrientation==="horizontal"){let w=function(L,P){const{data:D,label:R}=L;return P*R.length*C<=D.width-S};x(w,"fitsHorizontally");const C=.7,S=10,k=v.data.map((L,P)=>({data:L,label:o[P].toString()})).filter(L=>L.data.width>0&&L.data.height>0),E=k.map(L=>{const{data:P}=L;let D=P.height*.7;for(;!w(L,D)&&D>0;)D-=1;return D}),_=Math.floor(Math.min(...E)),M=x(L=>b?L.data.x+L.data.width+S:L.data.x+L.data.width-S,"determineLabelXPosition");T.selectAll("text").data(k).enter().append("text").attr("x",M).attr("y",L=>L.data.y+L.data.height/2).attr("text-anchor",b?"start":"end").attr("dominant-baseline","middle").attr("fill",a.dataLabelColor).attr("font-size",`${_}px`).text(L=>L.label)}else{let w=function(M,L,P){const{data:D,label:R}=M,$=L*R.length*.7,O=D.x+D.width/2,N=O-$/2,F=O+$/2,z=N>=D.x&&F<=D.x+D.width,V=D.y+P+L<=D.y+D.height;return z&&V};x(w,"fitsInBar");const C=10,S=v.data.map((M,L)=>({data:M,label:o[L].toString()})).filter(M=>M.data.width>0&&M.data.height>0),k=S.map(M=>{const{data:L,label:P}=M;let D=L.width/(P.length*.7);for(;!w(M,D,C)&&D>0;)D-=1;return D}),E=Math.floor(Math.min(...k)),_=x(M=>b?M.data.y-C:M.data.y+C,"determineLabelYPosition");T.selectAll("text").data(S).enter().append("text").attr("x",M=>M.data.x+M.data.width/2).attr("y",_).attr("text-anchor","middle").attr("dominant-baseline",b?"auto":"hanging").attr("fill",a.dataLabelColor).attr("font-size",`${E}px`).text(M=>M.label)}}break;case"text":T.selectAll("text").data(v.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",b=>b.fill).attr("font-size",b=>b.fontSize).attr("dominant-baseline",b=>l(b.verticalPos)).attr("text-anchor",b=>u(b.horizontalPos)).attr("transform",b=>h(b)).text(b=>b.text);break;case"path":T.selectAll("path").data(v.data).enter().append("path").attr("d",b=>b.path).attr("fill",b=>b.fill?b.fill:"none").attr("stroke",b=>b.strokeFill).attr("stroke-width",b=>b.strokeWidth);break}}},"draw"),R6t={draw:_6t},L6t={parser:y6t,db:A6t,renderer:R6t};const M6t=Object.freeze(Object.defineProperty({__proto__:null,diagram:L6t},Symbol.toStringTag,{value:"Module"}));var $B=(function(){var t=x(function(ae,he,W,ne){for(W=W||{},ne=ae.length;ne--;W[ae[ne]]=he);return W},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],o=[2,7],l=[1,26],u=[1,27],h=[1,28],d=[1,29],f=[1,33],p=[1,34],g=[1,35],m=[1,36],y=[1,37],v=[1,38],T=[1,24],b=[1,31],w=[1,32],C=[1,30],S=[1,39],k=[1,40],E=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],_=[1,61],M=[89,90],L=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],P=[27,29],D=[1,70],R=[1,71],I=[1,72],$=[1,73],O=[1,74],N=[1,75],F=[1,76],z=[1,83],V=[1,80],B=[1,84],G=[1,85],H=[1,86],q=[1,87],Z=[1,88],Y=[1,89],ie=[1,90],K=[1,91],Q=[1,92],te=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],J=[63,64],ge=[1,101],ee=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],Re=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Ie=[1,110],Be=[1,106],ce=[1,107],oe=[1,108],be=[1,109],fe=[1,111],Pe=[1,116],ve=[1,117],Ce=[1,114],Ve=[1,115],se={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:x(function(he,W,ne,j,ue,X,Oe){var xe=X.length-1;switch(ue){case 4:this.$=X[xe].trim(),j.setAccTitle(this.$);break;case 5:case 6:this.$=X[xe].trim(),j.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:j.setDirection("TB");break;case 18:j.setDirection("BT");break;case 19:j.setDirection("RL");break;case 20:j.setDirection("LR");break;case 21:j.addRequirement(X[xe-3],X[xe-4]);break;case 22:j.addRequirement(X[xe-5],X[xe-6]),j.setClass([X[xe-5]],X[xe-3]);break;case 23:j.setNewReqId(X[xe-2]);break;case 24:j.setNewReqText(X[xe-2]);break;case 25:j.setNewReqRisk(X[xe-2]);break;case 26:j.setNewReqVerifyMethod(X[xe-2]);break;case 29:this.$=j.RequirementType.REQUIREMENT;break;case 30:this.$=j.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=j.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=j.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=j.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=j.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=j.RiskLevel.LOW_RISK;break;case 36:this.$=j.RiskLevel.MED_RISK;break;case 37:this.$=j.RiskLevel.HIGH_RISK;break;case 38:this.$=j.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=j.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=j.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=j.VerifyType.VERIFY_TEST;break;case 42:j.addElement(X[xe-3]);break;case 43:j.addElement(X[xe-5]),j.setClass([X[xe-5]],X[xe-3]);break;case 44:j.setNewElementType(X[xe-2]);break;case 45:j.setNewElementDocRef(X[xe-2]);break;case 48:j.addRelationship(X[xe-2],X[xe],X[xe-4]);break;case 49:j.addRelationship(X[xe-2],X[xe-4],X[xe]);break;case 50:this.$=j.Relationships.CONTAINS;break;case 51:this.$=j.Relationships.COPIES;break;case 52:this.$=j.Relationships.DERIVES;break;case 53:this.$=j.Relationships.SATISFIES;break;case 54:this.$=j.Relationships.VERIFIES;break;case 55:this.$=j.Relationships.REFINES;break;case 56:this.$=j.Relationships.TRACES;break;case 57:this.$=X[xe-2],j.defineClass(X[xe-1],X[xe]);break;case 58:j.setClass(X[xe-1],X[xe]);break;case 59:j.setClass([X[xe-2]],X[xe]);break;case 60:case 62:this.$=[X[xe]];break;case 61:case 63:this.$=X[xe-2].concat([X[xe]]);break;case 64:this.$=X[xe-2],j.setCssStyle(X[xe-1],X[xe]);break;case 65:this.$=[X[xe]];break;case 66:X[xe-2].push(X[xe]),this.$=X[xe-2];break;case 68:this.$=X[xe-1]+X[xe];break}},"anonymous"),table:[{3:1,4:2,6:e,9:r,11:n,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:r,11:n,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(a,[2,6]),{3:12,4:2,6:e,9:r,11:n,13:i},{1:[2,2]},{4:17,5:s,7:13,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},t(a,[2,4]),t(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:43,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:44,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:45,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:46,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:47,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:48,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:49,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{4:17,5:s,7:50,8:o,9:r,11:n,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:h,24:d,25:23,33:25,41:f,42:p,43:g,44:m,45:y,46:v,54:T,72:b,74:w,77:C,89:S,90:k},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(E,[2,17]),t(E,[2,18]),t(E,[2,19]),t(E,[2,20]),{30:60,33:62,75:_,89:S,90:k},{30:63,33:62,75:_,89:S,90:k},{30:64,33:62,75:_,89:S,90:k},t(M,[2,29]),t(M,[2,30]),t(M,[2,31]),t(M,[2,32]),t(M,[2,33]),t(M,[2,34]),t(L,[2,81]),t(L,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(P,[2,79]),t(P,[2,80]),{27:[1,67],29:[1,68]},t(P,[2,85]),t(P,[2,86]),{62:69,65:D,66:R,67:I,68:$,69:O,70:N,71:F},{62:77,65:D,66:R,67:I,68:$,69:O,70:N,71:F},{30:78,33:62,75:_,89:S,90:k},{73:79,75:z,76:V,78:81,79:82,80:B,81:G,82:H,83:q,84:Z,85:Y,86:ie,87:K,88:Q},t(te,[2,60]),t(te,[2,62]),{73:93,75:z,76:V,78:81,79:82,80:B,81:G,82:H,83:q,84:Z,85:Y,86:ie,87:K,88:Q},{30:94,33:62,75:_,76:V,89:S,90:k},{5:[1,95]},{30:96,33:62,75:_,89:S,90:k},{5:[1,97]},{30:98,33:62,75:_,89:S,90:k},{63:[1,99]},t(J,[2,50]),t(J,[2,51]),t(J,[2,52]),t(J,[2,53]),t(J,[2,54]),t(J,[2,55]),t(J,[2,56]),{64:[1,100]},t(E,[2,59],{76:V}),t(E,[2,64],{76:ge}),{33:103,75:[1,102],89:S,90:k},t(ee,[2,65],{79:104,75:z,80:B,81:G,82:H,83:q,84:Z,85:Y,86:ie,87:K,88:Q}),t(Re,[2,67]),t(Re,[2,69]),t(Re,[2,70]),t(Re,[2,71]),t(Re,[2,72]),t(Re,[2,73]),t(Re,[2,74]),t(Re,[2,75]),t(Re,[2,76]),t(Re,[2,77]),t(Re,[2,78]),t(E,[2,57],{76:ge}),t(E,[2,58],{76:V}),{5:Ie,28:105,31:Be,34:ce,36:oe,38:be,40:fe},{27:[1,112],76:V},{5:Pe,40:ve,56:113,57:Ce,59:Ve},{27:[1,118],76:V},{33:119,89:S,90:k},{33:120,89:S,90:k},{75:z,78:121,79:82,80:B,81:G,82:H,83:q,84:Z,85:Y,86:ie,87:K,88:Q},t(te,[2,61]),t(te,[2,63]),t(Re,[2,68]),t(E,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Ie,28:126,31:Be,34:ce,36:oe,38:be,40:fe},t(E,[2,28]),{5:[1,127]},t(E,[2,42]),{32:[1,128]},{32:[1,129]},{5:Pe,40:ve,56:130,57:Ce,59:Ve},t(E,[2,47]),{5:[1,131]},t(E,[2,48]),t(E,[2,49]),t(ee,[2,66],{79:104,75:z,80:B,81:G,82:H,83:q,84:Z,85:Y,86:ie,87:K,88:Q}),{33:132,89:S,90:k},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(E,[2,27]),{5:Ie,28:145,31:Be,34:ce,36:oe,38:be,40:fe},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(E,[2,46]),{5:Pe,40:ve,56:152,57:Ce,59:Ve},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(E,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(E,[2,43]),{5:Ie,28:159,31:Be,34:ce,36:oe,38:be,40:fe},{5:Ie,28:160,31:Be,34:ce,36:oe,38:be,40:fe},{5:Ie,28:161,31:Be,34:ce,36:oe,38:be,40:fe},{5:Ie,28:162,31:Be,34:ce,36:oe,38:be,40:fe},{5:Pe,40:ve,56:163,57:Ce,59:Ve},{5:Pe,40:ve,56:164,57:Ce,59:Ve},t(E,[2,23]),t(E,[2,24]),t(E,[2,25]),t(E,[2,26]),t(E,[2,44]),t(E,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:x(function(he,W){if(W.recoverable)this.trace(he);else{var ne=new Error(he);throw ne.hash=W,ne}},"parseError"),parse:x(function(he){var W=this,ne=[0],j=[],ue=[null],X=[],Oe=this.table,xe="",Ge=0,_e=0,$e=2,Me=1,He=X.slice.call(arguments,1),De=Object.create(this.lexer),Ke={yy:{}};for(var Ae in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ae)&&(Ke.yy[Ae]=this.yy[Ae]);De.setInput(he,Ke.yy),Ke.yy.lexer=De,Ke.yy.parser=this,typeof De.yylloc>"u"&&(De.yylloc={});var at=De.yylloc;X.push(at);var Ee=De.options&&De.options.ranges;typeof Ke.yy.parseError=="function"?this.parseError=Ke.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(Se){ne.length=ne.length-2*Se,ue.length=ue.length-Se,X.length=X.length-Se}x(pt,"popStack");function ht(){var Se;return Se=j.pop()||De.lex()||Me,typeof Se!="number"&&(Se instanceof Array&&(j=Se,Se=j.pop()),Se=W.symbols_[Se]||Se),Se}x(ht,"lex");for(var rt,Et,vt,ot,pe={},Ct,lt,st,mt;;){if(Et=ne[ne.length-1],this.defaultActions[Et]?vt=this.defaultActions[Et]:((rt===null||typeof rt>"u")&&(rt=ht()),vt=Oe[Et]&&Oe[Et][rt]),typeof vt>"u"||!vt.length||!vt[0]){var _r="";mt=[];for(Ct in Oe[Et])this.terminals_[Ct]&&Ct>$e&&mt.push("'"+this.terminals_[Ct]+"'");De.showPosition?_r="Parse error on line "+(Ge+1)+`:
`+De.showPosition()+`
Expecting `+mt.join(", ")+", got '"+(this.terminals_[rt]||rt)+"'":_r="Parse error on line "+(Ge+1)+": Unexpected "+(rt==Me?"end of input":"'"+(this.terminals_[rt]||rt)+"'"),this.parseError(_r,{text:De.match,token:this.terminals_[rt]||rt,line:De.yylineno,loc:at,expected:mt})}if(vt[0]instanceof Array&&vt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Et+", token: "+rt);switch(vt[0]){case 1:ne.push(rt),ue.push(De.yytext),X.push(De.yylloc),ne.push(vt[1]),rt=null,_e=De.yyleng,xe=De.yytext,Ge=De.yylineno,at=De.yylloc;break;case 2:if(lt=this.productions_[vt[1]][1],pe.$=ue[ue.length-lt],pe._$={first_line:X[X.length-(lt||1)].first_line,last_line:X[X.length-1].last_line,first_column:X[X.length-(lt||1)].first_column,last_column:X[X.length-1].last_column},Ee&&(pe._$.range=[X[X.length-(lt||1)].range[0],X[X.length-1].range[1]]),ot=this.performAction.apply(pe,[xe,_e,Ge,Ke.yy,vt[1],ue,X].concat(He)),typeof ot<"u")return ot;lt&&(ne=ne.slice(0,-1*lt*2),ue=ue.slice(0,-1*lt),X=X.slice(0,-1*lt)),ne.push(this.productions_[vt[1]][0]),ue.push(pe.$),X.push(pe._$),st=Oe[ne[ne.length-2]][ne[ne.length-1]],ne.push(st);break;case 3:return!0}}return!0},"parse")},de=(function(){var ae={EOF:1,parseError:x(function(W,ne){if(this.yy.parser)this.yy.parser.parseError(W,ne);else throw new Error(W)},"parseError"),setInput:x(function(he,W){return this.yy=W||this.yy||{},this._input=he,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var he=this._input[0];this.yytext+=he,this.yyleng++,this.offset++,this.match+=he,this.matched+=he;var W=he.match(/(?:\r\n?|\n).*/g);return W?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),he},"input"),unput:x(function(he){var W=he.length,ne=he.split(/(?:\r\n?|\n)/g);this._input=he+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-W),this.offset-=W;var j=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),ne.length-1&&(this.yylineno-=ne.length-1);var ue=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:ne?(ne.length===j.length?this.yylloc.first_column:0)+j[j.length-ne.length].length-ne[0].length:this.yylloc.first_column-W},this.options.ranges&&(this.yylloc.range=[ue[0],ue[0]+this.yyleng-W]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(he){this.unput(this.match.slice(he))},"less"),pastInput:x(function(){var he=this.matched.substr(0,this.matched.length-this.match.length);return(he.length>20?"...":"")+he.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var he=this.match;return he.length<20&&(he+=this._input.substr(0,20-he.length)),(he.substr(0,20)+(he.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var he=this.pastInput(),W=new Array(he.length+1).join("-");return he+this.upcomingInput()+`
`+W+"^"},"showPosition"),test_match:x(function(he,W){var ne,j,ue;if(this.options.backtrack_lexer&&(ue={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(ue.yylloc.range=this.yylloc.range.slice(0))),j=he[0].match(/(?:\r\n?|\n).*/g),j&&(this.yylineno+=j.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:j?j[j.length-1].length-j[j.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+he[0].length},this.yytext+=he[0],this.match+=he[0],this.matches=he,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(he[0].length),this.matched+=he[0],ne=this.performAction.call(this,this.yy,this,W,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ne)return ne;if(this._backtrack){for(var X in ue)this[X]=ue[X];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var he,W,ne,j;this._more||(this.yytext="",this.match="");for(var ue=this._currentRules(),X=0;X<ue.length;X++)if(ne=this._input.match(this.rules[ue[X]]),ne&&(!W||ne[0].length>W[0].length)){if(W=ne,j=X,this.options.backtrack_lexer){if(he=this.test_match(ne,ue[X]),he!==!1)return he;if(this._backtrack){W=!1;continue}else return!1}else if(!this.options.flex)break}return W?(he=this.test_match(W,ue[j]),he!==!1?he:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var W=this.next();return W||this.lex()},"lex"),begin:x(function(W){this.conditionStack.push(W)},"begin"),popState:x(function(){var W=this.conditionStack.length-1;return W>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(W){return W=this.conditionStack.length-1-Math.abs(W||0),W>=0?this.conditionStack[W]:"INITIAL"},"topState"),pushState:x(function(W){this.begin(W)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(W,ne,j,ue){switch(j){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return ne.yytext=ne.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return ae})();se.lexer=de;function Te(){this.yy={}}return x(Te,"Parser"),Te.prototype=se,se.Parser=Te,new Te})();$B.parser=$B;var I6t=$B,tb,N6t=(tb=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=Hn,this.getAccTitle=ni,this.setAccDescription=ii,this.getAccDescription=ai,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.getConfig=x(()=>Fe().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,r){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:r,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),le.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,r,n){this.relations.push({type:e,src:r,dst:n})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,On()}setCssStyle(e,r){for(const n of e){const i=this.requirements.get(n)??this.elements.get(n);if(!r||!i)return;for(const a of r)a.includes(",")?i.cssStyles.push(...a.split(",")):i.cssStyles.push(a)}}setClass(e,r){var n;for(const i of e){const a=this.requirements.get(i)??this.elements.get(i);if(a)for(const s of r){a.classes.push(s);const o=(n=this.classes.get(s))==null?void 0:n.styles;o&&a.cssStyles.push(...o)}}}defineClass(e,r){for(const n of e){let i=this.classes.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.classes.set(n,i)),r&&r.forEach(function(a){if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)}),this.requirements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(s=>s.split(",")))}),this.elements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(s=>s.split(",")))})}}getClasses(){return this.classes}getData(){var i,a,s,o;const e=Fe(),r=[],n=[];for(const l of this.requirements.values()){const u=l;u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.shape="requirementBox",u.look=e.look,u.colorIndex=r.length,r.push(u)}for(const l of this.elements.values()){const u=l;u.shape="requirementBox",u.look=e.look,u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.colorIndex=r.length,r.push(u)}for(const l of this.relations){let u=0;const h=l.type===this.Relationships.CONTAINS,d={id:`${l.src}-${l.dst}-${u}`,start:((i=this.requirements.get(l.src))==null?void 0:i.name)??((a=this.elements.get(l.src))==null?void 0:a.name),end:((s=this.requirements.get(l.dst))==null?void 0:s.name)??((o=this.elements.get(l.dst))==null?void 0:o.name),label:`&lt;&lt;${l.type}&gt;&gt;`,classes:"relationshipLine",style:["fill:none",h?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:h?"normal":"dashed",arrowTypeStart:h?"requirement_contains":"",arrowTypeEnd:h?"":"requirement_arrow",look:e.look,labelType:"markdown"};n.push(d),u++}return{nodes:r,edges:n,other:{},config:e,direction:this.getDirection()}}},x(tb,"RequirementDB"),tb),D6t=x(t=>{const e=Xt(),{themeVariables:r,look:n}=e,{bkgColorArray:i,borderColorArray:a}=r;if(!(a!=null&&a.length))return"";let s="";for(let o=0;o<t.THEME_COLOR_LIMIT;o++)s+=`
[data-look="${n}"][data-color-id="color-${o}"].node path {
stroke: ${a[o]};
fill: ${i!=null&&i.length?i[o]:""};
}
[data-look="${n}"][data-color-id="color-${o}"].node rect {
stroke: ${a[o]};
fill: ${i!=null&&i.length?i[o]:""};
}
`;return s},"genColor"),O6t=x(t=>{const e=Xt(),{look:r,themeVariables:n}=e,{requirementEdgeLabelBackground:i}=n;return`
${D6t(t)}
marker {
fill: ${t.relationColor};
stroke: ${t.relationColor};
}
marker.cross {
stroke: ${t.lineColor};
}
svg {
font-family: ${t.fontFamily};
font-size: ${t.fontSize};
}
.reqBox {
fill: ${t.requirementBackground};
fill-opacity: 1.0;
stroke: ${t.requirementBorderColor};
stroke-width: ${t.requirementBorderSize};
}
.reqTitle, .reqLabel{
fill: ${t.requirementTextColor};
}
.reqLabelBox {
fill: ${t.relationLabelBackground};
fill-opacity: 1.0;
}
.req-title-line {
stroke: ${t.requirementBorderColor};
stroke-width: ${t.requirementBorderSize};
}
.relationshipLine {
stroke: ${t.relationColor};
stroke-width: ${r==="neo"?t.strokeWidth:"1px"};
}
.relationshipLabel {
fill: ${t.relationLabelColor};
}
.edgeLabel {
background-color: ${t.edgeLabelBackground};
}
.edgeLabel .label rect {
fill: ${t.edgeLabelBackground};
}
.edgeLabel .label text {
fill: ${t.relationLabelColor};
}
.divider {
stroke: ${t.nodeBorder};
stroke-width: 1;
}
.label {
font-family: ${t.fontFamily};
color: ${t.nodeTextColor||t.textColor};
}
.label text,span {
fill: ${t.nodeTextColor||t.textColor};
color: ${t.nodeTextColor||t.textColor};
}
.labelBkg {
background-color: ${i??t.edgeLabelBackground};
}
`},"getStyles"),$6t=O6t,A_e={};Z6(A_e,{draw:()=>P6t});var P6t=x(async function(t,e,r,n){le.info("REF0:"),le.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:a,layout:s,look:o}=Fe(),l=n.db.getData(),u=Ox(e,i);l.type=n.type,l.layoutAlgorithm=nS(s),l.nodeSpacing=(a==null?void 0:a.nodeSpacing)??50,l.rankSpacing=(a==null?void 0:a.rankSpacing)??50,l.markers=o==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],l.diagramId=e,await xx(l,u);const h=8;yr.insertTitle(u,"requirementDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),mg(u,h,"requirementDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),B6t={parser:I6t,get db(){return new N6t},renderer:A_e,styles:$6t};const F6t=Object.freeze(Object.defineProperty({__proto__:null,diagram:B6t},Symbol.toStringTag,{value:"Module"}));var PB=(function(){var t=x(function(_e,$e,Me,He){for(Me=Me||{},He=_e.length;He--;Me[_e[He]]=$e);return Me},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,12],l=[1,14],u=[1,15],h=[1,17],d=[1,18],f=[1,19],p=[1,25],g=[1,26],m=[1,27],y=[1,28],v=[1,29],T=[1,30],b=[1,31],w=[1,32],C=[1,33],S=[1,34],k=[1,35],E=[1,36],_=[1,37],M=[1,38],L=[1,39],P=[1,40],D=[1,42],R=[1,43],I=[1,44],$=[1,45],O=[1,46],N=[1,47],F=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],z=[1,74],V=[1,80],B=[1,81],G=[1,82],H=[1,83],q=[1,84],Z=[1,85],Y=[1,86],ie=[1,87],K=[1,88],Q=[1,89],te=[1,90],J=[1,91],ge=[1,92],ee=[1,93],Re=[1,94],Ie=[1,95],Be=[1,96],ce=[1,97],oe=[1,98],be=[1,99],fe=[1,100],Pe=[1,101],ve=[1,102],Ce=[1,103],Ve=[1,104],se=[1,105],de=[2,78],Te=[4,5,17,51,53,54],ae=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],he=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],W=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],ne=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],j=[5,52],ue=[70,71,72,73],X=[1,151],Oe={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:x(function($e,Me,He,De,Ke,Ae,at){var Ee=Ae.length-1;switch(Ke){case 3:return De.apply(Ae[Ee]),Ae[Ee];case 4:case 10:this.$=[];break;case 5:case 11:Ae[Ee-1].push(Ae[Ee]),this.$=Ae[Ee-1];break;case 6:case 7:case 12:case 13:this.$=Ae[Ee];break;case 8:case 9:case 14:this.$=[];break;case 16:Ae[Ee].type="createParticipant",this.$=Ae[Ee];break;case 17:Ae[Ee-1].unshift({type:"boxStart",boxData:De.parseBoxData(Ae[Ee-2])}),Ae[Ee-1].push({type:"boxEnd",boxText:Ae[Ee-2]}),this.$=Ae[Ee-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(Ae[Ee-2]),sequenceIndexStep:Number(Ae[Ee-1]),sequenceVisible:!0,signalType:De.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(Ae[Ee-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:De.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:De.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:De.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:De.LINETYPE.ACTIVE_START,actor:Ae[Ee-1].actor};break;case 24:this.$={type:"activeEnd",signalType:De.LINETYPE.ACTIVE_END,actor:Ae[Ee-1].actor};break;case 30:De.setDiagramTitle(Ae[Ee].substring(6)),this.$=Ae[Ee].substring(6);break;case 31:De.setDiagramTitle(Ae[Ee].substring(7)),this.$=Ae[Ee].substring(7);break;case 32:this.$=Ae[Ee].trim(),De.setAccTitle(this.$);break;case 33:case 34:this.$=Ae[Ee].trim(),De.setAccDescription(this.$);break;case 35:Ae[Ee-1].unshift({type:"loopStart",loopText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.LOOP_START}),Ae[Ee-1].push({type:"loopEnd",loopText:Ae[Ee-2],signalType:De.LINETYPE.LOOP_END}),this.$=Ae[Ee-1];break;case 36:Ae[Ee-1].unshift({type:"rectStart",color:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.RECT_START}),Ae[Ee-1].push({type:"rectEnd",color:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.RECT_END}),this.$=Ae[Ee-1];break;case 37:Ae[Ee-1].unshift({type:"optStart",optText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.OPT_START}),Ae[Ee-1].push({type:"optEnd",optText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.OPT_END}),this.$=Ae[Ee-1];break;case 38:Ae[Ee-1].unshift({type:"altStart",altText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.ALT_START}),Ae[Ee-1].push({type:"altEnd",signalType:De.LINETYPE.ALT_END}),this.$=Ae[Ee-1];break;case 39:Ae[Ee-1].unshift({type:"parStart",parText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.PAR_START}),Ae[Ee-1].push({type:"parEnd",signalType:De.LINETYPE.PAR_END}),this.$=Ae[Ee-1];break;case 40:Ae[Ee-1].unshift({type:"parStart",parText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.PAR_OVER_START}),Ae[Ee-1].push({type:"parEnd",signalType:De.LINETYPE.PAR_END}),this.$=Ae[Ee-1];break;case 41:Ae[Ee-1].unshift({type:"criticalStart",criticalText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.CRITICAL_START}),Ae[Ee-1].push({type:"criticalEnd",signalType:De.LINETYPE.CRITICAL_END}),this.$=Ae[Ee-1];break;case 42:Ae[Ee-1].unshift({type:"breakStart",breakText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.BREAK_START}),Ae[Ee-1].push({type:"breakEnd",optText:De.parseMessage(Ae[Ee-2]),signalType:De.LINETYPE.BREAK_END}),this.$=Ae[Ee-1];break;case 44:this.$=Ae[Ee-3].concat([{type:"option",optionText:De.parseMessage(Ae[Ee-1]),signalType:De.LINETYPE.CRITICAL_OPTION},Ae[Ee]]);break;case 46:this.$=Ae[Ee-3].concat([{type:"and",parText:De.parseMessage(Ae[Ee-1]),signalType:De.LINETYPE.PAR_AND},Ae[Ee]]);break;case 48:this.$=Ae[Ee-3].concat([{type:"else",altText:De.parseMessage(Ae[Ee-1]),signalType:De.LINETYPE.ALT_ELSE},Ae[Ee]]);break;case 49:Ae[Ee-3].draw="participant",Ae[Ee-3].type="addParticipant",Ae[Ee-3].description=De.parseMessage(Ae[Ee-1]),this.$=Ae[Ee-3];break;case 50:Ae[Ee-1].draw="participant",Ae[Ee-1].type="addParticipant",this.$=Ae[Ee-1];break;case 51:Ae[Ee-3].draw="actor",Ae[Ee-3].type="addParticipant",Ae[Ee-3].description=De.parseMessage(Ae[Ee-1]),this.$=Ae[Ee-3];break;case 52:case 57:Ae[Ee-1].draw="actor",Ae[Ee-1].type="addParticipant",this.$=Ae[Ee-1];break;case 53:Ae[Ee-1].type="destroyParticipant",this.$=Ae[Ee-1];break;case 54:Ae[Ee-3].draw="participant",Ae[Ee-3].type="addParticipant",Ae[Ee-3].description=De.parseMessage(Ae[Ee-1]),this.$=Ae[Ee-3];break;case 55:Ae[Ee-1].draw="participant",Ae[Ee-1].type="addParticipant",this.$=Ae[Ee-1];break;case 56:Ae[Ee-3].draw="actor",Ae[Ee-3].type="addParticipant",Ae[Ee-3].description=De.parseMessage(Ae[Ee-1]),this.$=Ae[Ee-3];break;case 58:this.$=[Ae[Ee-1],{type:"addNote",placement:Ae[Ee-2],actor:Ae[Ee-1].actor,text:Ae[Ee]}];break;case 59:Ae[Ee-2]=[].concat(Ae[Ee-1],Ae[Ee-1]).slice(0,2),Ae[Ee-2][0]=Ae[Ee-2][0].actor,Ae[Ee-2][1]=Ae[Ee-2][1].actor,this.$=[Ae[Ee-1],{type:"addNote",placement:De.PLACEMENT.OVER,actor:Ae[Ee-2].slice(0,2),text:Ae[Ee]}];break;case 60:this.$=[Ae[Ee-1],{type:"addLinks",actor:Ae[Ee-1].actor,text:Ae[Ee]}];break;case 61:this.$=[Ae[Ee-1],{type:"addALink",actor:Ae[Ee-1].actor,text:Ae[Ee]}];break;case 62:this.$=[Ae[Ee-1],{type:"addProperties",actor:Ae[Ee-1].actor,text:Ae[Ee]}];break;case 63:this.$=[Ae[Ee-1],{type:"addDetails",actor:Ae[Ee-1].actor,text:Ae[Ee]}];break;case 66:this.$=[Ae[Ee-2],Ae[Ee]];break;case 67:this.$=Ae[Ee];break;case 68:this.$=De.PLACEMENT.LEFTOF;break;case 69:this.$=De.PLACEMENT.RIGHTOF;break;case 70:this.$=[Ae[Ee-4],Ae[Ee-1],{type:"addMessage",from:Ae[Ee-4].actor,to:Ae[Ee-1].actor,signalType:Ae[Ee-3],msg:Ae[Ee],activate:!0},{type:"activeStart",signalType:De.LINETYPE.ACTIVE_START,actor:Ae[Ee-1].actor}];break;case 71:this.$=[Ae[Ee-4],Ae[Ee-1],{type:"addMessage",from:Ae[Ee-4].actor,to:Ae[Ee-1].actor,signalType:Ae[Ee-3],msg:Ae[Ee]},{type:"activeEnd",signalType:De.LINETYPE.ACTIVE_END,actor:Ae[Ee-4].actor}];break;case 72:this.$=[Ae[Ee-4],Ae[Ee-1],{type:"addMessage",from:Ae[Ee-4].actor,to:Ae[Ee-1].actor,signalType:Ae[Ee-3],msg:Ae[Ee],activate:!0,centralConnection:De.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:De.LINETYPE.CENTRAL_CONNECTION,actor:Ae[Ee-1].actor}];break;case 73:this.$=[Ae[Ee-4],Ae[Ee-1],{type:"addMessage",from:Ae[Ee-4].actor,to:Ae[Ee-1].actor,signalType:Ae[Ee-2],msg:Ae[Ee],activate:!1,centralConnection:De.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:De.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Ae[Ee-4].actor}];break;case 74:this.$=[Ae[Ee-5],Ae[Ee-1],{type:"addMessage",from:Ae[Ee-5].actor,to:Ae[Ee-1].actor,signalType:Ae[Ee-3],msg:Ae[Ee],activate:!0,centralConnection:De.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:De.LINETYPE.CENTRAL_CONNECTION,actor:Ae[Ee-1].actor},{type:"centralConnectionReverse",signalType:De.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Ae[Ee-5].actor}];break;case 75:this.$=[Ae[Ee-3],Ae[Ee-1],{type:"addMessage",from:Ae[Ee-3].actor,to:Ae[Ee-1].actor,signalType:Ae[Ee-2],msg:Ae[Ee]}];break;case 76:this.$={type:"addParticipant",actor:Ae[Ee-1],config:Ae[Ee]};break;case 77:this.$=Ae[Ee-1].trim();break;case 78:this.$={type:"addParticipant",actor:Ae[Ee]};break;case 79:this.$=De.LINETYPE.SOLID_OPEN;break;case 80:this.$=De.LINETYPE.DOTTED_OPEN;break;case 81:this.$=De.LINETYPE.SOLID;break;case 82:this.$=De.LINETYPE.SOLID_TOP;break;case 83:this.$=De.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=De.LINETYPE.STICK_TOP;break;case 85:this.$=De.LINETYPE.STICK_BOTTOM;break;case 86:this.$=De.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=De.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=De.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=De.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=De.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=De.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=De.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=De.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=De.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=De.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=De.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=De.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=De.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=De.LINETYPE.DOTTED;break;case 100:this.$=De.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=De.LINETYPE.SOLID_CROSS;break;case 102:this.$=De.LINETYPE.DOTTED_CROSS;break;case 103:this.$=De.LINETYPE.SOLID_POINT;break;case 104:this.$=De.LINETYPE.DOTTED_POINT;break;case 105:this.$=De.parseMessage(Ae[Ee].trim().substring(1));break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},t(F,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},t(F,[2,7]),t(F,[2,8]),t(F,[2,9]),t(F,[2,15]),{13:49,51:M,53:L,54:P},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:N},{23:56,73:N},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t(F,[2,30]),t(F,[2,31]),{33:[1,62]},{35:[1,63]},t(F,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:z},{23:75,55:76,73:z},{23:77,73:N},{69:78,72:[1,79],78:V,79:B,80:G,81:H,82:q,83:Z,84:Y,85:ie,86:K,87:Q,88:te,89:J,90:ge,91:ee,92:Re,93:Ie,94:Be,95:ce,96:oe,97:be,98:fe,99:Pe,100:ve,101:Ce,102:Ve,103:se},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:N},{23:111,73:N},{23:112,73:N},{23:113,73:N},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],de),t(F,[2,6]),t(F,[2,16]),t(Te,[2,10],{11:114}),t(F,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t(F,[2,22]),{5:[1,118]},{5:[1,119]},t(F,[2,25]),t(F,[2,26]),t(F,[2,27]),t(F,[2,28]),t(F,[2,29]),t(F,[2,32]),t(F,[2,33]),t(ae,i,{7:120}),t(ae,i,{7:121}),t(ae,i,{7:122}),t(he,i,{41:123,7:124}),t(W,i,{43:125,7:126}),t(W,i,{7:126,43:127}),t(ne,i,{46:128,7:129}),t(ae,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(j,de,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:N},{69:146,78:V,79:B,80:G,81:H,82:q,83:Z,84:Y,85:ie,86:K,87:Q,88:te,89:J,90:ge,91:ee,92:Re,93:Ie,94:Be,95:ce,96:oe,97:be,98:fe,99:Pe,100:ve,101:Ce,102:Ve,103:se},t(ue,[2,79]),t(ue,[2,80]),t(ue,[2,81]),t(ue,[2,82]),t(ue,[2,83]),t(ue,[2,84]),t(ue,[2,85]),t(ue,[2,86]),t(ue,[2,87]),t(ue,[2,88]),t(ue,[2,89]),t(ue,[2,90]),t(ue,[2,91]),t(ue,[2,92]),t(ue,[2,93]),t(ue,[2,94]),t(ue,[2,95]),t(ue,[2,96]),t(ue,[2,97]),t(ue,[2,98]),t(ue,[2,99]),t(ue,[2,100]),t(ue,[2,101]),t(ue,[2,102]),t(ue,[2,103]),t(ue,[2,104]),{23:147,73:N},{23:149,60:148,73:N},{73:[2,68]},{73:[2,69]},{58:150,104:X},{58:152,104:X},{58:153,104:X},{58:154,104:X},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:M,53:L,54:P},{5:[1,160]},t(F,[2,20]),t(F,[2,21]),t(F,[2,23]),t(F,[2,24]),{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,161],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,162],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,163],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{17:[1,164]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,47],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,50:[1,165],51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{17:[1,166]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,45],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,49:[1,167],51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{17:[1,168]},{17:[1,169]},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[2,43],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,48:[1,170],51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{4:a,5:s,8:8,9:10,10:o,13:13,14:l,15:u,17:[1,171],18:16,19:h,22:d,23:41,24:f,25:20,26:21,27:22,28:23,29:24,30:p,31:g,32:m,34:y,36:v,37:T,38:b,39:w,40:C,42:S,44:k,45:E,47:_,51:M,53:L,54:P,56:D,61:R,62:I,63:$,64:O,73:N},{16:[1,172]},t(F,[2,50]),{16:[1,173]},t(F,[2,55]),t(j,[2,76]),{76:[1,174]},{16:[1,175]},t(F,[2,52]),{16:[1,176]},t(F,[2,57]),t(F,[2,53]),{23:177,73:N},{23:178,73:N},{23:179,73:N},{58:180,104:X},{23:181,72:[1,182],73:N},{58:183,104:X},{58:184,104:X},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(F,[2,17]),t(Te,[2,11]),{13:186,51:M,53:L,54:P},t(Te,[2,13]),t(Te,[2,14]),t(F,[2,19]),t(F,[2,35]),t(F,[2,36]),t(F,[2,37]),t(F,[2,38]),{16:[1,187]},t(F,[2,39]),{16:[1,188]},t(F,[2,40]),t(F,[2,41]),{16:[1,189]},t(F,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:X},{58:196,104:X},{58:197,104:X},{5:[2,75]},{58:198,104:X},{23:199,73:N},{5:[2,58]},{5:[2,59]},{23:200,73:N},t(Te,[2,12]),t(he,i,{7:124,41:201}),t(W,i,{7:126,43:202}),t(ne,i,{7:129,46:203}),t(F,[2,49]),t(F,[2,54]),t(j,[2,77]),t(F,[2,51]),t(F,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:X},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:x(function($e,Me){if(Me.recoverable)this.trace($e);else{var He=new Error($e);throw He.hash=Me,He}},"parseError"),parse:x(function($e){var Me=this,He=[0],De=[],Ke=[null],Ae=[],at=this.table,Ee="",pt=0,ht=0,rt=2,Et=1,vt=Ae.slice.call(arguments,1),ot=Object.create(this.lexer),pe={yy:{}};for(var Ct in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ct)&&(pe.yy[Ct]=this.yy[Ct]);ot.setInput($e,pe.yy),pe.yy.lexer=ot,pe.yy.parser=this,typeof ot.yylloc>"u"&&(ot.yylloc={});var lt=ot.yylloc;Ae.push(lt);var st=ot.options&&ot.options.ranges;typeof pe.yy.parseError=="function"?this.parseError=pe.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function mt(Zt){He.length=He.length-2*Zt,Ke.length=Ke.length-Zt,Ae.length=Ae.length-Zt}x(mt,"popStack");function _r(){var Zt;return Zt=De.pop()||ot.lex()||Et,typeof Zt!="number"&&(Zt instanceof Array&&(De=Zt,Zt=De.pop()),Zt=Me.symbols_[Zt]||Zt),Zt}x(_r,"lex");for(var Se,Ue,tt,kt,Nt={},sr,Qt,vr,nr;;){if(Ue=He[He.length-1],this.defaultActions[Ue]?tt=this.defaultActions[Ue]:((Se===null||typeof Se>"u")&&(Se=_r()),tt=at[Ue]&&at[Ue][Se]),typeof tt>"u"||!tt.length||!tt[0]){var Rr="";nr=[];for(sr in at[Ue])this.terminals_[sr]&&sr>rt&&nr.push("'"+this.terminals_[sr]+"'");ot.showPosition?Rr="Parse error on line "+(pt+1)+`:
`+ot.showPosition()+`
Expecting `+nr.join(", ")+", got '"+(this.terminals_[Se]||Se)+"'":Rr="Parse error on line "+(pt+1)+": Unexpected "+(Se==Et?"end of input":"'"+(this.terminals_[Se]||Se)+"'"),this.parseError(Rr,{text:ot.match,token:this.terminals_[Se]||Se,line:ot.yylineno,loc:lt,expected:nr})}if(tt[0]instanceof Array&&tt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ue+", token: "+Se);switch(tt[0]){case 1:He.push(Se),Ke.push(ot.yytext),Ae.push(ot.yylloc),He.push(tt[1]),Se=null,ht=ot.yyleng,Ee=ot.yytext,pt=ot.yylineno,lt=ot.yylloc;break;case 2:if(Qt=this.productions_[tt[1]][1],Nt.$=Ke[Ke.length-Qt],Nt._$={first_line:Ae[Ae.length-(Qt||1)].first_line,last_line:Ae[Ae.length-1].last_line,first_column:Ae[Ae.length-(Qt||1)].first_column,last_column:Ae[Ae.length-1].last_column},st&&(Nt._$.range=[Ae[Ae.length-(Qt||1)].range[0],Ae[Ae.length-1].range[1]]),kt=this.performAction.apply(Nt,[Ee,ht,pt,pe.yy,tt[1],Ke,Ae].concat(vt)),typeof kt<"u")return kt;Qt&&(He=He.slice(0,-1*Qt*2),Ke=Ke.slice(0,-1*Qt),Ae=Ae.slice(0,-1*Qt)),He.push(this.productions_[tt[1]][0]),Ke.push(Nt.$),Ae.push(Nt._$),vr=at[He[He.length-2]][He[He.length-1]],He.push(vr);break;case 3:return!0}}return!0},"parse")},xe=(function(){var _e={EOF:1,parseError:x(function(Me,He){if(this.yy.parser)this.yy.parser.parseError(Me,He);else throw new Error(Me)},"parseError"),setInput:x(function($e,Me){return this.yy=Me||this.yy||{},this._input=$e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var $e=this._input[0];this.yytext+=$e,this.yyleng++,this.offset++,this.match+=$e,this.matched+=$e;var Me=$e.match(/(?:\r\n?|\n).*/g);return Me?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),$e},"input"),unput:x(function($e){var Me=$e.length,He=$e.split(/(?:\r\n?|\n)/g);this._input=$e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Me),this.offset-=Me;var De=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),He.length-1&&(this.yylineno-=He.length-1);var Ke=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:He?(He.length===De.length?this.yylloc.first_column:0)+De[De.length-He.length].length-He[0].length:this.yylloc.first_column-Me},this.options.ranges&&(this.yylloc.range=[Ke[0],Ke[0]+this.yyleng-Me]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function($e){this.unput(this.match.slice($e))},"less"),pastInput:x(function(){var $e=this.matched.substr(0,this.matched.length-this.match.length);return($e.length>20?"...":"")+$e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var $e=this.match;return $e.length<20&&($e+=this._input.substr(0,20-$e.length)),($e.substr(0,20)+($e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var $e=this.pastInput(),Me=new Array($e.length+1).join("-");return $e+this.upcomingInput()+`
`+Me+"^"},"showPosition"),test_match:x(function($e,Me){var He,De,Ke;if(this.options.backtrack_lexer&&(Ke={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Ke.yylloc.range=this.yylloc.range.slice(0))),De=$e[0].match(/(?:\r\n?|\n).*/g),De&&(this.yylineno+=De.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:De?De[De.length-1].length-De[De.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+$e[0].length},this.yytext+=$e[0],this.match+=$e[0],this.matches=$e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice($e[0].length),this.matched+=$e[0],He=this.performAction.call(this,this.yy,this,Me,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),He)return He;if(this._backtrack){for(var Ae in Ke)this[Ae]=Ke[Ae];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var $e,Me,He,De;this._more||(this.yytext="",this.match="");for(var Ke=this._currentRules(),Ae=0;Ae<Ke.length;Ae++)if(He=this._input.match(this.rules[Ke[Ae]]),He&&(!Me||He[0].length>Me[0].length)){if(Me=He,De=Ae,this.options.backtrack_lexer){if($e=this.test_match(He,Ke[Ae]),$e!==!1)return $e;if(this._backtrack){Me=!1;continue}else return!1}else if(!this.options.flex)break}return Me?($e=this.test_match(Me,Ke[De]),$e!==!1?$e:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var Me=this.next();return Me||this.lex()},"lex"),begin:x(function(Me){this.conditionStack.push(Me)},"begin"),popState:x(function(){var Me=this.conditionStack.length-1;return Me>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(Me){return Me=this.conditionStack.length-1-Math.abs(Me||0),Me>=0?this.conditionStack[Me]:"INITIAL"},"topState"),pushState:x(function(Me){this.begin(Me)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(Me,He,De,Ke){switch(De){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return He.yytext=He.yytext.trim(),73;case 12:return He.yytext=He.yytext.trim(),this.begin("ALIAS"),73;case 13:return He.yytext=He.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return He.yytext=He.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return He.yytext=He.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}};return _e})();Oe.lexer=xe;function Ge(){this.yy={}}return x(Ge,"Parser"),Ge.prototype=Oe,Oe.Parser=Ge,new Ge})();PB.parser=PB;var z6t=PB,V6t={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},G6t={FILLED:0,OPEN:1},W6t={LEFTOF:0,RIGHTOF:1,OVER:2},k4={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},rb,H6t=(rb=class{constructor(){this.state=new xW(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=Hn,this.setAccDescription=ii,this.setDiagramTitle=ti,this.getAccTitle=ni,this.getAccDescription=ai,this.getDiagramTitle=Yn,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(Fe().wrap),this.LINETYPE=V6t,this.ARROWTYPE=G6t,this.PLACEMENT=W6t}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,r,n,i,a){let s=this.state.records.currentBox,o;if(a!==void 0){let u;a.includes(`
`)?u=a+`
`:u=`{
`+a+`
}`,o=dR(u,{schema:hR})}i=(o==null?void 0:o.type)??i,o!=null&&o.alias&&(!n||n.text===r)&&(n={text:o.alias,wrap:n==null?void 0:n.wrap,type:i});const l=this.state.records.actors.get(e);if(l){if(this.state.records.currentBox&&l.box&&this.state.records.currentBox!==l.box)throw new Error(`A same participant should only be defined in one Box: ${l.name} can't be in '${l.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(s=l.box?l.box:this.state.records.currentBox,l.box=s,l&&r===l.name&&n==null)return}if((n==null?void 0:n.text)==null&&(n={text:r,type:i}),(i==null||n.text==null)&&(n={text:r,type:i}),this.state.records.actors.set(e,{box:s,name:r,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const u=this.state.records.actors.get(this.state.records.prevActor);u&&(u.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let r,n=0;if(!e)return 0;for(r=0;r<this.state.records.messages.length;r++)this.state.records.messages[r].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[r].from===e&&n++,this.state.records.messages[r].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[r].from===e&&n--;return n}addMessage(e,r,n,i){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:r,message:n.text,wrap:n.wrap??this.autoWrap(),answer:i})}addSignal(e,r,n,i,a=!1,s){if(i===this.LINETYPE.ACTIVE_END&&this.activationCount(e??"")<1){const l=new Error("Trying to inactivate an inactive participant ("+e+")");throw l.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},l}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:r,message:(n==null?void 0:n.text)??"",wrap:(n==null?void 0:n.wrap)??this.autoWrap(),type:i,activate:a,centralConnection:s??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();const r=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(r===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:r}}autoWrap(){var e;return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:((e=Fe().sequence)==null?void 0:e.wrap)??!1}clear(){this.state.reset(),On()}parseMessage(e){const r=e.trim(),{wrap:n,cleanedText:i}=this.extractWrap(r),a={text:i,wrap:n};return le.debug(`parseMessage: ${JSON.stringify(a)}`),a}parseBoxData(e){const r=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let n=r!=null&&r[1]?r[1].trim():"transparent",i=r!=null&&r[2]?r[2].trim():void 0;if(window!=null&&window.CSS)window.CSS.supports("color",n)||(n="transparent",i=e.trim());else{const o=new Option().style;o.color=n,o.color!==n&&(n="transparent",i=e.trim())}const{wrap:a,cleanedText:s}=this.extractWrap(i);return{text:s?Wr(s,Fe()):void 0,color:n,wrap:a}}addNote(e,r,n){const i={actor:e,placement:r,message:n.text,wrap:n.wrap??this.autoWrap()},a=[].concat(e,e);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:a[0],to:a[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:r})}addLinks(e,r){const n=this.getActor(e);try{let i=Wr(r.text,Fe());i=i.replace(/&equals;/g,"="),i=i.replace(/&amp;/g,"&");const a=JSON.parse(i);this.insertLinks(n,a)}catch(i){le.error("error while parsing actor link text",i)}}addALink(e,r){const n=this.getActor(e);try{const i={};let a=Wr(r.text,Fe());const s=a.indexOf("@");a=a.replace(/&equals;/g,"="),a=a.replace(/&amp;/g,"&");const o=a.slice(0,s-1).trim(),l=a.slice(s+1).trim();i[o]=l,this.insertLinks(n,i)}catch(i){le.error("error while parsing actor link text",i)}}insertLinks(e,r){if(e.links==null)e.links=r;else for(const n in r)e.links[n]=r[n]}addProperties(e,r){const n=this.getActor(e);try{const i=Wr(r.text,Fe()),a=JSON.parse(i);this.insertProperties(n,a)}catch(i){le.error("error while parsing actor properties text",i)}}insertProperties(e,r){if(e.properties==null)e.properties=r;else for(const n in r)e.properties[n]=r[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,r){const n=this.getActor(e),i=document.getElementById(r.text);try{const a=i.innerHTML,s=JSON.parse(a);s.properties&&this.insertProperties(n,s.properties),s.links&&this.insertLinks(n,s.links)}catch(a){le.error("error while parsing actor details text",a)}}getActorProperty(e,r){if((e==null?void 0:e.properties)!==void 0)return e.properties[r]}apply(e){if(Array.isArray(e))e.forEach(r=>{this.apply(r)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnection":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnectionReverse":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":Hn(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return Fe().sequence}},x(rb,"SequenceDB"),rb),q6t=x(t=>{const e=t.dropShadow??"none",{look:r}=Fe();return`.actor {
stroke: ${t.actorBorder};
fill: ${t.actorBkg};
stroke-width: ${t.strokeWidth??1};
}
rect.actor.outer-path[data-look="neo"] {
filter: ${e};
}
rect.note[data-look="neo"] {
stroke:${t.noteBorderColor};
fill:${t.noteBkgColor};
filter: ${e};
}
text.actor > tspan {
fill: ${t.actorTextColor};
stroke: none;
}
.actor-line {
stroke: ${t.actorLineColor};
}
.innerArc {
stroke-width: 1.5;
stroke-dasharray: none;
}
.messageLine0 {
stroke-width: 1.5;
stroke-dasharray: none;
stroke: ${t.signalColor};
}
.messageLine1 {
stroke-width: 1.5;
stroke-dasharray: 2, 2;
stroke: ${t.signalColor};
}
[id$="-arrowhead"] path {
fill: ${t.signalColor};
stroke: ${t.signalColor};
}
.sequenceNumber {
fill: ${t.sequenceNumberColor};
}
[id$="-sequencenumber"] {
fill: ${t.signalColor};
}
[id$="-crosshead"] path {
fill: ${t.signalColor};
stroke: ${t.signalColor};
}
.messageText {
fill: ${t.signalTextColor};
stroke: none;
}
.labelBox {
stroke: ${t.labelBoxBorderColor};
fill: ${t.labelBoxBkgColor};
filter: ${r==="neo"?e:"none"};
}
.labelText, .labelText > tspan {
fill: ${t.labelTextColor};
stroke: none;
}
.loopText, .loopText > tspan {
fill: ${t.loopTextColor};
stroke: none;
}
.sectionTitle, .sectionTitle > tspan {
fill: ${t.loopTextColor};
stroke: none;
}
.loopLine {
stroke-width: 2px;
stroke-dasharray: 2, 2;
stroke: ${t.labelBoxBorderColor};
fill: ${t.labelBoxBorderColor};
}
.note {
//stroke: #decc93;
stroke: ${t.noteBorderColor};
fill: ${t.noteBkgColor};
}
.noteText, .noteText > tspan {
fill: ${t.noteTextColor};
stroke: none;
${t.noteFontWeight?`font-weight: ${t.noteFontWeight};`:""}
}
.activation0 {
fill: ${t.activationBkgColor};
stroke: ${t.activationBorderColor};
}
.activation1 {
fill: ${t.activationBkgColor};
stroke: ${t.activationBorderColor};
}
.activation2 {
fill: ${t.activationBkgColor};
stroke: ${t.activationBorderColor};
}
.actorPopupMenu {
position: absolute;
}
.actorPopupMenuPanel {
position: absolute;
fill: ${t.actorBkg};
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
}
.actor-man circle, line {
fill: ${t.actorBkg};
stroke-width: 2px;
}
g rect.rect {
filter: ${e};
stroke: ${t.nodeBorder};
}
`},"getStyles"),U6t=q6t,i0=36,Ff="actor-top",zf="actor-bottom",O7="actor-box",j0="actor-man",Kh=new Set(["redux-color","redux-dark-color"]),Lk=x(function(t,e){const r=xL(t,e);return Xt().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),Y6t=x(function(t,e,r,n,i){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const a=e.links,s=e.actorCnt,o=e.rectData;var l="none";i&&(l="block !important");const u=t.append("g");u.attr("id","actor"+s+"_popup"),u.attr("class","actorPopupMenu"),u.attr("display",l);var h="";o.class!==void 0&&(h=" "+o.class);let d=o.width>r?o.width:r;const f=u.append("rect");if(f.attr("class","actorPopupMenuPanel"+h),f.attr("x",o.x),f.attr("y",o.height),f.attr("fill",o.fill),f.attr("stroke",o.stroke),f.attr("width",d),f.attr("height",o.height),f.attr("rx",o.rx),f.attr("ry",o.ry),a!=null){var p=20;for(let y in a){var g=u.append("a"),m=ig.sanitizeUrl(a[y]);g.attr("xlink:href",m),g.attr("target","_blank"),mRt(n)(y,g,o.x+10,o.height+p,d,20,{class:"actor"},n),p+=30}}return f.attr("height",p),{height:o.height+p,width:d}},"drawPopup"),$7=x(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),w6=x(async function(t,e,r=null){let n=t.append("foreignObject");const i=await eR(e.text,Xt()),s=n.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(n.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),e.class==="noteText"){const o=t.node().firstChild;o.setAttribute("height",s.height+2*e.textMargin);const l=o.getBBox();n.attr("x",Math.round(l.x+l.width/2-s.width/2)).attr("y",Math.round(l.y+l.height/2-s.height/2))}else if(r){let{startx:o,stopx:l,starty:u}=r;if(o>l){const h=o;o=l,l=h}n.attr("x",Math.round(o+Math.abs(o-l)/2-s.width/2)),e.class==="loopText"?n.attr("y",Math.round(u)):n.attr("y",Math.round(u-s.height))}return[n]},"drawKatex"),lx=x(function(t,e){let r=0,n=0;const i=e.text.split(At.lineBreakRegex),[a,s]=Oh(e.fontSize);let o=[],l=0,u=x(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":u=x(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":u=x(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":u=x(()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin),"yfunc");break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle";break}for(let[h,d]of i.entries()){e.textMargin!==void 0&&e.textMargin===0&&a!==void 0&&(l=h*a);const f=t.append("text");f.attr("x",e.x),f.attr("y",u()),e.anchor!==void 0&&f.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&f.style("font-family",e.fontFamily),s!==void 0&&f.style("font-size",s),e.fontWeight!==void 0&&f.style("font-weight",e.fontWeight),e.fill!==void 0&&f.attr("fill",e.fill),e.class!==void 0&&f.attr("class",e.class),e.dy!==void 0?f.attr("dy",e.dy):l!==0&&f.attr("dy",l);const p=d||kde;if(e.tspan){const g=f.append("tspan");g.attr("x",e.x),e.fill!==void 0&&g.attr("fill",e.fill),g.text(p)}else f.text(p);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(n+=(f._groups||f)[0][0].getBBox().height,r=n),o.push(f)}return o},"drawText"),__e=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");return n.attr("points",r(e.x,e.y,e.width,e.height,7)),n.attr("class","labelBox"),e.y=e.y+e.height/2,lx(t,e),n},"drawLabel"),Ur=-1,R_e=x((t,e,r,n)=>{t.select&&r.forEach(i=>{const a=e.get(i),s=t.select("#actor"+a.actorCnt);!n.mirrorActors&&a.stopy?s.attr("y2",a.stopy+a.height/2):n.mirrorActors&&s.attr("y2",a.stopy)})},"fixLifeLineHeights"),X6t=x(function(t,e,r,n,i){var w,C;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Ur++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",$7(`actor${Ur}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Ur,e.links!=null&&g.attr("id","root-"+Ur),l==="neo"&&g.attr("data-look","neo"));const m=Yo();var y="actor";(w=e.properties)!=null&&w.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${zf}`:y+=` ${Ff}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=y,m.rx=3,m.ry=3,m.name=e.name,l==="neo"&&(m.rx=6,m.ry=6);const v=Lk(g,m),T=i.get(e.name)??0;if(Kh.has(u)&&(v.style("stroke",f[T%f.length]),v.style("fill",d[T%f.length])),l==="neo"&&v.attr("filter","url(#drop-shadow)"),e.rectData=m,(C=e.properties)!=null&&C.icon){const S=e.properties.icon.trim();S.charAt(0)==="@"?hW(g,m.x+m.width-20,m.y+10,S.substr(1)):uW(g,m.x+m.width-20,m.y+10,S)}n||(g.attr("data-et","participant"),g.attr("data-type","participant"),g.attr("data-id",e.name)),Zh(r,$i(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${O7}`},r);let b=e.height;if(v.node){const S=v.node().getBBox();e.height=S.height,b=S.height}return b},"drawActorTypeParticipant"),j6t=x(function(t,e,r,n,i){var k,E;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Ur++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",$7(`actor${Ur}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Ur,e.links!=null&&g.attr("id","root-"+Ur),l==="neo"&&g.attr("data-look","neo"));const m=Yo();var y="actor";(k=e.properties)!=null&&k.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${zf}`:y+=` ${Ff}`,m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.class=y,m.name=e.name;const v=6,T={...m,x:m.x+-v,y:m.y+ +v,class:"actor"},b=Lk(g,m),w=Lk(g,T);e.rectData=m,l==="neo"&&g.attr("filter","url(#drop-shadow)");const C=i.get(e.name)??0;if(Kh.has(u)&&(b.style("stroke",f[C%f.length]),b.style("fill",d[C%f.length]),w.style("stroke",f[C%f.length]),w.style("fill",d[C%f.length])),(E=e.properties)!=null&&E.icon){const _=e.properties.icon.trim();_.charAt(0)==="@"?hW(g,m.x+m.width-20,m.y+10,_.substr(1)):uW(g,m.x+m.width-20,m.y+10,_)}Zh(r,$i(e.description))(e.description,g,m.x-v,m.y+v,m.width,m.height,{class:`actor ${O7}`},r);let S=e.height;if(b.node){const _=b.node().getBBox();e.height=_.height,S=_.height}return n||(g.attr("data-et","participant"),g.attr("data-type","collections"),g.attr("data-id",e.name)),S},"drawActorTypeCollections"),K6t=x(function(t,e,r,n,i){var _,M;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();let g=p;n||(Ur++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",$7(`actor${Ur}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),g=p.append("g"),e.actorCnt=Ur,e.links!=null&&g.attr("id","root-"+Ur),l==="neo"&&g.attr("data-look","neo"));const m=Yo();let y="actor";(_=e.properties)!=null&&_.class?y=e.properties.class:m.fill="#eaeaea",n?y+=` ${zf}`:y+=` ${Ff}`,g.attr("class",y),m.x=e.x,m.y=a,m.width=e.width,m.height=e.height,m.name=e.name;const v=m.height/2,T=v/(2.5+m.height/50),b=g.append("g"),w=g.append("g"),C=`M ${m.x},${m.y+v}
a ${T},${v} 0 0 0 0,${m.height}
h ${m.width-2*T}
a ${T},${v} 0 0 0 0,-${m.height}
Z
`;b.append("path").attr("d",C),w.append("path").attr("d",`M ${m.x},${m.y+v}
a ${T},${v} 0 0 0 0,${m.height}`),b.attr("transform",`translate(${T}, ${-(m.height/2)})`),w.attr("transform",`translate(${m.width-T}, ${-m.height/2})`),e.rectData=m,l==="neo"&&b.attr("filter","url(#drop-shadow)");const S=i.get(e.name)??0;if(Kh.has(u)&&(b.style("stroke",f[S%f.length]),b.style("fill",d[S%f.length]),w.style("stroke",f[S%f.length]),w.style("fill",d[S%f.length])),(M=e.properties)!=null&&M.icon){const L=e.properties.icon.trim(),P=m.x+m.width-20,D=m.y+10;L.charAt(0)==="@"?hW(g,P,D,L.substr(1)):uW(g,P,D,L)}Zh(r,$i(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${O7}`},r);let k=e.height;const E=b.select("path:last-child");if(E.node()){const L=E.node().getBBox();e.height=L.height,k=L.height}return n||(g.attr("data-et","participant"),g.attr("data-type","queue"),g.attr("data-id",e.name)),k},"drawActorTypeQueue"),Z6t=x(function(t,e,r,n,i,a){var _;const s=n?e.stopy:e.starty,o=e.x+e.width/2,l=s+75,{look:u,theme:h,themeVariables:d}=r,{bkgColorArray:f,borderColorArray:p,actorBorder:g,actorBkg:m}=d,y=t.append("g").lower();n||(Ur++,y.append("line").attr("id","actor"+Ur).attr("x1",o).attr("y1",l).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Ur);const v=t.append("g");let T=j0;n?T+=` ${zf}`:T+=` ${Ff}`,v.attr("class",T),v.attr("name",e.name);const b=Yo();b.x=e.x,b.y=s,b.fill="#eaeaea",b.width=e.width,b.height=e.height,b.class="actor";const w=e.x+e.width/2,C=s+32,S=22;v.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),v.append("circle").attr("cx",w).attr("cy",C).attr("r",S).attr("filter",`${u==="neo"?"url(#drop-shadow)":""}`),v.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${w}, ${C-S})`);const k=a.get(e.name)??0;Kh.has(h)?(v.style("stroke",p[k%p.length]),v.style("fill",f[k%p.length])):(v.style("stroke",g),v.style("fill",m));const E=v.node().getBBox();return e.height=E.height+2*(((_=r==null?void 0:r.sequence)==null?void 0:_.labelBoxHeight)??0),Zh(r,$i(e.description))(e.description,v,b.x,b.y+S+(n?5:12),b.width,b.height,{class:`actor ${j0}`},r),n||(v.attr("data-et","participant"),v.attr("data-type","control"),v.attr("data-id",e.name)),e.height},"drawActorTypeControl"),Q6t=x(function(t,e,r,n,i){var S;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+75,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower(),g=t.append("g");let m="actor";n?m+=` ${zf}`:m+=` ${Ff}`,g.attr("class",m),g.attr("name",e.name);const y=Yo();y.x=e.x,y.y=a,y.fill="#eaeaea",y.width=e.width,y.height=e.height,y.class="actor";const v=e.x+e.width/2,T=a+(n?10:25),b=22;g.append("circle").attr("cx",v).attr("cy",T).attr("r",b).attr("width",e.width).attr("height",e.height),g.append("line").attr("x1",v-b).attr("x2",v+b).attr("y1",T+b).attr("y2",T+b).attr("stroke-width",2),l==="neo"&&g.attr("filter","url(#drop-shadow)");const w=i.get(e.name)??0;Kh.has(u)&&(g.style("stroke",f[w%f.length]),g.style("fill",d[w%f.length]));const C=g.node().getBBox();return e.height=C.height+(((S=r==null?void 0:r.sequence)==null?void 0:S.labelBoxHeight)??0),n||(Ur++,p.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Ur),Zh(r,$i(e.description))(e.description,g,y.x,y.y+(n?15:30),y.width,y.height,{class:`actor ${j0}`},r),n?g.attr("transform",`translate(0, ${b})`):(g.attr("transform",`translate(0, ${b/2-5})`),g.attr("data-et","participant"),g.attr("data-type","entity"),g.attr("data-id",e.name)),e.height},"drawActorTypeEntity"),J6t=x(function(t,e,r,n,i){var M;const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+e.height+2*r.boxTextMargin,{theme:l,themeVariables:u,look:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=u,g=t.append("g").lower();let m=g;n||(Ur++,Object.keys(e.links||{}).length&&!r.forceMenus&&m.attr("onclick",$7(`actor${Ur}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),m=g.append("g"),e.actorCnt=Ur,e.links!=null&&m.attr("id","root-"+Ur),h==="neo"&&m.attr("data-look","neo"));const y=Yo();let v="actor";(M=e.properties)!=null&&M.class?v=e.properties.class:y.fill="#eaeaea",n?v+=` ${zf}`:v+=` ${Ff}`,y.x=e.x,y.y=a,y.width=e.width,y.height=e.height,y.class=v,y.name=e.name,y.x=e.x,y.y=a;const T=y.width/3,b=y.width/3,w=T/2,C=w/(2.5+T/50),S=m.append("g");S.attr("class",v);const k=`
M ${y.x},${y.y+C}
a ${w},${C} 0 0 0 ${T},0
a ${w},${C} 0 0 0 -${T},0
l 0,${b-2*C}
a ${w},${C} 0 0 0 ${T},0
l 0,-${b-2*C}
`;S.append("path").attr("d",k),h==="neo"&&S.attr("filter","url(#drop-shadow)");const E=i.get(e.name)??0;Kh.has(l)?(S.style("stroke",f[E%f.length]),S.style("fill",d[E%f.length])):S.style("stroke",p),S.attr("transform",`translate(${T}, ${C})`),e.rectData=y,Zh(r,$i(e.description))(e.description,m,y.x,y.y+35,y.width,y.height,{class:`actor ${O7}`},r);const _=S.select("path:last-child");if(_.node()){const L=_.node().getBBox();e.height=L.height+(r.sequence.labelBoxHeight??0)}return n||(m.attr("data-et","participant"),m.attr("data-type","database"),m.attr("data-id",e.name)),e.height},"drawActorTypeDatabase"),eRt=x(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,l=22,u=t.append("g").lower(),{look:h,theme:d,themeVariables:f}=r,{bkgColorArray:p,borderColorArray:g,actorBorder:m}=f;n||(Ur++,u.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Ur);const y=t.append("g");let v=j0;n?v+=` ${zf}`:v+=` ${Ff}`,y.attr("class",v),y.attr("name",e.name);const T=Yo();T.x=e.x,T.y=a,T.fill="#eaeaea",T.width=e.width,T.height=e.height,T.class="actor",y.append("line").attr("id","actor-man-torso"+Ur).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+12).attr("x2",e.x+e.width/2-15).attr("y2",a+12),y.append("line").attr("id","actor-man-arms"+Ur).attr("x1",e.x+e.width/2-l*2.5).attr("y1",a+2).attr("x2",e.x+e.width/2-l*2.5).attr("y2",a+22),y.append("circle").attr("cx",e.x+e.width/2).attr("cy",a+12).attr("r",l),h==="neo"&&y.attr("filter","url(#drop-shadow)");const b=i.get(e.name)??0;Kh.has(d)?(y.style("stroke",g[b%g.length]),y.style("fill",p[b%g.length])):y.style("stroke",m);const w=y.node().getBBox();return e.height=w.height+(r.sequence.labelBoxHeight??0),Zh(r,$i(e.description))(e.description,y,T.x,T.y+15,T.width,T.height,{class:`actor ${j0}`},r),y.attr("transform",`translate(0,${l/2+10})`),n||(y.attr("data-et","participant"),y.attr("data-type","boundary"),y.attr("data-id",e.name)),e.height},"drawActorTypeBoundary"),tRt=x(function(t,e,r,n,i){const a=n?e.stopy:e.starty,s=e.x+e.width/2,o=a+80,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=h,g=t.append("g").lower();n||(Ur++,g.append("line").attr("id","actor"+Ur).attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=Ur);const m=t.append("g");let y=j0;n?y+=` ${zf}`:y+=` ${Ff}`,m.attr("class",y),m.attr("name",e.name),n||m.attr("data-et","participant").attr("data-type","actor").attr("data-id",e.name);const v=l==="neo"?.5:1,T=l==="neo"?a+(1-v)*30:a;m.append("line").attr("id","actor-man-torso"+Ur).attr("x1",s).attr("y1",T+25*v).attr("x2",s).attr("y2",T+45*v),m.append("line").attr("id","actor-man-arms"+Ur).attr("x1",s-i0/2*v).attr("y1",T+33*v).attr("x2",s+i0/2*v).attr("y2",T+33*v),m.append("line").attr("x1",s-i0/2*v).attr("y1",T+60*v).attr("x2",s).attr("y2",T+45*v),m.append("line").attr("x1",s).attr("y1",T+45*v).attr("x2",s+(i0/2-2)*v).attr("y2",T+60*v);const b=m.append("circle");b.attr("cx",e.x+e.width/2),b.attr("cy",T+10*v),b.attr("r",15*v),b.attr("width",e.width*v),b.attr("height",e.height*v);const w=m.node().getBBox();e.height=w.height;const C=Yo();C.x=e.x,C.y=T,C.fill="#eaeaea",C.width=e.width,C.height=e.height/v,C.class="actor",C.rx=3,C.ry=3;const S=i.get(e.name)??0;return Kh.has(u)?(m.style("stroke",f[S%f.length]),m.style("fill",d[S%f.length])):m.style("stroke",p),Zh(r,$i(e.description))(e.description,m,C.x,T+35*v-(l==="neo"?10:0),C.width,C.height,{class:`actor ${j0}`},r),e.height},"drawActorTypeActor"),rRt=x(async function(t,e,r,n,i,a,s){const o=s??new Map([...a.db.getActors().values()].map((l,u)=>[l.name,u]));switch(e.type){case"actor":return await tRt(t,e,r,n,o);case"participant":return await X6t(t,e,r,n,o);case"boundary":return await eRt(t,e,r,n,o);case"control":return await Z6t(t,e,r,n,i,o);case"entity":return await Q6t(t,e,r,n,o);case"database":return await J6t(t,e,r,n,o);case"collections":return await j6t(t,e,r,n,o);case"queue":return await K6t(t,e,r,n,o)}},"drawActor"),nRt=x(function(t,e,r){const i=t.append("g");L_e(i,e),e.name&&Zh(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),iRt=x(function(t){return t.append("g")},"anchorElement"),aRt=x(function(t,e,r,n,i,a,s){const{theme:o,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:h,mainBkg:d}=l,f=Yo(),p=e.anchored,g=e.actor;f.x=e.startx,f.y=e.starty,f.class="activation"+i%3,f.width=e.stopx-e.startx,f.height=r-e.starty;const m=Lk(p,f),v=(s??new Map([...a.db.getActors().values()].map((T,b)=>[T.name,b]))).get(g)??0;Kh.has(o)&&(m.style("stroke",h[v%h.length]),m.style("fill",u[v%h.length]??d))},"drawActivation"),sRt=x(async function(t,e,r,n,i){const{boxMargin:a,boxTextMargin:s,labelBoxHeight:o,labelBoxWidth:l,messageFontFamily:u,messageFontSize:h,messageFontWeight:d}=n,f=t.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),p=x(function(y,v,T,b){return f.append("line").attr("x1",y).attr("y1",v).attr("x2",T).attr("y2",b).attr("class","loopLine")},"drawLoopLine");p(e.startx,e.starty,e.stopx,e.starty),p(e.stopx,e.starty,e.stopx,e.stopy),p(e.startx,e.stopy,e.stopx,e.stopy),p(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(y){p(e.startx,y.y,e.stopx,y.y).style("stroke-dasharray","3, 3")});let g=dW();g.text=r,g.x=e.startx,g.y=e.starty,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=Math.max(l??0,50),g.height=o+(n.look==="neo"?15:0)||20,g.textMargin=s,g.class="labelText",__e(f,g),g=M_e(),g.text=e.title,g.x=e.startx+l/2+(e.stopx-e.startx)/2,g.y=e.starty+a+s,g.anchor="middle",g.valign="middle",g.textMargin=s,g.class="loopText",g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=!0;let m=$i(g.text)?await w6(f,g,e):lx(f,g);if(e.sectionTitles!==void 0){for(const[y,v]of Object.entries(e.sectionTitles))if(v.message){g.text=v.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[y].y+a+s,g.class="sectionTitle",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=e.wrap,$i(g.text)?(e.starty=e.sections[y].y,await w6(f,g,e)):lx(f,g);let T=Math.round(m.map(b=>(b._groups||b)[0][0].getBBox().height).reduce((b,w)=>b+w));e.sections[y].height+=T-(a+s)}}return e.height=Math.round(e.stopy-e.starty),f},"drawLoop"),L_e=x(function(t,e){q2e(t,e)},"drawBackgroundRect"),oRt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),lRt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),cRt=x(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),uRt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),hRt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),dRt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),fRt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),pRt=x(function(t,e){const{theme:r}=e;t.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${r==="redux"||r==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),M_e=x(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),gRt=x(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Zh=(function(){function t(a,s,o,l,u,h,d){const f=s.append("text").attr("x",o+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(a);i(f,d)}x(t,"byText");function e(a,s,o,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[y,v]=Oh(p),T=a.split(At.lineBreakRegex);for(let b=0;b<T.length;b++){const w=b*y-y*(T.length-1)/2,C=s.append("text").attr("x",o+u/2).attr("y",l).style("text-anchor","middle").style("font-size",v).style("font-weight",m).style("font-family",g);C.append("tspan").attr("x",o+u/2).attr("dy",w).text(T[b]),C.attr("y",l+h/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(C,d)}}x(e,"byTspan");function r(a,s,o,l,u,h,d,f){const p=s.append("switch"),m=p.append("foreignObject").attr("x",o).attr("y",l).attr("width",u).attr("height",h).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");m.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(a),e(a,p,o,l,u,h,d,f),i(m,d)}x(r,"byFo");async function n(a,s,o,l,u,h,d,f){const p=await Yk(a,Xt()),g=s.append("switch"),y=g.append("foreignObject").attr("x",o+u/2-p.width/2).attr("y",l+h/2-p.height/2).attr("width",p.width).attr("height",p.height).append("xhtml:div").style("height","100%").style("width","100%");y.append("div").style("text-align","center").style("vertical-align","middle").html(await eR(a,Xt())),e(a,g,o,l,u,h,d,f),i(y,d)}x(n,"byKatex");function i(a,s){for(const o in s)s.hasOwnProperty(o)&&a.attr(o,s[o])}return x(i,"_setTextAttrs"),function(a,s=!1){return s?n:a.textPlacement==="fo"?r:a.textPlacement==="old"?t:e}})(),mRt=(function(){function t(i,a,s,o,l,u,h){const d=a.append("text").attr("x",s).attr("y",o).style("text-anchor","start").text(i);n(d,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d){const{actorFontSize:f,actorFontFamily:p,actorFontWeight:g}=d,m=i.split(At.lineBreakRegex);for(let y=0;y<m.length;y++){const v=y*f-f*(m.length-1)/2,T=a.append("text").attr("x",s).attr("y",o).style("text-anchor","start").style("font-size",f).style("font-weight",g).style("font-family",p);T.append("tspan").attr("x",s).attr("dy",v).text(m[y]),T.attr("y",o+u/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),n(T,h)}}x(e,"byTspan");function r(i,a,s,o,l,u,h,d){const f=a.append("switch"),g=f.append("foreignObject").attr("x",s).attr("y",o).attr("width",l).attr("height",u).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");g.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),e(i,f,s,o,l,u,h,d),n(g,h)}x(r,"byFo");function n(i,a){for(const s in a)a.hasOwnProperty(s)&&i.attr(s,a[s])}return x(n,"_setTextAttrs"),function(i){return i.textPlacement==="fo"?r:i.textPlacement==="old"?t:e}})(),yRt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-solidTopArrowHead").attr("refX",7.9).attr("refY",7.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 8 L 0 8 z")},"insertSolidTopArrowHead"),vRt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-solidBottomArrowHead").attr("refX",7.9).attr("refY",.75).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 0 L 0 8 z")},"insertSolidBottomArrowHead"),bRt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-stickTopArrowHead").attr("refX",7.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 7 7").attr("stroke","black").attr("stroke-width",1.5).attr("fill","none")},"insertStickTopArrowHead"),xRt=x(function(t,e){t.append("defs").append("marker").attr("id",e+"-stickBottomArrowHead").attr("refX",7.5).attr("refY",0).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 7 L 7 0").attr("stroke","black").attr("stroke-width",1.5).attr("fill","none")},"insertStickBottomArrowHead"),Fn={drawRect:Lk,drawText:lx,drawLabel:__e,drawActor:rRt,drawBox:nRt,drawPopup:Y6t,anchorElement:iRt,drawActivation:aRt,drawLoop:sRt,drawBackgroundRect:L_e,insertArrowHead:uRt,insertArrowFilledHead:hRt,insertSequenceNumber:dRt,insertArrowCrossHead:fRt,insertDatabaseIcon:oRt,insertComputerIcon:lRt,insertClockIcon:cRt,getTextObj:M_e,getNoteRect:gRt,fixLifeLineHeights:R_e,sanitizeUrl:ig.sanitizeUrl,insertDropShadow:pRt,insertSolidTopArrowHead:yRt,insertSolidBottomArrowHead:vRt,insertStickTopArrowHead:bRt,insertStickBottomArrowHead:xRt},Ye={},bt={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:x(function(){return Math.max.apply(null,this.actors.length===0?[0]:this.actors.map(t=>t.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:x(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:x(function(t){this.boxes.push(t)},"addBox"),addActor:x(function(t){this.actors.push(t)},"addActor"),addLoop:x(function(t){this.loops.push(t)},"addLoop"),addMessage:x(function(t){this.messages.push(t)},"addMessage"),addNote:x(function(t){this.notes.push(t)},"addNote"),lastActor:x(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:x(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:x(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:x(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:x(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,D_e(Fe())},"init"),updateVal:x(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:x(function(t,e,r,n){const i=this;let a=0;function s(o){return x(function(u){a++;const h=i.sequenceItems.length-a+1;i.updateVal(u,"starty",e-h*Ye.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*Ye.boxMargin,Math.max),i.updateVal(bt.data,"startx",t-h*Ye.boxMargin,Math.min),i.updateVal(bt.data,"stopx",r+h*Ye.boxMargin,Math.max),o!=="activation"&&(i.updateVal(u,"startx",t-h*Ye.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*Ye.boxMargin,Math.max),i.updateVal(bt.data,"starty",e-h*Ye.boxMargin,Math.min),i.updateVal(bt.data,"stopy",n+h*Ye.boxMargin,Math.max))},"updateItemBounds")}x(s,"updateFn"),this.sequenceItems.forEach(s()),this.activations.forEach(s("activation"))},"updateBounds"),insert:x(function(t,e,r,n){const i=At.getMin(t,r),a=At.getMax(t,r),s=At.getMin(e,n),o=At.getMax(e,n);this.updateVal(bt.data,"startx",i,Math.min),this.updateVal(bt.data,"starty",s,Math.min),this.updateVal(bt.data,"stopx",a,Math.max),this.updateVal(bt.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),newActivation:x(function(t,e,r){const n=r.get(t.from),i=P7(t.from).length||0,a=n.x+n.width/2+(i-1)*Ye.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Ye.activationWidth,stopy:void 0,actor:t.from,anchored:Fn.anchorElement(e)})},"newActivation"),endActivation:x(function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:x(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:x(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:x(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:x(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:x(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:bt.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:x(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:x(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:x(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=At.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:x(function(){return this.verticalPos},"getVerticalPos"),getBounds:x(function(){return{bounds:this.data,models:this.models}},"getBounds")},TRt=x(async function(t,e,r){bt.bumpVerticalPos(Ye.boxMargin),e.height=Ye.boxMargin,e.starty=bt.getVerticalPos();const n=Yo();n.x=e.startx,n.y=e.starty,n.width=e.width||Ye.width,n.class="note";const i=t.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);const a=Fn.drawRect(i,n),s=dW();s.x=e.startx,s.y=e.starty,s.width=n.width,s.dy="1em",s.text=e.message,s.class="noteText",s.fontFamily=Ye.noteFontFamily,s.fontSize=Ye.noteFontSize,s.fontWeight=Ye.noteFontWeight,s.anchor=Ye.noteAlign,s.textMargin=Ye.noteMargin,s.valign="center";const o=$i(s.text)?await w6(i,s):lx(i,s),l=Math.round(o.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,h)=>u+h));a.attr("height",l+2*Ye.noteMargin),e.height+=l+2*Ye.noteMargin,bt.bumpVerticalPos(l+2*Ye.noteMargin),e.stopy=e.starty+l+2*Ye.noteMargin,e.stopx=e.startx+n.width,bt.insert(e.startx,e.starty,e.stopx,e.stopy),bt.models.addNote(e)},"drawNote"),mie=x(function(t,e,r,n,i,a,s){const o=n.db.getActors(),l=o.get(e.from),u=o.get(e.to),h=r.sequenceVisible;let d=l.x+l.width/2,f=u.x+u.width/2;const p=d<=f,g=B_e(e,n),m=t.append("g"),y=16.5,v=x((S,k)=>{const E=S?y:-y;return k?-E:E},"getCircleOffset"),T=x(S=>{m.append("circle").attr("cx",S).attr("cy",s).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:b,CENTRAL_CONNECTION_REVERSE:w,CENTRAL_CONNECTION_DUAL:C}=n.db.LINETYPE;if(h)switch(e.centralConnection){case b:g&&(f+=v(p,!0));break;case w:g||(d+=v(p,!1));break;case C:g?f+=v(p,!0):d+=v(p,!1);break}switch(e.centralConnection){case b:T(f);break;case w:T(d);break;case C:T(d),T(f);break}},"drawCentralConnection"),K0=x(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),Pm=x(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),BB=x(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function I_e(t,e){bt.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,a=At.splitBreaks(i).length,s=$i(i),o=s?await Yk(i,Fe()):yr.calculateTextDimensions(i,K0(Ye));if(!s){const d=o.height/a;e.height+=d,bt.bumpVerticalPos(d)}let l,u=o.height-10;const h=o.width;if(r===n){l=bt.getVerticalPos()+u,Ye.rightAngles||(u+=Ye.boxMargin,l=bt.getVerticalPos()+u),u+=30;const d=At.getMax(h/2,Ye.width/2);bt.insert(r-d,bt.getVerticalPos()-10+u,n+d,bt.getVerticalPos()+30+u)}else u+=Ye.boxMargin,l=bt.getVerticalPos()+u,bt.insert(r,l-10,n,l);return bt.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,bt.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}x(I_e,"boundMessage");var wRt=x(async function(t,e,r,n,i,a){const{startx:s,stopx:o,starty:l,message:u,type:h,sequenceIndex:d,sequenceVisible:f}=e,p=yr.calculateTextDimensions(u,K0(Ye)),g=dW();g.x=Math.min(s,o),g.y=l+10,g.width=Math.abs(o-s),g.class="messageText",g.dy="1em",g.text=u,g.fontFamily=Ye.messageFontFamily,g.fontSize=Ye.messageFontSize,g.fontWeight=Ye.messageFontWeight,g.anchor=Ye.messageAlign,g.valign="center",g.textMargin=Ye.wrapPadding,g.tspan=!1,$i(g.text)?await w6(t,g,{startx:s,stopx:o,starty:r}):lx(t,g);const m=p.width;let y;if(s===o){const T=f||Ye.showSequenceNumbers,b=B_e(i,n),w=RRt(i,n),C=s+(T&&(b||w)?10:0);Ye.rightAngles?y=t.append("path").attr("d",`M ${C},${r} H ${s+At.getMax(Ye.width/2,m/2)} V ${r+25} H ${s}`):y=t.append("path").attr("d","M "+C+","+r+" C "+(C+60)+","+(r-10)+" "+(s+60)+","+(r+30)+" "+s+","+(r+20)),zN(i,n)&&mie(t,i,e,n,s,o,r)}else y=t.append("line"),y.attr("x1",s),y.attr("y1",r),y.attr("x2",o),y.attr("y2",r),zN(i,n)&&mie(t,i,e,n,s,o,r);h===n.db.LINETYPE.DOTTED||h===n.db.LINETYPE.DOTTED_CROSS||h===n.db.LINETYPE.DOTTED_POINT||h===n.db.LINETYPE.DOTTED_OPEN||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED||h===n.db.LINETYPE.SOLID_TOP_DOTTED||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED||h===n.db.LINETYPE.STICK_TOP_DOTTED||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(y.style("stroke-dasharray","3, 3"),y.attr("class","messageLine1")):y.attr("class","messageLine0"),y.attr("data-et","message"),y.attr("data-id","i"+e.id),y.attr("data-from",e.from),y.attr("data-to",e.to);let v="";if(Ye.arrowMarkerAbsolute&&(v=J6(!0)),y.attr("stroke-width",2),y.attr("stroke","none"),y.style("fill","none"),(h===n.db.LINETYPE.SOLID_TOP||h===n.db.LINETYPE.SOLID_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.SOLID_BOTTOM||h===n.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.STICK_TOP||h===n.db.LINETYPE.STICK_TOP_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.STICK_BOTTOM||h===n.db.LINETYPE.STICK_BOTTOM_DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidBottomArrowHead)"),(h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-solidTopArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickBottomArrowHead)"),(h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+v+"#"+a+"-stickTopArrowHead)"),(h===n.db.LINETYPE.SOLID||h===n.db.LINETYPE.DOTTED)&&y.attr("marker-end","url("+v+"#"+a+"-arrowhead)"),(h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(y.attr("marker-start","url("+v+"#"+a+"-arrowhead)"),y.attr("marker-end","url("+v+"#"+a+"-arrowhead)")),(h===n.db.LINETYPE.SOLID_POINT||h===n.db.LINETYPE.DOTTED_POINT)&&y.attr("marker-end","url("+v+"#"+a+"-filled-head)"),(h===n.db.LINETYPE.SOLID_CROSS||h===n.db.LINETYPE.DOTTED_CROSS)&&y.attr("marker-end","url("+v+"#"+a+"-crosshead)"),f||Ye.showSequenceNumbers){const T=h===n.db.LINETYPE.BIDIRECTIONAL_SOLID||h===n.db.LINETYPE.BIDIRECTIONAL_DOTTED,b=h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,w=6,C=zN(i,n);let S=s,k=o;T?(s<o?S=s+w*2:(S=s-w+(C?-5:0),S+=(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),y.attr("x1",S)):b?(o>s?k=o-2*w:(k=o-w,S+=(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(i==null?void 0:i.centralConnection)===n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),k+=C?15:0,y.attr("x2",k),y.attr("x1",S)):y.attr("x1",s+w);let E=0;const _=s===o,M=s<=o;_?E=e.fromBounds+1:b?E=M?e.toBounds-1:e.fromBounds+1:E=M?e.fromBounds+1:e.toBounds-1;let L="12px";const P=d.toString().length;P>5?L="7px":P>3&&(L="9px"),t.append("line").attr("x1",E).attr("y1",r).attr("x2",E).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+v+"#"+a+"-sequencenumber)"),t.append("text").attr("x",E).attr("y",r+4).attr("font-family","sans-serif").attr("font-size",L).attr("text-anchor","middle").attr("class","sequenceNumber").text(d)}},"drawMessage"),CRt=x(function(t,e,r,n,i,a,s){let o=0,l=0,u,h=0;for(const d of n){const f=e.get(d),p=f.box;u&&u!=p&&(s||bt.models.addBox(u),l+=Ye.boxMargin+u.margin),p&&p!=u&&(s||(p.x=o+l,p.y=i),l+=p.margin),f.width=At.getMax(f.width||Ye.width,Ye.width),f.height=At.getMax(f.height||Ye.height,Ye.height),f.margin=f.margin||Ye.actorMargin,h=At.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=o+l,f.starty=bt.getVerticalPos(),bt.insert(f.x,i,f.x+f.width,f.height),o+=f.width+l,f.box&&(f.box.width=o+p.margin-f.box.x),l=f.margin,u=f.box,bt.models.addActor(f)}u&&!s&&bt.models.addBox(u),bt.bumpVerticalPos(h)},"addActorRenderingData"),FB=x(async function(t,e,r,n,i,a,s){if(n){let o=0;bt.bumpVerticalPos(Ye.boxMargin*2);for(const l of r){const u=e.get(l);u.stopy||(u.stopy=bt.getVerticalPos());const h=await Fn.drawActor(t,u,Ye,!0,i,a,s);o=At.getMax(o,h)}bt.bumpVerticalPos(o+Ye.boxMargin)}else for(const o of r){const l=e.get(o);await Fn.drawActor(t,l,Ye,!1,i,a,s)}},"drawActors"),N_e=x(function(t,e,r,n){let i=0,a=0;for(const s of r){const o=e.get(s),l=SRt(o),u=Fn.drawPopup(t,o,l,Ye,Ye.forceMenus,n);u.height>i&&(i=u.height),u.width+o.x>a&&(a=u.width+o.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),D_e=x(function(t){Wi(Ye,t),t.fontFamily&&(Ye.actorFontFamily=Ye.noteFontFamily=Ye.messageFontFamily=t.fontFamily),t.fontSize&&(Ye.actorFontSize=Ye.noteFontSize=Ye.messageFontSize=t.fontSize),t.fontWeight&&(Ye.actorFontWeight=Ye.noteFontWeight=Ye.messageFontWeight=t.fontWeight)},"setConf"),P7=x(function(t){return bt.activations.filter(function(e){return e.actor===t})},"actorActivations"),yie=x(function(t,e){const r=e.get(t),n=P7(t),i=n.reduce(function(s,o){return At.getMin(s,o.startx)},r.x+r.width/2-1),a=n.reduce(function(s,o){return At.getMax(s,o.stopx)},r.x+r.width/2+1);return[i,a]},"activationBounds");function Ll(t,e,r,n,i){bt.bumpVerticalPos(r);let a=n;if(e.id&&e.message&&t[e.id]){const s=t[e.id].width,o=K0(Ye);e.message=yr.wrapLabel(`[${e.message}]`,s-2*Ye.wrapPadding,o),e.width=s,e.wrap=!0;const l=yr.calculateTextDimensions(e.message,o),u=At.getMax(l.height,Ye.labelBoxHeight);a=n+u,le.debug(`${u} - ${e.message}`)}i(e),bt.bumpVerticalPos(a)}x(Ll,"adjustLoopHeightForWrap");function O_e(t,e,r,n,i,a,s){function o(h,d){h.x<i.get(t.from).x?(bt.insert(e.stopx-d,e.starty,e.startx,e.stopy+h.height/2+Ye.noteMargin),e.stopx=e.stopx+d):(bt.insert(e.startx,e.starty,e.stopx+d,e.stopy+h.height/2+Ye.noteMargin),e.stopx=e.stopx-d)}x(o,"receiverAdjustment");function l(h,d){h.x<i.get(t.to).x?(bt.insert(e.startx-d,e.starty,e.stopx,e.stopy+h.height/2+Ye.noteMargin),e.startx=e.startx+d):(bt.insert(e.stopx,e.starty,e.startx+d,e.stopy+h.height/2+Ye.noteMargin),e.startx=e.startx-d)}x(l,"senderAdjustment");const u=[k4.ACTOR,k4.CONTROL,k4.ENTITY,k4.DATABASE];if(a.get(t.to)==n){const h=i.get(t.to),d=u.includes(h.type)?i0/2+3:h.width/2+3;o(h,d),h.starty=r-h.height/2,bt.bumpVerticalPos(h.height/2)}else if(s.get(t.from)==n){const h=i.get(t.from);if(Ye.mirrorActors){const d=u.includes(h.type)?i0/2:h.width/2;l(h,d)}h.stopy=r-h.height/2,bt.bumpVerticalPos(h.height/2)}else if(s.get(t.to)==n){const h=i.get(t.to);if(Ye.mirrorActors){const d=u.includes(h.type)?i0/2+3:h.width/2+3;o(h,d)}h.stopy=r-h.height/2,bt.bumpVerticalPos(h.height/2)}}x(O_e,"adjustCreatedDestroyedData");var kRt=x(async function(t,e,r,n){const{securityLevel:i,sequence:a,look:s,themeVariables:o}=Fe();Ye=a;let l;i==="sandbox"&&(l=ut("#i"+e));const u=ut(i==="sandbox"?l.nodes()[0].contentDocument.body:"body"),h=i==="sandbox"?l.nodes()[0].contentDocument:document;bt.init(),le.debug(n.db);const d=i==="sandbox"?u.select(`[id="${e}"]`):ut(`[id="${e}"]`),f=n.db.getActors(),p=n.db.getCreatedActors(),g=n.db.getDestroyedActors(),m=n.db.getBoxes();let y=n.db.getActorKeys();const v=n.db.getMessages(),T=n.db.getDiagramTitle(),b=n.db.hasAtLeastOneBox(),w=n.db.hasAtLeastOneBoxWithTitle(),C=await $_e(f,v,n);if(Ye.height=await P_e(f,C,m),Fn.insertComputerIcon(d,e),Fn.insertDatabaseIcon(d,e),Fn.insertClockIcon(d,e),b&&(bt.bumpVerticalPos(Ye.boxMargin),w&&bt.bumpVerticalPos(m[0].textMaxHeight)),Ye.hideUnusedParticipants===!0){const B=new Set;v.forEach(G=>{B.add(G.from),B.add(G.to)}),y=y.filter(G=>B.has(G))}const S=new Map(y.map((B,G)=>{var H;return[((H=f.get(B))==null?void 0:H.name)??B,G]}));CRt(d,f,p,y,0,v,!1);const k=await MRt(v,f,C,n);Fn.insertArrowHead(d,e),Fn.insertArrowCrossHead(d,e),Fn.insertArrowFilledHead(d,e),Fn.insertSequenceNumber(d,e),Fn.insertSolidTopArrowHead(d,e),Fn.insertSolidBottomArrowHead(d,e),Fn.insertStickTopArrowHead(d,e),Fn.insertStickBottomArrowHead(d,e),s==="neo"&&Fn.insertDropShadow(d,Ye);function E(B,G){const H=bt.endActivation(B);H.starty+18>G&&(H.starty=G-6,G+=12),Fn.drawActivation(d,H,G,Ye,P7(B.from).length,n,S),bt.insert(H.startx,G-10,H.stopx,G)}x(E,"activeEnd");let _=1,M=1;const L=[],P=[];let D=0;for(const B of v){let G,H,q;switch(B.type){case n.db.LINETYPE.NOTE:bt.resetVerticalPos(),H=B.noteModel,await TRt(d,H,B.id);break;case n.db.LINETYPE.ACTIVE_START:bt.newActivation(B,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION:bt.newActivation(B,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:bt.newActivation(B,d,f);break;case n.db.LINETYPE.ACTIVE_END:E(B,bt.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,Z=>bt.newLoop(Z));break;case n.db.LINETYPE.LOOP_END:G=bt.endLoop(),await Fn.drawLoop(d,G,"loop",Ye,B),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos()),bt.models.addLoop(G);break;case n.db.LINETYPE.RECT_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin,Z=>{let Y=Z.message;Y||(Y=(o==null?void 0:o.rectBkgColor)||(o==null?void 0:o.actorBkg)||"rgba(128, 128, 128, 0.5)"),bt.newLoop(void 0,Y)});break;case n.db.LINETYPE.RECT_END:G=bt.endLoop(),P.push(G),bt.models.addLoop(G),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos());break;case n.db.LINETYPE.OPT_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,Z=>bt.newLoop(Z));break;case n.db.LINETYPE.OPT_END:G=bt.endLoop(),await Fn.drawLoop(d,G,"opt",Ye,B),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos()),bt.models.addLoop(G);break;case n.db.LINETYPE.ALT_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,Z=>bt.newLoop(Z));break;case n.db.LINETYPE.ALT_ELSE:Ll(k,B,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,Z=>bt.addSectionToLoop(Z));break;case n.db.LINETYPE.ALT_END:G=bt.endLoop(),await Fn.drawLoop(d,G,"alt",Ye,B),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos()),bt.models.addLoop(G);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,Z=>bt.newLoop(Z)),bt.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:Ll(k,B,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,Z=>bt.addSectionToLoop(Z));break;case n.db.LINETYPE.PAR_END:G=bt.endLoop(),await Fn.drawLoop(d,G,"par",Ye,B),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos()),bt.models.addLoop(G);break;case n.db.LINETYPE.AUTONUMBER:_=B.message.start||_,M=B.message.step||M,B.message.visible?n.db.enableSequenceNumbers():n.db.disableSequenceNumbers();break;case n.db.LINETYPE.CRITICAL_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,Z=>bt.newLoop(Z));break;case n.db.LINETYPE.CRITICAL_OPTION:Ll(k,B,Ye.boxMargin+Ye.boxTextMargin,Ye.boxMargin,Z=>bt.addSectionToLoop(Z));break;case n.db.LINETYPE.CRITICAL_END:G=bt.endLoop(),await Fn.drawLoop(d,G,"critical",Ye,B),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos()),bt.models.addLoop(G);break;case n.db.LINETYPE.BREAK_START:Ll(k,B,Ye.boxMargin,Ye.boxMargin+Ye.boxTextMargin,Z=>bt.newLoop(Z));break;case n.db.LINETYPE.BREAK_END:G=bt.endLoop(),await Fn.drawLoop(d,G,"break",Ye,B),bt.bumpVerticalPos(G.stopy-bt.getVerticalPos()),bt.models.addLoop(G);break;default:try{q=B.msgModel,q.starty=bt.getVerticalPos(),q.sequenceIndex=_,q.sequenceVisible=n.db.showSequenceNumbers(),q.id=B.id,q.from=B.from,q.to=B.to;const Z=await I_e(d,q);O_e(B,q,Z,D,f,p,g),L.push({messageModel:q,lineStartY:Z,msg:B}),bt.models.addMessage(q)}catch(Z){le.error("error while drawing message",Z)}}[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.SOLID_TOP,n.db.LINETYPE.SOLID_BOTTOM,n.db.LINETYPE.STICK_TOP,n.db.LINETYPE.STICK_BOTTOM,n.db.LINETYPE.SOLID_TOP_DOTTED,n.db.LINETYPE.SOLID_BOTTOM_DOTTED,n.db.LINETYPE.STICK_TOP_DOTTED,n.db.LINETYPE.STICK_BOTTOM_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT,n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(B.type)&&(_=Math.round((_+M)*100)/100),D++}le.debug("createdActors",p),le.debug("destroyedActors",g),await FB(d,f,y,!1,e,n,S);for(const B of L)await wRt(d,B.messageModel,B.lineStartY,n,B.msg,e);Ye.mirrorActors&&await FB(d,f,y,!0,e,n,S),P.forEach(B=>Fn.drawBackgroundRect(d,B)),R_e(d,f,y,Ye);for(const B of bt.models.boxes){B.height=bt.getVerticalPos()-B.y,bt.insert(B.x,B.y,B.x+B.width,B.height);const G=Ye.boxMargin*2;B.startx=B.x-G,B.starty=B.y-G*.25,B.stopx=B.startx+B.width+2*G,B.stopy=B.starty+B.height+G*.75,B.stroke="rgb(0,0,0, 0.5)",Fn.drawBox(d,B,Ye)}b&&bt.bumpVerticalPos(Ye.boxMargin);const R=N_e(d,f,y,h),{bounds:I}=bt.getBounds();I.startx===void 0&&(I.startx=0),I.starty===void 0&&(I.starty=0),I.stopx===void 0&&(I.stopx=0),I.stopy===void 0&&(I.stopy=0);let $=I.stopy-I.starty;$<R.maxHeight&&($=R.maxHeight);let O=$+2*Ye.diagramMarginY;Ye.mirrorActors&&(O=O-Ye.boxMargin+Ye.bottomMarginAdj);let N=I.stopx-I.startx;N<R.maxWidth&&(N=R.maxWidth);const F=N+2*Ye.diagramMarginX;T&&d.append("text").text(T).attr("x",(I.stopx-I.startx)/2-2*Ye.diagramMarginX).attr("y",-25),Ai(d,O,F,Ye.useMaxWidth);const z=T?40:0,V=f.size&&s==="neo"?30:0;d.attr("viewBox",I.startx-Ye.diagramMarginX+" -"+(Ye.diagramMarginY+z)+" "+F+" "+(O+z+V)),le.debug("models:",bt.models)},"draw");async function $_e(t,e,r){const n={};for(const i of e)if(t.get(i.to)&&t.get(i.from)){const a=t.get(i.to);if(i.placement===r.db.PLACEMENT.LEFTOF&&!a.prevActor||i.placement===r.db.PLACEMENT.RIGHTOF&&!a.nextActor)continue;const s=i.placement!==void 0,o=!s,l=s?Pm(Ye):K0(Ye),u=i.wrap?yr.wrapLabel(i.message,Ye.width-2*Ye.wrapPadding,l):i.message,d=($i(u)?await Yk(i.message,Fe()):yr.calculateTextDimensions(u,l)).width+2*Ye.wrapPadding;o&&i.from===a.nextActor?n[i.to]=At.getMax(n[i.to]||0,d):o&&i.from===a.prevActor?n[i.from]=At.getMax(n[i.from]||0,d):o&&i.from===i.to?(n[i.from]=At.getMax(n[i.from]||0,d/2),n[i.to]=At.getMax(n[i.to]||0,d/2)):i.placement===r.db.PLACEMENT.RIGHTOF?n[i.from]=At.getMax(n[i.from]||0,d):i.placement===r.db.PLACEMENT.LEFTOF?n[a.prevActor]=At.getMax(n[a.prevActor]||0,d):i.placement===r.db.PLACEMENT.OVER&&(a.prevActor&&(n[a.prevActor]=At.getMax(n[a.prevActor]||0,d/2)),a.nextActor&&(n[i.from]=At.getMax(n[i.from]||0,d/2)))}return le.debug("maxMessageWidthPerActor:",n),n}x($_e,"getMaxMessageWidthPerActor");var SRt=x(function(t){let e=0;const r=BB(Ye);for(const n in t.links){const a=yr.calculateTextDimensions(n,r).width+2*Ye.wrapPadding+2*Ye.boxMargin;e<a&&(e=a)}return e},"getRequiredPopupWidth");async function P_e(t,e,r){let n=0;for(const a of t.keys()){const s=t.get(a);s.wrap&&(s.description=yr.wrapLabel(s.description,Ye.width-2*Ye.wrapPadding,BB(Ye)));const o=$i(s.description)?await Yk(s.description,Fe()):yr.calculateTextDimensions(s.description,BB(Ye));s.width=s.wrap?Ye.width:At.getMax(Ye.width,o.width+2*Ye.wrapPadding),s.height=s.wrap?At.getMax(o.height,Ye.height):Ye.height,n=At.getMax(n,s.height)}for(const a in e){const s=t.get(a);if(!s)continue;const o=t.get(s.nextActor);if(!o){const d=e[a]+Ye.actorMargin-s.width/2;s.margin=At.getMax(d,Ye.actorMargin);continue}const u=e[a]+Ye.actorMargin-s.width/2-o.width/2;s.margin=At.getMax(u,Ye.actorMargin)}let i=0;return r.forEach(a=>{const s=K0(Ye);let o=a.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=Ye.boxMargin*8;o+=l,o-=2*Ye.boxTextMargin,a.wrap&&(a.name=yr.wrapLabel(a.name,o-2*Ye.wrapPadding,s));const u=yr.calculateTextDimensions(a.name,s);i=At.getMax(u.height,i);const h=At.getMax(o,u.width+2*Ye.wrapPadding);if(a.margin=Ye.boxTextMargin,o<h){const d=(h-o)/2;a.margin+=d}}),r.forEach(a=>a.textMaxHeight=i),At.getMax(n,Ye.height)}x(P_e,"calculateActorMargins");var ERt=x(async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),a=n.x,s=i.x,o=t.wrap&&t.message;let l=$i(t.message)?await Yk(t.message,Fe()):yr.calculateTextDimensions(o?yr.wrapLabel(t.message,Ye.width,Pm(Ye)):t.message,Pm(Ye));const u={width:o?Ye.width:At.getMax(Ye.width,l.width+2*Ye.noteMargin),height:0,startx:n.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(u.width=o?At.getMax(Ye.width,l.width):At.getMax(n.width/2+i.width/2,l.width+2*Ye.noteMargin),u.startx=a+(n.width+Ye.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=o?At.getMax(Ye.width,l.width+2*Ye.noteMargin):At.getMax(n.width/2+i.width/2,l.width+2*Ye.noteMargin),u.startx=a-u.width+(n.width-Ye.actorMargin)/2):t.to===t.from?(l=yr.calculateTextDimensions(o?yr.wrapLabel(t.message,At.getMax(Ye.width,n.width),Pm(Ye)):t.message,Pm(Ye)),u.width=o?At.getMax(Ye.width,n.width):At.getMax(n.width,Ye.width,l.width+2*Ye.noteMargin),u.startx=a+(n.width-u.width)/2):(u.width=Math.abs(a+n.width/2-(s+i.width/2))+Ye.actorMargin,u.startx=a<s?a+n.width/2-Ye.actorMargin/2:s+i.width/2-Ye.actorMargin/2),o&&(u.message=yr.wrapLabel(t.message,u.width-2*Ye.wrapPadding,Pm(Ye))),le.debug(`NM:[${u.startx},${u.stopx},${u.starty},${u.stopy}:${u.width},${u.height}=${t.message}]`),u},"buildNoteModel"),ARt=4,zN=x(function(t,e){const{CENTRAL_CONNECTION:r,CENTRAL_CONNECTION_REVERSE:n,CENTRAL_CONNECTION_DUAL:i}=e.db.LINETYPE;return[r,n,i].includes(t.centralConnection)},"hasCentralConnection"),_Rt=x(function(t,e,r){const{CENTRAL_CONNECTION_REVERSE:n,CENTRAL_CONNECTION_DUAL:i,BIDIRECTIONAL_SOLID:a,BIDIRECTIONAL_DOTTED:s}=e.db.LINETYPE;let o=0;return(t.centralConnection===n||t.centralConnection===i)&&(o+=ARt),(t.centralConnection===n||t.centralConnection===i)&&(t.type===a||t.type===s)&&(o+=r?0:-6),o},"calculateCentralConnectionOffset"),B_e=x(function(t,e){const{SOLID_ARROW_TOP_REVERSE:r,SOLID_ARROW_TOP_REVERSE_DOTTED:n,SOLID_ARROW_BOTTOM_REVERSE:i,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:a,STICK_ARROW_TOP_REVERSE:s,STICK_ARROW_TOP_REVERSE_DOTTED:o,STICK_ARROW_BOTTOM_REVERSE:l,STICK_ARROW_BOTTOM_REVERSE_DOTTED:u}=e.db.LINETYPE;return[r,n,i,a,s,o,l,u].includes(t.type)},"isReverseArrowType"),RRt=x(function(t,e){const{BIDIRECTIONAL_SOLID:r,BIDIRECTIONAL_DOTTED:n}=e.db.LINETYPE;return[r,n].includes(t.type)},"isBidirectionalArrowType"),LRt=x(function(t,e,r){const{look:n}=Fe();if(![r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.SOLID_TOP,r.db.LINETYPE.SOLID_BOTTOM,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.SOLID_TOP_DOTTED,r.db.LINETYPE.SOLID_BOTTOM_DOTTED,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type))return{};const[i,a]=yie(t.from,e),[s,o]=yie(t.to,e),l=i<=s;let u=l?a:i,h=l?s:o;n==="neo"&&(t.type!==r.db.LINETYPE.SOLID_OPEN&&(h+=l?-3:3),(t.type===r.db.LINETYPE.BIDIRECTIONAL_SOLID||t.type===r.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(u+=l?3:-3)),u+=_Rt(t,r,l);const d=Math.abs(s-o)>2,f=x(y=>l?-y:y,"adjustValue");t.from===t.to?h=u:(t.activate&&!d&&(h+=f(Ye.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(h+=f(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(u-=f(3)));const p=[i,a,s,o],g=Math.abs(u-h);t.wrap&&t.message&&(t.message=yr.wrapLabel(t.message,At.getMax(g+2*Ye.wrapPadding,Ye.width),K0(Ye)));const m=yr.calculateTextDimensions(t.message,K0(Ye));return{width:At.getMax(t.wrap?0:m.width+2*Ye.wrapPadding,g+2*Ye.wrapPadding,Ye.width),height:0,startx:u,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,p),toBounds:Math.max.apply(null,p)}},"buildMessageModel"),MRt=x(async function(t,e,r,n){const i={},a=[];let s,o,l;for(const u of t){switch(u.type){case n.db.LINETYPE.LOOP_START:case n.db.LINETYPE.ALT_START:case n.db.LINETYPE.OPT_START:case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:case n.db.LINETYPE.CRITICAL_START:case n.db.LINETYPE.BREAK_START:a.push({id:u.id,msg:u.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case n.db.LINETYPE.ALT_ELSE:case n.db.LINETYPE.PAR_AND:case n.db.LINETYPE.CRITICAL_OPTION:u.message&&(s=a.pop(),i[s.id]=s,i[u.id]=s,a.push(s));break;case n.db.LINETYPE.LOOP_END:case n.db.LINETYPE.ALT_END:case n.db.LINETYPE.OPT_END:case n.db.LINETYPE.PAR_END:case n.db.LINETYPE.CRITICAL_END:case n.db.LINETYPE.BREAK_END:s=a.pop(),i[s.id]=s;break;case n.db.LINETYPE.ACTIVE_START:{const d=e.get(u.from?u.from:u.to.actor),f=P7(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*Ye.activationWidth/2,g={startx:p,stopx:p+Ye.activationWidth,actor:u.from,enabled:!0};bt.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=bt.activations.map(f=>f.actor).lastIndexOf(u.from);bt.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(o=await ERt(u,e,n),u.noteModel=o,a.forEach(d=>{s=d,s.from=At.getMin(s.from,o.startx),s.to=At.getMax(s.to,o.startx+o.width),s.width=At.getMax(s.width,Math.abs(s.from-s.to))-Ye.labelBoxWidth})):(l=LRt(u,e,n),u.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach(d=>{if(s=d,l.startx===l.stopx){const f=e.get(u.from),p=e.get(u.to);s.from=At.getMin(f.x-l.width/2,f.x-f.width/2,s.from),s.to=At.getMax(p.x+l.width/2,p.x+f.width/2,s.to),s.width=At.getMax(s.width,Math.abs(s.to-s.from))-Ye.labelBoxWidth}else s.from=At.getMin(l.startx,s.from),s.to=At.getMax(l.stopx,s.to),s.width=At.getMax(s.width,l.width)-Ye.labelBoxWidth}))}return bt.activations=[],le.debug("Loop type widths:",i),i},"calculateLoopBounds"),IRt={bounds:bt,drawActors:FB,drawActorsPopup:N_e,setConf:D_e,draw:kRt},NRt={parser:z6t,get db(){return new H6t},renderer:IRt,styles:U6t,init:x(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,jD({sequence:{wrap:t.wrap}}))},"init")};const DRt=Object.freeze(Object.defineProperty({__proto__:null,diagram:NRt},Symbol.toStringTag,{value:"Module"}));var zB=(function(){var t=x(function(de,Te,ae,he){for(ae=ae||{},he=de.length;he--;ae[de[he]]=Te);return ae},"o"),e=[1,18],r=[1,19],n=[1,20],i=[1,41],a=[1,26],s=[1,42],o=[1,24],l=[1,25],u=[1,32],h=[1,33],d=[1,34],f=[1,45],p=[1,35],g=[1,36],m=[1,37],y=[1,38],v=[1,27],T=[1,28],b=[1,29],w=[1,30],C=[1,31],S=[1,44],k=[1,46],E=[1,43],_=[1,47],M=[1,9],L=[1,8,9],P=[1,58],D=[1,59],R=[1,60],I=[1,61],$=[1,62],O=[1,63],N=[1,64],F=[1,8,9,41],z=[1,77],V=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],B=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],G=[13,60,86,100,102,103],H=[13,60,73,74,86,100,102,103],q=[13,60,68,69,70,71,72,86,100,102,103],Z=[1,103],Y=[1,121],ie=[1,117],K=[1,113],Q=[1,119],te=[1,114],J=[1,115],ge=[1,116],ee=[1,118],Re=[1,120],Ie=[22,50,60,61,82,86,87,88,89,90],Be=[1,128],ce=[12,39],oe=[1,8,9,39,41,44,46],be=[1,8,9,22],fe=[1,153],Pe=[1,8,9,61],ve=[1,8,9,22,50,60,61,82,86,87,88,89,90],Ce={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:x(function(Te,ae,he,W,ne,j,ue){var X=j.length-1;switch(ne){case 8:this.$=j[X-1];break;case 9:case 10:case 13:case 15:this.$=j[X];break;case 11:case 14:this.$=j[X-2]+"."+j[X];break;case 12:case 16:this.$=j[X-1]+j[X];break;case 17:case 18:this.$=j[X-1]+"~"+j[X]+"~";break;case 19:W.addRelation(j[X]);break;case 20:j[X-1].title=W.cleanupLabel(j[X]),W.addRelation(j[X-1]);break;case 31:this.$=j[X].trim(),W.setAccTitle(this.$);break;case 32:case 33:this.$=j[X].trim(),W.setAccDescription(this.$);break;case 34:W.addClassesToNamespace(j[X-3],j[X-1][0],j[X-1][1]),W.popNamespace();break;case 35:W.addClassesToNamespace(j[X-4],j[X-1][0],j[X-1][1]),W.popNamespace();break;case 36:this.$=W.addNamespace(j[X]);break;case 37:this.$=W.addNamespace(j[X-1],j[X]);break;case 38:this.$=[[j[X]],[]];break;case 39:this.$=[[j[X-1]],[]];break;case 40:j[X][0].unshift(j[X-2]),this.$=j[X];break;case 41:this.$=[[],[j[X]]];break;case 42:this.$=[[],[j[X-1]]];break;case 43:j[X][1].unshift(j[X-2]),this.$=j[X];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=j[X];break;case 48:W.setCssClass(j[X-2],j[X]);break;case 49:W.addMembers(j[X-3],j[X-1]);break;case 51:W.setCssClass(j[X-5],j[X-3]),W.addMembers(j[X-5],j[X-1]);break;case 52:W.addAnnotation(j[X-3],j[X-1]);break;case 53:W.addAnnotation(j[X-6],j[X-4]),W.addMembers(j[X-6],j[X-1]);break;case 54:W.addAnnotation(j[X-5],j[X-3]);break;case 55:this.$=j[X],W.addClass(j[X]);break;case 56:this.$=j[X-1],W.addClass(j[X-1]),W.setClassLabel(j[X-1],j[X]);break;case 60:W.addAnnotation(j[X],j[X-2]);break;case 61:case 74:this.$=[j[X]];break;case 62:j[X].push(j[X-1]),this.$=j[X];break;case 63:break;case 64:W.addMember(j[X-1],W.cleanupLabel(j[X]));break;case 65:break;case 66:break;case 67:this.$={id1:j[X-2],id2:j[X],relation:j[X-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:j[X-3],id2:j[X],relation:j[X-1],relationTitle1:j[X-2],relationTitle2:"none"};break;case 69:this.$={id1:j[X-3],id2:j[X],relation:j[X-2],relationTitle1:"none",relationTitle2:j[X-1]};break;case 70:this.$={id1:j[X-4],id2:j[X],relation:j[X-2],relationTitle1:j[X-3],relationTitle2:j[X-1]};break;case 71:this.$=W.addNote(j[X],j[X-1]);break;case 72:this.$=W.addNote(j[X]);break;case 73:this.$=j[X-2],W.defineClass(j[X-1],j[X]);break;case 75:this.$=j[X-2].concat([j[X]]);break;case 76:W.setDirection("TB");break;case 77:W.setDirection("BT");break;case 78:W.setDirection("RL");break;case 79:W.setDirection("LR");break;case 80:this.$={type1:j[X-2],type2:j[X],lineType:j[X-1]};break;case 81:this.$={type1:"none",type2:j[X],lineType:j[X-1]};break;case 82:this.$={type1:j[X-1],type2:"none",lineType:j[X]};break;case 83:this.$={type1:"none",type2:"none",lineType:j[X]};break;case 84:this.$=W.relationType.AGGREGATION;break;case 85:this.$=W.relationType.EXTENSION;break;case 86:this.$=W.relationType.COMPOSITION;break;case 87:this.$=W.relationType.DEPENDENCY;break;case 88:this.$=W.relationType.LOLLIPOP;break;case 89:this.$=W.lineType.LINE;break;case 90:this.$=W.lineType.DOTTED_LINE;break;case 91:case 97:this.$=j[X-2],W.setClickEvent(j[X-1],j[X]);break;case 92:case 98:this.$=j[X-3],W.setClickEvent(j[X-2],j[X-1]),W.setTooltip(j[X-2],j[X]);break;case 93:this.$=j[X-2],W.setLink(j[X-1],j[X]);break;case 94:this.$=j[X-3],W.setLink(j[X-2],j[X-1],j[X]);break;case 95:this.$=j[X-3],W.setLink(j[X-2],j[X-1]),W.setTooltip(j[X-2],j[X]);break;case 96:this.$=j[X-4],W.setLink(j[X-3],j[X-2],j[X]),W.setTooltip(j[X-3],j[X-1]);break;case 99:this.$=j[X-3],W.setClickEvent(j[X-2],j[X-1],j[X]);break;case 100:this.$=j[X-4],W.setClickEvent(j[X-3],j[X-2],j[X-1]),W.setTooltip(j[X-3],j[X]);break;case 101:this.$=j[X-3],W.setLink(j[X-2],j[X]);break;case 102:this.$=j[X-4],W.setLink(j[X-3],j[X-1],j[X]);break;case 103:this.$=j[X-4],W.setLink(j[X-3],j[X-1]),W.setTooltip(j[X-3],j[X]);break;case 104:this.$=j[X-5],W.setLink(j[X-4],j[X-2],j[X]),W.setTooltip(j[X-4],j[X-1]);break;case 105:this.$=j[X-2],W.setCssStyle(j[X-1],j[X]);break;case 106:W.setCssClass(j[X-1],j[X]);break;case 107:this.$=[j[X]];break;case 108:j[X-2].push(j[X]),this.$=j[X-2];break;case 110:this.$=j[X-1]+j[X];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:b,82:w,83:C,86:S,100:k,102:E,103:_},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(M,[2,5],{8:[1,48]}),{8:[1,49]},t(L,[2,19],{22:[1,50]}),t(L,[2,21]),t(L,[2,22]),t(L,[2,23]),t(L,[2,24]),t(L,[2,25]),t(L,[2,26]),t(L,[2,27]),t(L,[2,28]),t(L,[2,29]),t(L,[2,30]),{34:[1,51]},{36:[1,52]},t(L,[2,33]),t(L,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:P,69:D,70:R,71:I,72:$,73:O,74:N}),{39:[1,65]},t(F,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(L,[2,65]),t(L,[2,66]),{16:69,60:f,86:S,100:k,102:E},{16:39,17:40,19:70,60:f,86:S,100:k,102:E,103:_},{16:39,17:40,19:71,60:f,86:S,100:k,102:E,103:_},{16:39,17:40,19:72,60:f,86:S,100:k,102:E,103:_},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:S,100:k,102:E,103:_},{13:z,55:76},{58:78,60:[1,79]},t(L,[2,76]),t(L,[2,77]),t(L,[2,78]),t(L,[2,79]),t(V,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:f,86:S,100:k,102:E,103:_}),t(V,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:S,100:k,102:E,103:_},{16:39,17:40,19:87,60:f,86:S,100:k,102:E,103:_},t(B,[2,133]),t(B,[2,134]),t(B,[2,135]),t(B,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(M,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:e,35:r,37:n,42:i,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:b,82:w,83:C,86:S,100:k,102:E,103:_}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:e,35:r,37:n,38:22,42:i,43:23,46:a,48:s,51:o,52:l,54:u,56:h,57:d,60:f,62:p,63:g,64:m,65:y,75:v,76:T,78:b,82:w,83:C,86:S,100:k,102:E,103:_},t(L,[2,20]),t(L,[2,31]),t(L,[2,32]),{13:[1,91],16:39,17:40,19:90,60:f,86:S,100:k,102:E,103:_},{53:92,66:56,67:57,68:P,69:D,70:R,71:I,72:$,73:O,74:N},t(L,[2,64]),{67:93,73:O,74:N},t(G,[2,83],{66:94,68:P,69:D,70:R,71:I,72:$}),t(H,[2,84]),t(H,[2,85]),t(H,[2,86]),t(H,[2,87]),t(H,[2,88]),t(q,[2,89]),t(q,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:i,43:23,48:s,54:u,56:h},{16:100,60:f,86:S,100:k,102:E},{41:[1,102],45:101,51:Z},{16:104,60:f,86:S,100:k,102:E},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:Y,50:ie,59:110,60:K,82:Q,84:111,85:112,86:te,87:J,88:ge,89:ee,90:Re},{60:[1,122]},{13:z,55:123},t(F,[2,72]),t(F,[2,138]),{22:Y,50:ie,59:124,60:K,61:[1,125],82:Q,84:111,85:112,86:te,87:J,88:ge,89:ee,90:Re},t(Ie,[2,74]),{16:39,17:40,19:126,60:f,86:S,100:k,102:E,103:_},t(V,[2,16]),t(V,[2,17]),t(V,[2,18]),{11:127,12:Be,39:[2,36]},t(ce,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:S,100:k,102:E,103:_}),t(ce,[2,10]),t(oe,[2,55],{11:131,12:Be}),t(M,[2,7]),{9:[1,132]},t(be,[2,67]),{16:39,17:40,19:133,60:f,86:S,100:k,102:E,103:_},{13:[1,135],16:39,17:40,19:134,60:f,86:S,100:k,102:E,103:_},t(G,[2,82],{66:136,68:P,69:D,70:R,71:I,72:$}),t(G,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:i,43:23,48:s,54:u,56:h},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(F,[2,48],{39:[1,142]}),{41:[1,143]},t(F,[2,50]),{41:[2,61],45:144,51:Z},{47:[1,145]},{16:39,17:40,19:146,60:f,86:S,100:k,102:E,103:_},t(L,[2,91],{13:[1,147]}),t(L,[2,93],{13:[1,149],77:[1,148]}),t(L,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(L,[2,105],{61:fe}),t(Pe,[2,107],{85:154,22:Y,50:ie,60:K,82:Q,86:te,87:J,88:ge,89:ee,90:Re}),t(ve,[2,109]),t(ve,[2,111]),t(ve,[2,112]),t(ve,[2,113]),t(ve,[2,114]),t(ve,[2,115]),t(ve,[2,116]),t(ve,[2,117]),t(ve,[2,118]),t(ve,[2,119]),t(L,[2,106]),t(F,[2,71]),t(L,[2,73],{61:fe}),{60:[1,155]},t(V,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:f,86:S,100:k,102:E,103:_},t(ce,[2,12]),t(oe,[2,56]),{1:[2,4]},t(be,[2,69]),t(be,[2,68]),{16:39,17:40,19:158,60:f,86:S,100:k,102:E,103:_},t(G,[2,80]),t(F,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:i,43:23,48:s,54:u,56:h},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:i,43:23,48:s,54:u,56:h},{45:163,51:Z},t(F,[2,49]),{41:[2,62]},t(F,[2,52],{39:[1,164]}),t(L,[2,60]),t(L,[2,92]),t(L,[2,94]),t(L,[2,95],{77:[1,165]}),t(L,[2,98]),t(L,[2,99],{13:[1,166]}),t(L,[2,101],{13:[1,168],77:[1,167]}),{22:Y,50:ie,60:K,82:Q,84:169,85:112,86:te,87:J,88:ge,89:ee,90:Re},t(ve,[2,110]),t(Ie,[2,75]),{14:[1,170]},t(ce,[2,11]),t(be,[2,70]),t(F,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:Z},t(L,[2,96]),t(L,[2,100]),t(L,[2,102]),t(L,[2,103],{77:[1,174]}),t(Pe,[2,108],{85:154,22:Y,50:ie,60:K,82:Q,86:te,87:J,88:ge,89:ee,90:Re}),t(oe,[2,8]),t(F,[2,51]),{41:[1,175]},t(F,[2,54]),t(L,[2,104]),t(F,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:x(function(Te,ae){if(ae.recoverable)this.trace(Te);else{var he=new Error(Te);throw he.hash=ae,he}},"parseError"),parse:x(function(Te){var ae=this,he=[0],W=[],ne=[null],j=[],ue=this.table,X="",Oe=0,xe=0,Ge=2,_e=1,$e=j.slice.call(arguments,1),Me=Object.create(this.lexer),He={yy:{}};for(var De in this.yy)Object.prototype.hasOwnProperty.call(this.yy,De)&&(He.yy[De]=this.yy[De]);Me.setInput(Te,He.yy),He.yy.lexer=Me,He.yy.parser=this,typeof Me.yylloc>"u"&&(Me.yylloc={});var Ke=Me.yylloc;j.push(Ke);var Ae=Me.options&&Me.options.ranges;typeof He.yy.parseError=="function"?this.parseError=He.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function at(mt){he.length=he.length-2*mt,ne.length=ne.length-mt,j.length=j.length-mt}x(at,"popStack");function Ee(){var mt;return mt=W.pop()||Me.lex()||_e,typeof mt!="number"&&(mt instanceof Array&&(W=mt,mt=W.pop()),mt=ae.symbols_[mt]||mt),mt}x(Ee,"lex");for(var pt,ht,rt,Et,vt={},ot,pe,Ct,lt;;){if(ht=he[he.length-1],this.defaultActions[ht]?rt=this.defaultActions[ht]:((pt===null||typeof pt>"u")&&(pt=Ee()),rt=ue[ht]&&ue[ht][pt]),typeof rt>"u"||!rt.length||!rt[0]){var st="";lt=[];for(ot in ue[ht])this.terminals_[ot]&&ot>Ge&&lt.push("'"+this.terminals_[ot]+"'");Me.showPosition?st="Parse error on line "+(Oe+1)+`:
`+Me.showPosition()+`
Expecting `+lt.join(", ")+", got '"+(this.terminals_[pt]||pt)+"'":st="Parse error on line "+(Oe+1)+": Unexpected "+(pt==_e?"end of input":"'"+(this.terminals_[pt]||pt)+"'"),this.parseError(st,{text:Me.match,token:this.terminals_[pt]||pt,line:Me.yylineno,loc:Ke,expected:lt})}if(rt[0]instanceof Array&&rt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ht+", token: "+pt);switch(rt[0]){case 1:he.push(pt),ne.push(Me.yytext),j.push(Me.yylloc),he.push(rt[1]),pt=null,xe=Me.yyleng,X=Me.yytext,Oe=Me.yylineno,Ke=Me.yylloc;break;case 2:if(pe=this.productions_[rt[1]][1],vt.$=ne[ne.length-pe],vt._$={first_line:j[j.length-(pe||1)].first_line,last_line:j[j.length-1].last_line,first_column:j[j.length-(pe||1)].first_column,last_column:j[j.length-1].last_column},Ae&&(vt._$.range=[j[j.length-(pe||1)].range[0],j[j.length-1].range[1]]),Et=this.performAction.apply(vt,[X,xe,Oe,He.yy,rt[1],ne,j].concat($e)),typeof Et<"u")return Et;pe&&(he=he.slice(0,-1*pe*2),ne=ne.slice(0,-1*pe),j=j.slice(0,-1*pe)),he.push(this.productions_[rt[1]][0]),ne.push(vt.$),j.push(vt._$),Ct=ue[he[he.length-2]][he[he.length-1]],he.push(Ct);break;case 3:return!0}}return!0},"parse")},Ve=(function(){var de={EOF:1,parseError:x(function(ae,he){if(this.yy.parser)this.yy.parser.parseError(ae,he);else throw new Error(ae)},"parseError"),setInput:x(function(Te,ae){return this.yy=ae||this.yy||{},this._input=Te,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var Te=this._input[0];this.yytext+=Te,this.yyleng++,this.offset++,this.match+=Te,this.matched+=Te;var ae=Te.match(/(?:\r\n?|\n).*/g);return ae?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Te},"input"),unput:x(function(Te){var ae=Te.length,he=Te.split(/(?:\r\n?|\n)/g);this._input=Te+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ae),this.offset-=ae;var W=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),he.length-1&&(this.yylineno-=he.length-1);var ne=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:he?(he.length===W.length?this.yylloc.first_column:0)+W[W.length-he.length].length-he[0].length:this.yylloc.first_column-ae},this.options.ranges&&(this.yylloc.range=[ne[0],ne[0]+this.yyleng-ae]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(Te){this.unput(this.match.slice(Te))},"less"),pastInput:x(function(){var Te=this.matched.substr(0,this.matched.length-this.match.length);return(Te.length>20?"...":"")+Te.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var Te=this.match;return Te.length<20&&(Te+=this._input.substr(0,20-Te.length)),(Te.substr(0,20)+(Te.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var Te=this.pastInput(),ae=new Array(Te.length+1).join("-");return Te+this.upcomingInput()+`
`+ae+"^"},"showPosition"),test_match:x(function(Te,ae){var he,W,ne;if(this.options.backtrack_lexer&&(ne={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(ne.yylloc.range=this.yylloc.range.slice(0))),W=Te[0].match(/(?:\r\n?|\n).*/g),W&&(this.yylineno+=W.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:W?W[W.length-1].length-W[W.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Te[0].length},this.yytext+=Te[0],this.match+=Te[0],this.matches=Te,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Te[0].length),this.matched+=Te[0],he=this.performAction.call(this,this.yy,this,ae,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),he)return he;if(this._backtrack){for(var j in ne)this[j]=ne[j];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Te,ae,he,W;this._more||(this.yytext="",this.match="");for(var ne=this._currentRules(),j=0;j<ne.length;j++)if(he=this._input.match(this.rules[ne[j]]),he&&(!ae||he[0].length>ae[0].length)){if(ae=he,W=j,this.options.backtrack_lexer){if(Te=this.test_match(he,ne[j]),Te!==!1)return Te;if(this._backtrack){ae=!1;continue}else return!1}else if(!this.options.flex)break}return ae?(Te=this.test_match(ae,ne[W]),Te!==!1?Te:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var ae=this.next();return ae||this.lex()},"lex"),begin:x(function(ae){this.conditionStack.push(ae)},"begin"),popState:x(function(){var ae=this.conditionStack.length-1;return ae>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(ae){return ae=this.conditionStack.length-1-Math.abs(ae||0),ae>=0?this.conditionStack[ae]:"INITIAL"},"topState"),pushState:x(function(ae){this.begin(ae)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(ae,he,W,ne){switch(W){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}};return de})();Ce.lexer=Ve;function se(){this.yy={}}return x(se,"Parser"),se.prototype=Ce,Ce.Parser=se,new se})();zB.parser=zB;var F_e=zB,vie=["#","+","~","-",""],nb,bie=(nb=class{constructor(e,r){this.memberType=r,this.visibility="",this.classifier="",this.text="";const n=Wr(e,Fe());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+fd(this.id);this.memberType==="method"&&(e+=`(${fd(this.parameters.trim())})`,this.returnType&&(e+=" : "+fd(this.returnType))),e=e.trim();const r=this.parseClassifier();return{displayText:e,cssStyle:r}}parseMember(e){let r="";if(this.memberType==="method"){const a=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(a){const s=a[1]?a[1].trim():"";if(vie.includes(s)&&(this.visibility=s),this.id=a[2],this.parameters=a[3]?a[3].trim():"",r=a[4]?a[4].trim():"",this.returnType=a[5]?a[5].trim():"",r===""){const o=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(o)&&(r=o,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const i=e.length,a=e.substring(0,1),s=e.substring(i-1);vie.includes(a)&&(this.visibility=a),/[$*]/.exec(s)&&(r=s),this.id=e.substring(this.visibility===""?0:1,r===""?i:i-1)}this.classifier=r,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const n=`${this.visibility?"\\"+this.visibility:""}${fd(this.id)}${this.memberType==="method"?`(${fd(this.parameters)})${this.returnType?" : "+fd(this.returnType):""}`:""}`;this.text=n.replaceAll("<","&lt;").replaceAll(">","&gt;"),this.text.startsWith("\\&lt;")&&(this.text=this.text.replace("\\&lt;","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},x(nb,"ClassMember"),nb),S4="classId-",xie=0,np=x(t=>At.sanitizeText(t,Fe()),"sanitizeText"),jd,z_e=(jd=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=x(e=>{const r=fW();ut(e).select("svg").selectAll("g").filter(function(){return ut(this).attr("title")!==null}).on("mouseover",a=>{const s=ut(a.currentTarget),o=s.attr("title");if(!o)return;const l=a.currentTarget.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.html(ph.sanitize(o)).style("left",`${window.scrollX+l.left+l.width/2}px`).style("top",`${window.scrollY+l.bottom+4}px`),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),ut(a.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=Hn,this.getAccTitle=ni,this.setAccDescription=ii,this.getAccDescription=ai,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.getConfig=x(()=>Fe().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}splitClassNameAndType(e){const r=At.sanitizeText(e,Fe());let n="",i=r;if(r.indexOf("~")>0){const a=r.split("~");i=np(a[0]),n=np(a[1])}return{className:i,type:n}}setClassLabel(e,r){const n=At.sanitizeText(e,Fe());r&&(r=np(r));const{className:i}=this.splitClassNameAndType(n);this.classes.get(i).label=r,this.classes.get(i).text=`${r}${this.classes.get(i).type?`<${this.classes.get(i).type}>`:""}`}addClass(e){const r=At.sanitizeText(e,Fe()),{className:n,type:i}=this.splitClassNameAndType(r);if(this.classes.has(n))return;const a=At.sanitizeText(n,Fe());this.classes.set(a,{id:a,type:i,label:a,text:`${a}${i?`&lt;${i}&gt;`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:S4+a+"-"+xie}),xie++}addInterface(e,r){const n={id:`interface${this.interfaces.length}`,label:e,classId:r};this.interfaces.push(n)}setDiagramId(e){this.diagramId=e}lookUpDomId(e){const r=At.sanitizeText(e,Fe());if(this.classes.has(r)){const n=this.classes.get(r).domId;return this.diagramId?`${this.diagramId}-${n}`:n}throw new Error("Class not found: "+r)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",On()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(e){const r=typeof e=="number"?`note${e}`:e;return this.notes.get(r)}getNotes(){return this.notes}addRelation(e){le.debug("Adding relation: "+JSON.stringify(e));const r=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1===this.relationType.LOLLIPOP&&!r.includes(e.relation.type2)?(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1=`interface${this.interfaces.length-1}`):e.relation.type2===this.relationType.LOLLIPOP&&!r.includes(e.relation.type1)?(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2=`interface${this.interfaces.length-1}`):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=At.sanitizeText(e.relationTitle1.trim(),Fe()),e.relationTitle2=At.sanitizeText(e.relationTitle2.trim(),Fe()),this.relations.push(e)}addAnnotation(e,r){const n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(r)}addMember(e,r){this.addClass(e);const n=this.splitClassNameAndType(e).className,i=this.classes.get(n);if(typeof r=="string"){const a=r.trim();a.startsWith("<<")&&a.endsWith(">>")?i.annotations.push(np(a.substring(2,a.length-2))):a.indexOf(")")>0?i.methods.push(new bie(a,"method")):a&&i.members.push(new bie(a,"attribute"))}}addMembers(e,r){Array.isArray(r)&&(r.reverse(),r.forEach(n=>this.addMember(e,n)))}addNote(e,r){const n=this.notes.size,i={id:`note${n}`,class:r,text:e,index:n};return this.notes.set(i.id,i),i.id}cleanupLabel(e){return e.startsWith(":")&&(e=e.substring(1)),np(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=S4+i),i=this.splitClassNameAndType(i).className;const a=this.classes.get(i);a&&(a.cssClasses+=" "+r)})}defineClass(e,r){for(const n of e){let i=this.styleClasses.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,i)),r&&r.forEach(a=>{if(/color/.exec(a)){const s=a.replace("fill","bgFill");i.textStyles.push(s)}i.styles.push(a)}),this.classes.forEach(a=>{a.cssClasses.includes(n)&&a.styles.push(...r.flatMap(s=>s.split(",")))})}}setTooltip(e,r){e.split(",").forEach(n=>{if(r!==void 0){const i=this.splitClassNameAndType(n).className,a=this.classes.get(i);a&&(a.tooltip=np(r))}})}getTooltip(e,r){return r&&this.namespaces.has(r)?this.namespaces.get(r).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,r,n){const i=Fe();e.split(",").forEach(a=>{let s=a;/\d/.exec(a[0])&&(s=S4+s),s=this.splitClassNameAndType(s).className;const o=this.classes.get(s);o&&(o.link=yr.formatUrl(r,i),i.securityLevel==="sandbox"?o.linkTarget="_top":typeof n=="string"?o.linkTarget=np(n):o.linkTarget="_blank")}),this.setCssClass(e,"clickable")}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFunc(i,r,n);const a=this.splitClassNameAndType(i).className,s=this.classes.get(a);s&&(s.haveCallback=!0)}),this.setCssClass(e,"clickable")}setClickFunc(e,r,n){const i=At.sanitizeText(e,Fe());if(Fe().securityLevel!=="loose"||r===void 0)return;const s=this.splitClassNameAndType(i).className;if(this.classes.has(s)){let o=[];if(typeof n=="string"){o=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l<o.length;l++){let u=o[l].trim();u.startsWith('"')&&u.endsWith('"')&&(u=u.substr(1,u.length-2)),o[l]=u}}o.length===0&&o.push(s),this.functions.push(()=>{const l=this.lookUpDomId(s),u=document.querySelector(`[id="${l}"]`);u!==null&&u.addEventListener("click",()=>{yr.runFunc(r,...o)},!1)})}}bindFunctions(e){this.functions.forEach(r=>{r(e)})}escapeHtml(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}getDirection(){return this.direction}setDirection(e){this.direction=e}static resolveQualifiedId(e,r){const n=r.at(-1);return n?`${n}.${e}`:e}static getAncestorIds(e){const r=e.split("."),n=new Array(r.length);n[0]=r[0];for(let i=1;i<r.length;i++)n[i]=`${n[i-1]}.${r[i]}`;return n}createNamespaceNode(e,r,n,i=!1){return{id:e,label:r,classes:new Map,notes:new Map,children:new Map,domId:S4+e+"-"+this.namespaceCounter++,parent:n,explicit:i}}linkParentChild(e,r){const n=this.namespaces.get(e),i=this.namespaces.get(r);!n||!i||(n.children.has(r)||n.children.set(r,i),i.parent??(i.parent=e))}addNamespace(e,r){const n=jd.resolveQualifiedId(e,this.namespaceStack);if(this.namespaceStack.push(n),this.namespaces.has(n)){const s=this.namespaces.get(n);return s.explicit=!0,r&&(s.label=r),n}const i=n.split("."),a=jd.getAncestorIds(n);for(let s=0;s<a.length;s++){const o=a[s],l=s>0?a[s-1]:void 0,u=s===a.length-1,h=u&&r?r:i[s];this.namespaces.has(o)?u&&(this.namespaces.get(o).explicit=!0):this.namespaces.set(o,this.createNamespaceNode(o,h,l,u)),l&&this.linkParentChild(l,o)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,r,n){if(this.namespaces.has(e)){for(const i of r){const{className:a}=this.splitClassNameAndType(i),s=this.getClass(a);s.parent=e,this.namespaces.get(e).classes.set(a,s)}for(const i of n){const a=this.getNote(i);a.parent=e,this.namespaces.get(e).notes.set(i,a)}}}setCssStyle(e,r){const n=this.classes.get(e);if(!(!r||!n))for(const i of r)i.includes(",")?n.styles.push(...i.split(",")):n.styles.push(i)}getArrowMarker(e){let r;switch(e){case 0:r="aggregation";break;case 1:r="extension";break;case 2:r="composition";break;case 3:r="dependency";break;case 4:r="lollipop";break;default:r="none"}return r}resolveExplicitAncestor(e){let r=e;for(;r;){const n=this.namespaces.get(r);if(!n)return;if(n.explicit)return r;r=n.parent}}getData(){var s,o;const e=[],r=[],n=Fe(),i=((s=n.class)==null?void 0:s.hierarchicalNamespaces)??!0;for(const l of this.namespaces.values()){if(!i&&!l.explicit)continue;const u={id:l.id,label:i?l.label:l.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:i?l.parent:void 0};e.push(u)}for(const l of this.classes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={...l,type:void 0,isGroup:!1,parentId:u,look:n.look};e.push(h)}for(const l of this.notes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={id:l.id,label:l.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:u,labelType:"markdown"};e.push(h);const d=(o=this.classes.get(l.class))==null?void 0:o.id;if(d){const f={id:`edgeNote${l.index}`,start:l.id,end:d,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};r.push(f)}}for(const l of this.interfaces){const u={id:l.id,label:l.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};e.push(u)}let a=0;for(const l of this.relations){a++;const u={id:dy(l.id1,l.id2,{prefix:"id",counter:a}),start:l.id1,end:l.id2,type:"normal",label:l.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(l.relation.type1),arrowTypeEnd:this.getArrowMarker(l.relation.type2),startLabelRight:l.relationTitle1==="none"?"":l.relationTitle1,endLabelLeft:l.relationTitle2==="none"?"":l.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:l.style||"",pattern:l.relation.lineType==1?"dashed":"solid",look:n.look,labelType:"markdown"};r.push(u)}return{nodes:e,edges:r,other:{},config:n,direction:this.getDirection()}}},x(jd,"ClassDB"),jd),ORt=x(t=>`g.classGroup text {
fill: ${t.nodeBorder||t.classText};
stroke: none;
font-family: ${t.fontFamily};
font-size: 10px;
.title {
font-weight: bolder;
}
}
.cluster-label text {
fill: ${t.titleColor};
}
.cluster-label span {
color: ${t.titleColor};
}
.cluster-label span p {
background-color: transparent;
}
.cluster rect {
fill: ${t.clusterBkg};
stroke: ${t.clusterBorder};
stroke-width: 1px;
}
.cluster text {
fill: ${t.titleColor};
}
.cluster span {
color: ${t.titleColor};
}
.nodeLabel, .edgeLabel {
color: ${t.classText};
}
.noteLabel .nodeLabel, .noteLabel .edgeLabel {
color: ${t.noteTextColor};
}
.edgeLabel .label rect {
fill: ${t.mainBkg};
}
.label text {
fill: ${t.classText};
}
.labelBkg {
background: ${t.mainBkg};
}
.edgeLabel .label span {
background: ${t.mainBkg};
}
.classTitle {
font-weight: bolder;
}
.node rect,
.node circle,
.node ellipse,
.node polygon,
.node path {
fill: ${t.mainBkg};
stroke: ${t.nodeBorder};
stroke-width: ${t.strokeWidth};
}
.divider {
stroke: ${t.nodeBorder};
stroke-width: 1;
}
g.clickable {
cursor: pointer;
}
g.classGroup rect {
fill: ${t.mainBkg};
stroke: ${t.nodeBorder};
}
g.classGroup line {
stroke: ${t.nodeBorder};
stroke-width: 1;
}
.classLabel .box {
stroke: none;
stroke-width: 0;
fill: ${t.mainBkg};
opacity: 0.5;
}
.classLabel .label {
fill: ${t.nodeBorder};
font-size: 10px;
}
.relation {
stroke: ${t.lineColor};
stroke-width: ${t.strokeWidth};
fill: none;
}
.dashed-line{
stroke-dasharray: 3;
}
.dotted-line{
stroke-dasharray: 1 2;
}
[id$="-compositionStart"], .composition {
fill: ${t.lineColor} !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
[id$="-compositionEnd"], .composition {
fill: ${t.lineColor} !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
[id$="-dependencyStart"], .dependency {
fill: ${t.lineColor} !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
[id$="-dependencyEnd"], .dependency {
fill: ${t.lineColor} !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
[id$="-extensionStart"], .extension {
fill: transparent !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
[id$="-extensionEnd"], .extension {
fill: transparent !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
[id$="-aggregationStart"], .aggregation {
fill: transparent !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
[id$="-aggregationEnd"], .aggregation {
fill: transparent !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
[id$="-lollipopStart"], .lollipop {
fill: ${t.mainBkg} !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
[id$="-lollipopEnd"], .lollipop {
fill: ${t.mainBkg} !important;
stroke: ${t.lineColor} !important;
stroke-width: 1;
}
.edgeTerminals {
font-size: 11px;
line-height: initial;
}
.classTitleText {
text-anchor: middle;
font-size: 18px;
fill: ${t.textColor};
}
.edgeLabel[data-look="neo"] {
background-color: ${t.edgeLabelBackground};
p {
background-color: ${t.edgeLabelBackground};
}
rect {
opacity: 0.5;
background-color: ${t.edgeLabelBackground};
fill: ${t.edgeLabelBackground};
}
text-align: center;
}
${CS()}
`,"getStyles"),V_e=ORt,$Rt=x((t,e="TB")=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),PRt=x(function(t,e){return e.db.getClasses()},"getClasses"),BRt=x(async function(t,e,r,n){le.info("REF0:"),le.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:s}=Fe();n.db.setDiagramId(e);const o=n.db.getData(),l=Ox(e,i);o.type=n.type,o.layoutAlgorithm=nS(s),o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,o.markers=["aggregation","extension","composition","dependency","lollipop"],o.diagramId=e,await xx(o,l);const u=8;yr.insertTitle(l,"classDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),mg(l,u,"classDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),G_e={getClasses:PRt,draw:BRt,getDir:$Rt},FRt={parser:F_e,get db(){return new z_e},renderer:G_e,styles:V_e,init:x(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const zRt=Object.freeze(Object.defineProperty({__proto__:null,diagram:FRt},Symbol.toStringTag,{value:"Module"}));var VRt={parser:F_e,get db(){return new z_e},renderer:G_e,styles:V_e,init:x(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const GRt=Object.freeze(Object.defineProperty({__proto__:null,diagram:VRt},Symbol.toStringTag,{value:"Module"}));var VB=(function(){var t=x(function(F,z,V,B){for(V=V||{},B=F.length;B--;V[F[B]]=z);return V},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],s=[1,11],o=[1,16],l=[1,17],u=[1,18],h=[1,19],d=[1,33],f=[1,20],p=[1,21],g=[1,22],m=[1,23],y=[1,24],v=[1,26],T=[1,27],b=[1,28],w=[1,29],C=[1,30],S=[1,31],k=[1,32],E=[1,35],_=[1,36],M=[1,37],L=[1,38],P=[1,34],D=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],R=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],I=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],$={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:x(function(z,V,B,G,H,q,Z){var Y=q.length-1;switch(H){case 3:return G.setRootDoc(q[Y]),q[Y];case 4:this.$=[];break;case 5:q[Y]!="nl"&&(q[Y-1].push(q[Y]),this.$=q[Y-1]);break;case 6:case 7:this.$=q[Y];break;case 8:this.$="nl";break;case 12:this.$=q[Y];break;case 13:const te=q[Y-1];te.description=G.trimColon(q[Y]),this.$=te;break;case 14:this.$={stmt:"relation",state1:q[Y-2],state2:q[Y]};break;case 15:const J=G.trimColon(q[Y]);this.$={stmt:"relation",state1:q[Y-3],state2:q[Y-1],description:J};break;case 19:this.$={stmt:"state",id:q[Y-3],type:"default",description:"",doc:q[Y-1]};break;case 20:var ie=q[Y],K=q[Y-2].trim();if(q[Y].match(":")){var Q=q[Y].split(":");ie=Q[0],K=[K,Q[1]]}this.$={stmt:"state",id:ie,type:"default",description:K};break;case 21:this.$={stmt:"state",id:q[Y-3],type:"default",description:q[Y-5],doc:q[Y-1]};break;case 22:this.$={stmt:"state",id:q[Y],type:"fork"};break;case 23:this.$={stmt:"state",id:q[Y],type:"join"};break;case 24:this.$={stmt:"state",id:q[Y],type:"choice"};break;case 25:this.$={stmt:"state",id:G.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:q[Y-1].trim(),note:{position:q[Y-2].trim(),text:q[Y].trim()}};break;case 29:this.$=q[Y].trim(),G.setAccTitle(this.$);break;case 30:case 31:this.$=q[Y].trim(),G.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:q[Y-3],url:q[Y-2],tooltip:q[Y-1]};break;case 33:this.$={stmt:"click",id:q[Y-3],url:q[Y-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:q[Y-1].trim(),classes:q[Y].trim()};break;case 36:this.$={stmt:"style",id:q[Y-1].trim(),styleClass:q[Y].trim()};break;case 37:this.$={stmt:"applyClass",id:q[Y-1].trim(),styleClass:q[Y].trim()};break;case 38:G.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:G.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:G.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:G.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:q[Y].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:q[Y-2].trim(),classes:[q[Y].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:q[Y-2].trim(),classes:[q[Y].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:r,6:n},{1:[3]},{3:5,4:e,5:r,6:n},{3:6,4:e,5:r,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:w,41:C,45:S,48:k,51:E,52:_,53:M,54:L,57:P},t(D,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:o,17:l,19:u,22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:w,41:C,45:S,48:k,51:E,52:_,53:M,54:L,57:P},t(D,[2,7]),t(D,[2,8]),t(D,[2,9]),t(D,[2,10]),t(D,[2,11]),t(D,[2,12],{14:[1,40],15:[1,41]}),t(D,[2,16]),{18:[1,42]},t(D,[2,18],{20:[1,43]}),{23:[1,44]},t(D,[2,22]),t(D,[2,23]),t(D,[2,24]),t(D,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(D,[2,28]),{34:[1,49]},{36:[1,50]},t(D,[2,31]),{13:51,24:d,57:P},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(R,[2,44],{58:[1,56]}),t(R,[2,45],{58:[1,57]}),t(D,[2,38]),t(D,[2,39]),t(D,[2,40]),t(D,[2,41]),t(D,[2,6]),t(D,[2,13]),{13:58,24:d,57:P},t(D,[2,17]),t(I,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(D,[2,29]),t(D,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(D,[2,14],{14:[1,71]}),{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,72],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:w,41:C,45:S,48:k,51:E,52:_,53:M,54:L,57:P},t(D,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(D,[2,34]),t(D,[2,35]),t(D,[2,36]),t(D,[2,37]),t(R,[2,46]),t(R,[2,47]),t(D,[2,15]),t(D,[2,19]),t(I,i,{7:78}),t(D,[2,26]),t(D,[2,27]),{5:[1,79]},{5:[1,80]},{4:a,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:o,17:l,19:u,21:[1,81],22:h,24:d,25:f,26:p,27:g,28:m,29:y,32:25,33:v,35:T,37:b,38:w,41:C,45:S,48:k,51:E,52:_,53:M,54:L,57:P},t(D,[2,32]),t(D,[2,33]),t(D,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:x(function(z,V){if(V.recoverable)this.trace(z);else{var B=new Error(z);throw B.hash=V,B}},"parseError"),parse:x(function(z){var V=this,B=[0],G=[],H=[null],q=[],Z=this.table,Y="",ie=0,K=0,Q=2,te=1,J=q.slice.call(arguments,1),ge=Object.create(this.lexer),ee={yy:{}};for(var Re in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Re)&&(ee.yy[Re]=this.yy[Re]);ge.setInput(z,ee.yy),ee.yy.lexer=ge,ee.yy.parser=this,typeof ge.yylloc>"u"&&(ge.yylloc={});var Ie=ge.yylloc;q.push(Ie);var Be=ge.options&&ge.options.ranges;typeof ee.yy.parseError=="function"?this.parseError=ee.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(he){B.length=B.length-2*he,H.length=H.length-he,q.length=q.length-he}x(ce,"popStack");function oe(){var he;return he=G.pop()||ge.lex()||te,typeof he!="number"&&(he instanceof Array&&(G=he,he=G.pop()),he=V.symbols_[he]||he),he}x(oe,"lex");for(var be,fe,Pe,ve,Ce={},Ve,se,de,Te;;){if(fe=B[B.length-1],this.defaultActions[fe]?Pe=this.defaultActions[fe]:((be===null||typeof be>"u")&&(be=oe()),Pe=Z[fe]&&Z[fe][be]),typeof Pe>"u"||!Pe.length||!Pe[0]){var ae="";Te=[];for(Ve in Z[fe])this.terminals_[Ve]&&Ve>Q&&Te.push("'"+this.terminals_[Ve]+"'");ge.showPosition?ae="Parse error on line "+(ie+1)+`:
`+ge.showPosition()+`
Expecting `+Te.join(", ")+", got '"+(this.terminals_[be]||be)+"'":ae="Parse error on line "+(ie+1)+": Unexpected "+(be==te?"end of input":"'"+(this.terminals_[be]||be)+"'"),this.parseError(ae,{text:ge.match,token:this.terminals_[be]||be,line:ge.yylineno,loc:Ie,expected:Te})}if(Pe[0]instanceof Array&&Pe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+fe+", token: "+be);switch(Pe[0]){case 1:B.push(be),H.push(ge.yytext),q.push(ge.yylloc),B.push(Pe[1]),be=null,K=ge.yyleng,Y=ge.yytext,ie=ge.yylineno,Ie=ge.yylloc;break;case 2:if(se=this.productions_[Pe[1]][1],Ce.$=H[H.length-se],Ce._$={first_line:q[q.length-(se||1)].first_line,last_line:q[q.length-1].last_line,first_column:q[q.length-(se||1)].first_column,last_column:q[q.length-1].last_column},Be&&(Ce._$.range=[q[q.length-(se||1)].range[0],q[q.length-1].range[1]]),ve=this.performAction.apply(Ce,[Y,K,ie,ee.yy,Pe[1],H,q].concat(J)),typeof ve<"u")return ve;se&&(B=B.slice(0,-1*se*2),H=H.slice(0,-1*se),q=q.slice(0,-1*se)),B.push(this.productions_[Pe[1]][0]),H.push(Ce.$),q.push(Ce._$),de=Z[B[B.length-2]][B[B.length-1]],B.push(de);break;case 3:return!0}}return!0},"parse")},O=(function(){var F={EOF:1,parseError:x(function(V,B){if(this.yy.parser)this.yy.parser.parseError(V,B);else throw new Error(V)},"parseError"),setInput:x(function(z,V){return this.yy=V||this.yy||{},this._input=z,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var z=this._input[0];this.yytext+=z,this.yyleng++,this.offset++,this.match+=z,this.matched+=z;var V=z.match(/(?:\r\n?|\n).*/g);return V?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),z},"input"),unput:x(function(z){var V=z.length,B=z.split(/(?:\r\n?|\n)/g);this._input=z+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-V),this.offset-=V;var G=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),B.length-1&&(this.yylineno-=B.length-1);var H=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:B?(B.length===G.length?this.yylloc.first_column:0)+G[G.length-B.length].length-B[0].length:this.yylloc.first_column-V},this.options.ranges&&(this.yylloc.range=[H[0],H[0]+this.yyleng-V]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(z){this.unput(this.match.slice(z))},"less"),pastInput:x(function(){var z=this.matched.substr(0,this.matched.length-this.match.length);return(z.length>20?"...":"")+z.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var z=this.match;return z.length<20&&(z+=this._input.substr(0,20-z.length)),(z.substr(0,20)+(z.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var z=this.pastInput(),V=new Array(z.length+1).join("-");return z+this.upcomingInput()+`
`+V+"^"},"showPosition"),test_match:x(function(z,V){var B,G,H;if(this.options.backtrack_lexer&&(H={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(H.yylloc.range=this.yylloc.range.slice(0))),G=z[0].match(/(?:\r\n?|\n).*/g),G&&(this.yylineno+=G.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:G?G[G.length-1].length-G[G.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+z[0].length},this.yytext+=z[0],this.match+=z[0],this.matches=z,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(z[0].length),this.matched+=z[0],B=this.performAction.call(this,this.yy,this,V,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),B)return B;if(this._backtrack){for(var q in H)this[q]=H[q];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var z,V,B,G;this._more||(this.yytext="",this.match="");for(var H=this._currentRules(),q=0;q<H.length;q++)if(B=this._input.match(this.rules[H[q]]),B&&(!V||B[0].length>V[0].length)){if(V=B,G=q,this.options.backtrack_lexer){if(z=this.test_match(B,H[q]),z!==!1)return z;if(this._backtrack){V=!1;continue}else return!1}else if(!this.options.flex)break}return V?(z=this.test_match(V,H[G]),z!==!1?z:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var V=this.next();return V||this.lex()},"lex"),begin:x(function(V){this.conditionStack.push(V)},"begin"),popState:x(function(){var V=this.conditionStack.length-1;return V>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(V){return V=this.conditionStack.length-1-Math.abs(V||0),V>=0?this.conditionStack[V]:"INITIAL"},"topState"),pushState:x(function(V){this.begin(V)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(V,B,G,H){function q(){const Z=B.yytext.indexOf("%%");if(Z===0)return!1;if(Z>0){const Y=B.yytext.slice(0,Z),ie=B.yytext.slice(Z);ie&&V.lexer.unput(ie),B.yytext=Y}return!0}switch(x(q,"processId"),G){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),B.yytext=B.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),B.yytext=B.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return q()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+B.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:break;case 64:return"NOTE_TEXT";case 65:return q()?(this.popState(),"ID"):void 0;case 66:return q()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),B.yytext=B.yytext.substr(2).trim(),31;case 68:return this.popState(),B.yytext=B.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return q()?24:void 0;case 74:return B.yytext=B.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return F})();$.lexer=O;function N(){this.yy={}}return x(N,"Parser"),N.prototype=$,$.Parser=N,new N})();VB.parser=VB;var W_e=VB,WRt="TB",H_e="TB",Tie="dir",Bm="state",cm="root",GB="relation",HRt="classDef",qRt="style",URt="applyClass",cC="default",q_e="divider",U_e="fill:none",Y_e="fill: #333",X_e="c",j_e="markdown",K_e="normal",VN="rect",GN="rectWithTitle",YRt="stateStart",XRt="stateEnd",wie="divider",Cie="roundedWithTitle",jRt="note",KRt="noteGroup",jS="statediagram",ZRt="state",QRt=`${jS}-${ZRt}`,Z_e="transition",JRt="note",eLt="note-edge",tLt=`${Z_e} ${eLt}`,rLt=`${jS}-${JRt}`,nLt="cluster",iLt=`${jS}-${nLt}`,aLt="cluster-alt",sLt=`${jS}-${aLt}`,Q_e="parent",J_e="note",oLt="state",IU="----",lLt=`${IU}${J_e}`,kie=`${IU}${Q_e}`,e6e=x((t,e=H_e)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),cLt=x(function(t,e){return e.db.getClasses()},"getClasses"),uLt=x(async function(t,e,r,n){le.info("REF0:"),le.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:s}=Fe();n.db.extract(n.db.getRootDocV2());const o=n.db.getData(),l=Ox(e,i);o.type=n.type,o.layoutAlgorithm=s,o.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,o.rankSpacing=(a==null?void 0:a.rankSpacing)||50,Fe().look==="neo"?o.markers=["barbNeo"]:o.markers=["barb"],o.diagramId=e,await xx(o,l);const h=8;try{(typeof n.db.getLinks=="function"?n.db.getLinks():new Map).forEach((f,p)=>{var C;const g=typeof p=="string"?p:typeof(p==null?void 0:p.id)=="string"?p.id:"",m=o.nodes.find(S=>S.id===g);if(!g){le.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(p));return}const y=(C=l.node())==null?void 0:C.querySelectorAll("g.node, g.rough-node");let v;if(y==null||y.forEach(S=>{var E;const k=(E=S.textContent)==null?void 0:E.trim();(S.id===(m==null?void 0:m.domId)||k===g)&&(v=S)}),!v){le.warn("⚠️ Could not find node matching text:",g);return}const T=v.parentNode;if(!T){le.warn("⚠️ Node has no parent, cannot wrap:",g);return}const b=document.createElementNS("http://www.w3.org/2000/svg","a"),w=f.url.replace(/^"+|"+$/g,"");if(b.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",w),b.setAttribute("target","_blank"),f.tooltip){const S=f.tooltip.replace(/^"+|"+$/g,"");b.setAttribute("title",S),v.setAttribute("title",S)}T.replaceChild(b,v),b.appendChild(v),le.info("🔗 Wrapped node in <a> tag for:",g,f.url)})}catch(d){le.error("❌ Error injecting clickable links:",d)}yr.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),mg(l,h,jS,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),hLt={getClasses:cLt,draw:uLt,getDir:e6e},Z3=new Map,Sd=0;function Q3(t="",e=0,r="",n=IU){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${oLt}-${t}${i}-${e}`}x(Q3,"stateDomId");var dLt=x((t,e,r,n,i,a,s,o)=>{le.trace("items",e),e.forEach(l=>{switch(l.stmt){case Bm:vw(t,l,r,n,i,a,s,o);break;case cC:vw(t,l,r,n,i,a,s,o);break;case GB:{vw(t,l.state1,r,n,i,a,s,o),vw(t,l.state2,r,n,i,a,s,o);const u=s==="neo",h={id:"edge"+Sd,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:U_e,labelStyle:"",label:At.sanitizeText(l.description??"",Fe()),arrowheadStyle:Y_e,labelpos:X_e,labelType:j_e,thickness:K_e,classes:Z_e,look:s};i.push(h),Sd++}break}})},"setupDoc"),Sie=x((t,e=H_e)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function yw(t,e,r){if(!e.id||e.id==="</join></fork>"||e.id==="</choice>")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{const a=r.get(i);a&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...a.styles])}));const n=t.find(i=>i.id===e.id);n?Object.assign(n,e):t.push(e)}x(yw,"insertOrUpdateNode");function t6e(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}x(t6e,"getClassesFromDbInfo");function r6e(t){return(t==null?void 0:t.styles)??[]}x(r6e,"getStylesFromDbInfo");var vw=x((t,e,r,n,i,a,s,o)=>{var p,g,m;const l=e.id,u=r.get(l),h=t6e(u),d=r6e(u),f=Fe();if(le.info("dataFetcher parsedItem",e,u,d),l!=="root"){let y=VN;e.start===!0?y=YRt:e.start===!1&&(y=XRt),e.type!==cC&&(y=e.type),Z3.get(l)||Z3.set(l,{id:l,shape:y,description:At.sanitizeText(l,f),cssClasses:`${h} ${QRt}`,cssStyles:d});const v=Z3.get(l);e.description&&(Array.isArray(v.description)?(v.shape=GN,v.description.push(e.description)):(p=v.description)!=null&&p.length&&v.description.length>0?(v.shape=GN,v.description===l?v.description=[e.description]:v.description=[v.description,e.description]):(v.shape=VN,v.description=e.description),v.description=At.sanitizeTextOrArray(v.description,f)),((g=v.description)==null?void 0:g.length)===1&&v.shape===GN&&(v.type==="group"?v.shape=Cie:v.shape=VN),!v.type&&e.doc&&(le.info("Setting cluster for XCX",l,Sie(e)),v.type="group",v.isGroup=!0,v.dir=Sie(e),v.explicitDir=e.doc.some(b=>b.stmt==="dir"),v.shape=e.type===q_e?wie:Cie,v.cssClasses=`${v.cssClasses} ${iLt} ${a?sLt:""}`);const T={labelStyle:"",shape:v.shape,label:v.description,cssClasses:v.cssClasses,cssCompiledStyles:[],cssStyles:v.cssStyles,id:l,dir:v.dir,domId:Q3(l,Sd),type:v.type,isGroup:v.type==="group",padding:8,rx:10,ry:10,look:s,labelType:"markdown"};if(T.shape===wie&&(T.label=""),t&&t.id!=="root"&&(le.trace("Setting node ",l," to be child of its parent ",t.id),T.parentId=t.id),T.centerLabel=!0,e.note){const b={labelStyle:"",shape:jRt,label:e.note.text,labelType:"markdown",cssClasses:rLt,cssStyles:[],cssCompiledStyles:[],id:l+lLt+"-"+Sd,domId:Q3(l,Sd,J_e),type:v.type,isGroup:v.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:s,position:e.note.position},w=l+kie,C={labelStyle:"",shape:KRt,label:e.note.text,cssClasses:v.cssClasses,cssStyles:[],id:l+kie,domId:Q3(l,Sd,Q_e),type:"group",isGroup:!0,padding:16,look:s,position:e.note.position};Sd++,C.id=w,b.parentId=w,yw(n,C,o),yw(n,b,o),yw(n,T,o);let S=l,k=b.id;e.note.position==="left of"&&(S=b.id,k=l),i.push({id:S+"-"+k,start:S,end:k,arrowhead:"none",arrowTypeEnd:"",style:U_e,labelStyle:"",classes:tLt,arrowheadStyle:Y_e,labelpos:X_e,labelType:j_e,thickness:K_e,look:s})}else yw(n,T,o)}e.doc&&(le.trace("Adding nodes children "),dLt(e,e.doc,r,n,i,!a,s,o))},"dataFetcher"),fLt=x(()=>{Z3.clear(),Sd=0},"reset"),_s={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Eie=x(()=>new Map,"newClassesList"),Aie=x(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),E4=x(t=>JSON.parse(JSON.stringify(t)),"clone"),v0,Gp=(v0=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Eie(),this.documents={root:Aie()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=ni,this.setAccTitle=Hn,this.getAccDescription=ai,this.setAccDescription=ii,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}extract(e){this.clear(!0);for(const i of Array.isArray(e)?e:e.doc)switch(i.stmt){case Bm:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case GB:this.addRelation(i.state1,i.state2,i.description);break;case HRt:this.addStyleClass(i.id.trim(),i.classes);break;case qRt:this.handleStyleDef(i);break;case URt:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const r=this.getStates(),n=Fe();fLt(),vw(void 0,this.getRootDocV2(),r,this.nodes,this.edges,!0,n.look,this.classes);for(const i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(e){const r=e.id.trim().split(","),n=e.styleClass.split(",");for(const i of r){let a=this.getState(i);if(!a){const s=i.trim();this.addState(s),a=this.getState(s)}a&&(a.styles=n.map(s=>{var o;return(o=s.replace(/;/g,""))==null?void 0:o.trim()}))}}setRootDoc(e){le.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,r,n){if(r.stmt===GB){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===Bm&&(r.id===_s.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==cm&&r.stmt!==Bm||!r.doc)return;const i=[];let a=[];for(const s of r.doc)if(s.type===q_e){const o=E4(s);o.doc=E4(a),i.push(o),a=[]}else a.push(s);if(i.length>0&&a.length>0){const s={stmt:Bm,id:Lde(),type:"divider",doc:E4(a)};i.push(E4(s)),r.doc=i}r.doc.forEach(s=>this.docTranslator(r,s,!0))}getRootDocV2(){return this.docTranslator({id:cm,stmt:cm},{id:cm,stmt:cm,doc:this.rootDoc},!0),{id:cm,doc:this.rootDoc}}addState(e,r=cC,n=void 0,i=void 0,a=void 0,s=void 0,o=void 0,l=void 0){const u=e==null?void 0:e.trim();if(!this.currentDocument.states.has(u))le.info("Adding state ",u,i),this.currentDocument.states.set(u,{stmt:Bm,id:u,descriptions:[],type:r,doc:n,note:a,classes:[],styles:[],textStyles:[]});else{const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.doc||(h.doc=n),h.type||(h.type=r)}if(i&&(le.info("Setting state description",u,i),(Array.isArray(i)?i:[i]).forEach(d=>this.addDescription(u,d.trim()))),a){const h=this.currentDocument.states.get(u);if(!h)throw new Error(`State not found: ${u}`);h.note=a,h.note.text=At.sanitizeText(h.note.text,Fe())}s&&(le.info("Setting state classes",u,s),(Array.isArray(s)?s:[s]).forEach(d=>this.setCssClass(u,d.trim()))),o&&(le.info("Setting state styles",u,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setStyle(u,d.trim()))),l&&(le.info("Setting state styles",u,o),(Array.isArray(l)?l:[l]).forEach(d=>this.setTextStyle(u,d.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Aie()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Eie(),e||(this.links=new Map,On())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){le.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,r,n){this.links.set(e,{url:r,tooltip:n}),le.warn("Adding link",e,r,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===_s.START_NODE?(this.startEndCount++,`${_s.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=cC){return e===_s.START_NODE?_s.START_TYPE:r}endIdIfNeeded(e=""){return e===_s.END_NODE?(this.startEndCount++,`${_s.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=cC){return e===_s.END_NODE?_s.END_TYPE:r}addRelationObjs(e,r,n=""){const i=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type),s=this.startIdIfNeeded(r.id.trim()),o=this.startTypeIfNeeded(r.id.trim(),r.type);this.addState(i,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(s,o,r.doc,r.description,r.note,r.classes,r.styles,r.textStyles),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:At.sanitizeText(n,Fe())})}addRelation(e,r,n){if(typeof e=="object"&&typeof r=="object")this.addRelationObjs(e,r,n);else if(typeof e=="string"&&typeof r=="string"){const i=this.startIdIfNeeded(e.trim()),a=this.startTypeIfNeeded(e),s=this.endIdIfNeeded(r.trim()),o=this.endTypeIfNeeded(r);this.addState(i,a),this.addState(s,o),this.currentDocument.relations.push({id1:i,id2:s,relationTitle:n?At.sanitizeText(n,Fe()):void 0})}}addDescription(e,r){var a;const n=this.currentDocument.states.get(e),i=r.startsWith(":")?r.replace(":","").trim():r;(a=n==null?void 0:n.descriptions)==null||a.push(At.sanitizeText(i,Fe()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,r=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const n=this.classes.get(e);r&&n&&r.split(_s.STYLECLASS_SEP).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(_s.COLOR_KEYWORD).exec(i)){const o=a.replace(_s.FILL_KEYWORD,_s.BG_FILL).replace(_s.COLOR_KEYWORD,_s.FILL_KEYWORD);n.textStyles.push(o)}n.styles.push(a)})}getClasses(){return this.classes}setupToolTips(e){const r=fW();ut(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",a=>{var u;const s=ut(a.currentTarget),o=s.attr("title");if(o===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(ph.sanitize(o)),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),ut(a.currentTarget).classed("hover",!1)})}setCssClass(e,r){e.split(",").forEach(n=>{var a;let i=this.getState(n);if(!i){const s=n.trim();this.addState(s),i=this.getState(s)}(a=i==null?void 0:i.classes)==null||a.push(r)})}setStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.styles)==null||i.push(r)}setTextStyle(e,r){var n,i;(i=(n=this.getState(e))==null?void 0:n.textStyles)==null||i.push(r)}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===Tie)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??WRt}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:Tie,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=Fe();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:e6e(this.getRootDocV2())}}getConfig(){return Fe().state}},x(v0,"StateDB"),v0.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},v0),pLt=x(t=>`
defs [id$="-barbEnd"] {
fill: ${t.transitionColor};
stroke: ${t.transitionColor};
}
g.stateGroup text {
fill: ${t.nodeBorder};
stroke: none;
font-size: 10px;
}
g.stateGroup text {
fill: ${t.textColor};
stroke: none;
font-size: 10px;
}
g.stateGroup .state-title {
font-weight: bolder;
fill: ${t.stateLabelColor};
}
g.stateGroup rect {
fill: ${t.mainBkg};
stroke: ${t.nodeBorder};
}
g.stateGroup line {
stroke: ${t.lineColor};
stroke-width: ${t.strokeWidth||1};
}
.transition {
stroke: ${t.transitionColor};
stroke-width: ${t.strokeWidth||1};
fill: none;
}
.stateGroup .composit {
fill: ${t.background};
border-bottom: 1px
}
.stateGroup .alt-composit {
fill: #e0e0e0;
border-bottom: 1px
}
.state-note {
stroke: ${t.noteBorderColor};
fill: ${t.noteBkgColor};
text {
fill: ${t.noteTextColor};
stroke: none;
font-size: 10px;
}
}
.stateLabel .box {
stroke: none;
stroke-width: 0;
fill: ${t.mainBkg};
opacity: 0.5;
}
.edgeLabel .label rect {
fill: ${t.labelBackgroundColor};
opacity: 0.5;
}
.edgeLabel {
background-color: ${t.edgeLabelBackground};
p {
background-color: ${t.edgeLabelBackground};
}
rect {
opacity: 0.5;
background-color: ${t.edgeLabelBackground};
fill: ${t.edgeLabelBackground};
}
text-align: center;
}
.edgeLabel .label text {
fill: ${t.transitionLabelColor||t.tertiaryTextColor};
}
.label div .edgeLabel {
color: ${t.transitionLabelColor||t.tertiaryTextColor};
}
.stateLabel text {
fill: ${t.stateLabelColor};
font-size: 10px;
font-weight: bold;
}
.node circle.state-start {
fill: ${t.specialStateColor};
stroke: ${t.specialStateColor};
}
.node .fork-join {
fill: ${t.specialStateColor};
stroke: ${t.specialStateColor};
}
.node circle.state-end {
fill: ${t.innerEndBackground};
stroke: ${t.background};
stroke-width: 1.5
}
.end-state-inner {
fill: ${t.compositeBackground||t.background};
// stroke: ${t.background};
stroke-width: 1.5
}
.node rect {
fill: ${t.stateBkg||t.mainBkg};
stroke: ${t.stateBorder||t.nodeBorder};
stroke-width: ${t.strokeWidth||1}px;
}
.node polygon {
fill: ${t.mainBkg};
stroke: ${t.stateBorder||t.nodeBorder};;
stroke-width: ${t.strokeWidth||1}px;
}
[id$="-barbEnd"] {
fill: ${t.lineColor};
}
.statediagram-cluster rect {
fill: ${t.compositeTitleBackground};
stroke: ${t.stateBorder||t.nodeBorder};
stroke-width: ${t.strokeWidth||1}px;
}
.cluster-label, .nodeLabel {
color: ${t.stateLabelColor};
// line-height: 1;
}
.statediagram-cluster rect.outer {
rx: 5px;
ry: 5px;
}
.statediagram-state .divider {
stroke: ${t.stateBorder||t.nodeBorder};
}
.statediagram-state .title-state {
rx: 5px;
ry: 5px;
}
.statediagram-cluster.statediagram-cluster .inner {
fill: ${t.compositeBackground||t.background};
}
.statediagram-cluster.statediagram-cluster-alt .inner {
fill: ${t.altBackground?t.altBackground:"#efefef"};
}
.statediagram-cluster .inner {
rx:0;
ry:0;
}
.statediagram-state rect.basic {
rx: 5px;
ry: 5px;
}
.statediagram-state rect.divider {
stroke-dasharray: 10,10;
fill: ${t.altBackground?t.altBackground:"#efefef"};
}
.note-edge {
stroke-dasharray: 5;
}
.statediagram-note rect {
fill: ${t.noteBkgColor};
stroke: ${t.noteBorderColor};
stroke-width: 1px;
rx: 0;
ry: 0;
}
.statediagram-note rect {
fill: ${t.noteBkgColor};
stroke: ${t.noteBorderColor};
stroke-width: 1px;
rx: 0;
ry: 0;
}
.statediagram-note text {
fill: ${t.noteTextColor};
}
.statediagram-note .nodeLabel {
color: ${t.noteTextColor};
}
.statediagram .edgeLabel {
color: red; // ${t.noteTextColor};
}
[id$="-dependencyStart"], [id$="-dependencyEnd"] {
fill: ${t.lineColor};
stroke: ${t.lineColor};
stroke-width: ${t.strokeWidth||1};
}
.statediagramTitleText {
text-anchor: middle;
font-size: 18px;
fill: ${t.textColor};
}
[data-look="neo"].statediagram-cluster rect {
fill: ${t.mainBkg};
stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder};
stroke-width: ${t.strokeWidth??1};
}
[data-look="neo"].statediagram-cluster rect.outer {
rx: ${t.radius}px;
ry: ${t.radius}px;
filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"}
}
`,"getStyles"),n6e=pLt,gLt=x(t=>t.append("circle").attr("class","start-state").attr("r",Fe().state.sizeUnit).attr("cx",Fe().state.padding+Fe().state.sizeUnit).attr("cy",Fe().state.padding+Fe().state.sizeUnit),"drawStartState"),mLt=x(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",Fe().state.textHeight).attr("class","divider").attr("x2",Fe().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),yLt=x((t,e)=>{const r=t.append("text").attr("x",2*Fe().state.padding).attr("y",Fe().state.textHeight+2*Fe().state.padding).attr("font-size",Fe().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",Fe().state.padding).attr("y",Fe().state.padding).attr("width",n.width+2*Fe().state.padding).attr("height",n.height+2*Fe().state.padding).attr("rx",Fe().state.radius),r},"drawSimpleState"),vLt=x((t,e)=>{const r=x(function(f,p,g){const m=f.append("tspan").attr("x",2*Fe().state.padding).text(p);g||m.attr("dy",Fe().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*Fe().state.padding).attr("y",Fe().state.textHeight+1.3*Fe().state.padding).attr("font-size",Fe().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),a=i.height,s=t.append("text").attr("x",Fe().state.padding).attr("y",a+Fe().state.padding*.4+Fe().state.dividerMargin+Fe().state.textHeight).attr("class","state-description");let o=!0,l=!0;e.descriptions.forEach(function(f){o||(r(s,f,l),l=!1),o=!1});const u=t.append("line").attr("x1",Fe().state.padding).attr("y1",Fe().state.padding+a+Fe().state.dividerMargin/2).attr("y2",Fe().state.padding+a+Fe().state.dividerMargin/2).attr("class","descr-divider"),h=s.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*Fe().state.padding),t.insert("rect",":first-child").attr("x",Fe().state.padding).attr("y",Fe().state.padding).attr("width",d+2*Fe().state.padding).attr("height",h.height+a+2*Fe().state.padding).attr("rx",Fe().state.radius),t},"drawDescrState"),bLt=x((t,e,r)=>{const n=Fe().state.padding,i=2*Fe().state.padding,a=t.node().getBBox(),s=a.width,o=a.x,l=t.append("text").attr("x",0).attr("y",Fe().state.titleShift).attr("font-size",Fe().state.fontSize).attr("class","state-title").text(e.id),h=l.node().getBBox().width+i;let d=Math.max(h,s);d===s&&(d=d+i);let f;const p=t.node().getBBox();e.doc,f=o-n,h>s&&(f=(s-d)/2+n),Math.abs(o-p.x)<n&&h>s&&(f=o-(h-s)/2);const g=1-Fe().state.textHeight;return t.insert("rect",":first-child").attr("x",f).attr("y",g).attr("class",r?"alt-composit":"composit").attr("width",d).attr("height",p.height+Fe().state.textHeight+Fe().state.titleShift+1).attr("rx","0"),l.attr("x",f+n),h<=s&&l.attr("x",o+(d-i)/2-h/2+n),t.insert("rect",":first-child").attr("x",f).attr("y",Fe().state.titleShift-Fe().state.textHeight-Fe().state.padding).attr("width",d).attr("height",Fe().state.textHeight*3).attr("rx",Fe().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",Fe().state.titleShift-Fe().state.textHeight-Fe().state.padding).attr("width",d).attr("height",p.height+3+2*Fe().state.textHeight).attr("rx",Fe().state.radius),t},"addTitleAndBox"),xLt=x(t=>(t.append("circle").attr("class","end-state-outer").attr("r",Fe().state.sizeUnit+Fe().state.miniPadding).attr("cx",Fe().state.padding+Fe().state.sizeUnit+Fe().state.miniPadding).attr("cy",Fe().state.padding+Fe().state.sizeUnit+Fe().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",Fe().state.sizeUnit).attr("cx",Fe().state.padding+Fe().state.sizeUnit+2).attr("cy",Fe().state.padding+Fe().state.sizeUnit+2)),"drawEndState"),TLt=x((t,e)=>{let r=Fe().state.forkWidth,n=Fe().state.forkHeight;if(e.parentId){let i=r;r=n,n=i}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",Fe().state.padding).attr("y",Fe().state.padding)},"drawForkJoinState"),wLt=x((t,e,r,n)=>{let i=0;const a=n.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let s=t.replace(/\r\n/g,"<br/>");s=s.replace(/\n/g,"<br/>");const o=s.split(At.lineBreakRegex);let l=1.25*Fe().state.noteMargin;for(const u of o){const h=u.trim();if(h.length>0){const d=a.append("tspan");if(d.text(h),l===0){const f=d.node().getBBox();l+=f.height}i+=l,d.attr("x",e+Fe().state.noteMargin),d.attr("y",r+i+1.25*Fe().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),CLt=x((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",Fe().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=wLt(t,0,0,n);return r.attr("height",a+2*Fe().state.noteMargin),r.attr("width",i+Fe().state.noteMargin*2),r},"drawNote"),_ie=x(function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");e.type==="start"&&gLt(i),e.type==="end"&&xLt(i),(e.type==="fork"||e.type==="join")&&TLt(i,e),e.type==="note"&&CLt(e.note.text,i),e.type==="divider"&&mLt(i),e.type==="default"&&e.descriptions.length===0&&yLt(i,e),e.type==="default"&&e.descriptions.length>0&&vLt(i,e);const a=i.node().getBBox();return n.width=a.width+2*Fe().state.padding,n.height=a.height+2*Fe().state.padding,n},"drawState"),Rie=0,kLt=x(function(t,e,r){const n=x(function(l){switch(l){case Gp.relationType.AGGREGATION:return"aggregation";case Gp.relationType.EXTENSION:return"extension";case Gp.relationType.COMPOSITION:return"composition";case Gp.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,a=NC().x(function(l){return l.x}).y(function(l){return l.y}).curve(DC),s=t.append("path").attr("d",a(i)).attr("id","edge"+Rie).attr("class","transition");let o="";if(Fe().state.arrowMarkerAbsolute&&(o=J6(!0)),s.attr("marker-end","url("+o+"#"+n(Gp.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=yr.calcLabelPosition(e.points),d=At.getRows(r.title);let f=0;const p=[];let g=0,m=0;for(let T=0;T<=d.length;T++){const b=l.append("text").attr("text-anchor","middle").text(d[T]).attr("x",u).attr("y",h+f),w=b.node().getBBox();g=Math.max(g,w.width),m=Math.min(m,w.x),le.info(w.x,u,h+f),f===0&&(f=b.node().getBBox().height,le.info("Title height",f,h)),p.push(b)}let y=f*d.length;if(d.length>1){const T=(d.length-1)*f*.5;p.forEach((b,w)=>b.attr("y",h+w*f-T)),y=f*d.length}const v=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-g/2-Fe().state.padding/2).attr("y",h-y/2-Fe().state.padding/2-3.5).attr("width",g+Fe().state.padding).attr("height",y+Fe().state.padding),le.info(v)}Rie++},"drawEdge"),Ro,WN={},SLt=x(function(){},"setConf"),ELt=x(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),ALt=x(function(t,e,r,n){Ro=Fe().state;const i=Fe().securityLevel;let a;i==="sandbox"&&(a=ut("#i"+e));const s=ut(i==="sandbox"?a.nodes()[0].contentDocument.body:"body"),o=i==="sandbox"?a.nodes()[0].contentDocument:document;le.debug("Rendering diagram "+t);const l=s.select(`[id='${e}']`);ELt(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");i6e(u,h,void 0,!1,s,o,n);const d=Ro.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;Ai(l,g,m,Ro.useMaxWidth),l.attr("viewBox",`${f.x-Ro.padding} ${f.y-Ro.padding} `+p+" "+g)},"draw"),_Lt=x(t=>t?t.length*Ro.fontSizeFactor:1,"getLabelWidth"),i6e=x((t,e,r,n,i,a,s)=>{const o=new ms({compound:!0,multigraph:!0});let l,u=!0;for(l=0;l<t.length;l++)if(t[l].stmt==="relation"){u=!1;break}r?o.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:u?1:Ro.edgeLengthFactor,nodeSep:u?1:50,isMultiGraph:!0}):o.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:u?1:Ro.edgeLengthFactor,nodeSep:u?1:50,ranker:"tight-tree",isMultiGraph:!0}),o.setDefaultEdgeLabel(function(){return{}});const h=s.db.getStates(),d=s.db.getRelations(),f=Object.keys(h);for(const v of f){const T=h[v];r&&(T.parentId=r);let b;if(T.doc){let w=e.append("g").attr("id",T.id).attr("class","stateGroup");b=i6e(T.doc,w,T.id,!n,i,a,s);{w=bLt(w,T,n);let C=w.node().getBBox();b.width=C.width,b.height=C.height+Ro.padding/2,WN[T.id]={y:Ro.compositTitleSize}}}else b=_ie(e,T,o);if(T.note){const w={descriptions:[],id:T.id+"-note",note:T.note,type:"note"},C=_ie(e,w,o);T.note.position==="left of"?(o.setNode(b.id+"-note",C),o.setNode(b.id,b)):(o.setNode(b.id,b),o.setNode(b.id+"-note",C)),o.setParent(b.id,b.id+"-group"),o.setParent(b.id+"-note",b.id+"-group")}else o.setNode(b.id,b)}le.debug("Count=",o.nodeCount(),o);let p=0;d.forEach(function(v){p++,le.debug("Setting edge",v),o.setEdge(v.id1,v.id2,{relation:v,width:_Lt(v.title),height:Ro.labelHeight*At.getRows(v.title).length,labelpos:"c"},"id"+p)}),lye(o),le.debug("Graph after layout",o.nodes());const g=e.node();o.nodes().forEach(function(v){v!==void 0&&o.node(v)!==void 0?(le.warn("Node "+v+": "+JSON.stringify(o.node(v))),i.select("#"+g.id+" #"+v).attr("transform","translate("+(o.node(v).x-o.node(v).width/2)+","+(o.node(v).y+(WN[v]?WN[v].y:0)-o.node(v).height/2)+" )"),i.select("#"+g.id+" #"+v).attr("data-x-shift",o.node(v).x-o.node(v).width/2),a.querySelectorAll("#"+g.id+" #"+v+" .divider").forEach(b=>{const w=b.parentElement;let C=0,S=0;w&&(w.parentElement&&(C=w.parentElement.getBBox().width),S=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(S)&&(S=0)),b.setAttribute("x1",0-S+8),b.setAttribute("x2",C-S-8)})):le.debug("No Node "+v+": "+JSON.stringify(o.node(v)))});let m=g.getBBox();o.edges().forEach(function(v){v!==void 0&&o.edge(v)!==void 0&&(le.debug("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(o.edge(v))),kLt(e,o.edge(v),o.edge(v).relation))}),m=g.getBBox();const y={id:r||"root",label:r||"root",width:0,height:0};return y.width=m.width+2*Ro.padding,y.height=m.height+2*Ro.padding,le.debug("Doc rendered",y,o),y},"renderDoc"),RLt={setConf:SLt,draw:ALt},LLt={parser:W_e,get db(){return new Gp(1)},renderer:RLt,styles:n6e,init:x(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const MLt=Object.freeze(Object.defineProperty({__proto__:null,diagram:LLt},Symbol.toStringTag,{value:"Module"}));var ILt={parser:W_e,get db(){return new Gp(2)},renderer:hLt,styles:n6e,init:x(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const NLt=Object.freeze(Object.defineProperty({__proto__:null,diagram:ILt},Symbol.toStringTag,{value:"Module"}));var WB=(function(){var t=x(function(d,f,p,g){for(p=p||{},g=d.length;g--;p[d[g]]=f);return p},"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],n=[1,10],i=[1,11],a=[1,12],s=[1,13],o=[1,14],l={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:x(function(f,p,g,m,y,v,T){var b=v.length-1;switch(y){case 1:return v[b-1];case 2:this.$=[];break;case 3:v[b-1].push(v[b]),this.$=v[b-1];break;case 4:case 5:this.$=v[b];break;case 6:case 7:this.$=[];break;case 8:m.setDiagramTitle(v[b].substr(6)),this.$=v[b].substr(6);break;case 9:this.$=v[b].trim(),m.setAccTitle(this.$);break;case 10:case 11:this.$=v[b].trim(),m.setAccDescription(this.$);break;case 12:m.addSection(v[b].substr(8)),this.$=v[b].substr(8);break;case 13:m.addTask(v[b-1],v[b]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:a,17:s,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:x(function(f,p){if(p.recoverable)this.trace(f);else{var g=new Error(f);throw g.hash=p,g}},"parseError"),parse:x(function(f){var p=this,g=[0],m=[],y=[null],v=[],T=this.table,b="",w=0,C=0,S=2,k=1,E=v.slice.call(arguments,1),_=Object.create(this.lexer),M={yy:{}};for(var L in this.yy)Object.prototype.hasOwnProperty.call(this.yy,L)&&(M.yy[L]=this.yy[L]);_.setInput(f,M.yy),M.yy.lexer=_,M.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var P=_.yylloc;v.push(P);var D=_.options&&_.options.ranges;typeof M.yy.parseError=="function"?this.parseError=M.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function R(Z){g.length=g.length-2*Z,y.length=y.length-Z,v.length=v.length-Z}x(R,"popStack");function I(){var Z;return Z=m.pop()||_.lex()||k,typeof Z!="number"&&(Z instanceof Array&&(m=Z,Z=m.pop()),Z=p.symbols_[Z]||Z),Z}x(I,"lex");for(var $,O,N,F,z={},V,B,G,H;;){if(O=g[g.length-1],this.defaultActions[O]?N=this.defaultActions[O]:(($===null||typeof $>"u")&&($=I()),N=T[O]&&T[O][$]),typeof N>"u"||!N.length||!N[0]){var q="";H=[];for(V in T[O])this.terminals_[V]&&V>S&&H.push("'"+this.terminals_[V]+"'");_.showPosition?q="Parse error on line "+(w+1)+`:
`+_.showPosition()+`
Expecting `+H.join(", ")+", got '"+(this.terminals_[$]||$)+"'":q="Parse error on line "+(w+1)+": Unexpected "+($==k?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(q,{text:_.match,token:this.terminals_[$]||$,line:_.yylineno,loc:P,expected:H})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+$);switch(N[0]){case 1:g.push($),y.push(_.yytext),v.push(_.yylloc),g.push(N[1]),$=null,C=_.yyleng,b=_.yytext,w=_.yylineno,P=_.yylloc;break;case 2:if(B=this.productions_[N[1]][1],z.$=y[y.length-B],z._$={first_line:v[v.length-(B||1)].first_line,last_line:v[v.length-1].last_line,first_column:v[v.length-(B||1)].first_column,last_column:v[v.length-1].last_column},D&&(z._$.range=[v[v.length-(B||1)].range[0],v[v.length-1].range[1]]),F=this.performAction.apply(z,[b,C,w,M.yy,N[1],y,v].concat(E)),typeof F<"u")return F;B&&(g=g.slice(0,-1*B*2),y=y.slice(0,-1*B),v=v.slice(0,-1*B)),g.push(this.productions_[N[1]][0]),y.push(z.$),v.push(z._$),G=T[g[g.length-2]][g[g.length-1]],g.push(G);break;case 3:return!0}}return!0},"parse")},u=(function(){var d={EOF:1,parseError:x(function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},"parseError"),setInput:x(function(f,p){return this.yy=p||this.yy||{},this._input=f,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var f=this._input[0];this.yytext+=f,this.yyleng++,this.offset++,this.match+=f,this.matched+=f;var p=f.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),f},"input"),unput:x(function(f){var p=f.length,g=f.split(/(?:\r\n?|\n)/g);this._input=f+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===m.length?this.yylloc.first_column:0)+m[m.length-g.length].length-g[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(f){this.unput(this.match.slice(f))},"less"),pastInput:x(function(){var f=this.matched.substr(0,this.matched.length-this.match.length);return(f.length>20?"...":"")+f.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var f=this.match;return f.length<20&&(f+=this._input.substr(0,20-f.length)),(f.substr(0,20)+(f.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var f=this.pastInput(),p=new Array(f.length+1).join("-");return f+this.upcomingInput()+`
`+p+"^"},"showPosition"),test_match:x(function(f,p){var g,m,y;if(this.options.backtrack_lexer&&(y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(y.yylloc.range=this.yylloc.range.slice(0))),m=f[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+f[0].length},this.yytext+=f[0],this.match+=f[0],this.matches=f,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(f[0].length),this.matched+=f[0],g=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var v in y)this[v]=y[v];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var f,p,g,m;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),v=0;v<y.length;v++)if(g=this._input.match(this.rules[y[v]]),g&&(!p||g[0].length>p[0].length)){if(p=g,m=v,this.options.backtrack_lexer){if(f=this.test_match(g,y[v]),f!==!1)return f;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(f=this.test_match(p,y[m]),f!==!1?f:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var p=this.next();return p||this.lex()},"lex"),begin:x(function(p){this.conditionStack.push(p)},"begin"),popState:x(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:x(function(p){this.begin(p)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(p,g,m,y){switch(m){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return d})();l.lexer=u;function h(){this.yy={}}return x(h,"Parser"),h.prototype=l,l.Parser=h,new h})();WB.parser=WB;var DLt=WB,cx="",NU=[],Mk=[],Ik=[],OLt=x(function(){NU.length=0,Mk.length=0,cx="",Ik.length=0,On()},"clear"),$Lt=x(function(t){cx=t,NU.push(t)},"addSection"),PLt=x(function(){return NU},"getSections"),BLt=x(function(){let t=Lie();const e=100;let r=0;for(;!t&&r<e;)t=Lie(),r++;return Mk.push(...Ik),Mk},"getTasks"),FLt=x(function(){const t=[];return Mk.forEach(r=>{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),zLt=x(function(t,e){const r=e.substr(1).split(":");let n=0,i=[];r.length===1?(n=Number(r[0]),i=[]):(n=Number(r[0]),i=r[1].split(","));const a=i.map(o=>o.trim()),s={section:cx,type:cx,people:a,task:t,score:n};Ik.push(s)},"addTask"),VLt=x(function(t){const e={section:cx,type:cx,description:t,task:t,classes:[]};Mk.push(e)},"addTaskOrg"),Lie=x(function(){const t=x(function(r){return Ik[r].processed},"compileTask");let e=!0;for(const[r,n]of Ik.entries())t(r),e=e&&n.processed;return e},"compileTasks"),GLt=x(function(){return FLt()},"getActors"),Mie={getConfig:x(()=>Fe().journey,"getConfig"),clear:OLt,setDiagramTitle:ti,getDiagramTitle:Yn,setAccTitle:Hn,getAccTitle:ni,setAccDescription:ii,getAccDescription:ai,addSection:$Lt,getSections:PLt,getTasks:BLt,addTask:zLt,addTaskOrg:VLt,getActors:GLt},WLt=x(t=>`.label {
font-family: ${t.fontFamily};
color: ${t.textColor};
}
.mouth {
stroke: #666;
}
line {
stroke: ${t.textColor}
}
.legend {
fill: ${t.textColor};
font-family: ${t.fontFamily};
}
.label text {
fill: #333;
}
.label {
color: ${t.textColor}
}
.face {
${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};
stroke: #999;
}
.node rect,
.node circle,
.node ellipse,
.node polygon,
.node path {
fill: ${t.mainBkg};
stroke: ${t.nodeBorder};
stroke-width: 1px;
}
.node .label {
text-align: center;
}
.node.clickable {
cursor: pointer;
}
.arrowheadPath {
fill: ${t.arrowheadColor};
}
.edgePath .path {
stroke: ${t.lineColor};
stroke-width: 1.5px;
}
.flowchart-link {
stroke: ${t.lineColor};
fill: none;
}
.edgeLabel {
background-color: ${t.edgeLabelBackground};
rect {
opacity: 0.5;
}
text-align: center;
}
.cluster rect {
}
.cluster text {
fill: ${t.titleColor};
}
div.mermaidTooltip {
position: absolute;
text-align: center;
max-width: 200px;
padding: 2px;
font-family: ${t.fontFamily};
font-size: 12px;
background: ${t.tertiaryColor};
border: 1px solid ${t.border2};
border-radius: 2px;
pointer-events: none;
z-index: 100;
}
.task-type-0, .section-type-0 {
${t.fillType0?`fill: ${t.fillType0}`:""};
}
.task-type-1, .section-type-1 {
${t.fillType0?`fill: ${t.fillType1}`:""};
}
.task-type-2, .section-type-2 {
${t.fillType0?`fill: ${t.fillType2}`:""};
}
.task-type-3, .section-type-3 {
${t.fillType0?`fill: ${t.fillType3}`:""};
}
.task-type-4, .section-type-4 {
${t.fillType0?`fill: ${t.fillType4}`:""};
}
.task-type-5, .section-type-5 {
${t.fillType0?`fill: ${t.fillType5}`:""};
}
.task-type-6, .section-type-6 {
${t.fillType0?`fill: ${t.fillType6}`:""};
}
.task-type-7, .section-type-7 {
${t.fillType0?`fill: ${t.fillType7}`:""};
}
.actor-0 {
${t.actor0?`fill: ${t.actor0}`:""};
}
.actor-1 {
${t.actor1?`fill: ${t.actor1}`:""};
}
.actor-2 {
${t.actor2?`fill: ${t.actor2}`:""};
}
.actor-3 {
${t.actor3?`fill: ${t.actor3}`:""};
}
.actor-4 {
${t.actor4?`fill: ${t.actor4}`:""};
}
.actor-5 {
${t.actor5?`fill: ${t.actor5}`:""};
}
${CS()}
`,"getStyles"),HLt=WLt,DU=x(function(t,e){return xL(t,e)},"drawRect"),qLt=x(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=_b().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}x(a,"smile");function s(l){const u=_b().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}x(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return x(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),a6e=x(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),s6e=x(function(t,e){return cmt(t,e)},"drawText"),ULt=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,s6e(t,e)},"drawLabel"),YLt=x(function(t,e,r){const n=t.append("g"),i=Yo();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width*e.taskCount+r.diagramMarginX*(e.taskCount-1),i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,DU(n,i),o6e(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),HB=-1,XLt=x(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");HB++,a.append("line").attr("id",n+"-task"+HB).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),qLt(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=Yo();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,DU(a,o);let l=e.x+14;e.people.forEach(u=>{const h=e.actors[u].color,d={cx:l,cy:e.y,r:7,fill:h,stroke:"#000",title:u,pos:e.actors[u].position};a6e(a,d),l+=10}),o6e(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),jLt=x(function(t,e){q2e(t,e)},"drawBackgroundRect"),o6e=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(/<br\s*\/?>/gi);for(let y=0;y<m.length;y++){const v=y*p-p*(m.length-1)/2,T=a.append("text").attr("x",s+l/2).attr("y",o).attr("fill",f).style("text-anchor","middle").style("font-size",p).style("font-family",g);T.append("tspan").attr("x",s+l/2).attr("dy",v).text(m[y]),T.attr("y",o+u/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),n(T,h)}}x(e,"byTspan");function r(i,a,s,o,l,u,h,d){const f=a.append("switch"),g=f.append("foreignObject").attr("x",s).attr("y",o).attr("width",l).attr("height",u).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");g.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),e(i,f,s,o,l,u,h,d),n(g,h)}x(r,"byFo");function n(i,a){for(const s in a)s in a&&i.attr(s,a[s])}return x(n,"_setTextAttrs"),function(i){return i.textPlacement==="fo"?r:i.textPlacement==="old"?t:e}})(),KLt=x(function(t,e){HB=-1,t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics"),Nk={drawRect:DU,drawCircle:a6e,drawSection:YLt,drawText:s6e,drawLabel:ULt,drawTask:XLt,drawBackgroundRect:jLt,initGraphics:KLt},ZLt=x(function(t){Object.keys(t).forEach(function(r){Dl[r]=t[r]})},"setConf"),ih={},J3=0;function l6e(t){const e=Fe().journey,r=e.maxLabelWidth;J3=0;let n=60;Object.keys(ih).forEach(i=>{const a=ih[i].color,s={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:ih[i].position};Nk.drawCircle(t,s);let o=t.append("text").attr("visibility","hidden").text(i);const l=o.node().getBoundingClientRect().width;o.remove();let u=[];if(l<=r)u=[i];else{const h=i.split(" ");let d="";o=t.append("text").attr("visibility","hidden"),h.forEach(f=>{const p=d?`${d} ${f}`:f;if(o.text(p),o.node().getBoundingClientRect().width>r){if(d&&u.push(d),d=f,o.text(f),o.node().getBoundingClientRect().width>r){let m="";for(const y of f)m+=y,o.text(m+"-"),o.node().getBoundingClientRect().width>r&&(u.push(m.slice(0,-1)+"-"),m=y);d=m}}else d=p}),d&&u.push(d),o.remove()}u.forEach((h,d)=>{const f={x:40,y:n+7+d*20,fill:"#666",text:h,textMargin:e.boxTextMargin??5},g=Nk.drawText(t,f).node().getBoundingClientRect().width;g>J3&&g>e.leftMargin-g&&(J3=g)}),n+=Math.max(20,u.length*20)})}x(l6e,"drawActorLegend");var Dl=Fe().journey,xd=0,QLt=x(function(t,e,r,n){const i=Fe(),a=i.journey.titleColor,s=i.journey.titleFontSize,o=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=ut("#i"+e));const h=ut(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");il.init();const d=h.select("#"+e);Nk.initGraphics(d,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const w in ih)delete ih[w];let m=0;g.forEach(w=>{ih[w]={color:Dl.actorColours[m%Dl.actorColours.length],position:m},m++}),l6e(d),xd=Dl.leftMargin+J3,il.insert(0,0,xd,Object.keys(ih).length*50),JLt(d,f,0,e);const y=il.getBounds();p&&d.append("text").text(p).attr("x",xd).attr("font-size",s).attr("font-weight","bold").attr("y",25).attr("fill",a).attr("font-family",o);const v=y.stopy-y.starty+2*Dl.diagramMarginY,T=xd+y.stopx+2*Dl.diagramMarginX;Ai(d,v,T,Dl.useMaxWidth),d.append("line").attr("x1",xd).attr("y1",Dl.height*4).attr("x2",T-xd-4).attr("y2",Dl.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const b=p?70:0;d.attr("viewBox",`${y.startx} -25 ${T} ${v+b}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",v+b+25)},"draw"),il={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:x(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:x(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:x(function(t,e,r,n){const i=Fe().journey,a=this;let s=0;function o(l){return x(function(h){s++;const d=a.sequenceItems.length-s+1;a.updateVal(h,"starty",e-d*i.boxMargin,Math.min),a.updateVal(h,"stopy",n+d*i.boxMargin,Math.max),a.updateVal(il.data,"startx",t-d*i.boxMargin,Math.min),a.updateVal(il.data,"stopx",r+d*i.boxMargin,Math.max),l!=="activation"&&(a.updateVal(h,"startx",t-d*i.boxMargin,Math.min),a.updateVal(h,"stopx",r+d*i.boxMargin,Math.max),a.updateVal(il.data,"starty",e-d*i.boxMargin,Math.min),a.updateVal(il.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}x(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:x(function(t,e,r,n){const i=Math.min(t,r),a=Math.max(t,r),s=Math.min(e,n),o=Math.max(e,n);this.updateVal(il.data,"startx",i,Math.min),this.updateVal(il.data,"starty",s,Math.min),this.updateVal(il.data,"stopx",a,Math.max),this.updateVal(il.data,"stopy",o,Math.max),this.updateBounds(i,s,a,o)},"insert"),bumpVerticalPos:x(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:x(function(){return this.verticalPos},"getVerticalPos"),getBounds:x(function(){return this.data},"getBounds")},HN=Dl.sectionFills,Iie=Dl.sectionColours,JLt=x(function(t,e,r,n){const i=Fe().journey;let a="";const s=i.height*2+i.diagramMarginY,o=r+s;let l=0,u="#CCC",h="black",d=0;for(const[f,p]of e.entries()){if(a!==p.section){u=HN[l%HN.length],d=l%HN.length,h=Iie[l%Iie.length];let m=0;const y=p.section;for(let T=f;T<e.length&&e[T].section==y;T++)m=m+1;const v={x:f*i.taskMargin+f*i.width+xd,y:50,text:p.section,fill:u,num:d,colour:h,taskCount:m};Nk.drawSection(t,v,i),a=p.section,l++}const g=p.people.reduce((m,y)=>(ih[y]&&(m[y]=ih[y]),m),{});p.x=f*i.taskMargin+f*i.width+xd,p.y=o,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,Nk.drawTask(t,p,i,n),il.insert(p.x,p.y,p.x+p.width+i.taskMargin,450)}},"drawTasks"),Nie={setConf:ZLt,draw:QLt},e7t={parser:DLt,db:Mie,renderer:Nie,styles:HLt,init:x(t=>{Nie.setConf(t.journey),Mie.clear()},"init")};const t7t=Object.freeze(Object.defineProperty({__proto__:null,diagram:e7t},Symbol.toStringTag,{value:"Module"}));var qB=(function(){var t=x(function(f,p,g,m){for(g=g||{},m=f.length;m--;g[f[m]]=p);return g},"o"),e=[6,11,13,14,15,17,19,20,23,24],r=[1,12],n=[1,13],i=[1,14],a=[1,15],s=[1,16],o=[1,19],l=[1,20],u={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:x(function(p,g,m,y,v,T,b){var w=T.length-1;switch(v){case 1:return T[w-1];case 3:y.setDirection("LR");break;case 4:y.setDirection("TD");break;case 5:this.$=[];break;case 6:T[w-1].push(T[w]),this.$=T[w-1];break;case 7:case 8:this.$=T[w];break;case 9:case 10:this.$=[];break;case 11:y.getCommonDb().setDiagramTitle(T[w].substr(6)),this.$=T[w].substr(6);break;case 12:this.$=T[w].trim(),y.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=T[w].trim(),y.getCommonDb().setAccDescription(this.$);break;case 15:y.addSection(T[w].substr(8)),this.$=T[w].substr(8);break;case 18:y.addTask(T[w],0,""),this.$=T[w];break;case 19:y.addEvent(T[w].substr(2)),this.$=T[w];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},t(e,[2,5],{5:6}),t(e,[2,2]),t(e,[2,3]),t(e,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,10],{1:[2,1]}),t(e,[2,6]),{12:21,14:r,15:n,17:i,19:a,20:s,21:17,22:18,23:o,24:l},t(e,[2,8]),t(e,[2,9]),t(e,[2,11]),{16:[1,22]},{18:[1,23]},t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,7]),t(e,[2,12]),t(e,[2,13])],defaultActions:{},parseError:x(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:x(function(p){var g=this,m=[0],y=[],v=[null],T=[],b=this.table,w="",C=0,S=0,k=2,E=1,_=T.slice.call(arguments,1),M=Object.create(this.lexer),L={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(L.yy[P]=this.yy[P]);M.setInput(p,L.yy),L.yy.lexer=M,L.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var D=M.yylloc;T.push(D);var R=M.options&&M.options.ranges;typeof L.yy.parseError=="function"?this.parseError=L.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function I(Y){m.length=m.length-2*Y,v.length=v.length-Y,T.length=T.length-Y}x(I,"popStack");function $(){var Y;return Y=y.pop()||M.lex()||E,typeof Y!="number"&&(Y instanceof Array&&(y=Y,Y=y.pop()),Y=g.symbols_[Y]||Y),Y}x($,"lex");for(var O,N,F,z,V={},B,G,H,q;;){if(N=m[m.length-1],this.defaultActions[N]?F=this.defaultActions[N]:((O===null||typeof O>"u")&&(O=$()),F=b[N]&&b[N][O]),typeof F>"u"||!F.length||!F[0]){var Z="";q=[];for(B in b[N])this.terminals_[B]&&B>k&&q.push("'"+this.terminals_[B]+"'");M.showPosition?Z="Parse error on line "+(C+1)+`:
`+M.showPosition()+`
Expecting `+q.join(", ")+", got '"+(this.terminals_[O]||O)+"'":Z="Parse error on line "+(C+1)+": Unexpected "+(O==E?"end of input":"'"+(this.terminals_[O]||O)+"'"),this.parseError(Z,{text:M.match,token:this.terminals_[O]||O,line:M.yylineno,loc:D,expected:q})}if(F[0]instanceof Array&&F.length>1)throw new Error("Parse Error: multiple actions possible at state: "+N+", token: "+O);switch(F[0]){case 1:m.push(O),v.push(M.yytext),T.push(M.yylloc),m.push(F[1]),O=null,S=M.yyleng,w=M.yytext,C=M.yylineno,D=M.yylloc;break;case 2:if(G=this.productions_[F[1]][1],V.$=v[v.length-G],V._$={first_line:T[T.length-(G||1)].first_line,last_line:T[T.length-1].last_line,first_column:T[T.length-(G||1)].first_column,last_column:T[T.length-1].last_column},R&&(V._$.range=[T[T.length-(G||1)].range[0],T[T.length-1].range[1]]),z=this.performAction.apply(V,[w,S,C,L.yy,F[1],v,T].concat(_)),typeof z<"u")return z;G&&(m=m.slice(0,-1*G*2),v=v.slice(0,-1*G),T=T.slice(0,-1*G)),m.push(this.productions_[F[1]][0]),v.push(V.$),T.push(V._$),H=b[m[m.length-2]][m[m.length-1]],m.push(H);break;case 3:return!0}}return!0},"parse")},h=(function(){var f={EOF:1,parseError:x(function(g,m){if(this.yy.parser)this.yy.parser.parseError(g,m);else throw new Error(g)},"parseError"),setInput:x(function(p,g){return this.yy=g||this.yy||{},this._input=p,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var p=this._input[0];this.yytext+=p,this.yyleng++,this.offset++,this.match+=p,this.matched+=p;var g=p.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),p},"input"),unput:x(function(p){var g=p.length,m=p.split(/(?:\r\n?|\n)/g);this._input=p+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),m.length-1&&(this.yylineno-=m.length-1);var v=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:m?(m.length===y.length?this.yylloc.first_column:0)+y[y.length-m.length].length-m[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(p){this.unput(this.match.slice(p))},"less"),pastInput:x(function(){var p=this.matched.substr(0,this.matched.length-this.match.length);return(p.length>20?"...":"")+p.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var p=this.match;return p.length<20&&(p+=this._input.substr(0,20-p.length)),(p.substr(0,20)+(p.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var p=this.pastInput(),g=new Array(p.length+1).join("-");return p+this.upcomingInput()+`
`+g+"^"},"showPosition"),test_match:x(function(p,g){var m,y,v;if(this.options.backtrack_lexer&&(v={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(v.yylloc.range=this.yylloc.range.slice(0))),y=p[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+p[0].length},this.yytext+=p[0],this.match+=p[0],this.matches=p,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(p[0].length),this.matched+=p[0],m=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),m)return m;if(this._backtrack){for(var T in v)this[T]=v[T];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var p,g,m,y;this._more||(this.yytext="",this.match="");for(var v=this._currentRules(),T=0;T<v.length;T++)if(m=this._input.match(this.rules[v[T]]),m&&(!g||m[0].length>g[0].length)){if(g=m,y=T,this.options.backtrack_lexer){if(p=this.test_match(m,v[T]),p!==!1)return p;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(p=this.test_match(g,v[y]),p!==!1?p:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var g=this.next();return g||this.lex()},"lex"),begin:x(function(g){this.conditionStack.push(g)},"begin"),popState:x(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:x(function(g){this.begin(g)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(g,m,y,v){switch(y){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return f})();u.lexer=h;function d(){this.yy={}}return x(d,"Parser"),d.prototype=u,u.Parser=d,new d})();qB.parser=qB;var r7t=qB,c6e={};Z6(c6e,{addEvent:()=>b6e,addSection:()=>g6e,addTask:()=>v6e,addTaskOrg:()=>x6e,clear:()=>d6e,default:()=>n7t,getCommonDb:()=>h6e,getDirection:()=>p6e,getSections:()=>m6e,getTasks:()=>y6e,setDirection:()=>f6e});var ux="",u6e=0,OU="LR",$U=[],C6=[],hx=[],h6e=x(()=>Sz,"getCommonDb"),d6e=x(function(){$U.length=0,C6.length=0,ux="",hx.length=0,OU="LR",On()},"clear"),f6e=x(function(t){OU=t},"setDirection"),p6e=x(function(){return OU},"getDirection"),g6e=x(function(t){ux=t,$U.push(t)},"addSection"),m6e=x(function(){return $U},"getSections"),y6e=x(function(){let t=Die();const e=100;let r=0;for(;!t&&r<e;)t=Die(),r++;return C6.push(...hx),C6},"getTasks"),v6e=x(function(t,e,r){const n={id:u6e++,section:ux,type:ux,task:t,score:e||0,events:r?[r]:[]};hx.push(n)},"addTask"),b6e=x(function(t){hx.find(r=>r.id===u6e-1).events.push(t)},"addEvent"),x6e=x(function(t){const e={section:ux,type:ux,description:t,task:t,classes:[]};C6.push(e)},"addTaskOrg"),Die=x(function(){const t=x(function(r){return hx[r].processed},"compileTask");let e=!0;for(const[r,n]of hx.entries())t(r),e=e&&n.processed;return e},"compileTasks"),n7t={clear:d6e,getCommonDb:h6e,getDirection:p6e,setDirection:f6e,addSection:g6e,getSections:m6e,getTasks:y6e,addTask:v6e,addTaskOrg:x6e,addEvent:b6e},T6e=0,B7=x(function(t,e){const r=t.append("rect");return r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),r.attr("rx",e.rx),r.attr("ry",e.ry),e.class!==void 0&&r.attr("class",e.class),r},"drawRect"),i7t=x(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function a(l){const u=_b().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}x(a,"smile");function s(l){const u=_b().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}x(s,"sad");function o(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return x(o,"ambivalent"),e.score>3?a(i):e.score<3?s(i):o(i),n},"drawFace"),a7t=x(function(t,e){const r=t.append("circle");return r.attr("cx",e.cx),r.attr("cy",e.cy),r.attr("class","actor-"+e.pos),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("r",e.r),r.class!==void 0&&r.attr("class",r.class),e.title!==void 0&&r.append("title").text(e.title),r},"drawCircle"),w6e=x(function(t,e){const r=e.text.replace(/<br\s*\/?>/gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class!==void 0&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),s7t=x(function(t,e){function r(i,a,s,o,l){return i+","+a+" "+(i+s)+","+a+" "+(i+s)+","+(a+o-l)+" "+(i+s-l*1.2)+","+(a+o)+" "+i+","+(a+o)}x(r,"genPoints");const n=t.append("polygon");n.attr("points",r(e.x,e.y,50,20,7)),n.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,w6e(t,e)},"drawLabel"),o7t=x(function(t,e,r){const n=t.append("g"),i=PU();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=r.width,i.height=r.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,B7(n,i),C6e(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),UB=-1,l7t=x(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");UB++,a.append("line").attr("id",n+"-task"+UB).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),i7t(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=PU();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=r.width,o.height=r.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,B7(a,o),C6e(r)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},r,e.colour)},"drawTask"),c7t=x(function(t,e){B7(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),u7t=x(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),PU=x(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),C6e=(function(){function t(i,a,s,o,l,u,h,d){const f=a.append("text").attr("x",s+l/2).attr("y",o+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}x(t,"byText");function e(i,a,s,o,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(/<br\s*\/?>/gi);for(let y=0;y<m.length;y++){const v=y*p-p*(m.length-1)/2,T=a.append("text").attr("x",s+l/2).attr("y",o).attr("fill",f).style("text-anchor","middle").style("font-size",p).style("font-family",g);T.append("tspan").attr("x",s+l/2).attr("dy",v).text(m[y]),T.attr("y",o+u/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),n(T,h)}}x(e,"byTspan");function r(i,a,s,o,l,u,h,d){const f=a.append("switch"),g=f.append("foreignObject").attr("x",s).attr("y",o).attr("width",l).attr("height",u).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");g.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),e(i,f,s,o,l,u,h,d),n(g,h)}x(r,"byFo");function n(i,a){for(const s in a)s in a&&i.attr(s,a[s])}return x(n,"_setTextAttrs"),function(i){return i.textPlacement==="fo"?r:i.textPlacement==="old"?t:e}})(),h7t=x(function(t,e){T6e=0,UB=-1,t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function BU(t,e){t.each(function(){var r=ut(this),n=r.text().split(/(\s+|<br>)/).reverse(),i,a=[],s=1.1,o=r.attr("y"),l=parseFloat(r.attr("dy")),u=r.text(null).append("tspan").attr("x",0).attr("y",o).attr("dy",l+"em");for(let h=0;h<n.length;h++)i=n[n.length-1-h],a.push(i),u.text(a.join(" ").trim()),(u.node().getComputedTextLength()>e||i==="<br>")&&(a.pop(),u.text(a.join(" ").trim()),i==="<br>"?a=[""]:a=[i],u=r.append("tspan").attr("x",0).attr("y",o).attr("dy",s+"em").text(i))})}x(BU,"wrap");var d7t=x(function(t,e,r,n,i,a=!1){var v,T,b;const{theme:s,look:o}=n,l=s==null?void 0:s.includes("redux"),u=((v=n==null?void 0:n.themeVariables)==null?void 0:v.THEME_COLOR_LIMIT)??12,h=r%u-1,d=t.append("g");e.section=h,d.attr("class",(e.class?e.class+" ":"")+"timeline-node "+("section-"+h));const f=d.append("g"),p=d.append("g"),m=p.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(BU,e.width).node().getBBox(),y=(T=n.fontSize)!=null&&T.replace?n.fontSize.replace("px",""):n.fontSize;if(e.height=m.height+y*1.1*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,p.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),l&&p.attr("transform",`translate(${e.width/2}, ${a?e.padding/2+3:e.padding})`),p7t(f,e,h,i,n),o==="neo"&&(d.attr("data-look","neo"),l)){const w=s.includes("dark"),C=((b=t.node())==null?void 0:b.ownerSVGElement)??t.node(),S=ut(C),k=S.attr("id")??"",E=k?`${k}-drop-shadow`:"drop-shadow";if(S.select(`#${E}`).empty()){const _=S.select("defs");(_.empty()?S.append("defs"):_).append("filter").attr("id",E).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",w?"0.2":"0.06").attr("flood-color",w?"#FFFFFF":"#000000")}}return e},"drawNode"),f7t=x(function(t,e,r){var o;const n=t.append("g"),a=n.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(BU,e.width).node().getBBox(),s=(o=r.fontSize)!=null&&o.replace?r.fontSize.replace("px",""):r.fontSize;return n.remove(),a.height+s*1.1*.5+e.padding},"getVirtualNodeHeight"),p7t=x(function(t,e,r,n,i){const{theme:a}=i,s=a!=null&&a.includes("redux")?0:5,o=5,l=s>0?`M0 ${e.height-o} v${-e.height+2*o} q0,-${s},${s},-${s} h${e.width-2*o} q${s},0,${s},${s} v${e.height-o} H0 Z`:`M0 ${e.height-o} v${-(e.height-o)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",n+"-node-"+T6e++).attr("class","node-bkg node-"+e.type).attr("d",l),a!=null&&a.includes("redux")||t.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),mo={drawRect:B7,drawCircle:a7t,drawSection:o7t,drawText:w6e,drawLabel:s7t,drawTask:l7t,drawBackgroundRect:c7t,getTextObj:u7t,getNoteRect:PU,initGraphics:h7t,drawNode:d7t,getVirtualNodeHeight:f7t},g7t=x(function(t,e,r,n){var I,$,O;const i=Fe(),{look:a,theme:s,themeVariables:o}=i,{useGradient:l,gradientStart:u,gradientStop:h}=o,d=((I=i.timeline)==null?void 0:I.leftMargin)??50;le.debug("timeline",n.db);const f=i.securityLevel;let p;f==="sandbox"&&(p=ut("#i"+e));const m=ut(f==="sandbox"?p.nodes()[0].contentDocument.body:"body").select("#"+e);m.append("g");const y=n.db.getTasks(),v=n.db.getCommonDb().getDiagramTitle();le.debug("task",y),mo.initGraphics(m,e);const T=n.db.getSections();le.debug("sections",T);let b=0,w=0,C=0,S=0,k=50+d,E=50;S=50;let _=0,M=!0;T.forEach(function(N){const F={number:_,descr:N,section:_,width:150,padding:20,maxHeight:b},z=mo.getVirtualNodeHeight(m,F,i);le.debug("sectionHeight before draw",z),b=Math.max(b,z+20)});let L=0,P=0;le.debug("tasks.length",y.length);for(const[N,F]of y.entries()){const z={number:N,descr:F,section:F.section,width:150,padding:20,maxHeight:w},V=mo.getVirtualNodeHeight(m,z,i);le.debug("taskHeight before draw",V),w=Math.max(w,V+20),L=Math.max(L,F.events.length);let B=0;for(const G of F.events){const H={descr:G,section:F.section,number:F.section,width:150,padding:20,maxHeight:50};B+=mo.getVirtualNodeHeight(m,H,i)}F.events.length>0&&(B+=(F.events.length-1)*10),P=Math.max(P,B)}le.debug("maxSectionHeight before draw",b),le.debug("maxTaskHeight before draw",w),T&&T.length>0?T.forEach(N=>{const F=y.filter(G=>G.section===N),z={number:_,descr:N,section:_,width:200*Math.max(F.length,1)-50,padding:20,maxHeight:b};le.debug("sectionNode",z);const V=m.append("g"),B=mo.drawNode(V,z,_,i,e);le.debug("sectionNode output",B),V.attr("transform",`translate(${k}, ${S})`),E+=b+50,F.length>0&&Oie(m,F,_,k,E,w,i,L,P,b,!1,e),k+=200*Math.max(F.length,1),E=S,_++}):(M=!1,Oie(m,y,_,k,E,w,i,L,P,b,!0,e));const D=m.node().getBBox();if(le.debug("bounds",D),v&&m.append("text").text(v).attr("x",a==="neo"?D.x*2+d:D.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),C=M?b+w+150:w+100,m.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",C).attr("x2",D.width+3*d).attr("y2",C).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),a==="neo"&&l&&s!=="neutral"){const N=m.select("defs"),z=(N.empty()?m.append("defs"):N).append("linearGradient").attr("id",m.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");z.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1),z.append("stop").attr("offset","100%").attr("stop-color",h).attr("stop-opacity",1)}mx(void 0,m,(($=i.timeline)==null?void 0:$.padding)??50,((O=i.timeline)==null?void 0:O.useMaxWidth)??!1)},"draw"),Oie=x(function(t,e,r,n,i,a,s,o,l,u,h,d){var f;for(const p of e){const g={descr:p.task,section:r,number:r,width:150,padding:20,maxHeight:a};le.debug("taskNode",g);const m=t.append("g").attr("class","taskWrapper"),v=mo.drawNode(m,g,r,s,d).height;if(le.debug("taskHeight after draw",v),m.attr("transform",`translate(${n}, ${i})`),a=Math.max(a,v),p.events){const T=t.append("g").attr("class","lineWrapper");let b=a;i+=100,b=b+m7t(t,p.events,r,n,i,s,d),i-=100,T.append("line").attr("x1",n+190/2).attr("y1",i+a).attr("x2",n+190/2).attr("y2",i+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${d}-arrowhead)`).attr("stroke-dasharray","5,5")}n=n+200,h&&!((f=s.timeline)!=null&&f.disableMulticolor)&&r++}i=i-10},"drawTasks"),m7t=x(function(t,e,r,n,i,a,s){let o=0;const l=i;i=i+100;for(const u of e){const h={descr:u,section:r,number:r,width:150,padding:20,maxHeight:50};le.debug("eventNode",h);const d=t.append("g").attr("class","eventWrapper"),p=mo.drawNode(d,h,r,a,s,!0).height;o=o+p,d.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,o},"drawEvents"),y7t={setConf:x(()=>{},"setConf"),draw:g7t},F7=200,Yu=5,v7t=F7+Yu*2,FU=F7+100,b7t=FU+Yu*2,k6e=10,x7t=0,$ie=20,S6e=20,Pie=30,E6e=50,T7t=x(function(t,e,r,n){var I,$,O,N,F;const i=Fe(),a=((I=i.timeline)==null?void 0:I.leftMargin)??50;le.debug("timeline",n.db);const s=xs(e);s.append("g");const o=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();le.debug("task",o),mo.initGraphics(s);const u=n.db.getSections();le.debug("sections",u);let h=0,d=0;const f=50+a;let p=50;const g=p,m=f,y=v7t+S6e,v=b7t+E6e,T=m+y;let b=0;const w=u&&u.length>0,C=w?T:f+y,S=Math.max(50,y+v-Yu*2);u.forEach(function(z){const V={number:b,descr:z,section:b,width:S,padding:Yu,maxHeight:h},B=mo.getVirtualNodeHeight(s,V,i);le.debug("sectionHeight before draw",B),h=Math.max(h,B)});let k=0;le.debug("tasks.length",o.length);for(const[z,V]of o.entries()){const B={number:z,descr:V,section:V.section,width:F7,padding:Yu,maxHeight:d},G=mo.getVirtualNodeHeight(s,B,i);le.debug("taskHeight before draw",G),d=Math.max(d,G);let H=0;for(const q of V.events){const Z={descr:q,section:V.section,number:V.section,width:FU,padding:Yu,maxHeight:50};H+=mo.getVirtualNodeHeight(s,Z,i)}V.events.length>0&&(H+=(V.events.length-1)*k6e),k=Math.max(k,H)+x7t}le.debug("maxSectionHeight before draw",h),le.debug("maxTaskHeight before draw",d);const _=Math.max(d,k)+Pie;w?u.forEach(z=>{const V=o.filter(K=>K.section===z),B={number:b,descr:z,section:b,width:S,padding:Yu,maxHeight:h};le.debug("sectionNode",B);const G=s.append("g"),H=mo.drawNode(G,B,b,i);le.debug("sectionNode output",H);const q=C-y;G.attr("transform",`translate(${q}, ${p})`);const Z=p+H.height+$ie;V.length>0&&Bie(s,V,b,C,Z,d,i,_,!1);const Y=V.length,ie=H.height+$ie+_*Math.max(Y,1)-(Y>0?Pie*2:0);p+=ie,b++}):Bie(s,o,b,C,p,d,i,_,!0);let M=($=s.node())==null?void 0:$.getBBox();if(!M)throw new Error("bbox not found");if(le.debug("bounds",M),l){if(s.append("text").text(l).attr("x",M.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),M=(O=s.node())==null?void 0:O.getBBox(),!M)throw new Error("bbox not found");le.debug("bounds after title",M)}const[L]=Oh(i.fontSize),P=(L??16)*2,D=(L??16)*.5+20,R=s.append("g").attr("class","lineWrapper");R.append("line").attr("x1",C).attr("y1",g-P).attr("x2",C).attr("y2",M.y+M.height+D).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),R.lower(),mx(void 0,s,((N=i.timeline)==null?void 0:N.padding)??50,((F=i.timeline)==null?void 0:F.useMaxWidth)??!1)},"draw"),Bie=x(function(t,e,r,n,i,a,s,o,l){var u;for(const h of e){const d={descr:h.task,section:r,number:r,width:F7,padding:Yu,maxHeight:a};le.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=mo.drawNode(f,d,r,s),g=p.height;le.debug("taskHeight after draw",g);const m=n-S6e-p.width;if(f.attr("transform",`translate(${m}, ${i})`),a=Math.max(a,g),h.events&&h.events.length>0){const y=i,v=n+E6e;w7t(t,h.events,r,n,v,y,s)}i=i+o,l&&!((u=s.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),w7t=x(function(t,e,r,n,i,a,s){let o=a;for(const l of e){const u={descr:l,section:r,number:r,width:FU,padding:Yu,maxHeight:0};le.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=mo.drawNode(h,u,r,s).height;h.attr("transform",`translate(${i}, ${o})`);const p=t.append("g").attr("class","lineWrapper"),g=o+f/2;p.append("line").attr("x1",n).attr("y1",g).attr("x2",i).attr("y2",g).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),o=o+f+k6e}return o-a},"drawEvents"),C7t={setConf:x(()=>{},"setConf"),draw:T7t},k7t=x(t=>{var o;const{theme:e}=Xt(),r=e==null?void 0:e.includes("dark"),n=e==null?void 0:e.includes("color"),i=((o=t.svgId)==null?void 0:o.replace(/^#/,""))??"",a=i?`url(#${i}-drop-shadow)`:t.dropShadow??"none";let s="";for(let l=0;l<t.THEME_COLOR_LIMIT;l++){const u=`${17-3*l}`,h=n?t.borderColorArray[l]:t.mainBkg,d=n?t.borderColorArray[l]:t.nodeBorder;s+=`
.section-${l-1} rect,
.section-${l-1} path,
.section-${l-1} circle {
fill: ${r&&n?t.mainBkg:h};
stroke: ${d};
stroke-width: ${t.strokeWidth};
filter: ${a};
}
.section-${l-1} text {
fill: ${t.nodeBorder};
font-weight: ${t.fontWeight}
}
.node-icon-${l-1} {
font-size: 40px;
color: ${t["cScaleLabel"+l]};
}
.section-edge-${l-1} {
stroke: ${t["cScale"+l]};
}
.edge-depth-${l-1} {
stroke-width: ${u};
}
.section-${l-1} line {
stroke: ${t["cScaleInv"+l]};
stroke-width: 3;
}
.lineWrapper line {
stroke: ${t.nodeBorder};
stroke-width:${t.strokeWidth}
}
.disabled,
.disabled circle,
.disabled text {
fill: ${t.tertiaryColor??"lightgray"};
}
.disabled text {
fill: ${t.clusterBorder??"#efefef"};
}
`}return s},"genReduxSections"),S7t=x(t=>{let e="";for(let r=0;r<t.THEME_COLOR_LIMIT;r++)t["lineColor"+r]=t["lineColor"+r]||t["cScaleInv"+r],Zs(t["lineColor"+r])?t["lineColor"+r]=Je(t["lineColor"+r],20):t["lineColor"+r]=et(t["lineColor"+r],20);for(let r=0;r<t.THEME_COLOR_LIMIT;r++){const n=""+(17-3*r);e+=`
.section-${r-1} rect, .section-${r-1} path, .section-${r-1} circle, .section-${r-1} path {
fill: ${t["cScale"+r]};
}
.section-${r-1} text {
fill: ${t["cScaleLabel"+r]};
}
.node-icon-${r-1} {
font-size: 40px;
color: ${t["cScaleLabel"+r]};
}
.section-edge-${r-1}{
stroke: ${t["cScale"+r]};
}
.edge-depth-${r-1}{
stroke-width: ${n};
}
.section-${r-1} line {
stroke: ${t["cScaleInv"+r]} ;
stroke-width: 3;
}
.lineWrapper line{
stroke: ${t["cScaleLabel"+r]} ;
}
.disabled, .disabled circle, .disabled text {
fill: ${t.tertiaryColor??"lightgray"};
}
.disabled text {
fill: ${t.clusterBorder??"#efefef"};
}
`}return e},"genSections"),E7t=x(t=>{var s;const{theme:e}=Xt(),r=e==null?void 0:e.includes("redux"),n=e==="neutral",i=((s=t.svgId)==null?void 0:s.replace(/^#/,""))??"";let a="";if(t.useGradient&&i&&t.THEME_COLOR_LIMIT&&!n)for(let o=0;o<t.THEME_COLOR_LIMIT;o++)a+=`
.section-${o-1}[data-look="neo"] rect,
.section-${o-1}[data-look="neo"] path,
.section-${o-1}[data-look="neo"] circle {
fill: ${t.mainBkg};
stroke: url(#${i}-gradient);
stroke-width: 2;
}
.section-${o-1}[data-look="neo"] line {
stroke: url(#${i}-gradient);
stroke-width: 2;
}`;return`
.edge {
stroke-width: 3;
}
${r?k7t(t):S7t(t)}
${a}
.section-root rect, .section-root path, .section-root circle {
fill: ${t.git0};
}
.section-root text {
fill: ${t.gitBranchLabel0};
}
.icon-container {
height:100%;
display: flex;
justify-content: center;
align-items: center;
}
.edge {
fill: none;
}
.eventWrapper {
filter: brightness(120%);
}
`},"getStyles"),A7t=E7t,_7t={setConf:x(()=>{},"setConf"),draw:x((t,e,r,n)=>{var a,s;return(((s=(a=n==null?void 0:n.db)==null?void 0:a.getDirection)==null?void 0:s.call(a))??"LR")==="TD"?C7t.draw(t,e,r,n):y7t.draw(t,e,r,n)},"draw")},R7t={db:c6e,renderer:_7t,parser:r7t,styles:A7t};const L7t=Object.freeze(Object.defineProperty({__proto__:null,diagram:R7t},Symbol.toStringTag,{value:"Module"})),za=[];for(let t=0;t<256;++t)za.push((t+256).toString(16).slice(1));function M7t(t,e=0){return(za[t[e+0]]+za[t[e+1]]+za[t[e+2]]+za[t[e+3]]+"-"+za[t[e+4]]+za[t[e+5]]+"-"+za[t[e+6]]+za[t[e+7]]+"-"+za[t[e+8]]+za[t[e+9]]+"-"+za[t[e+10]]+za[t[e+11]]+za[t[e+12]]+za[t[e+13]]+za[t[e+14]]+za[t[e+15]]).toLowerCase()}const I7t=new Uint8Array(16);function N7t(){return crypto.getRandomValues(I7t)}function D7t(t,e,r){return crypto.randomUUID?crypto.randomUUID():O7t(t)}function O7t(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??N7t();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,M7t(n)}var YB=(function(){var t=x(function(w,C,S,k){for(S=S||{},k=w.length;k--;S[w[k]]=C);return S},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,6,13,15,16,19,22],g=[1,33],m=[1,34],y=[1,6,7,11,13,15,16,19,22],v={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:x(function(C,S,k,E,_,M,L){var P=M.length-1;switch(_){case 6:case 7:return E;case 8:E.getLogger().trace("Stop NL ");break;case 9:E.getLogger().trace("Stop EOF ");break;case 11:E.getLogger().trace("Stop NL2 ");break;case 12:E.getLogger().trace("Stop EOF2 ");break;case 15:E.getLogger().info("Node: ",M[P].id),E.addNode(M[P-1].length,M[P].id,M[P].descr,M[P].type);break;case 16:E.getLogger().trace("Icon: ",M[P]),E.decorateNode({icon:M[P]});break;case 17:case 21:E.decorateNode({class:M[P]});break;case 18:E.getLogger().trace("SPACELIST");break;case 19:E.getLogger().trace("Node: ",M[P].id),E.addNode(0,M[P].id,M[P].descr,M[P].type);break;case 20:E.decorateNode({icon:M[P]});break;case 25:E.getLogger().trace("node found ..",M[P-2]),this.$={id:M[P-1],descr:M[P-1],type:E.getType(M[P-2],M[P])};break;case 26:this.$={id:M[P],descr:M[P],type:E.nodeType.DEFAULT};break;case 27:E.getLogger().trace("node found ..",M[P-3]),this.$={id:M[P-3],descr:M[P-1],type:E.getType(M[P-2],M[P])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:r,9:22,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},{6:u,7:h,10:23,11:d},t(f,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:o}),t(f,[2,18]),t(f,[2,19]),t(f,[2,20]),t(f,[2,21]),t(f,[2,23]),t(f,[2,24]),t(f,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:h,10:32,11:d},{1:[2,7],6:r,12:21,13:n,14:14,15:i,16:a,17:17,18:18,19:s,22:o},t(p,[2,14],{7:g,11:m}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(f,[2,15]),t(f,[2,16]),t(f,[2,17]),{20:[1,35]},{21:[1,36]},t(p,[2,13],{7:g,11:m}),t(y,[2,11]),t(y,[2,12]),{21:[1,37]},t(f,[2,25]),t(f,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(C,S){if(S.recoverable)this.trace(C);else{var k=new Error(C);throw k.hash=S,k}},"parseError"),parse:x(function(C){var S=this,k=[0],E=[],_=[null],M=[],L=this.table,P="",D=0,R=0,I=2,$=1,O=M.slice.call(arguments,1),N=Object.create(this.lexer),F={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(F.yy[z]=this.yy[z]);N.setInput(C,F.yy),F.yy.lexer=N,F.yy.parser=this,typeof N.yylloc>"u"&&(N.yylloc={});var V=N.yylloc;M.push(V);var B=N.options&&N.options.ranges;typeof F.yy.parseError=="function"?this.parseError=F.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function G(Re){k.length=k.length-2*Re,_.length=_.length-Re,M.length=M.length-Re}x(G,"popStack");function H(){var Re;return Re=E.pop()||N.lex()||$,typeof Re!="number"&&(Re instanceof Array&&(E=Re,Re=E.pop()),Re=S.symbols_[Re]||Re),Re}x(H,"lex");for(var q,Z,Y,ie,K={},Q,te,J,ge;;){if(Z=k[k.length-1],this.defaultActions[Z]?Y=this.defaultActions[Z]:((q===null||typeof q>"u")&&(q=H()),Y=L[Z]&&L[Z][q]),typeof Y>"u"||!Y.length||!Y[0]){var ee="";ge=[];for(Q in L[Z])this.terminals_[Q]&&Q>I&&ge.push("'"+this.terminals_[Q]+"'");N.showPosition?ee="Parse error on line "+(D+1)+`:
`+N.showPosition()+`
Expecting `+ge.join(", ")+", got '"+(this.terminals_[q]||q)+"'":ee="Parse error on line "+(D+1)+": Unexpected "+(q==$?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(ee,{text:N.match,token:this.terminals_[q]||q,line:N.yylineno,loc:V,expected:ge})}if(Y[0]instanceof Array&&Y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+q);switch(Y[0]){case 1:k.push(q),_.push(N.yytext),M.push(N.yylloc),k.push(Y[1]),q=null,R=N.yyleng,P=N.yytext,D=N.yylineno,V=N.yylloc;break;case 2:if(te=this.productions_[Y[1]][1],K.$=_[_.length-te],K._$={first_line:M[M.length-(te||1)].first_line,last_line:M[M.length-1].last_line,first_column:M[M.length-(te||1)].first_column,last_column:M[M.length-1].last_column},B&&(K._$.range=[M[M.length-(te||1)].range[0],M[M.length-1].range[1]]),ie=this.performAction.apply(K,[P,R,D,F.yy,Y[1],_,M].concat(O)),typeof ie<"u")return ie;te&&(k=k.slice(0,-1*te*2),_=_.slice(0,-1*te),M=M.slice(0,-1*te)),k.push(this.productions_[Y[1]][0]),_.push(K.$),M.push(K._$),J=L[k[k.length-2]][k[k.length-1]],k.push(J);break;case 3:return!0}}return!0},"parse")},T=(function(){var w={EOF:1,parseError:x(function(S,k){if(this.yy.parser)this.yy.parser.parseError(S,k);else throw new Error(S)},"parseError"),setInput:x(function(C,S){return this.yy=S||this.yy||{},this._input=C,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var C=this._input[0];this.yytext+=C,this.yyleng++,this.offset++,this.match+=C,this.matched+=C;var S=C.match(/(?:\r\n?|\n).*/g);return S?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),C},"input"),unput:x(function(C){var S=C.length,k=C.split(/(?:\r\n?|\n)/g);this._input=C+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-S),this.offset-=S;var E=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),k.length-1&&(this.yylineno-=k.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:k?(k.length===E.length?this.yylloc.first_column:0)+E[E.length-k.length].length-k[0].length:this.yylloc.first_column-S},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-S]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(C){this.unput(this.match.slice(C))},"less"),pastInput:x(function(){var C=this.matched.substr(0,this.matched.length-this.match.length);return(C.length>20?"...":"")+C.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var C=this.match;return C.length<20&&(C+=this._input.substr(0,20-C.length)),(C.substr(0,20)+(C.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var C=this.pastInput(),S=new Array(C.length+1).join("-");return C+this.upcomingInput()+`
`+S+"^"},"showPosition"),test_match:x(function(C,S){var k,E,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),E=C[0].match(/(?:\r\n?|\n).*/g),E&&(this.yylineno+=E.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:E?E[E.length-1].length-E[E.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+C[0].length},this.yytext+=C[0],this.match+=C[0],this.matches=C,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(C[0].length),this.matched+=C[0],k=this.performAction.call(this,this.yy,this,S,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),k)return k;if(this._backtrack){for(var M in _)this[M]=_[M];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var C,S,k,E;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),M=0;M<_.length;M++)if(k=this._input.match(this.rules[_[M]]),k&&(!S||k[0].length>S[0].length)){if(S=k,E=M,this.options.backtrack_lexer){if(C=this.test_match(k,_[M]),C!==!1)return C;if(this._backtrack){S=!1;continue}else return!1}else if(!this.options.flex)break}return S?(C=this.test_match(S,_[E]),C!==!1?C:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var S=this.next();return S||this.lex()},"lex"),begin:x(function(S){this.conditionStack.push(S)},"begin"),popState:x(function(){var S=this.conditionStack.length-1;return S>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(S){return S=this.conditionStack.length-1-Math.abs(S||0),S>=0?this.conditionStack[S]:"INITIAL"},"topState"),pushState:x(function(S){this.begin(S)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(S,k,E,_){switch(E){case 0:return S.getLogger().trace("Found comment",k.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:S.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return S.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:S.getLogger().trace("end icon"),this.popState();break;case 10:return S.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return S.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return S.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return S.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:S.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return S.getLogger().trace("description:",k.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),S.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),S.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),S.getLogger().trace("node end ...",k.yytext),"NODE_DEND";case 30:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),S.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),S.getLogger().trace("node end (("),"NODE_DEND";case 35:return S.getLogger().trace("Long description:",k.yytext),20;case 36:return S.getLogger().trace("Long description:",k.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return w})();v.lexer=T;function b(){this.yy={}}return x(b,"Parser"),b.prototype=v,v.Parser=b,new b})();YB.parser=YB;var $7t=YB,P7t=12,Du={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},ib,B7t=(ib=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=Du,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let r=this.nodes.length-1;r>=0;r--)if(this.nodes[r].level<e)return this.nodes[r];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(e,r,n,i){var h,d;le.info("addNode",e,r,n,i);let a=!1;this.nodes.length===0?(this.baseLevel=e,e=0,a=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,a=!1);const s=Fe();let o=((h=s.mindmap)==null?void 0:h.padding)??Vr.mindmap.padding;switch(i){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:o*=2;break}const l={id:this.count++,nodeId:Wr(r,s),level:e,descr:Wr(n,s),type:i,children:[],width:((d=s.mindmap)==null?void 0:d.maxNodeWidth)??Vr.mindmap.maxNodeWidth,padding:o,isRoot:a},u=this.getParent(e);if(u)u.children.push(l),this.nodes.push(l);else if(a)this.nodes.push(l);else throw new Error(`There can be only one root. No parent could be found for ("${l.descr}")`)}getType(e,r){switch(le.debug("In get type",e,r),e){case"[":return this.nodeType.RECT;case"(":return r===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const r=Fe(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=Wr(e.icon,r)),e.class&&(n.class=Wr(e.class,r))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,r){if(e.level===0?e.section=void 0:e.section=r,e.children)for(const[n,i]of e.children.entries()){const a=e.level===0?n%(P7t-1):r;this.assignSections(i,a)}}flattenNodes(e,r){const n=Fe(),i=["mindmap-node"];e.isRoot===!0?i.push("section-root","section--1"):e.section!==void 0&&i.push(`section-${e.section}`),e.class&&i.push(e.class);const a=i.join(" "),s=x(l=>{var d;const h=(((d=n.theme)==null?void 0:d.toLowerCase())??"").includes("redux");switch(l){case Du.CIRCLE:return"mindmapCircle";case Du.RECT:return"rect";case Du.ROUNDED_RECT:return"rounded";case Du.CLOUD:return"cloud";case Du.BANG:return"bang";case Du.HEXAGON:return"hexagon";case Du.DEFAULT:return h?"rounded":"defaultMindmapNode";case Du.NO_BORDER:default:return"rect"}},"getShapeFromType"),o={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:s(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:a,cssStyles:[],look:n.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(r.push(o),e.children)for(const l of e.children)this.flattenNodes(l,r)}generateEdges(e,r){if(!e.children)return;const n=Fe();for(const i of e.children){let a="edge";i.section!==void 0&&(a+=` section-edge-${i.section}`);const s=e.level+1;a+=` edge-depth-${s}`;const o={id:`edge_${e.id}_${i.id}`,start:e.id.toString(),end:i.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:n.look,classes:a,depth:e.level,section:i.section};r.push(o),this.generateEdges(i,r)}}getData(){const e=this.getMindmap(),r=Fe(),i=Zle().layout!==void 0,a=r;if(i||(a.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:a};le.debug("getData: mindmapRoot",e,r),this.assignSections(e);const s=[],o=[];this.flattenNodes(e,s),this.generateEdges(e,o),le.debug(`getData: processed ${s.length} nodes and ${o.length} edges`);const l=new Map;for(const u of s)l.set(u.id,{shape:u.shape,width:u.width,height:u.height,padding:u.padding});return{nodes:s,edges:o,config:a,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(l),type:"mindmap",diagramId:"mindmap-"+D7t()}}getLogger(){return le}},x(ib,"MindmapDB"),ib),F7t=x(async(t,e,r,n)=>{var f,p;le.debug(`Rendering mindmap diagram
`+t);const i=n.db,a=i.getData(),s=Ox(e,a.config.securityLevel);if(a.type=n.type,a.layoutAlgorithm=nS(a.config.layout,{fallback:"cose-bilkent"}),a.diagramId=e,!i.getMindmap())return;a.nodes.forEach(g=>{g.shape==="rounded"?(g.radius=15,g.taper=15,g.stroke="none",g.width=0,g.padding=15):g.shape==="circle"?g.padding=10:g.shape==="rect"?(g.width=0,g.padding=10):g.shape==="hexagon"&&(g.width=0,g.height=0)}),await xx(a,s);const{themeVariables:l}=Xt(),{useGradient:u,gradientStart:h,gradientStop:d}=l;if(u&&h&&d){const g=s.attr("id"),m=s.append("defs").append("linearGradient").attr("id",`${g}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");m.append("stop").attr("offset","0%").attr("stop-color",h).attr("stop-opacity",1),m.append("stop").attr("offset","100%").attr("stop-color",d).attr("stop-opacity",1)}mg(s,((f=a.config.mindmap)==null?void 0:f.padding)??Vr.mindmap.padding,"mindmapDiagram",((p=a.config.mindmap)==null?void 0:p.useMaxWidth)??Vr.mindmap.useMaxWidth)},"draw"),z7t={draw:F7t},V7t=x(t=>{const{theme:e,look:r}=t;let n="";for(let i=0;i<t.THEME_COLOR_LIMIT;i++)t["lineColor"+i]=t["lineColor"+i]||t["cScaleInv"+i],Zs(t["lineColor"+i])?t["lineColor"+i]=Je(t["lineColor"+i],20):t["lineColor"+i]=et(t["lineColor"+i],20);for(let i=0;i<t.THEME_COLOR_LIMIT;i++){const a=""+(r==="neo"?Math.max(10-(i-1)*2,2):17-3*i);n+=`
.section-${i-1} rect, .section-${i-1} path, .section-${i-1} circle, .section-${i-1} polygon, .section-${i-1} path {
fill: ${t["cScale"+i]};
}
.section-${i-1} text {
fill: ${t["cScaleLabel"+i]};
}
.section-${i-1} span {
color: ${t["cScaleLabel"+i]};
}
.node-icon-${i-1} {
font-size: 40px;
color: ${t["cScaleLabel"+i]};
}
.section-edge-${i-1}{
stroke: ${t["cScale"+i]};
}
.edge-depth-${i-1}{
stroke-width: ${a};
}
.section-${i-1} line {
stroke: ${t["cScaleInv"+i]} ;
stroke-width: 3;
}
.disabled, .disabled circle, .disabled text {
fill: lightgray;
}
.disabled text {
fill: #efefef;
}
[data-look="neo"].mindmap-node.section-${i-1} rect, [data-look="neo"].mindmap-node.section-${i-1} path, [data-look="neo"].mindmap-node.section-${i-1} circle, [data-look="neo"].mindmap-node.section-${i-1} polygon {
fill: ${e==="redux"||e==="redux-dark"||e==="neutral"?t.mainBkg:t["cScale"+i]};
stroke: ${e==="redux"||e==="redux-dark"?t.nodeBorder:t["cScale"+i]};
stroke-width: ${t.strokeWidth??2}px;
}
[data-look="neo"].section-edge-${i-1}{
stroke: ${e!=null&&e.includes("redux")||e==="neo-dark"?t.nodeBorder:t["cScale"+i]};
}
[data-look="neo"].mindmap-node.section-${i-1} text {
fill: ${e==="redux"||e==="redux-dark"?t.nodeBorder:t["cScaleLabel"+(e==="neutral"?1:i)]};
}
`}return n},"genSections"),G7t=x((t,e,r)=>{let n="";for(let i=0;i<t;i++)n+=`
[data-look="neo"].mindmap-node.section-${i-1} rect, [data-look="neo"].mindmap-node.section-${i-1} path, [data-look="neo"].mindmap-node.section-${i-1} circle, [data-look="neo"].mindmap-node.section-${i-1} polygon {
stroke: url(${e}-gradient);
fill: ${r};
}
.section-${i-1} line {
stroke-width: 0;
}`;return n},"genGradient"),W7t=x(t=>{const{theme:e}=t,r=t.svgId,n=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none";return`
.edge {
stroke-width: 3;
}
${V7t(t)}
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
fill: ${t.git0};
}
.section-root text {
fill: ${t.gitBranchLabel0};
}
.section-root span {
color: ${e!=null&&e.includes("redux")?t.nodeBorder:t.gitBranchLabel0};
}
.icon-container {
height:100%;
display: flex;
justify-content: center;
align-items: center;
}
.edge {
fill: none;
}
.mindmap-node-label {
dy: 1em;
alignment-baseline: middle;
text-anchor: middle;
dominant-baseline: middle;
text-align: center;
}
[data-look="neo"].mindmap-node {
filter: ${n};
}
[data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon {
fill: ${e!=null&&e.includes("redux")?t.mainBkg:t.git0};
}
[data-look="neo"].mindmap-node.section-root .text-inner-tspan {
fill: ${e!=null&&e.includes("redux")?t.nodeBorder:t["cScaleLabel"+(e==="neutral"?1:0)]};
}
${t.useGradient&&r&&t.mainBkg?G7t(t.THEME_COLOR_LIMIT,r,t.mainBkg):""}
`},"getStyles"),H7t=W7t,q7t={get db(){return new B7t},renderer:z7t,parser:$7t,styles:H7t};const U7t=Object.freeze(Object.defineProperty({__proto__:null,diagram:q7t},Symbol.toStringTag,{value:"Module"}));var XB=(function(){var t=x(function(k,E,_,M){for(_=_||{},M=k.length;M--;_[k[M]]=E);return _},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],d=[1,25],f=[6,7,11],p=[1,31],g=[6,7,11,24],m=[1,6,13,16,17,20,23],y=[1,35],v=[1,36],T=[1,6,7,11,13,16,17,20,23],b=[1,38],w={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:x(function(E,_,M,L,P,D,R){var I=D.length-1;switch(P){case 6:case 7:return L;case 8:L.getLogger().trace("Stop NL ");break;case 9:L.getLogger().trace("Stop EOF ");break;case 11:L.getLogger().trace("Stop NL2 ");break;case 12:L.getLogger().trace("Stop EOF2 ");break;case 15:L.getLogger().info("Node: ",D[I-1].id),L.addNode(D[I-2].length,D[I-1].id,D[I-1].descr,D[I-1].type,D[I]);break;case 16:L.getLogger().info("Node: ",D[I].id),L.addNode(D[I-1].length,D[I].id,D[I].descr,D[I].type);break;case 17:L.getLogger().trace("Icon: ",D[I]),L.decorateNode({icon:D[I]});break;case 18:case 23:L.decorateNode({class:D[I]});break;case 19:L.getLogger().trace("SPACELIST");break;case 20:L.getLogger().trace("Node: ",D[I-1].id),L.addNode(0,D[I-1].id,D[I-1].descr,D[I-1].type,D[I]);break;case 21:L.getLogger().trace("Node: ",D[I].id),L.addNode(0,D[I].id,D[I].descr,D[I].type);break;case 22:L.decorateNode({icon:D[I]});break;case 27:L.getLogger().trace("node found ..",D[I-2]),this.$={id:D[I-1],descr:D[I-1],type:L.getType(D[I-2],D[I])};break;case 28:this.$={id:D[I],descr:D[I],type:0};break;case 29:L.getLogger().trace("node found ..",D[I-3]),this.$={id:D[I-3],descr:D[I-1],type:L.getType(D[I-2],D[I])};break;case 30:this.$=D[I-1]+D[I];break;case 31:this.$=D[I];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:r,9:22,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},{6:u,7:h,10:23,11:d},t(f,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:s,23:o}),t(f,[2,19]),t(f,[2,21],{15:30,24:p}),t(f,[2,22]),t(f,[2,23]),t(g,[2,25]),t(g,[2,26]),t(g,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:h,10:34,11:d},{1:[2,7],6:r,12:21,13:n,14:14,16:i,17:a,18:17,19:18,20:s,23:o},t(m,[2,14],{7:y,11:v}),t(T,[2,8]),t(T,[2,9]),t(T,[2,10]),t(f,[2,16],{15:37,24:p}),t(f,[2,17]),t(f,[2,18]),t(f,[2,20],{24:b}),t(g,[2,31]),{21:[1,39]},{22:[1,40]},t(m,[2,13],{7:y,11:v}),t(T,[2,11]),t(T,[2,12]),t(f,[2,15],{24:b}),t(g,[2,30]),{22:[1,41]},t(g,[2,27]),t(g,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(E,_){if(_.recoverable)this.trace(E);else{var M=new Error(E);throw M.hash=_,M}},"parseError"),parse:x(function(E){var _=this,M=[0],L=[],P=[null],D=[],R=this.table,I="",$=0,O=0,N=2,F=1,z=D.slice.call(arguments,1),V=Object.create(this.lexer),B={yy:{}};for(var G in this.yy)Object.prototype.hasOwnProperty.call(this.yy,G)&&(B.yy[G]=this.yy[G]);V.setInput(E,B.yy),B.yy.lexer=V,B.yy.parser=this,typeof V.yylloc>"u"&&(V.yylloc={});var H=V.yylloc;D.push(H);var q=V.options&&V.options.ranges;typeof B.yy.parseError=="function"?this.parseError=B.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Z(ce){M.length=M.length-2*ce,P.length=P.length-ce,D.length=D.length-ce}x(Z,"popStack");function Y(){var ce;return ce=L.pop()||V.lex()||F,typeof ce!="number"&&(ce instanceof Array&&(L=ce,ce=L.pop()),ce=_.symbols_[ce]||ce),ce}x(Y,"lex");for(var ie,K,Q,te,J={},ge,ee,Re,Ie;;){if(K=M[M.length-1],this.defaultActions[K]?Q=this.defaultActions[K]:((ie===null||typeof ie>"u")&&(ie=Y()),Q=R[K]&&R[K][ie]),typeof Q>"u"||!Q.length||!Q[0]){var Be="";Ie=[];for(ge in R[K])this.terminals_[ge]&&ge>N&&Ie.push("'"+this.terminals_[ge]+"'");V.showPosition?Be="Parse error on line "+($+1)+`:
`+V.showPosition()+`
Expecting `+Ie.join(", ")+", got '"+(this.terminals_[ie]||ie)+"'":Be="Parse error on line "+($+1)+": Unexpected "+(ie==F?"end of input":"'"+(this.terminals_[ie]||ie)+"'"),this.parseError(Be,{text:V.match,token:this.terminals_[ie]||ie,line:V.yylineno,loc:H,expected:Ie})}if(Q[0]instanceof Array&&Q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+K+", token: "+ie);switch(Q[0]){case 1:M.push(ie),P.push(V.yytext),D.push(V.yylloc),M.push(Q[1]),ie=null,O=V.yyleng,I=V.yytext,$=V.yylineno,H=V.yylloc;break;case 2:if(ee=this.productions_[Q[1]][1],J.$=P[P.length-ee],J._$={first_line:D[D.length-(ee||1)].first_line,last_line:D[D.length-1].last_line,first_column:D[D.length-(ee||1)].first_column,last_column:D[D.length-1].last_column},q&&(J._$.range=[D[D.length-(ee||1)].range[0],D[D.length-1].range[1]]),te=this.performAction.apply(J,[I,O,$,B.yy,Q[1],P,D].concat(z)),typeof te<"u")return te;ee&&(M=M.slice(0,-1*ee*2),P=P.slice(0,-1*ee),D=D.slice(0,-1*ee)),M.push(this.productions_[Q[1]][0]),P.push(J.$),D.push(J._$),Re=R[M[M.length-2]][M[M.length-1]],M.push(Re);break;case 3:return!0}}return!0},"parse")},C=(function(){var k={EOF:1,parseError:x(function(_,M){if(this.yy.parser)this.yy.parser.parseError(_,M);else throw new Error(_)},"parseError"),setInput:x(function(E,_){return this.yy=_||this.yy||{},this._input=E,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var E=this._input[0];this.yytext+=E,this.yyleng++,this.offset++,this.match+=E,this.matched+=E;var _=E.match(/(?:\r\n?|\n).*/g);return _?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),E},"input"),unput:x(function(E){var _=E.length,M=E.split(/(?:\r\n?|\n)/g);this._input=E+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-_),this.offset-=_;var L=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),M.length-1&&(this.yylineno-=M.length-1);var P=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:M?(M.length===L.length?this.yylloc.first_column:0)+L[L.length-M.length].length-M[0].length:this.yylloc.first_column-_},this.options.ranges&&(this.yylloc.range=[P[0],P[0]+this.yyleng-_]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(E){this.unput(this.match.slice(E))},"less"),pastInput:x(function(){var E=this.matched.substr(0,this.matched.length-this.match.length);return(E.length>20?"...":"")+E.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var E=this.match;return E.length<20&&(E+=this._input.substr(0,20-E.length)),(E.substr(0,20)+(E.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var E=this.pastInput(),_=new Array(E.length+1).join("-");return E+this.upcomingInput()+`
`+_+"^"},"showPosition"),test_match:x(function(E,_){var M,L,P;if(this.options.backtrack_lexer&&(P={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(P.yylloc.range=this.yylloc.range.slice(0))),L=E[0].match(/(?:\r\n?|\n).*/g),L&&(this.yylineno+=L.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:L?L[L.length-1].length-L[L.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+E[0].length},this.yytext+=E[0],this.match+=E[0],this.matches=E,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(E[0].length),this.matched+=E[0],M=this.performAction.call(this,this.yy,this,_,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),M)return M;if(this._backtrack){for(var D in P)this[D]=P[D];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var E,_,M,L;this._more||(this.yytext="",this.match="");for(var P=this._currentRules(),D=0;D<P.length;D++)if(M=this._input.match(this.rules[P[D]]),M&&(!_||M[0].length>_[0].length)){if(_=M,L=D,this.options.backtrack_lexer){if(E=this.test_match(M,P[D]),E!==!1)return E;if(this._backtrack){_=!1;continue}else return!1}else if(!this.options.flex)break}return _?(E=this.test_match(_,P[L]),E!==!1?E:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var _=this.next();return _||this.lex()},"lex"),begin:x(function(_){this.conditionStack.push(_)},"begin"),popState:x(function(){var _=this.conditionStack.length-1;return _>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(_){return _=this.conditionStack.length-1-Math.abs(_||0),_>=0?this.conditionStack[_]:"INITIAL"},"topState"),pushState:x(function(_){this.begin(_)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(_,M,L,P){switch(L){case 0:return this.pushState("shapeData"),M.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const D=/\n\s*/g;return M.yytext=M.yytext.replace(D,"<br/>"),24;case 4:return 24;case 5:this.popState();break;case 6:return _.getLogger().trace("Found comment",M.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:_.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return _.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:_.getLogger().trace("end icon"),this.popState();break;case 16:return _.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return _.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return _.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return _.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:_.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return _.getLogger().trace("description:",M.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),_.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),_.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),_.getLogger().trace("node end ...",M.yytext),"NODE_DEND";case 36:return this.popState(),_.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),_.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),_.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),_.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),_.getLogger().trace("node end (("),"NODE_DEND";case 41:return _.getLogger().trace("Long description:",M.yytext),21;case 42:return _.getLogger().trace("Long description:",M.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return k})();w.lexer=C;function S(){this.yy={}}return x(S,"Parser"),S.prototype=w,w.Parser=S,new S})();XB.parser=XB;var Y7t=XB,sl=[],zU=[],jB=0,VU={},X7t=x(()=>{sl=[],zU=[],jB=0,VU={}},"clear"),j7t=x(t=>{if(sl.length===0)return null;const e=sl[0].level;let r=null;for(let n=sl.length-1;n>=0;n--)if(sl[n].level===e&&!r&&(r=sl[n]),sl[n].level<e)throw new Error('Items without section detected, found section ("'+sl[n].label+'")');return t===(r==null?void 0:r.level)?null:r},"getSection"),A6e=x(function(){return zU},"getSections"),K7t=x(function(){const t=[],e=[],r=A6e(),n=Fe();for(const i of r){const a={id:i.id,label:Wr(i.label??"",n),labelType:"markdown",isGroup:!0,ticket:i.ticket,shape:"kanbanSection",level:i.level,look:n.look};e.push(a);const s=sl.filter(o=>o.parentId===i.id);for(const o of s){const l={id:o.id,parentId:i.id,label:Wr(o.label??"",n),labelType:"markdown",isGroup:!1,ticket:o==null?void 0:o.ticket,priority:o==null?void 0:o.priority,assigned:o==null?void 0:o.assigned,icon:o==null?void 0:o.icon,shape:"kanbanItem",level:o.level,rx:5,ry:5,cssStyles:["text-align: left"]};e.push(l)}}return{nodes:e,edges:t,other:{},config:Fe()}},"getData"),Z7t=x((t,e,r,n,i)=>{var u,h;const a=Fe();let s=((u=a.mindmap)==null?void 0:u.padding)??Vr.mindmap.padding;switch(n){case ia.ROUNDED_RECT:case ia.RECT:case ia.HEXAGON:s*=2}const o={id:Wr(e,a)||"kbn"+jB++,level:t,label:Wr(r,a),width:((h=a.mindmap)==null?void 0:h.maxNodeWidth)??Vr.mindmap.maxNodeWidth,padding:s,isGroup:!1};if(i!==void 0){let d;i.includes(`
`)?d=i+`
`:d=`{
`+i+`
}`;const f=dR(d,{schema:hR});if(f.shape&&(f.shape!==f.shape.toLowerCase()||f.shape.includes("_")))throw new Error(`No such shape: ${f.shape}. Shape names should be lowercase.`);f!=null&&f.shape&&f.shape==="kanbanItem"&&(o.shape=f==null?void 0:f.shape),f!=null&&f.label&&(o.label=f==null?void 0:f.label),f!=null&&f.icon&&(o.icon=f==null?void 0:f.icon.toString()),f!=null&&f.assigned&&(o.assigned=f==null?void 0:f.assigned.toString()),f!=null&&f.ticket&&(o.ticket=f==null?void 0:f.ticket.toString()),f!=null&&f.priority&&(o.priority=f==null?void 0:f.priority)}const l=j7t(t);l?o.parentId=l.id||"kbn"+jB++:zU.push(o),sl.push(o)},"addNode"),ia={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Q7t=x((t,e)=>{switch(le.debug("In get type",t,e),t){case"[":return ia.RECT;case"(":return e===")"?ia.ROUNDED_RECT:ia.CLOUD;case"((":return ia.CIRCLE;case")":return ia.CLOUD;case"))":return ia.BANG;case"{{":return ia.HEXAGON;default:return ia.DEFAULT}},"getType"),J7t=x((t,e)=>{VU[t]=e},"setElementForId"),eMt=x(t=>{if(!t)return;const e=Fe(),r=sl[sl.length-1];t.icon&&(r.icon=Wr(t.icon,e)),t.class&&(r.cssClasses=Wr(t.class,e))},"decorateNode"),tMt=x(t=>{switch(t){case ia.DEFAULT:return"no-border";case ia.RECT:return"rect";case ia.ROUNDED_RECT:return"rounded-rect";case ia.CIRCLE:return"circle";case ia.CLOUD:return"cloud";case ia.BANG:return"bang";case ia.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),rMt=x(()=>le,"getLogger"),nMt=x(t=>VU[t],"getElementById"),iMt={clear:X7t,addNode:Z7t,getSections:A6e,getData:K7t,nodeType:ia,getType:Q7t,setElementForId:J7t,decorateNode:eMt,type2Str:tMt,getLogger:rMt,getElementById:nMt},aMt=iMt,sMt=x(async(t,e,r,n)=>{var y,v,T,b,w;le.debug(`Rendering kanban diagram
`+t);const a=n.db.getData(),s=Fe();s.htmlLabels=!1;const o=xs(e);for(const C of a.nodes)C.domId=`${e}-${C.id}`;const l=o.append("g");l.attr("class","sections");const u=o.append("g");u.attr("class","items");const h=a.nodes.filter(C=>C.isGroup);let d=0;const f=10,p=[];let g=25;for(const C of h){const S=((y=s==null?void 0:s.kanban)==null?void 0:y.sectionWidth)||200;d=d+1,C.x=S*d+(d-1)*f/2,C.width=S,C.y=0,C.height=S*3,C.rx=5,C.ry=5,C.cssClasses=C.cssClasses+" section-"+d;const k=await xR(l,C);g=Math.max(g,(v=k==null?void 0:k.labelBBox)==null?void 0:v.height),p.push(k)}let m=0;for(const C of h){const S=p[m];m=m+1;const k=((T=s==null?void 0:s.kanban)==null?void 0:T.sectionWidth)||200,E=-k*3/2+g;let _=E;const M=a.nodes.filter(D=>D.parentId===C.id);for(const D of M){if(D.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");D.x=C.x,D.width=k-1.5*f;const I=(await rS(u,D,{config:s})).node().getBBox();D.y=_+I.height/2,await FA(D),_=D.y+I.height/2+f/2}const L=S.cluster.select("rect"),P=Math.max(_-E+3*f,50)+(g-25);L.attr("height",P)}mx(void 0,o,((b=s.mindmap)==null?void 0:b.padding)??Vr.kanban.padding,((w=s.mindmap)==null?void 0:w.useMaxWidth)??Vr.kanban.useMaxWidth)},"draw"),oMt={draw:sMt},lMt=x(t=>{let e="";for(let n=0;n<t.THEME_COLOR_LIMIT;n++)t["lineColor"+n]=t["lineColor"+n]||t["cScaleInv"+n],Zs(t["lineColor"+n])?t["lineColor"+n]=Je(t["lineColor"+n],20):t["lineColor"+n]=et(t["lineColor"+n],20);const r=x((n,i)=>t.darkMode?et(n,i):Je(n,i),"adjuster");for(let n=0;n<t.THEME_COLOR_LIMIT;n++){const i=""+(17-3*n);e+=`
.section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} polygon, .section-${n-1} path {
fill: ${r(t["cScale"+n],10)};
stroke: ${r(t["cScale"+n],10)};
}
.section-${n-1} text {
fill: ${t["cScaleLabel"+n]};
}
.node-icon-${n-1} {
font-size: 40px;
color: ${t["cScaleLabel"+n]};
}
.section-edge-${n-1}{
stroke: ${t["cScale"+n]};
}
.edge-depth-${n-1}{
stroke-width: ${i};
}
.section-${n-1} line {
stroke: ${t["cScaleInv"+n]} ;
stroke-width: 3;
}
.disabled, .disabled circle, .disabled text {
fill: lightgray;
}
.disabled text {
fill: #efefef;
}
.node rect,
.node circle,
.node ellipse,
.node polygon,
.node path {
fill: ${t.background};
stroke: ${t.nodeBorder};
stroke-width: 1px;
}
.kanban-ticket-link {
fill: ${t.background};
stroke: ${t.nodeBorder};
text-decoration: underline;
}
`}return e},"genSections"),cMt=x(t=>`
.edge {
stroke-width: 3;
}
${lMt(t)}
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
fill: ${t.git0};
}
.section-root text {
fill: ${t.gitBranchLabel0};
}
.icon-container {
height:100%;
display: flex;
justify-content: center;
align-items: center;
}
.edge {
fill: none;
}
.cluster-label, .label {
color: ${t.textColor};
fill: ${t.textColor};
}
.kanban-label {
dy: 1em;
alignment-baseline: middle;
text-anchor: middle;
dominant-baseline: middle;
text-align: center;
}
${CS()}
`,"getStyles"),uMt=cMt,hMt={db:aMt,renderer:oMt,parser:Y7t,styles:uMt};const dMt=Object.freeze(Object.defineProperty({__proto__:null,diagram:hMt},Symbol.toStringTag,{value:"Module"}));function Fie(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}return r}function _6e(t,e){let r;if(e===void 0)for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of t)(i=e(i,++n,t))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}function qN(t,e){let r=0;if(e===void 0)for(let n of t)(n=+n)&&(r+=n);else{let n=-1;for(let i of t)(i=+e(i,++n,t))&&(r+=i)}return r}function fMt(t){return t.target.depth}function pMt(t){return t.depth}function gMt(t,e){return e-1-t.height}function R6e(t,e){return t.sourceLinks.length?t.depth:e-1}function mMt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?_6e(t.sourceLinks,fMt)-1:0}function A4(t){return function(){return t}}function zie(t,e){return k6(t.source,e.source)||t.index-e.index}function Vie(t,e){return k6(t.target,e.target)||t.index-e.index}function k6(t,e){return t.y0-e.y0}function UN(t){return t.value}function yMt(t){return t.index}function vMt(t){return t.nodes}function bMt(t){return t.links}function Gie(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function Wie({nodes:t}){for(const e of t){let r=e.y0,n=r;for(const i of e.sourceLinks)i.y0=r+i.width/2,r+=i.width;for(const i of e.targetLinks)i.y1=n+i.width/2,n+=i.width}}function xMt(){let t=0,e=0,r=1,n=1,i=24,a=8,s,o=yMt,l=R6e,u,h,d=vMt,f=bMt,p=6;function g(){const I={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return m(I),y(I),v(I),T(I),C(I),Wie(I),I}g.update=function(I){return Wie(I),I},g.nodeId=function(I){return arguments.length?(o=typeof I=="function"?I:A4(I),g):o},g.nodeAlign=function(I){return arguments.length?(l=typeof I=="function"?I:A4(I),g):l},g.nodeSort=function(I){return arguments.length?(u=I,g):u},g.nodeWidth=function(I){return arguments.length?(i=+I,g):i},g.nodePadding=function(I){return arguments.length?(a=s=+I,g):a},g.nodes=function(I){return arguments.length?(d=typeof I=="function"?I:A4(I),g):d},g.links=function(I){return arguments.length?(f=typeof I=="function"?I:A4(I),g):f},g.linkSort=function(I){return arguments.length?(h=I,g):h},g.size=function(I){return arguments.length?(t=e=0,r=+I[0],n=+I[1],g):[r-t,n-e]},g.extent=function(I){return arguments.length?(t=+I[0][0],r=+I[1][0],e=+I[0][1],n=+I[1][1],g):[[t,e],[r,n]]},g.iterations=function(I){return arguments.length?(p=+I,g):p};function m({nodes:I,links:$}){for(const[N,F]of I.entries())F.index=N,F.sourceLinks=[],F.targetLinks=[];const O=new Map(I.map((N,F)=>[o(N,F,I),N]));for(const[N,F]of $.entries()){F.index=N;let{source:z,target:V}=F;typeof z!="object"&&(z=F.source=Gie(O,z)),typeof V!="object"&&(V=F.target=Gie(O,V)),z.sourceLinks.push(F),V.targetLinks.push(F)}if(h!=null)for(const{sourceLinks:N,targetLinks:F}of I)N.sort(h),F.sort(h)}function y({nodes:I}){for(const $ of I)$.value=$.fixedValue===void 0?Math.max(qN($.sourceLinks,UN),qN($.targetLinks,UN)):$.fixedValue}function v({nodes:I}){const $=I.length;let O=new Set(I),N=new Set,F=0;for(;O.size;){for(const z of O){z.depth=F;for(const{target:V}of z.sourceLinks)N.add(V)}if(++F>$)throw new Error("circular link");O=N,N=new Set}}function T({nodes:I}){const $=I.length;let O=new Set(I),N=new Set,F=0;for(;O.size;){for(const z of O){z.height=F;for(const{source:V}of z.targetLinks)N.add(V)}if(++F>$)throw new Error("circular link");O=N,N=new Set}}function b({nodes:I}){const $=Fie(I,F=>F.depth)+1,O=(r-t-i)/($-1),N=new Array($);for(const F of I){const z=Math.max(0,Math.min($-1,Math.floor(l.call(null,F,$))));F.layer=z,F.x0=t+z*O,F.x1=F.x0+i,N[z]?N[z].push(F):N[z]=[F]}if(u)for(const F of N)F.sort(u);return N}function w(I){const $=_6e(I,O=>(n-e-(O.length-1)*s)/qN(O,UN));for(const O of I){let N=e;for(const F of O){F.y0=N,F.y1=N+F.value*$,N=F.y1+s;for(const z of F.sourceLinks)z.width=z.value*$}N=(n-N+s)/(O.length+1);for(let F=0;F<O.length;++F){const z=O[F];z.y0+=N*(F+1),z.y1+=N*(F+1)}P(O)}}function C(I){const $=b(I);s=Math.min(a,(n-e)/(Fie($,O=>O.length)-1)),w($);for(let O=0;O<p;++O){const N=Math.pow(.99,O),F=Math.max(1-N,(O+1)/p);k($,N,F),S($,N,F)}}function S(I,$,O){for(let N=1,F=I.length;N<F;++N){const z=I[N];for(const V of z){let B=0,G=0;for(const{source:q,value:Z}of V.targetLinks){let Y=Z*(V.layer-q.layer);B+=D(q,V)*Y,G+=Y}if(!(G>0))continue;let H=(B/G-V.y0)*$;V.y0+=H,V.y1+=H,L(V)}u===void 0&&z.sort(k6),E(z,O)}}function k(I,$,O){for(let N=I.length,F=N-2;F>=0;--F){const z=I[F];for(const V of z){let B=0,G=0;for(const{target:q,value:Z}of V.sourceLinks){let Y=Z*(q.layer-V.layer);B+=R(V,q)*Y,G+=Y}if(!(G>0))continue;let H=(B/G-V.y0)*$;V.y0+=H,V.y1+=H,L(V)}u===void 0&&z.sort(k6),E(z,O)}}function E(I,$){const O=I.length>>1,N=I[O];M(I,N.y0-s,O-1,$),_(I,N.y1+s,O+1,$),M(I,n,I.length-1,$),_(I,e,0,$)}function _(I,$,O,N){for(;O<I.length;++O){const F=I[O],z=($-F.y0)*N;z>1e-6&&(F.y0+=z,F.y1+=z),$=F.y1+s}}function M(I,$,O,N){for(;O>=0;--O){const F=I[O],z=(F.y1-$)*N;z>1e-6&&(F.y0-=z,F.y1-=z),$=F.y0-s}}function L({sourceLinks:I,targetLinks:$}){if(h===void 0){for(const{source:{sourceLinks:O}}of $)O.sort(Vie);for(const{target:{targetLinks:O}}of I)O.sort(zie)}}function P(I){if(h===void 0)for(const{sourceLinks:$,targetLinks:O}of I)$.sort(Vie),O.sort(zie)}function D(I,$){let O=I.y0-(I.sourceLinks.length-1)*s/2;for(const{target:N,width:F}of I.sourceLinks){if(N===$)break;O+=F+s}for(const{source:N,width:F}of $.targetLinks){if(N===I)break;O-=F}return O}function R(I,$){let O=$.y0-($.targetLinks.length-1)*s/2;for(const{source:N,width:F}of $.targetLinks){if(N===I)break;O+=F+s}for(const{target:N,width:F}of I.sourceLinks){if(N===$)break;O-=F}return O}return g}var KB=Math.PI,ZB=2*KB,xp=1e-6,TMt=ZB-xp;function QB(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function L6e(){return new QB}QB.prototype=L6e.prototype={constructor:QB,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,r,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(t,e,r,n,i,a){this._+="C"+ +t+","+ +e+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(t,e,r,n,i){t=+t,e=+e,r=+r,n=+n,i=+i;var a=this._x1,s=this._y1,o=r-t,l=n-e,u=a-t,h=s-e,d=u*u+h*h;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(d>xp)if(!(Math.abs(h*o-l*u)>xp)||!i)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var f=r-a,p=n-s,g=o*o+l*l,m=f*f+p*p,y=Math.sqrt(g),v=Math.sqrt(d),T=i*Math.tan((KB-Math.acos((g+d-m)/(2*y*v)))/2),b=T/v,w=T/y;Math.abs(b-1)>xp&&(this._+="L"+(t+b*u)+","+(e+b*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>u*p)+","+(this._x1=t+w*o)+","+(this._y1=e+w*l)}},arc:function(t,e,r,n,i,a){t=+t,e=+e,r=+r,a=!!a;var s=r*Math.cos(n),o=r*Math.sin(n),l=t+s,u=e+o,h=1^a,d=a?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>xp||Math.abs(this._y1-u)>xp)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%ZB+ZB),d>TMt?this._+="A"+r+","+r+",0,1,"+h+","+(t-s)+","+(e-o)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>xp&&(this._+="A"+r+","+r+",0,"+ +(d>=KB)+","+h+","+(this._x1=t+r*Math.cos(i))+","+(this._y1=e+r*Math.sin(i))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};function Hie(t){return function(){return t}}function wMt(t){return t[0]}function CMt(t){return t[1]}var kMt=Array.prototype.slice;function SMt(t){return t.source}function EMt(t){return t.target}function AMt(t){var e=SMt,r=EMt,n=wMt,i=CMt,a=null;function s(){var o,l=kMt.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(a||(a=o=L6e()),t(a,+n.apply(this,(l[0]=u,l)),+i.apply(this,l),+n.apply(this,(l[0]=h,l)),+i.apply(this,l)),o)return a=null,o+""||null}return s.source=function(o){return arguments.length?(e=o,s):e},s.target=function(o){return arguments.length?(r=o,s):r},s.x=function(o){return arguments.length?(n=typeof o=="function"?o:Hie(+o),s):n},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:Hie(+o),s):i},s.context=function(o){return arguments.length?(a=o??null,s):a},s}function _Mt(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function RMt(){return AMt(_Mt)}function LMt(t){return[t.source.x1,t.y0]}function MMt(t){return[t.target.x0,t.y1]}function IMt(){return RMt().source(LMt).target(MMt)}var JB=(function(){var t=x(function(o,l,u,h){for(u=u||{},h=o.length;h--;u[o[h]]=l);return u},"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:x(function(l,u,h,d,f,p,g){var m=p.length-1;switch(f){case 7:const y=d.findOrCreateNode(p[m-4].trim().replaceAll('""','"')),v=d.findOrCreateNode(p[m-2].trim().replaceAll('""','"')),T=parseFloat(p[m].trim());d.addLink(y,v,T);break;case 8:case 9:case 11:this.$=p[m];break;case 10:this.$=p[m-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(n,[2,8]),t(n,[2,9]),{19:[1,16]},t(n,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:r},{15:18,16:7,17:8,18:e,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(n,[2,10]),{15:21,16:7,17:8,18:e,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:x(function(l,u){if(u.recoverable)this.trace(l);else{var h=new Error(l);throw h.hash=u,h}},"parseError"),parse:x(function(l){var u=this,h=[0],d=[],f=[null],p=[],g=this.table,m="",y=0,v=0,T=2,b=1,w=p.slice.call(arguments,1),C=Object.create(this.lexer),S={yy:{}};for(var k in this.yy)Object.prototype.hasOwnProperty.call(this.yy,k)&&(S.yy[k]=this.yy[k]);C.setInput(l,S.yy),S.yy.lexer=C,S.yy.parser=this,typeof C.yylloc>"u"&&(C.yylloc={});var E=C.yylloc;p.push(E);var _=C.options&&C.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function M(B){h.length=h.length-2*B,f.length=f.length-B,p.length=p.length-B}x(M,"popStack");function L(){var B;return B=d.pop()||C.lex()||b,typeof B!="number"&&(B instanceof Array&&(d=B,B=d.pop()),B=u.symbols_[B]||B),B}x(L,"lex");for(var P,D,R,I,$={},O,N,F,z;;){if(D=h[h.length-1],this.defaultActions[D]?R=this.defaultActions[D]:((P===null||typeof P>"u")&&(P=L()),R=g[D]&&g[D][P]),typeof R>"u"||!R.length||!R[0]){var V="";z=[];for(O in g[D])this.terminals_[O]&&O>T&&z.push("'"+this.terminals_[O]+"'");C.showPosition?V="Parse error on line "+(y+1)+`:
`+C.showPosition()+`
Expecting `+z.join(", ")+", got '"+(this.terminals_[P]||P)+"'":V="Parse error on line "+(y+1)+": Unexpected "+(P==b?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(V,{text:C.match,token:this.terminals_[P]||P,line:C.yylineno,loc:E,expected:z})}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+D+", token: "+P);switch(R[0]){case 1:h.push(P),f.push(C.yytext),p.push(C.yylloc),h.push(R[1]),P=null,v=C.yyleng,m=C.yytext,y=C.yylineno,E=C.yylloc;break;case 2:if(N=this.productions_[R[1]][1],$.$=f[f.length-N],$._$={first_line:p[p.length-(N||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(N||1)].first_column,last_column:p[p.length-1].last_column},_&&($._$.range=[p[p.length-(N||1)].range[0],p[p.length-1].range[1]]),I=this.performAction.apply($,[m,v,y,S.yy,R[1],f,p].concat(w)),typeof I<"u")return I;N&&(h=h.slice(0,-1*N*2),f=f.slice(0,-1*N),p=p.slice(0,-1*N)),h.push(this.productions_[R[1]][0]),f.push($.$),p.push($._$),F=g[h[h.length-2]][h[h.length-1]],h.push(F);break;case 3:return!0}}return!0},"parse")},a=(function(){var o={EOF:1,parseError:x(function(u,h){if(this.yy.parser)this.yy.parser.parseError(u,h);else throw new Error(u)},"parseError"),setInput:x(function(l,u){return this.yy=u||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var u=l.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:x(function(l){var u=l.length,h=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===d.length?this.yylloc.first_column:0)+d[d.length-h.length].length-h[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(l){this.unput(this.match.slice(l))},"less"),pastInput:x(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+`
`+u+"^"},"showPosition"),test_match:x(function(l,u){var h,d,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),d=l[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(l[0].length),this.matched+=l[0],h=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var p in f)this[p]=f[p];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,u,h,d;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),p=0;p<f.length;p++)if(h=this._input.match(this.rules[f[p]]),h&&(!u||h[0].length>u[0].length)){if(u=h,d=p,this.options.backtrack_lexer){if(l=this.test_match(h,f[p]),l!==!1)return l;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(l=this.test_match(u,f[d]),l!==!1?l:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var u=this.next();return u||this.lex()},"lex"),begin:x(function(u){this.conditionStack.push(u)},"begin"),popState:x(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:x(function(u){this.begin(u)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(u,h,d,f){switch(d){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return o})();i.lexer=a;function s(){this.yy={}}return x(s,"Parser"),s.prototype=i,i.Parser=s,new s})();JB.parser=JB;var S6=JB,z7=[],V7=[],E6=new Map,NMt=x(()=>{z7=[],V7=[],E6=new Map,On()},"clear"),ab,DMt=(ab=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},x(ab,"SankeyLink"),ab),OMt=x((t,e,r)=>{z7.push(new DMt(t,e,r))},"addLink"),sb,$Mt=(sb=class{constructor(e){this.ID=e}},x(sb,"SankeyNode"),sb),PMt=x(t=>{t=At.sanitizeText(t,Fe());let e=E6.get(t);return e===void 0&&(e=new $Mt(t),E6.set(t,e),V7.push(e)),e},"findOrCreateNode"),BMt=x(()=>V7,"getNodes"),FMt=x(()=>z7,"getLinks"),zMt=x(()=>({nodes:V7.map(t=>({id:t.ID})),links:z7.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),VMt={nodesMap:E6,getConfig:x(()=>Fe().sankey,"getConfig"),getNodes:BMt,getLinks:FMt,getGraph:zMt,addLink:OMt,findOrCreateNode:PMt,getAccTitle:ni,setAccTitle:Hn,getAccDescription:ai,setAccDescription:ii,getDiagramTitle:Yn,setDiagramTitle:ti,clear:NMt},ah,qie=(ah=class{static next(e){return new ah(e+ ++ah.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},x(ah,"Uid"),ah.count=0,ah),GMt={left:pMt,right:gMt,center:mMt,justify:R6e},WMt=x(t=>{let e=0,r=0;for(const n of t){const i=n.value??0;i>e&&(e=i,r=n.layer??0)}return r},"findCentralNodeLayer"),HMt=x(function(t,e,r,n){const{securityLevel:i,sankey:a}=Fe(),s=ice.sankey;let o;i==="sandbox"&&(o=ut("#i"+e));const l=ut(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):ut(`[id="${e}"]`),h=(a==null?void 0:a.width)??s.width,d=(a==null?void 0:a.height)??s.width,f=(a==null?void 0:a.useMaxWidth)??s.useMaxWidth,p=(a==null?void 0:a.nodeAlignment)??s.nodeAlignment,g=(a==null?void 0:a.prefix)??s.prefix,m=(a==null?void 0:a.suffix)??s.suffix,y=(a==null?void 0:a.showValues)??s.showValues,v=(a==null?void 0:a.nodeWidth)??s.nodeWidth??10,T=(a==null?void 0:a.nodePadding)??s.nodePadding??12,b=(a==null?void 0:a.labelStyle)??s.labelStyle??"legacy",w=(a==null?void 0:a.nodeColors)??{},C=n.db.getGraph(),S=GMt[p];xMt().nodeId(N=>N.id).nodeWidth(v).nodePadding(T+(y?15:0)).nodeAlign(S).extent([[0,0],[h,d]])(C);const E=WMt(C.nodes),_=h0(Qqe),M=x(N=>w[N]??_(N),"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(C.nodes).join("g").attr("class","node").attr("id",N=>(N.uid=qie.next("node-")).id).attr("transform",function(N){return"translate("+N.x0+","+N.y0+")"}).attr("x",N=>N.x0).attr("y",N=>N.y0).append("rect").attr("height",N=>N.y1-N.y0).attr("width",N=>N.x1-N.x0).attr("fill",N=>M(N.id));const L=x(({id:N,value:F})=>y?`${N}
${g}${Math.round(F*100)/100}${m}`:N,"getText"),P=x(N=>b==="outlined"?(N.layer??0)<E?{x:N.x0-6,anchor:"end"}:{x:N.x1+6,anchor:"start"}:N.x0<h/2?{x:N.x1+6,anchor:"start"}:{x:N.x0-6,anchor:"end"},"getLabelPosition"),D=u.append("g").attr("class","node-labels").attr("font-size",14),R=x(N=>D.selectAll(N?`.${N}`:"text").data(C.nodes).join("text").attr("class",N??null).attr("x",F=>P(F).x).attr("y",F=>(F.y1+F.y0)/2).attr("dy",`${y?"0":"0.35"}em`).attr("text-anchor",F=>P(F).anchor).text(L),"appendLabel");b==="outlined"?(R("sankey-label-bg"),R("sankey-label-fg")):R();const I=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(C.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),$=(a==null?void 0:a.linkColor)??"gradient";if($==="gradient"){const N=I.append("linearGradient").attr("id",F=>(F.uid=qie.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",F=>F.source.x1).attr("x2",F=>F.target.x0);N.append("stop").attr("offset","0%").attr("stop-color",F=>M(F.source.id)),N.append("stop").attr("offset","100%").attr("stop-color",F=>M(F.target.id))}let O;switch($){case"gradient":O=x(N=>N.uid,"coloring");break;case"source":O=x(N=>M(N.source.id),"coloring");break;case"target":O=x(N=>M(N.target.id),"coloring");break;default:O=$}I.append("path").attr("d",IMt()).attr("stroke",O).attr("stroke-width",N=>Math.max(1,N.width)),mx(void 0,u,0,f)},"draw"),qMt={draw:HMt},UMt=x(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,`
`).trim(),"prepareTextForParsing"),YMt=x(t=>`.label {
font-family: ${t.fontFamily};
}
.node-labels {
font-family: ${t.fontFamily};
}
/* Outlined label style - background stroke for better readability */
.sankey-label-bg {
stroke: ${t.mainBkg||t.background||"#fff"};
stroke-width: 4px;
stroke-linejoin: round;
paint-order: stroke;
}
/* Foreground label text */
.sankey-label-fg {
fill: ${t.textColor};
}
/* Node styling */
.node rect {
shape-rendering: crispEdges;
}
/* Link styling */
.link {
fill: none;
stroke-opacity: 0.5;
mix-blend-mode: multiply;
}
`,"getStyles"),XMt=YMt,jMt=S6.parse.bind(S6);S6.parse=t=>jMt(UMt(t));var KMt={styles:XMt,parser:S6,db:VMt,renderer:qMt};const ZMt=Object.freeze(Object.defineProperty({__proto__:null,diagram:KMt},Symbol.toStringTag,{value:"Module"}));var QMt=Vr.packet,ob,M6e=(ob=class{constructor(){this.packet=[],this.setAccTitle=Hn,this.getAccTitle=ni,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.getAccDescription=ai,this.setAccDescription=ii}getConfig(){const e=ri({...QMt,...Xt().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){On(),this.packet=[]}},x(ob,"PacketDB"),ob),JMt=1e4,eIt=x((t,e)=>{eo(t,e);let r=-1,n=[],i=1;const{bitsPerRow:a}=e.getConfig();for(let{start:s,end:o,bits:l,label:u}of t.blocks){if(s!==void 0&&o!==void 0&&o<s)throw new Error(`Packet block ${s} - ${o} is invalid. End must be greater than start.`);if(s??(s=r+1),s!==r+1)throw new Error(`Packet block ${s} - ${o??s} is not contiguous. It should start from ${r+1}.`);if(l===0)throw new Error(`Packet block ${s} is invalid. Cannot have a zero bit field.`);for(o??(o=s+(l??1)-1),l??(l=o-s+1),r=o,le.debug(`Packet block ${s} - ${r} with label ${u}`);n.length<=a+1&&e.getPacket().length<JMt;){const[h,d]=tIt({start:s,end:o,bits:l,label:u},i,a);if(n.push(h),h.end+1===i*a&&(e.pushWord(n),n=[],i++),!d)break;({start:s,end:o,bits:l,label:u}=d)}}e.pushWord(n)},"populate"),tIt=x((t,e,r)=>{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const n=e*r-1,i=e*r;return[{start:t.start,end:n,label:t.label,bits:n-t.start},{start:i,end:t.end,label:t.label,bits:t.end-i}]},"getNextFittingBlock"),I6e={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Al("packet",t),r=(n=I6e.parser)==null?void 0:n.yy;if(!(r instanceof M6e))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");le.debug(e),eIt(e,r)},"parse")},rIt=x((t,e,r,n)=>{const i=n.db,a=i.getConfig(),{rowHeight:s,paddingY:o,bitWidth:l,bitsPerRow:u}=a,h=i.getPacket(),d=i.getDiagramTitle(),f=s+o,p=f*(h.length+1)-(d?0:s),g=l*u+2,m=xs(e);m.attr("viewBox",`0 0 ${g} ${p}`),Ai(m,p,g,a.useMaxWidth);for(const[y,v]of h.entries())nIt(m,v,y,a);m.append("text").text(d).attr("x",g/2).attr("y",p-f/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),nIt=x((t,e,r,{rowHeight:n,paddingX:i,paddingY:a,bitWidth:s,bitsPerRow:o,showBits:l})=>{const u=t.append("g"),h=r*(n+a)+a;for(const d of e){const f=d.start%o*s+1,p=(d.end-d.start+1)*s-i;if(u.append("rect").attr("x",f).attr("y",h).attr("width",p).attr("height",n).attr("class","packetBlock"),u.append("text").attr("x",f+p/2).attr("y",h+n/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(d.label),!l)continue;const g=d.end===d.start,m=h-2;u.append("text").attr("x",f+(g?p/2:0)).attr("y",m).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",g?"middle":"start").text(d.start),g||u.append("text").attr("x",f+p).attr("y",m).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(d.end)}},"drawWord"),iIt={draw:rIt},aIt={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},sIt=x(({packet:t}={})=>{const e=ri(aIt,t);return`
.packetByte {
font-size: ${e.byteFontSize};
}
.packetByte.start {
fill: ${e.startByteColor};
}
.packetByte.end {
fill: ${e.endByteColor};
}
.packetLabel {
fill: ${e.labelColor};
font-size: ${e.labelFontSize};
}
.packetTitle {
fill: ${e.titleColor};
font-size: ${e.titleFontSize};
}
.packetBlock {
stroke: ${e.blockStrokeColor};
stroke-width: ${e.blockStrokeWidth};
fill: ${e.blockFillColor};
}
`},"styles"),oIt={parser:I6e,get db(){return new M6e},renderer:iIt,styles:sIt};const lIt=Object.freeze(Object.defineProperty({__proto__:null,diagram:oIt},Symbol.toStringTag,{value:"Module"}));var Fm={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},_4=32,N6e={axes:[],curves:[],options:Fm},Wc=structuredClone(N6e),cIt=Vr.radar,uIt=x(()=>ri({...cIt,...Xt().radar}),"getConfig"),D6e=x(()=>Wc.axes,"getAxes"),hIt=x(()=>Wc.curves,"getCurves"),dIt=x(()=>Wc.options,"getOptions"),fIt=x(t=>{Wc.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),pIt=x(t=>{Wc.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:gIt(e.entries)}))},"setCurves"),gIt=x(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=D6e();if(e.length===0)throw new Error("Axes must be populated before curves for reference entries");return e.map(r=>{const n=t.find(i=>{var a;return((a=i.axis)==null?void 0:a.$refText)===r.name});if(n===void 0)throw new Error("Missing entry for axis "+r.label);return n.value})},"computeCurveEntries"),mIt=x(t=>{var r,n,i,a,s;const e=t.reduce((o,l)=>(o[l.name]=l,o),{});Wc.options={showLegend:((r=e.showLegend)==null?void 0:r.value)??Fm.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??Fm.ticks,max:((i=e.max)==null?void 0:i.value)??Fm.max,min:((a=e.min)==null?void 0:a.value)??Fm.min,graticule:((s=e.graticule)==null?void 0:s.value)??Fm.graticule},Wc.options.ticks>_4&&(le.warn(`Radar diagram ticks (${Wc.options.ticks}) exceeds maximum allowed (${_4}). Using ${_4} instead.`),Wc.options.ticks=_4)},"setOptions"),yIt=x(()=>{On(),Wc=structuredClone(N6e)},"clear"),bw={getAxes:D6e,getCurves:hIt,getOptions:dIt,setAxes:fIt,setCurves:pIt,setOptions:mIt,getConfig:uIt,clear:yIt,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,getAccDescription:ai,setAccDescription:ii},vIt=x(t=>{eo(t,bw);const{axes:e,curves:r,options:n}=t;bw.setAxes(e),bw.setCurves(r),bw.setOptions(n)},"populate"),bIt={parse:x(async t=>{const e=await Al("radar",t);le.debug(e),vIt(e)},"parse")},xIt=x((t,e,r,n)=>{const i=n.db,a=i.getAxes(),s=i.getCurves(),o=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=xs(e),d=TIt(h,l),f=o.max??Math.max(...s.map(m=>Math.max(...m.entries))),p=o.min,g=Math.min(l.width,l.height)/2;wIt(d,a,g,o.ticks,o.graticule),CIt(d,a,g,l),O6e(d,a,s,p,f,o.graticule,l),B6e(d,s,o.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),TIt=x((t,e)=>{const r=e.width+e.marginLeft+e.marginRight,n=e.height+e.marginTop+e.marginBottom,i={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return Ai(t,n,r,e.useMaxWidth??!0),t.attr("viewBox",`0 0 ${r} ${n}`).attr("overflow","visible"),t.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame"),wIt=x((t,e,r,n,i)=>{if(i==="circle")for(let a=0;a<n;a++){const s=r*(a+1)/n;t.append("circle").attr("r",s).attr("class","radarGraticule")}else if(i==="polygon"){const a=e.length;for(let s=0;s<n;s++){const o=r*(s+1)/n,l=e.map((u,h)=>{const d=2*h*Math.PI/a-Math.PI/2,f=o*Math.cos(d),p=o*Math.sin(d);return`${f},${p}`}).join(" ");t.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),CIt=x((t,e,r,n)=>{const i=e.length;for(let a=0;a<i;a++){const s=e[a].label,o=2*a*Math.PI/i-Math.PI/2,l=Math.cos(o),u=Math.sin(o);t.append("line").attr("x1",0).attr("y1",0).attr("x2",r*n.axisScaleFactor*l).attr("y2",r*n.axisScaleFactor*u).attr("class","radarAxisLine");const h=l>.01?"start":l<-.01?"end":"middle",d=u>.01?"hanging":u<-.01?"auto":"central",f=4;t.append("text").text(s).attr("x",r*n.axisLabelFactor*l+f*l).attr("y",r*n.axisLabelFactor*u+f*u).attr("text-anchor",h).attr("dominant-baseline",d).attr("class","radarAxisLabel")}},"drawAxes");function O6e(t,e,r,n,i,a,s){const o=e.length,l=Math.min(s.width,s.height)/2;r.forEach((u,h)=>{if(u.entries.length!==o)return;const d=u.entries.map((f,p)=>{const g=2*Math.PI*p/o-Math.PI/2,m=$6e(f,n,i,l),y=m*Math.cos(g),v=m*Math.sin(g);return{x:y,y:v}});a==="circle"?t.append("path").attr("d",P6e(d,s.curveTension)).attr("class",`radarCurve-${h}`):a==="polygon"&&t.append("polygon").attr("points",d.map(f=>`${f.x},${f.y}`).join(" ")).attr("class",`radarCurve-${h}`)})}x(O6e,"drawCurves");function $6e(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}x($6e,"relativeRadius");function P6e(t,e){const r=t.length;let n=`M${t[0].x},${t[0].y}`;for(let i=0;i<r;i++){const a=t[(i-1+r)%r],s=t[i],o=t[(i+1)%r],l=t[(i+2)%r],u={x:s.x+(o.x-a.x)*e,y:s.y+(o.y-a.y)*e},h={x:o.x-(l.x-s.x)*e,y:o.y-(l.y-s.y)*e};n+=` C${u.x},${u.y} ${h.x},${h.y} ${o.x},${o.y}`}return`${n} Z`}x(P6e,"closedRoundCurve");function B6e(t,e,r,n){if(!r)return;const i=(n.width/2+n.marginRight)*3/4,a=-(n.height/2+n.marginTop)*3/4,s=20;e.forEach((o,l)=>{const u=t.append("g").attr("transform",`translate(${i}, ${a+l*s})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`),u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}x(B6e,"drawLegend");var kIt={draw:xIt},SIt=x((t,e)=>{let r="";for(let n=0;n<t.THEME_COLOR_LIMIT;n++){const i=t[`cScale${n}`];r+=`
.radarCurve-${n} {
color: ${i};
fill: ${i};
fill-opacity: ${e.curveOpacity};
stroke: ${i};
stroke-width: ${e.curveStrokeWidth};
}
.radarLegendBox-${n} {
fill: ${i};
fill-opacity: ${e.curveOpacity};
stroke: ${i};
}
`}return r},"genIndexStyles"),EIt=x(t=>{const e=Dh(),r=Xt(),n=ri(e,r.themeVariables),i=ri(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),AIt=x(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=EIt(t);return`
.radarTitle {
font-size: ${e.fontSize};
color: ${e.titleColor};
dominant-baseline: hanging;
text-anchor: middle;
}
.radarAxisLine {
stroke: ${r.axisColor};
stroke-width: ${r.axisStrokeWidth};
}
.radarAxisLabel {
font-size: ${r.axisLabelFontSize}px;
color: ${r.axisColor};
}
.radarGraticule {
fill: ${r.graticuleColor};
fill-opacity: ${r.graticuleOpacity};
stroke: ${r.graticuleColor};
stroke-width: ${r.graticuleStrokeWidth};
}
.radarLegendText {
text-anchor: start;
font-size: ${r.legendFontSize}px;
dominant-baseline: hanging;
}
${SIt(e,r)}
`},"styles"),_It={parser:bIt,db:bw,renderer:kIt,styles:AIt};const RIt=Object.freeze(Object.defineProperty({__proto__:null,diagram:_It},Symbol.toStringTag,{value:"Module"}));var eF=(function(){var t=x(function(b,w,C,S){for(C=C||{},S=b.length;S--;C[b[S]]=w);return C},"o"),e=[1,15],r=[1,7],n=[1,13],i=[1,14],a=[1,19],s=[1,16],o=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],f=[1,24],p=[8,10,15,16,21,28,29,30,31,39,43,46],g=[8,10,15,16,21,27,28,29,30,31,39,43,46],m=[1,49],y={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:x(function(w,C,S,k,E,_,M){var L=_.length-1;switch(E){case 4:k.getLogger().debug("Rule: separator (NL) ");break;case 5:k.getLogger().debug("Rule: separator (Space) ");break;case 6:k.getLogger().debug("Rule: separator (EOF) ");break;case 7:k.getLogger().debug("Rule: hierarchy: ",_[L-1]),k.setHierarchy(_[L-1]);break;case 8:k.getLogger().debug("Stop NL ");break;case 9:k.getLogger().debug("Stop EOF ");break;case 10:k.getLogger().debug("Stop NL2 ");break;case 11:k.getLogger().debug("Stop EOF2 ");break;case 12:k.getLogger().debug("Rule: statement: ",_[L]),typeof _[L].length=="number"?this.$=_[L]:this.$=[_[L]];break;case 13:k.getLogger().debug("Rule: statement #2: ",_[L-1]),this.$=[_[L-1]].concat(_[L]);break;case 14:k.getLogger().debug("Rule: link: ",_[L],w),this.$={edgeTypeStr:_[L],label:""};break;case 15:k.getLogger().debug("Rule: LABEL link: ",_[L-3],_[L-1],_[L]),this.$={edgeTypeStr:_[L],label:_[L-1]};break;case 18:const P=parseInt(_[L]),D=k.generateId();this.$={id:D,type:"space",label:"",width:P,children:[]};break;case 23:k.getLogger().debug("Rule: (nodeStatement link node) ",_[L-2],_[L-1],_[L]," typestr: ",_[L-1].edgeTypeStr);const R=k.edgeStrToEdgeData(_[L-1].edgeTypeStr),I=k.edgeStrToEdgeStartData(_[L-1].edgeTypeStr),$=k.edgeStrToThickness(_[L-1].edgeTypeStr),O=k.edgeStrToPattern(_[L-1].edgeTypeStr);this.$=[{id:_[L-2].id,label:_[L-2].label,type:_[L-2].type,directions:_[L-2].directions},{id:_[L-2].id+"-"+_[L].id,start:_[L-2].id,end:_[L].id,label:_[L-1].label,type:"edge",thickness:$,pattern:O,directions:_[L].directions,arrowTypeEnd:R,arrowTypeStart:I},{id:_[L].id,label:_[L].label,type:k.typeStr2Type(_[L].typeStr),directions:_[L].directions}];break;case 24:k.getLogger().debug("Rule: nodeStatement (abc88 node size) ",_[L-1],_[L]),this.$={id:_[L-1].id,label:_[L-1].label,type:k.typeStr2Type(_[L-1].typeStr),directions:_[L-1].directions,widthInColumns:parseInt(_[L],10)};break;case 25:k.getLogger().debug("Rule: nodeStatement (node) ",_[L]),this.$={id:_[L].id,label:_[L].label,type:k.typeStr2Type(_[L].typeStr),directions:_[L].directions,widthInColumns:1};break;case 26:k.getLogger().debug("APA123",this?this:"na"),k.getLogger().debug("COLUMNS: ",_[L]),this.$={type:"column-setting",columns:_[L]==="auto"?-1:parseInt(_[L])};break;case 27:k.getLogger().debug("Rule: id-block statement : ",_[L-2],_[L-1]),k.generateId(),this.$={..._[L-2],type:"composite",children:_[L-1]};break;case 28:k.getLogger().debug("Rule: blockStatement : ",_[L-2],_[L-1],_[L]);const N=k.generateId();this.$={id:N,type:"composite",label:"",children:_[L-1]};break;case 29:k.getLogger().debug("Rule: node (NODE_ID separator): ",_[L]),this.$={id:_[L]};break;case 30:k.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",_[L-1],_[L]),this.$={id:_[L-1],label:_[L].label,typeStr:_[L].typeStr,directions:_[L].directions};break;case 31:k.getLogger().debug("Rule: dirList: ",_[L]),this.$=[_[L]];break;case 32:k.getLogger().debug("Rule: dirList: ",_[L-1],_[L]),this.$=[_[L-1]].concat(_[L]);break;case 33:k.getLogger().debug("Rule: nodeShapeNLabel: ",_[L-2],_[L-1],_[L]),this.$={typeStr:_[L-2]+_[L],label:_[L-1]};break;case 34:k.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",_[L-3],_[L-2]," #3:",_[L-1],_[L]),this.$={typeStr:_[L-3]+_[L],label:_[L-2],directions:_[L-1]};break;case 35:case 36:this.$={type:"classDef",id:_[L-1].trim(),css:_[L].trim()};break;case 37:this.$={type:"applyClass",id:_[L-1].trim(),styleClass:_[L].trim()};break;case 38:this.$={type:"applyStyles",id:_[L-1].trim(),stylesStr:_[L].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:n,29:i,31:a,39:s,43:o,46:l}),t(h,[2,16],{14:22,15:d,16:f}),t(h,[2,17]),t(h,[2,18]),t(h,[2,19]),t(h,[2,20]),t(h,[2,21]),t(h,[2,22]),t(p,[2,25],{27:[1,25]}),t(h,[2,26]),{19:26,26:12,31:a},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(g,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:a},{31:[2,14]},{17:[1,36]},t(p,[2,24]),{10:e,11:37,13:4,14:22,15:d,16:f,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:a,39:s,43:o,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(g,[2,30]),{18:[1,43]},{18:[1,44]},t(p,[2,23]),{18:[1,45]},{30:[1,46]},t(h,[2,28]),t(h,[2,35]),t(h,[2,36]),t(h,[2,37]),t(h,[2,38]),{36:[1,47]},{33:48,34:m},{15:[1,50]},t(h,[2,27]),t(g,[2,33]),{38:[1,51]},{33:52,34:m,38:[2,31]},{31:[2,15]},t(g,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:x(function(w,C){if(C.recoverable)this.trace(w);else{var S=new Error(w);throw S.hash=C,S}},"parseError"),parse:x(function(w){var C=this,S=[0],k=[],E=[null],_=[],M=this.table,L="",P=0,D=0,R=2,I=1,$=_.slice.call(arguments,1),O=Object.create(this.lexer),N={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(N.yy[F]=this.yy[F]);O.setInput(w,N.yy),N.yy.lexer=O,N.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var z=O.yylloc;_.push(z);var V=O.options&&O.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function B(ee){S.length=S.length-2*ee,E.length=E.length-ee,_.length=_.length-ee}x(B,"popStack");function G(){var ee;return ee=k.pop()||O.lex()||I,typeof ee!="number"&&(ee instanceof Array&&(k=ee,ee=k.pop()),ee=C.symbols_[ee]||ee),ee}x(G,"lex");for(var H,q,Z,Y,ie={},K,Q,te,J;;){if(q=S[S.length-1],this.defaultActions[q]?Z=this.defaultActions[q]:((H===null||typeof H>"u")&&(H=G()),Z=M[q]&&M[q][H]),typeof Z>"u"||!Z.length||!Z[0]){var ge="";J=[];for(K in M[q])this.terminals_[K]&&K>R&&J.push("'"+this.terminals_[K]+"'");O.showPosition?ge="Parse error on line "+(P+1)+`:
`+O.showPosition()+`
Expecting `+J.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ge="Parse error on line "+(P+1)+": Unexpected "+(H==I?"end of input":"'"+(this.terminals_[H]||H)+"'"),this.parseError(ge,{text:O.match,token:this.terminals_[H]||H,line:O.yylineno,loc:z,expected:J})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+H);switch(Z[0]){case 1:S.push(H),E.push(O.yytext),_.push(O.yylloc),S.push(Z[1]),H=null,D=O.yyleng,L=O.yytext,P=O.yylineno,z=O.yylloc;break;case 2:if(Q=this.productions_[Z[1]][1],ie.$=E[E.length-Q],ie._$={first_line:_[_.length-(Q||1)].first_line,last_line:_[_.length-1].last_line,first_column:_[_.length-(Q||1)].first_column,last_column:_[_.length-1].last_column},V&&(ie._$.range=[_[_.length-(Q||1)].range[0],_[_.length-1].range[1]]),Y=this.performAction.apply(ie,[L,D,P,N.yy,Z[1],E,_].concat($)),typeof Y<"u")return Y;Q&&(S=S.slice(0,-1*Q*2),E=E.slice(0,-1*Q),_=_.slice(0,-1*Q)),S.push(this.productions_[Z[1]][0]),E.push(ie.$),_.push(ie._$),te=M[S[S.length-2]][S[S.length-1]],S.push(te);break;case 3:return!0}}return!0},"parse")},v=(function(){var b={EOF:1,parseError:x(function(C,S){if(this.yy.parser)this.yy.parser.parseError(C,S);else throw new Error(C)},"parseError"),setInput:x(function(w,C){return this.yy=C||this.yy||{},this._input=w,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var C=w.match(/(?:\r\n?|\n).*/g);return C?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),w},"input"),unput:x(function(w){var C=w.length,S=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-C),this.offset-=C;var k=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),S.length-1&&(this.yylineno-=S.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:S?(S.length===k.length?this.yylloc.first_column:0)+k[k.length-S.length].length-S[0].length:this.yylloc.first_column-C},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-C]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(w){this.unput(this.match.slice(w))},"less"),pastInput:x(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var w=this.pastInput(),C=new Array(w.length+1).join("-");return w+this.upcomingInput()+`
`+C+"^"},"showPosition"),test_match:x(function(w,C){var S,k,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),k=w[0].match(/(?:\r\n?|\n).*/g),k&&(this.yylineno+=k.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:k?k[k.length-1].length-k[k.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+w[0].length},this.yytext+=w[0],this.match+=w[0],this.matches=w,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(w[0].length),this.matched+=w[0],S=this.performAction.call(this,this.yy,this,C,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),S)return S;if(this._backtrack){for(var _ in E)this[_]=E[_];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var w,C,S,k;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),_=0;_<E.length;_++)if(S=this._input.match(this.rules[E[_]]),S&&(!C||S[0].length>C[0].length)){if(C=S,k=_,this.options.backtrack_lexer){if(w=this.test_match(S,E[_]),w!==!1)return w;if(this._backtrack){C=!1;continue}else return!1}else if(!this.options.flex)break}return C?(w=this.test_match(C,E[k]),w!==!1?w:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var C=this.next();return C||this.lex()},"lex"),begin:x(function(C){this.conditionStack.push(C)},"begin"),popState:x(function(){var C=this.conditionStack.length-1;return C>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(C){return C=this.conditionStack.length-1-Math.abs(C||0),C>=0?this.conditionStack[C]:"INITIAL"},"topState"),pushState:x(function(C){this.begin(C)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:x(function(C,S,k,E){switch(k){case 0:return C.getLogger().debug("Found block-beta"),10;case 1:return C.getLogger().debug("Found id-block"),29;case 2:return C.getLogger().debug("Found block"),10;case 3:C.getLogger().debug(".",S.yytext);break;case 4:C.getLogger().debug("_",S.yytext);break;case 5:return 5;case 6:return S.yytext=-1,28;case 7:return S.yytext=S.yytext.replace(/columns\s+/,""),C.getLogger().debug("COLUMNS (LEX)",S.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:C.getLogger().debug("LEX: POPPING STR:",S.yytext),this.popState();break;case 13:return C.getLogger().debug("LEX: STR end:",S.yytext),"STR";case 14:return S.yytext=S.yytext.replace(/space\:/,""),C.getLogger().debug("SPACE NUM (LEX)",S.yytext),21;case 15:return S.yytext="1",C.getLogger().debug("COLUMNS (LEX)",S.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),C.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),C.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),C.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),C.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),C.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),C.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),C.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),C.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),C.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),C.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),C.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),C.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),C.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return C.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return C.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return C.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return C.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return C.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return C.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return C.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return C.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),C.getLogger().debug("LEX ARR START"),37;case 74:return C.getLogger().debug("Lex: NODE_ID",S.yytext),31;case 75:return C.getLogger().debug("Lex: EOF",S.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:C.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:C.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return C.getLogger().debug("LEX: NODE_DESCR:",S.yytext),"NODE_DESCR";case 83:C.getLogger().debug("LEX POPPING"),this.popState();break;case 84:C.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (right): dir:",S.yytext),"DIR";case 86:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (left):",S.yytext),"DIR";case 87:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (x):",S.yytext),"DIR";case 88:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (y):",S.yytext),"DIR";case 89:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (up):",S.yytext),"DIR";case 90:return S.yytext=S.yytext.replace(/^,\s*/,""),C.getLogger().debug("Lex (down):",S.yytext),"DIR";case 91:return S.yytext="]>",C.getLogger().debug("Lex (ARROW_DIR end):",S.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return C.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 93:return C.getLogger().debug("Lex: LINK",S.yytext),15;case 94:return C.getLogger().debug("Lex: LINK",S.yytext),15;case 95:return C.getLogger().debug("Lex: LINK",S.yytext),15;case 96:return C.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 97:return C.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 98:return C.getLogger().debug("Lex: START_LINK",S.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return C.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),C.getLogger().debug("Lex: LINK","#"+S.yytext+"#"),15;case 102:return this.popState(),C.getLogger().debug("Lex: LINK",S.yytext),15;case 103:return this.popState(),C.getLogger().debug("Lex: LINK",S.yytext),15;case 104:return C.getLogger().debug("Lex: COLON",S.yytext),S.yytext=S.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return b})();y.lexer=v;function T(){this.yy={}}return x(T,"Parser"),T.prototype=y,y.Parser=T,new T})();eF.parser=eF;var LIt=eF,ac=new Map,GU=[],tF=new Map,Uie="color",Yie="fill",MIt="bgFill",F6e=",",A6=new Map,WU="",IIt=x(t=>At.sanitizeText(t,Fe()),"sanitizeText"),NIt=x(function(t,e=""){let r=A6.get(t);r||(r={id:t,styles:[],textStyles:[]},A6.set(t,r)),e!=null&&e.split(F6e).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(Uie).exec(n)){const s=i.replace(Yie,MIt).replace(Uie,Yie);r.textStyles.push(s)}r.styles.push(i)})},"addStyleClass"),DIt=x(function(t,e=""){const r=ac.get(t);e!=null&&(r.styles=e.split(F6e))},"addStyle2Node"),OIt=x(function(t,e){t.split(",").forEach(function(r){let n=ac.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},ac.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),z6e=x((t,e)=>{const r=t.flat(),n=[],i=r.find(s=>(s==null?void 0:s.type)==="column-setting"),a=(i==null?void 0:i.columns)??-1;for(const s of r){if(typeof a=="number"&&a>0&&s.type!=="column-setting"&&typeof s.widthInColumns=="number"&&s.widthInColumns>a&&le.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${a}`),s.label&&(s.label=IIt(s.label)),s.type==="classDef"){NIt(s.id,s.css);continue}if(s.type==="applyClass"){OIt(s.id,(s==null?void 0:s.styleClass)??"");continue}if(s.type==="applyStyles"){s!=null&&s.stylesStr&&DIt(s.id,s==null?void 0:s.stylesStr);continue}if(s.type==="column-setting")e.columns=s.columns??-1;else if(s.type==="edge"){const o=(tF.get(s.id)??0)+1;tF.set(s.id,o),s.id=o+"-"+s.id,GU.push(s)}else{s.label||(s.type==="composite"?s.label="":s.label=s.id);const o=ac.get(s.id);if(o===void 0?ac.set(s.id,s):(s.type!=="na"&&(o.type=s.type),s.label!==s.id&&(o.label=s.label)),s.children&&z6e(s.children,s),s.type==="space"){const l=s.width??1;for(let u=0;u<l;u++){const h=FYe(s);h.id=h.id+"-"+u,ac.set(h.id,h),n.push(h)}}else o===void 0&&n.push(s)}}e.children=n},"populateBlockDatabase"),HU=[],uC={id:"root",type:"composite",children:[],columns:-1},$It=x(()=>{le.debug("Clear called"),On(),uC={id:"root",type:"composite",children:[],columns:-1},ac=new Map([["root",uC]]),HU=[],A6=new Map,GU=[],tF=new Map,WU=""},"clear");function V6e(t){switch(le.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return le.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}x(V6e,"typeStr2Type");function G6e(t){switch(le.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}x(G6e,"edgeTypeStr2Type");function W6e(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}x(W6e,"edgeStrToEdgeData");function H6e(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}x(H6e,"edgeStrToEdgeStartData");function q6e(t){return t.includes("==")?"thick":"normal"}x(q6e,"edgeStrToThickness");function U6e(t){return t.includes(".-")?"dotted":"solid"}x(U6e,"edgeStrToPattern");var Xie=0,PIt=x(()=>(Xie++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Xie),"generateId"),BIt=x(t=>{uC.children=t,z6e(t,uC),HU=uC.children},"setHierarchy"),FIt=x(t=>{const e=ac.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),zIt=x(()=>[...ac.values()],"getBlocksFlat"),VIt=x(()=>HU||[],"getBlocks"),GIt=x(()=>GU,"getEdges"),WIt=x(t=>ac.get(t),"getBlock"),HIt=x(t=>{ac.set(t.id,t)},"setBlock"),qIt=x(t=>{WU=t},"setDiagramId"),UIt=x(()=>WU,"getDiagramId"),YIt=x(()=>le,"getLogger"),XIt=x(function(){return A6},"getClasses"),jIt={getConfig:x(()=>Xt().block,"getConfig"),typeStr2Type:V6e,edgeTypeStr2Type:G6e,edgeStrToEdgeData:W6e,edgeStrToEdgeStartData:H6e,edgeStrToThickness:q6e,edgeStrToPattern:U6e,getLogger:YIt,getBlocksFlat:zIt,getBlocks:VIt,getEdges:GIt,setHierarchy:BIt,getBlock:WIt,setBlock:HIt,getColumns:FIt,getClasses:XIt,clear:$It,generateId:PIt,setDiagramId:qIt,getDiagramId:UIt},KIt=jIt,YN=x((t,e)=>{const r=wz,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return jl(n,i,a,e)},"fade"),ZIt=x(t=>`.label {
font-family: ${t.fontFamily};
color: ${t.nodeTextColor||t.textColor};
}
.cluster-label text {
fill: ${t.titleColor};
}
.cluster-label span,p {
color: ${t.titleColor};
}
.label text,span,p {
fill: ${t.nodeTextColor||t.textColor};
color: ${t.nodeTextColor||t.textColor};
}
.node rect,
.node circle,
.node ellipse,
.node polygon,
.node path {
fill: ${t.mainBkg};
stroke: ${t.nodeBorder};
stroke-width: 1px;
}
.flowchart-label text {
text-anchor: middle;
}
// .flowchart-label .text-outer-tspan {
// text-anchor: middle;
// }
// .flowchart-label .text-inner-tspan {
// text-anchor: start;
// }
.node .label {
text-align: center;
}
.node.clickable {
cursor: pointer;
}
.arrowheadPath {
fill: ${t.arrowheadColor};
}
.edgePath .path {
stroke: ${t.lineColor};
stroke-width: 2.0px;
}
.flowchart-link {
stroke: ${t.lineColor};
fill: none;
}
.edgeLabel {
background-color: ${t.edgeLabelBackground};
/*
* This is for backward compatibility with existing code that didn't
* add a \`<p>\` around edge labels.
*
* TODO: We should probably remove this in a future release.
*/
p {
margin: 0;
padding: 0;
display: inline;
}
rect {
opacity: 0.5;
background-color: ${t.edgeLabelBackground};
fill: ${t.edgeLabelBackground};
}
text-align: center;
}
/* For html labels only */
.labelBkg {
background-color: ${t.edgeLabelBackground};
}
.node .cluster {
// fill: ${YN(t.mainBkg,.5)};
fill: ${YN(t.clusterBkg,.5)};
stroke: ${YN(t.clusterBorder,.2)};
box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
stroke-width: 1px;
}
.cluster text {
fill: ${t.titleColor};
}
.cluster span,p {
color: ${t.titleColor};
}
/* .cluster div {
color: ${t.titleColor};
} */
div.mermaidTooltip {
position: absolute;
text-align: center;
max-width: 200px;
padding: 2px;
font-family: ${t.fontFamily};
font-size: 12px;
background: ${t.tertiaryColor};
border: 1px solid ${t.border2};
border-radius: 2px;
pointer-events: none;
z-index: 100;
}
.flowchartTitleText {
text-anchor: middle;
font-size: 18px;
fill: ${t.textColor};
}
${CS()}
`,"getStyles"),QIt=ZIt,JIt=x((t,e,r,n)=>{e.forEach(i=>{c8t[i](t,r,n)})},"insertMarkers"),e8t=x((t,e,r)=>{le.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),t8t=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),r8t=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),n8t=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),i8t=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),a8t=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),s8t=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),o8t=x((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),l8t=x((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),c8t={extension:e8t,composition:t8t,aggregation:r8t,dependency:n8t,lollipop:i8t,point:a8t,circle:s8t,cross:o8t,barb:l8t},u8t=JIt;function rF(t,e){if(t===0||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(t===1)return{px:0,py:e};const r=e%t,n=Math.floor(e/t);return{px:r,py:n}}x(rF,"calculateBlockPosition");var h8t=x(t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:a,x:s,y:o}=n.size??{width:0,height:0,x:0,y:0};if(le.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",s,"y:",o,n.type),n.type==="space")continue;const l=i/(n.widthInColumns??1);l>e&&(e=l),a>r&&(r=a)}return{width:e,height:r}},"getMaxChildSize");function _6(t,e,r=0,n=0,i=8){var o,l,u,h,d,f,p,g,m,y,v;le.debug("setBlockSizes abc95 (start)",t.id,(o=t==null?void 0:t.size)==null?void 0:o.x,"block width =",t==null?void 0:t.size,"siblingWidth",r),(l=t==null?void 0:t.size)!=null&&l.width||(t.size={width:r,height:n,x:0,y:0});let a=0,s=0;if(((u=t.children)==null?void 0:u.length)>0){for(const _ of t.children)_6(_,e,0,0,i);const T=h8t(t);a=T.width,s=T.height,le.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",a,s);for(const _ of t.children)_.size&&(le.debug(`abc95 Setting size of children of ${t.id} id=${_.id} ${a} ${s} ${JSON.stringify(_.size)}`),_.size.width=a*(_.widthInColumns??1)+i*((_.widthInColumns??1)-1),_.size.height=s,_.size.x=0,_.size.y=0,le.debug(`abc95 updating size of ${t.id} children child:${_.id} maxWidth:${a} maxHeight:${s}`));for(const _ of t.children)_6(_,e,a,s,i);const b=t.columns??-1;let w=0;for(const _ of t.children)w+=_.widthInColumns??1;let C=t.children.length;b>0&&b<w&&(C=b);const S=Math.ceil(w/C);let k=C*(a+i)+i,E=S*(s+i)+i;if(k<r){le.debug(`Detected to small sibling: abc95 ${t.id} siblingWidth ${r} siblingHeight ${n} width ${k}`),k=r,E=n;const _=(r-C*i-i)/C,M=(n-S*i-i)/S;le.debug("Size indata abc88",t.id,"childWidth",_,"maxWidth",a),le.debug("Size indata abc88",t.id,"childHeight",M,"maxHeight",s),le.debug("Size indata abc88 xSize",C,"padding",i);for(const L of t.children)L.size&&(L.size.width=_,L.size.height=M,L.size.x=0,L.size.y=0)}if(le.debug(`abc95 (finale calc) ${t.id} xSize ${C} ySize ${S} columns ${b}${t.children.length} width=${Math.max(k,((h=t.size)==null?void 0:h.width)||0)}`),k<(((d=t==null?void 0:t.size)==null?void 0:d.width)||0)){k=((f=t==null?void 0:t.size)==null?void 0:f.width)||0;const _=b>0?Math.min(t.children.length,b):t.children.length;if(_>0){const M=(k-_*i-i)/_;le.debug("abc95 (growing to fit) width",t.id,k,(p=t.size)==null?void 0:p.width,M);for(const L of t.children)L.size&&(L.size.width=M)}}t.size={width:k,height:E,x:0,y:0}}le.debug("setBlockSizes abc94 (done)",t.id,(g=t==null?void 0:t.size)==null?void 0:g.x,(m=t==null?void 0:t.size)==null?void 0:m.width,(y=t==null?void 0:t.size)==null?void 0:y.y,(v=t==null?void 0:t.size)==null?void 0:v.height)}x(_6,"setBlockSizes");function qU(t,e,r=8){var i,a,s,o,l,u,h,d,f,p,g,m,y,v,T,b,w;le.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${(i=t==null?void 0:t.size)==null?void 0:i.x} y: ${(a=t==null?void 0:t.size)==null?void 0:a.y} width: ${(s=t==null?void 0:t.size)==null?void 0:s.width}`);const n=t.columns??-1;if(le.debug("layoutBlocks columns abc95",t.id,"=>",n,t),t.children&&t.children.length>0){const C=((l=(o=t==null?void 0:t.children[0])==null?void 0:o.size)==null?void 0:l.width)??0,S=t.children.length*C+(t.children.length-1)*r;le.debug("widthOfChildren 88",S,"posX");const k=new Map;{let P=0;for(const D of t.children){if(!D.size)continue;const{py:R}=rF(n,P),I=k.get(R)??0;D.size.height>I&&k.set(R,D.size.height);let $=(D==null?void 0:D.widthInColumns)??1;n>0&&($=Math.min($,n-P%n)),P+=$}}const E=new Map;{let P=0;const D=[...k.keys()].sort((R,I)=>R-I);for(const R of D)E.set(R,P),P+=(k.get(R)??0)+r}let _=0;le.debug("abc91 block?.size?.x",t.id,(u=t==null?void 0:t.size)==null?void 0:u.x);let M=(h=t==null?void 0:t.size)!=null&&h.x?((d=t==null?void 0:t.size)==null?void 0:d.x)+(-((f=t==null?void 0:t.size)==null?void 0:f.width)/2||0):-r,L=0;for(const P of t.children){const D=t;if(!P.size)continue;const{width:R,height:I}=P.size,{px:$,py:O}=rF(n,_);if(O!=L&&(L=O,M=(p=t==null?void 0:t.size)!=null&&p.x?((g=t==null?void 0:t.size)==null?void 0:g.x)+(-((m=t==null?void 0:t.size)==null?void 0:m.width)/2||0):-r,le.debug("New row in layout for block",t.id," and child ",P.id,L)),le.debug(`abc89 layout blocks (child) id: ${P.id} Pos: ${_} (px, py) ${$},${O} (${(y=D==null?void 0:D.size)==null?void 0:y.x},${(v=D==null?void 0:D.size)==null?void 0:v.y}) parent: ${D.id} width: ${R}${r}`),D.size){const F=R/2;P.size.x=M+r+F,le.debug(`abc91 layout blocks (calc) px, pyid:${P.id} startingPos=X${M} new startingPosX${P.size.x} ${F} padding=${r} width=${R} halfWidth=${F} => x:${P.size.x} y:${P.size.y} ${P.widthInColumns} (width * (child?.w || 1)) / 2 ${R*((P==null?void 0:P.widthInColumns)??1)/2}`),M=P.size.x+F;const z=E.get(O)??0,V=k.get(O)??I;P.size.y=D.size.y-D.size.height/2+z+V/2+r,le.debug(`abc88 layout blocks (calc) px, pyid:${P.id}startingPosX${M}${r}${F}=>x:${P.size.x}y:${P.size.y}${P.widthInColumns}(width * (child?.w || 1)) / 2${R*((P==null?void 0:P.widthInColumns)??1)/2}`)}P.children&&qU(P,e,r);let N=(P==null?void 0:P.widthInColumns)??1;n>0&&(N=Math.min(N,n-_%n)),_+=N,le.debug("abc88 columnsPos",P,_)}}le.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${(T=t==null?void 0:t.size)==null?void 0:T.x} y: ${(b=t==null?void 0:t.size)==null?void 0:b.y} width: ${(w=t==null?void 0:t.size)==null?void 0:w.width}`)}x(qU,"layoutBlocks");function UU(t,{minX:e,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&t.id!=="root"){const{x:a,y:s,width:o,height:l}=t.size;a-o/2<e&&(e=a-o/2),s-l/2<r&&(r=s-l/2),a+o/2>n&&(n=a+o/2),s+l/2>i&&(i=s+l/2)}if(t.children)for(const a of t.children)({minX:e,minY:r,maxX:n,maxY:i}=UU(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}x(UU,"findBounds");function Y6e(t){var u,h;const e=t.getBlock("root");if(!e)return;const r=((h=(u=Fe())==null?void 0:u.block)==null?void 0:h.padding)??8;_6(e,t,0,0,r),qU(e,t,r),le.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:i,maxX:a,maxY:s}=UU(e),o=s-i,l=a-n;return{x:n,y:i,width:l,height:o}}x(Y6e,"layout");var d8t=x(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const s=Fe(),o=xn(s);return await ws(t,a,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Yl=d8t,f8t=x((t,e,r,n,i)=>{e.arrowTypeStart&&jie(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&jie(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),p8t={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},jie=x((t,e,r,n,i,a)=>{const s=p8t[r];if(!s){le.warn(`Unknown arrow type: ${r}`);return}const o=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${s}${o})`)},"addEdgeMarker"),nF={},cs={},g8t=x(async(t,e)=>{const r=Fe(),n=xn(r),i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label"),s=e.labelType==="markdown",o=await ws(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:s,isNode:!1,markdown:s,width:s?void 0:Number.POSITIVE_INFINITY},r);a.node().appendChild(o);let l=o.getBBox(),u=l;if(n){const d=o.children[0],f=ut(o);l=d.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const d=ut(o).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}a.attr("transform",Pc(u,n)),nF[e.id]=i,e.width=l.width,e.height=l.height;let h;if(e.startLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Yl(f,e.startLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=ut(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Pc(g,n)),cs[e.id]||(cs[e.id]={}),cs[e.id].startLeft=d,xw(h,e.startLabelLeft)}if(e.startLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Yl(f,e.startLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=ut(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Pc(g,n)),cs[e.id]||(cs[e.id]={}),cs[e.id].startRight=d,xw(h,e.startLabelRight)}if(e.endLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Yl(d,e.endLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=ut(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Pc(g,n)),cs[e.id]||(cs[e.id]={}),cs[e.id].endLeft=d,xw(h,e.endLabelLeft)}if(e.endLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await Yl(d,e.endLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],y=ut(p);g=m.getBoundingClientRect(),y.attr("width",g.width),y.attr("height",g.height)}f.attr("transform",Pc(g,n)),cs[e.id]||(cs[e.id]={}),cs[e.id].endRight=d,xw(h,e.endLabelRight)}return o},"insertEdgeLabel");function xw(t,e){xn(Fe())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}x(xw,"setTerminalWidth");var m8t=x((t,e)=>{le.debug("Moving label abc88 ",t.id,t.label,nF[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Fe(),{subGraphTitleTotalMargin:i}=vx(n);if(t.label){const a=nF[t.id];let s=t.x,o=t.y;if(r){const l=yr.calcLabelPosition(r);le.debug("Moving label "+t.label+" from (",s,",",o,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(s=l.x,o=l.y)}a.attr("transform",`translate(${s}, ${o+i/2})`)}if(t.startLabelLeft){const a=cs[t.id].startLeft;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){const a=cs[t.id].startRight;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){const a=cs[t.id].endLeft;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){const a=cs[t.id].endRight;let s=t.x,o=t.y;if(r){const l=yr.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=l.x,o=l.y}a.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),y8t=x((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,o=t.height/2;return i>=s||a>=o},"outsideNode"),v8t=x((t,e,r)=>{le.debug(`intersection calc abc89:
outsidePoint: ${JSON.stringify(e)}
insidePoint : ${JSON.stringify(r)}
node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2;let o=r.x<e.x?s-a:s+a;const l=t.height/2,u=Math.abs(e.y-r.y),h=Math.abs(e.x-r.x);if(Math.abs(i-e.y)*s>Math.abs(n-e.x)*l){let d=r.y<e.y?e.y-l-i:i-l-e.y;o=h*d/u;const f={x:r.x<e.x?r.x+o:r.x-h+o,y:r.y<e.y?r.y+u-d:r.y-u+d};return o===0&&(f.x=e.x,f.y=e.y),h===0&&(f.x=e.x),u===0&&(f.y=e.y),le.debug(`abc89 topp/bott calc, Q ${u}, q ${d}, R ${h}, r ${o}`,f),f}else{r.x<e.x?o=e.x-s-n:o=n-s-e.x;let d=u*o/h,f=r.x<e.x?r.x+h-o:r.x-h+o,p=r.y<e.y?r.y+d:r.y-d;return le.debug(`sides calc abc89, Q ${u}, q ${d}, R ${h}, r ${o}`,{_x:f,_y:p}),o===0&&(f=e.x,p=e.y),h===0&&(f=e.x),u===0&&(p=e.y),{x:f,y:p}}},"intersection"),Kie=x((t,e)=>{le.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!y8t(e,a)&&!i){const s=v8t(e,n,a);let o=!1;r.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)||r.push(s),i=!0}else n=a,i||r.push(a)}),r},"cutPathAtIntersect"),b8t=x(function(t,e,r,n,i,a,s){let o=r.points;le.debug("abc88 InsertEdge: edge=",r,"e=",e);let l=!1;const u=a.node(e.v);var h=a.node(e.w);h!=null&&h.intersect&&(u!=null&&u.intersect)&&(o=o.slice(1,r.points.length-1),o.unshift(u.intersect(o[0])),o.push(h.intersect(o[o.length-1]))),r.toCluster&&(le.debug("to cluster abc88",n[r.toCluster]),o=Kie(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(le.debug("from cluster abc88",n[r.fromCluster]),o=Kie(o.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=o.filter(w=>!Number.isNaN(w.y));let f=DC;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=Fpe(r),m=NC().x(p).y(g).curve(f);let y;switch(r.thickness){case"normal":y="edge-thickness-normal";break;case"thick":y="edge-thickness-thick";break;case"invisible":y="edge-thickness-thick";break;default:y=""}switch(r.pattern){case"solid":y+=" edge-pattern-solid";break;case"dotted":y+=" edge-pattern-dotted";break;case"dashed":y+=" edge-pattern-dashed";break}const v=t.append("path").attr("d",m(d)).attr("id",r.id).attr("class"," "+y+(r.classes?" "+r.classes:"")).attr("style",r.style);let T="";(Fe().flowchart.arrowMarkerAbsolute||Fe().state.arrowMarkerAbsolute)&&(T=J6(!0)),f8t(v,r,T,s,i);let b={};return l&&(b.updatedPath=o),b.originalPath=r.points,b},"insertEdge"),x8t=x(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r);break}return e},"expandAndDeduplicateDirections"),T8t=x((t,e,r,n)=>{const i=x8t(t),a=2,s=e.height+2*r.padding,o=s/a,l=n??e.width+2*o+r.padding,u=r.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:o,y:0},{x:l/2,y:2*u},{x:l-o,y:0},{x:l,y:0},{x:l,y:-s/3},{x:l+2*u,y:-s/2},{x:l,y:-2*s/3},{x:l,y:-s},{x:l-o,y:-s},{x:l/2,y:-s-2*u},{x:o,y:-s},{x:0,y:-s},{x:0,y:-2*s/3},{x:-2*u,y:-s/2},{x:0,y:-s/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:o,y:0},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:o,y:-s},{x:0,y:-s/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:o,y:-s},{x:l-o,y:-s},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-o},{x:l,y:-s+o},{x:0,y:-s}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-o},{x:0,y:-s+o},{x:l,y:-s}]:i.has("right")&&i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-o},{x:0,y:-s}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-s}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-o},{x:l,y:-s}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-s}]:i.has("right")?[{x:o,y:-u},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:0},{x:l,y:-s/2},{x:l-o,y:-s},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s+u}]:i.has("left")?[{x:o,y:0},{x:o,y:-u},{x:l-o,y:-u},{x:l-o,y:-s+u},{x:o,y:-s+u},{x:o,y:-s},{x:0,y:-s/2}]:i.has("up")?[{x:o,y:-u},{x:o,y:-s+u},{x:0,y:-s+u},{x:l/2,y:-s},{x:l,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:o,y:-u},{x:o,y:-s+u},{x:l-o,y:-s+u},{x:l-o,y:-u},{x:l,y:-u}]:[{x:0,y:0}]},"getArrowPoints");function X6e(t,e){return t.intersect(e)}x(X6e,"intersectNode");var w8t=X6e;function j6e(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,o=a-n.y,l=Math.sqrt(e*e*o*o+r*r*s*s),u=Math.abs(e*r*s/l);n.x<i&&(u=-u);var h=Math.abs(e*r*o/l);return n.y<a&&(h=-h),{x:i+u,y:a+h}}x(j6e,"intersectEllipse");var K6e=j6e;function Z6e(t,e,r){return K6e(t,e,e,r)}x(Z6e,"intersectCircle");var C8t=Z6e;function Q6e(t,e,r,n){var i,a,s,o,l,u,h,d,f,p,g,m,y,v,T;if(i=e.y-t.y,s=t.x-e.x,l=e.x*t.y-t.x*e.y,f=i*r.x+s*r.y+l,p=i*n.x+s*n.y+l,!(f!==0&&p!==0&&iF(f,p))&&(a=n.y-r.y,o=r.x-n.x,u=n.x*r.y-r.x*n.y,h=a*t.x+o*t.y+u,d=a*e.x+o*e.y+u,!(h!==0&&d!==0&&iF(h,d))&&(g=i*o-a*s,g!==0)))return m=Math.abs(g/2),y=s*u-o*l,v=y<0?(y-m)/g:(y+m)/g,y=a*l-i*u,T=y<0?(y-m)/g:(y+m)/g,{x:v,y:T}}x(Q6e,"intersectLine");function iF(t,e){return t*e>0}x(iF,"sameSign");var k8t=Q6e,S8t=J6e;function J6e(t,e,r){var n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(g){s=Math.min(s,g.x),o=Math.min(o,g.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));for(var l=n-t.width/2-s,u=i-t.height/2-o,h=0;h<e.length;h++){var d=e[h],f=e[h<e.length-1?h+1:0],p=k8t(t,r,{x:l+d.x,y:u+d.y},{x:l+f.x,y:u+f.y});p&&a.push(p)}return a.length?(a.length>1&&a.sort(function(g,m){var y=g.x-r.x,v=g.y-r.y,T=Math.sqrt(y*y+v*v),b=m.x-r.x,w=m.y-r.y,C=Math.sqrt(b*b+w*w);return T<C?-1:T===C?0:1}),a[0]):t}x(J6e,"intersectPolygon");var E8t=x((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,o=t.height/2,l,u;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=a===0?0:o*i/a,u=o):(i<0&&(s=-s),l=s,u=i===0?0:s*a/i),{x:r+l,y:n+u}},"intersectRect"),A8t=E8t,hi={node:w8t,circle:C8t,ellipse:K6e,polygon:S8t,rect:A8t},Na=x(async(t,e,r,n)=>{const i=Fe();let a;const s=e.useHtmlLabels||xn(i);r?a=r:a="node default";const o=t.insert("g").attr("class",a).attr("id",e.domId||e.id),l=o.insert("g").attr("class","label").attr("style",e.labelStyle);let u;e.labelText===void 0?u="":u=typeof e.labelText=="string"?e.labelText:e.labelText[0];let h;e.labelType==="markdown"?h=ws(l,Wr(vh(u),i),{useHtmlLabels:s,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await Yl(l,Wr(vh(u),i),e.labelStyle,!1,n);let d=h.getBBox();const f=e.padding/2;if(xn(i)){const p=h.children[0],g=ut(h);await fV(p,u),d=p.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return s?l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):l.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:o,bbox:d,halfPadding:f,label:l}},"labelHelper"),Ri=x((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function pc(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}x(pc,"insertPolygonShape");var _8t=x(async(t,e)=>{e.useHtmlLabels||xn(Fe())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:a}=await Na(t,e,"node "+e.classes,!0);le.info("Classes = ",e.classes);const s=n.insert("rect",":first-child");return s.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-a).attr("y",-i.height/2-a).attr("width",i.width+e.padding).attr("height",i.height+e.padding),Ri(e,s),e.intersect=function(o){return hi.rect(e,o)},n},"note"),R8t=_8t,Zie=x(t=>t?" "+t:"","formatClass"),Ko=x((t,e)=>`${e||"node default"}${Zie(t.classes)} ${Zie(t.class)}`,"getClassesFromNode"),Qie=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=i+a,o=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];le.info("Question main (Circle)");const l=pc(r,s,s,o);return l.attr("style",e.style),Ri(e,l),e.intersect=function(u){return le.warn("Intersect called"),hi.polygon(e,o,u)},r},"question"),L8t=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=28,i=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}];return r.insert("polygon",":first-child").attr("points",i.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(s){return hi.circle(e,14,s)},r},"choice"),M8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=4,a=e.positioned?e.height:n.height+e.padding,s=a/i,o=e.positioned?e.width:n.width+2*s+e.padding,l=[{x:s,y:0},{x:o-s,y:0},{x:o,y:-a/2},{x:o-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}],u=pc(r,o,a,l);return u.attr("style",e.style),Ri(e,u),e.intersect=function(h){return hi.polygon(e,l,h)},r},"hexagon"),I8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,void 0,!0),i=2,a=n.height+2*e.padding,s=a/i,o=n.width+2*s+e.padding,u=e.positioned&&(e.widthInColumns??1)>1&&e.width>o?e.width:o,h=T8t(e.directions,n,e,u),d=pc(r,u,a,h);return d.attr("style",e.style),Ri(e,d),e.intersect=function(f){return hi.polygon(e,h,f)},r},"block_arrow"),N8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return pc(r,i,a,s).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(l){return hi.polygon(e,s,l)},r},"rect_left_inv_arrow"),D8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],o=pc(r,i,a,s);return o.attr("style",e.style),Ri(e,o),e.intersect=function(l){return hi.polygon(e,s,l)},r},"lean_right"),O8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],o=pc(r,i,a,s);return o.attr("style",e.style),Ri(e,o),e.intersect=function(l){return hi.polygon(e,s,l)},r},"lean_left"),$8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],o=pc(r,i,a,s);return o.attr("style",e.style),Ri(e,o),e.intersect=function(l){return hi.polygon(e,s,l)},r},"trapezoid"),P8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],o=pc(r,i,a,s);return o.attr("style",e.style),Ri(e,o),e.intersect=function(l){return hi.polygon(e,s,l)},r},"inv_trapezoid"),B8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i+a/2,y:0},{x:i,y:-a/2},{x:i+a/2,y:-a},{x:0,y:-a}],o=pc(r,i,a,s);return o.attr("style",e.style),Ri(e,o),e.intersect=function(l){return hi.polygon(e,s,l)},r},"rect_right_inv_arrow"),F8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=i/2,s=a/(2.5+i/50),o=n.height+s+e.padding,l="M 0,"+s+" a "+a+","+s+" 0,0,0 "+i+" 0 a "+a+","+s+" 0,0,0 "+-i+" 0 l 0,"+o+" a "+a+","+s+" 0,0,0 "+i+" 0 l 0,"+-o,u=r.attr("label-offset-y",s).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(o/2+s)+")");return Ri(e,u),e.intersect=function(h){const d=hi.rect(e,h),f=d.x-e.x;if(a!=0&&(Math.abs(f)<e.width/2||Math.abs(f)==e.width/2&&Math.abs(d.y-e.y)>e.height/2-s)){let p=s*s*(1-f*f/(a*a));p!=0&&(p=Math.sqrt(p)),p=s-p,h.y-e.y>0&&(p=-p),d.y+=p}return d},r},"cylinder"),z8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Na(t,e,"node "+e.classes+" "+e.class,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(G7(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{le.warn(`Unknown node property ${d}`)})}return Ri(e,a),e.intersect=function(h){return hi.rect(e,h)},r},"rect"),V8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Na(t,e,"node "+e.classes,!0),a=r.insert("rect",":first-child"),s=e.positioned?e.width:n.width+e.padding,o=e.positioned?e.height:n.height+e.padding,l=e.positioned?-s/2:-n.width/2-i,u=e.positioned?-o/2:-n.height/2-i;if(a.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",l).attr("y",u).attr("width",s).attr("height",o),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(G7(a,e.props.borders,s,o),h.delete("borders")),h.forEach(d=>{le.warn(`Unknown node property ${d}`)})}return Ri(e,a),e.intersect=function(h){return hi.rect(e,h)},r},"composite"),G8t=x(async(t,e)=>{const{shapeSvg:r}=await Na(t,e,"label",!0);le.trace("Classes = ",e.class);const n=r.insert("rect",":first-child"),i=0,a=0;if(n.attr("width",i).attr("height",a),r.attr("class","label edgeLabel"),e.props){const s=new Set(Object.keys(e.props));e.props.borders&&(G7(n,e.props.borders,i,a),s.delete("borders")),s.forEach(o=>{le.warn(`Unknown node property ${o}`)})}return Ri(e,n),e.intersect=function(s){return hi.rect(e,s)},r},"labelRect");function G7(t,e,r,n){const i=[],a=x(o=>{i.push(o,0)},"addBorder"),s=x(o=>{i.push(0,o)},"skipBorder");e.includes("t")?(le.debug("add top border"),a(r)):s(r),e.includes("r")?(le.debug("add right border"),a(n)):s(n),e.includes("b")?(le.debug("add bottom border"),a(r)):s(r),e.includes("l")?(le.debug("add left border"),a(n)):s(n),t.attr("stroke-dasharray",i.join(" "))}x(G7,"applyNodePropertyBorders");var W8t=x(async(t,e)=>{let r;e.classes?r="node "+e.classes:r="node default";const n=t.insert("g").attr("class",r).attr("id",e.domId||e.id),i=n.insert("rect",":first-child"),a=n.insert("line"),s=n.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let l="";typeof o=="object"?l=o[0]:l=o,le.info("Label text abc79",l,o,typeof o=="object");const u=await Yl(s,l,e.labelStyle,!0,!0);let h={width:0,height:0};if(xn(Fe())){const m=u.children[0],y=ut(u);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}le.info("Text 2",o);const d=o.slice(1,o.length);let f=u.getBBox();const p=await Yl(s,d.join?d.join("<br/>"):d,e.labelStyle,!0,!0);if(xn(Fe())){const m=p.children[0],y=ut(p);h=m.getBoundingClientRect(),y.attr("width",h.width),y.attr("height",h.height)}const g=e.padding/2;return ut(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),ut(u).attr("transform","translate( "+(h.width<f.width?0:-(f.width-h.width)/2)+", 0)"),h=s.node().getBBox(),s.attr("transform","translate("+-h.width/2+", "+(-h.height/2-g+3)+")"),i.attr("class","outer title-state").attr("x",-h.width/2-g).attr("y",-h.height/2-g).attr("width",h.width+e.padding).attr("height",h.height+e.padding),a.attr("class","divider").attr("x1",-h.width/2-g).attr("x2",h.width/2+g).attr("y1",-h.height/2-g+f.height+g).attr("y2",-h.height/2-g+f.height+g),Ri(e,i),e.intersect=function(m){return hi.rect(e,m)},n},"rectWithTitle"),H8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.height+e.padding,a=n.width+i/4+e.padding,s=r.insert("rect",":first-child").attr("style",e.style).attr("rx",i/2).attr("ry",i/2).attr("x",-a/2).attr("y",-i/2).attr("width",a).attr("height",i);return Ri(e,s),e.intersect=function(o){return hi.rect(e,o)},r},"stadium"),q8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Na(t,e,Ko(e,void 0),!0),a=r.insert("circle",":first-child");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),le.info("Circle main"),Ri(e,a),e.intersect=function(s){return le.info("Circle intersect",e,n.width/2+i,s),hi.circle(e,n.width/2+i,s)},r},"circle"),U8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Na(t,e,Ko(e,void 0),!0),a=5,s=r.insert("g",":first-child"),o=s.insert("circle"),l=s.insert("circle");return s.attr("class",e.class),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+a).attr("width",n.width+e.padding+a*2).attr("height",n.height+e.padding+a*2),l.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),le.info("DoubleCircle main"),Ri(e,o),e.intersect=function(u){return le.info("DoubleCircle intersect",e,n.width/2+i+a,u),hi.circle(e,n.width/2+i+a,u)},r},"doublecircle"),Y8t=x(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Na(t,e,Ko(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,s=[{x:0,y:0},{x:i,y:0},{x:i,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],o=pc(r,i,a,s);return o.attr("style",e.style),Ri(e,o),e.intersect=function(l){return hi.polygon(e,s,l)},r},"subroutine"),X8t=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),Ri(e,n),e.intersect=function(i){return hi.circle(e,7,i)},r},"start"),Jie=x((t,e,r)=>{const n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let i=70,a=10;r==="LR"&&(i=10,a=70);const s=n.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return Ri(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(o){return hi.rect(e,o)},n},"forkJoin"),j8t=x((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),Ri(e,i),e.intersect=function(a){return hi.circle(e,7,a)},r},"end"),K8t=x(async(t,e)=>{var E;const r=e.padding/2,n=4,i=8;let a;e.classes?a="node "+e.classes:a="node default";const s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),o=s.insert("rect",":first-child"),l=s.insert("line"),u=s.insert("line");let h=0,d=n;const f=s.insert("g").attr("class","label");let p=0;const g=(E=e.classData.annotations)==null?void 0:E[0],m=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",y=await Yl(f,m,e.labelStyle,!0,!0);let v=y.getBBox();if(xn(Fe())){const _=y.children[0],M=ut(y);v=_.getBoundingClientRect(),M.attr("width",v.width),M.attr("height",v.height)}e.classData.annotations[0]&&(d+=v.height+n,h+=v.width);let T=e.classData.label;e.classData.type!==void 0&&e.classData.type!==""&&(xn(Fe())?T+="&lt;"+e.classData.type+"&gt;":T+="<"+e.classData.type+">");const b=await Yl(f,T,e.labelStyle,!0,!0);ut(b).attr("class","classTitle");let w=b.getBBox();if(xn(Fe())){const _=b.children[0],M=ut(b);w=_.getBoundingClientRect(),M.attr("width",w.width),M.attr("height",w.height)}d+=w.height+n,w.width>h&&(h=w.width);const C=[];e.classData.members.forEach(async _=>{const M=_.getDisplayDetails();let L=M.displayText;xn(Fe())&&(L=L.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const P=await Yl(f,L,M.cssStyle?M.cssStyle:e.labelStyle,!0,!0);let D=P.getBBox();if(xn(Fe())){const R=P.children[0],I=ut(P);D=R.getBoundingClientRect(),I.attr("width",D.width),I.attr("height",D.height)}D.width>h&&(h=D.width),d+=D.height+n,C.push(P)}),d+=i;const S=[];if(e.classData.methods.forEach(async _=>{const M=_.getDisplayDetails();let L=M.displayText;xn(Fe())&&(L=L.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const P=await Yl(f,L,M.cssStyle?M.cssStyle:e.labelStyle,!0,!0);let D=P.getBBox();if(xn(Fe())){const R=P.children[0],I=ut(P);D=R.getBoundingClientRect(),I.attr("width",D.width),I.attr("height",D.height)}D.width>h&&(h=D.width),d+=D.height+n,S.push(P)}),d+=i,g){let _=(h-v.width)/2;ut(y).attr("transform","translate( "+(-1*h/2+_)+", "+-1*d/2+")"),p=v.height+n}let k=(h-w.width)/2;return ut(b).attr("transform","translate( "+(-1*h/2+k)+", "+(-1*d/2+p)+")"),p+=w.height+n,l.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,C.forEach(_=>{ut(_).attr("transform","translate( "+-h/2+", "+(-1*d/2+p+i/2)+")");const M=_==null?void 0:_.getBBox();p+=((M==null?void 0:M.height)??0)+n}),p+=i,u.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-d/2-r+i+p).attr("y2",-d/2-r+i+p),p+=i,S.forEach(_=>{ut(_).attr("transform","translate( "+-h/2+", "+(-1*d/2+p)+")");const M=_==null?void 0:_.getBBox();p+=((M==null?void 0:M.height)??0)+n}),o.attr("style",e.style).attr("class","outer title-state").attr("x",-h/2-r).attr("y",-(d/2)-r).attr("width",h+e.padding).attr("height",d+e.padding),Ri(e,o),e.intersect=function(_){return hi.rect(e,_)},s},"class_box"),eae={rhombus:Qie,composite:V8t,question:Qie,rect:z8t,labelRect:G8t,rectWithTitle:W8t,choice:L8t,circle:q8t,doublecircle:U8t,stadium:H8t,hexagon:M8t,block_arrow:I8t,rect_left_inv_arrow:N8t,lean_right:D8t,lean_left:O8t,trapezoid:$8t,inv_trapezoid:P8t,rect_right_inv_arrow:B8t,cylinder:F8t,start:X8t,end:j8t,note:R8t,subroutine:Y8t,fork:Jie,join:Jie,class_box:K8t},e5={},eRe=x(async(t,e,r)=>{let n,i;if(e.link){let a;Fe().securityLevel==="sandbox"?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a),i=await eae[e.shape](n,e,r)}else i=await eae[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),e5[e.id]=n,e.haveCallback&&e5[e.id].attr("class",e5[e.id].attr("class")+" clickable"),n},"insertNode"),Z8t=x(t=>{const e=e5[t.id];le.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode");function YU(t,e,r=!1){var p,g,m;const n=t;let i="default";(((p=n==null?void 0:n.classes)==null?void 0:p.length)||0)>0&&(i=((n==null?void 0:n.classes)??[]).join(" ")),i=i+" flowchart-label";let a=0,s="",o;switch(n.type){case"round":a=5,s="rect";break;case"composite":a=0,s="composite",o=0;break;case"square":s="rect";break;case"diamond":s="question";break;case"hexagon":s="hexagon";break;case"block_arrow":s="block_arrow";break;case"odd":s="rect_left_inv_arrow";break;case"lean_right":s="lean_right";break;case"lean_left":s="lean_left";break;case"trapezoid":s="trapezoid";break;case"inv_trapezoid":s="inv_trapezoid";break;case"rect_left_inv_arrow":s="rect_left_inv_arrow";break;case"circle":s="circle";break;case"ellipse":s="ellipse";break;case"stadium":s="stadium";break;case"subroutine":s="subroutine";break;case"cylinder":s="cylinder";break;case"group":s="rect";break;case"doublecircle":s="doublecircle";break;default:s="rect"}const l=hV((n==null?void 0:n.styles)??[]),u=n.label,h=n.size??{width:0,height:0,x:0,y:0},d=e.getDiagramId();return{labelStyle:l.labelStyle,shape:s,labelText:u,rx:a,ry:a,class:i,style:l.style,id:n.id,domId:d?`${d}-${n.id}`:n.id,directions:n.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:r,intersect:void 0,type:n.type,padding:o??((m=(g=Xt())==null?void 0:g.block)==null?void 0:m.padding)??0,widthInColumns:n.widthInColumns??1}}x(YU,"getNodeFromBlock");async function tRe(t,e,r){const n=YU(e,r,!1);if(n.type==="group")return;const i=Xt(),a=await eRe(t,n,{config:i}),s=a.node().getBBox(),o=r.getBlock(n.id);o.size={width:s.width,height:s.height,x:0,y:0,node:a},r.setBlock(o),a.remove()}x(tRe,"calculateBlockSize");async function rRe(t,e,r){const n=YU(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=Xt();await eRe(t,n,{config:a}),e.intersect=n==null?void 0:n.intersect,Z8t(n)}}x(rRe,"insertBlockPositioned");async function W7(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await W7(t,i.children,r,n)}x(W7,"performOperations");async function nRe(t,e,r){await W7(t,e,r,tRe)}x(nRe,"calculateBlockSizes");async function iRe(t,e,r){await W7(t,e,r,rRe)}x(iRe,"insertBlocks");async function aRe(t,e,r,n,i){const a=new ms({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of r)s.size&&a.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of e)if(s.start&&s.end){const o=n.getBlock(s.start),l=n.getBlock(s.end);if(o!=null&&o.size&&(l!=null&&l.size)){const u=o.size,h=l.size,d=[{x:u.x,y:u.y},{x:u.x+(h.x-u.x)/2,y:u.y+(h.y-u.y)/2},{x:h.x,y:h.y}],f=i?`${i}-${s.id}`:s.id,p=s.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",g=s.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",m=`${p} ${g} flowchart-link LS-a1 LE-b1`;b8t(t,{v:s.start,w:s.end,name:f},{...s,id:f,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m},void 0,"block",a,i),s.label&&(await g8t(t,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:d,classes:m}),m8t({...s,x:d[1].x,y:d[1].y},{originalPath:d}))}}}x(aRe,"insertEdges");var Q8t=x(function(t,e){return e.db.getClasses()},"getClasses"),J8t=x(async function(t,e,r,n){const{securityLevel:i,block:a}=Xt(),s=n.db;s.setDiagramId(e);let o;i==="sandbox"&&(o=ut("#i"+e));const l=ut(i==="sandbox"?o.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):ut(`[id="${e}"]`);u8t(u,["point","circle","cross"],n.type,e);const d=s.getBlocks(),f=s.getBlocksFlat(),p=s.getEdges(),g=u.insert("g").attr("class","block");await nRe(g,d,s);const m=Y6e(s);if(await iRe(g,d,s),await aRe(g,p,f,s,e),m){const y=m,v=Math.max(1,Math.round(.125*(y.width/y.height))),T=y.height+v+10,b=y.width+10,{useMaxWidth:w}=a;Ai(u,T,b,!!w),le.debug("Here Bounds",m,y),u.attr("viewBox",`${y.x-5} ${y.y-5} ${y.width+10} ${y.height+10}`)}},"draw"),eNt={draw:J8t,getClasses:Q8t},tNt={parser:LIt,db:KIt,renderer:eNt,styles:QIt};const rNt=Object.freeze(Object.defineProperty({__proto__:null,diagram:tNt},Symbol.toStringTag,{value:"Module"}));var sRe=/[─━│┃└┗├┣]/,oRe=/[└┗├┣]/,nNt=/[─━]/,tae=/^[\s│┃]+$/,rae=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,nae=/^\s*%%/,iNt=" ";function lRe(t){return t.some(e=>sRe.test(e))}x(lRe,"isBoxDrawingFormat");function cRe(t){for(const e of t){const r=oRe.exec(e);if(r!=null&&r.index&&r.index>0)return r.index}return 4}x(cRe,"inferSegmentWidth");function uRe(t,e){return t.replace(/\bline\s+(\d+)\b/gi,(r,n)=>{const i=parseInt(n,10),a=e.get(i);return a?`line ${a}`:r})}x(uRe,"remapErrorLines");function hRe(t){const e=t.split(`
`),r=new Map;let n=-1;for(const[l,u]of e.entries())if(u.trim()==="treeView-beta"){n=l;break}if(n===-1)return{text:t,lineMap:r};const i=[];for(let l=n+1;l<e.length;l++){const u=e[l];u.trim()===""||nae.test(u)||rae.test(u)||tae.test(u)||i.push(u.replace(/\t/g," "))}if(!lRe(i))return{text:t,lineMap:r};const a=cRe(i),s=[];let o=0;for(let l=0;l<=n;l++)s.push(e[l]),o++,r.set(o,l+1);for(let l=n+1;l<e.length;l++){const u=e[l],h=u.trim(),d=l+1;if(h===""){s.push(u),o++,r.set(o,d);continue}if(nae.test(u)){s.push(u),o++,r.set(o,d);continue}if(rae.test(u)){s.push(u),o++,r.set(o,d);continue}if(tae.test(u))continue;const f=u.replace(/\t/g," "),p=oRe.exec(f);if((p==null?void 0:p.index)!==void 0){const g=p.index,m=Math.round(g/a)+1;let y=g+1;for(;y<f.length&&nNt.test(f[y]);)y++;for(;y<f.length&&f[y]===" ";)y++;const v=f.slice(y).trimEnd();if(!v)throw new Error(`Line ${d}: Empty node — expected a filename or directory name after the box-drawing prefix`);const T=iNt.repeat(m);s.push(T+v),o++,r.set(o,d)}else{if(/^[\s─━│┃└┗├┣]+$/.test(f))continue;if(sRe.test(f))s.push(u),o++,r.set(o,d);else{if(/^\s+/.test(f))throw new Error(`Line ${d}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);s.push(u),o++,r.set(o,d)}}}return{text:s.join(`
`),lineMap:r}}x(hRe,"preprocessBoxDrawing");var Dc=new xW(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),aNt=x(()=>{Dc.reset(),On()},"clear"),sNt=x(()=>Dc.records.stack[0],"getRoot"),oNt=x(()=>Dc.records.cnt,"getCount"),lNt=Vr.treeView,cNt=x(()=>ri(lNt,Xt().treeView),"getConfig"),uNt=x((t,e,r,n,i,a)=>{for(;t<=Dc.records.stack[Dc.records.stack.length-1].level;)Dc.records.stack.pop();const s={id:Dc.records.cnt++,level:t,name:e,nodeType:r,icon:i,cssClass:n,description:a,children:[]};Dc.records.stack[Dc.records.stack.length-1].children.push(s),Dc.records.stack.push(s)},"addNode"),hNt={clear:aNt,addNode:uNt,getRoot:sNt,getCount:oNt,getConfig:cNt,getAccTitle:ni,getAccDescription:ai,getDiagramTitle:Yn,setAccDescription:ii,setAccTitle:Hn,setDiagramTitle:ti},aF=hNt,dNt=x(t=>{eo(t,aF);for(const e of t.nodes){const r=typeof e.indent=="number"?e.indent:0;let n=e.name;const i=n.endsWith("/");i&&(n=n.slice(0,-1));const a=i?"directory":"file",s=e.classAnnotation||void 0,o=e.iconAnnotation,l=o!==void 0?o||"none":void 0,u=e.descAnnotation||void 0,h=u?Wr(u,Xt()):void 0;aF.addNode(r,n,a,s,l,h)}},"populate"),fNt={parse:x(async t=>{const{text:e,lineMap:r}=hRe(t);try{const n=await Al("treeView",e);le.debug(n),dNt(n)}catch(n){throw r.size>0&&n instanceof Error&&(n.message=uRe(n.message,r)),n}},"parse")},Dk={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function dRe(t,e){var i;const r=(i=e==null?void 0:e.filenameIcons)==null?void 0:i[t];if(r)return r;const n=t.lastIndexOf(".");if(n>0){const a=t.substring(n).toLowerCase(),s=e==null?void 0:e.extensionIcons;return(s==null?void 0:s[a])??(s==null?void 0:s[a.slice(1)])}}x(dRe,"detectIcon");function sF(t,e){return t.includes(":")?t:t in Dk.icons||!e?`${Dk.prefix}:${t}`:`${e}:${t}`}x(sF,"qualifyIcon");function XU(t,e){if(t.icon!=="none"){if(t.icon)return sF(t.icon,e.defaultIconPack);if(e.showIcons){if(t.nodeType==="file"){const r=dRe(t.name,e);if(r==="none")return;if(r)return sF(r,e.defaultIconPack)}return`${Dk.prefix}:${t.nodeType==="directory"?"folder":"file"}`}}}x(XU,"getNodeIcon");pV([{name:Dk.prefix,icons:Dk}]);var oF=14,pNt=4,gNt=16,fRe=x((t,e)=>`tv-icon-${t}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),mNt=x(async(t,e,r,n)=>{const i=new Set,a=x(l=>{const u=XU(l,r);u&&i.add(u),l.children.forEach(a)},"collect");if(a(e),i.size===0)return;const s=await Promise.all([...i].map(async l=>({icon:l,svg:await bh(l,{height:oF,width:oF})}))),o=t.append("defs");for(const{icon:l,svg:u}of s)o.append("g").attr("id",fRe(n,l)).html(u)},"injectIconDefs"),yNt=x((t,e,r,n,i,a)=>{var T;const s=n.append("g");let o="treeView-node-label";r.nodeType==="directory"&&(o+=" treeView-node-dir"),r.cssClass&&(o+=` ${r.cssClass}`);const l=oF+pNt,u=XU(r,i),h=u!==void 0;u&&s.append("use").attr("xlink:href",`#${fRe(a,u)}`).attr("x",t+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const d=s.append("text").text(r.name).attr("dominant-baseline","middle").attr("class",o),{height:f,width:p}=d.node().getBBox(),g=f+i.paddingY*2,m=t+i.paddingX+(h?l:0);d.attr("x",m),d.attr("y",e+g/2);const y=m+p,v=p+i.paddingX*2+(h?l:0);return r.BBox={x:t,y:e,width:v,height:g},(T=r.cssClass)!=null&&T.split(/\s+/).includes("highlight")&&s.insert("rect",":first-child").attr("x",t).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:r,nodeGroup:s,labelRightEdge:y,centerY:e+g/2}},"positionLabel"),iae=x((t,e,r,n,i,a)=>t.append("line").attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),vNt=x((t,e,r,n)=>{var h;let i=0,a=0;const s=[],o=x((d,f,p,g)=>{const m=g*(p.rowIndent+p.paddingX),y=yNt(m,i,f,d,p,n);s.push(y);const{height:v,width:T}=f.BBox;iae(d,m-p.rowIndent,i+v/2,m,i+v/2,p.lineThickness),a=Math.max(a,m+T),i+=v},"drawNode"),l=x((d,f=0)=>{o(t,d,r,f),d.children.forEach(y=>{l(y,f+1)});const{x:p,y:g,height:m}=d.BBox;if(d.children.length){const{y,height:v}=d.children[d.children.length-1].BBox;iae(t,p+r.paddingX,g+m,p+r.paddingX,y+v/2+r.lineThickness/2,r.lineThickness)}},"processNode");l(e);const u=s.filter(d=>d.node.description);if(u.length>0){const f=Math.max(...s.map(p=>p.labelRightEdge))+gNt;for(const p of u){const m=p.nodeGroup.append("text").text(p.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",f).attr("y",p.centerY).node().getBBox();a=Math.max(a,f+m.width+r.paddingX)}}for(const d of s)if((h=d.node.cssClass)!=null&&h.split(/\s+/).includes("highlight")){const f=d.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){const p=a-d.node.BBox.x+8;f.attr("width",p),a=Math.max(a,d.node.BBox.x+p+2)}}return{totalHeight:i,totalWidth:a}},"drawTree"),bNt=x(async(t,e,r,n)=>{le.debug(`Rendering treeView diagram
`+t);const i=n.db,a=i.getRoot(),s=i.getConfig(),o=xs(e);await mNt(o,a,s,e);const l=o.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:h}=vNt(l,a,s,e);o.attr("viewBox",`-${s.lineThickness/2} 0 ${h} ${u}`),Ai(o,u,h,s.useMaxWidth)},"draw"),xNt={draw:bNt},TNt=xNt,wNt={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},CNt=x(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n,iconColor:i,descriptionColor:a,highlightBg:s,highlightStroke:o}=ri(wNt,t);return`
.treeView-node-label {
font-size: ${e};
fill: ${r};
white-space: pre;
}
.treeView-node-dir {
font-weight: bold;
}
.treeView-node-line {
stroke: ${n};
}
.treeView-node-icon {
color: ${i};
}
.treeView-node-description {
font-size: ${e};
fill: ${a};
font-style: italic;
white-space: pre;
}
.treeView-highlight-bg {
fill: ${s};
stroke: ${o};
stroke-width: 1;
}
`},"styles"),kNt=CNt,SNt={db:aF,renderer:TNt,parser:fNt,styles:kNt};const ENt=Object.freeze(Object.defineProperty({__proto__:null,diagram:SNt},Symbol.toStringTag,{value:"Module"}));var t5={exports:{}},r5={exports:{}},n5={exports:{}},ANt=n5.exports,aae;function _Nt(){return aae||(aae=1,(function(t,e){(function(n,i){t.exports=i()})(ANt,function(){return(function(r){var n={};function i(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=n,i.i=function(a){return a},i.d=function(a,s,o){i.o(a,s)||Object.defineProperty(a,s,{configurable:!1,enumerable:!0,get:o})},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="",i(i.s=28)})([(function(r,n,i){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1e3,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,r.exports=a}),(function(r,n,i){var a=i(2),s=i(8),o=i(9);function l(h,d,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=h,this.target=d}l.prototype=Object.create(a.prototype);for(var u in a)l[u]=a[u];l.prototype.getSource=function(){return this.source},l.prototype.getTarget=function(){return this.target},l.prototype.isInterGraph=function(){return this.isInterGraph},l.prototype.getLength=function(){return this.length},l.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},l.prototype.getBendpoints=function(){return this.bendpoints},l.prototype.getLca=function(){return this.lca},l.prototype.getSourceInLca=function(){return this.sourceInLca},l.prototype.getTargetInLca=function(){return this.targetInLca},l.prototype.getOtherEnd=function(h){if(this.source===h)return this.target;if(this.target===h)return this.source;throw"Node is not incident with this edge"},l.prototype.getOtherEndInGraph=function(h,d){for(var f=this.getOtherEnd(h),p=d.getGraphManager().getRoot();;){if(f.getOwner()==d)return f;if(f.getOwner()==p)break;f=f.getOwner().getParent()}return null},l.prototype.updateLength=function(){var h=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),h),this.isOverlapingSourceAndTarget||(this.lengthX=h[0]-h[2],this.lengthY=h[1]-h[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},l.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l}),(function(r,n,i){function a(s){this.vGraphObject=s}r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(13),l=i(0),u=i(16),h=i(5);function d(p,g,m,y){m==null&&y==null&&(y=g),a.call(this,y),p.graphManager!=null&&(p=p.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=y,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new o(g.x,g.y,m.width,m.height):this.rect=new o}d.prototype=Object.create(a.prototype);for(var f in a)d[f]=a[f];d.prototype.getEdges=function(){return this.edges},d.prototype.getChild=function(){return this.child},d.prototype.getOwner=function(){return this.owner},d.prototype.getWidth=function(){return this.rect.width},d.prototype.setWidth=function(p){this.rect.width=p},d.prototype.getHeight=function(){return this.rect.height},d.prototype.setHeight=function(p){this.rect.height=p},d.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},d.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},d.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},d.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},d.prototype.getRect=function(){return this.rect},d.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},d.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},d.prototype.setRect=function(p,g){this.rect.x=p.x,this.rect.y=p.y,this.rect.width=g.width,this.rect.height=g.height},d.prototype.setCenter=function(p,g){this.rect.x=p-this.rect.width/2,this.rect.y=g-this.rect.height/2},d.prototype.setLocation=function(p,g){this.rect.x=p,this.rect.y=g},d.prototype.moveBy=function(p,g){this.rect.x+=p,this.rect.y+=g},d.prototype.getEdgeListToNode=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(y.target==p){if(y.source!=m)throw"Incorrect edge source!";g.push(y)}}),g},d.prototype.getEdgesBetween=function(p){var g=[],m=this;return m.edges.forEach(function(y){if(!(y.source==m||y.target==m))throw"Incorrect edge source and/or target";(y.target==p||y.source==p)&&g.push(y)}),g},d.prototype.getNeighborsList=function(){var p=new Set,g=this;return g.edges.forEach(function(m){if(m.source==g)p.add(m.target);else{if(m.target!=g)throw"Incorrect incidency!";p.add(m.source)}}),p},d.prototype.withChildren=function(){var p=new Set,g,m;if(p.add(this),this.child!=null)for(var y=this.child.getNodes(),v=0;v<y.length;v++)g=y[v],m=g.withChildren(),m.forEach(function(T){p.add(T)});return p},d.prototype.getNoOfChildren=function(){var p=0,g;if(this.child==null)p=1;else for(var m=this.child.getNodes(),y=0;y<m.length;y++)g=m[y],p+=g.getNoOfChildren();return p==0&&(p=1),p},d.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},d.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},d.prototype.scatter=function(){var p,g,m=-l.INITIAL_WORLD_BOUNDARY,y=l.INITIAL_WORLD_BOUNDARY;p=l.WORLD_CENTER_X+u.nextDouble()*(y-m)+m;var v=-l.INITIAL_WORLD_BOUNDARY,T=l.INITIAL_WORLD_BOUNDARY;g=l.WORLD_CENTER_Y+u.nextDouble()*(T-v)+v,this.rect.x=p,this.rect.y=g},d.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var p=this.getChild();if(p.updateBounds(!0),this.rect.x=p.getLeft(),this.rect.y=p.getTop(),this.setWidth(p.getRight()-p.getLeft()),this.setHeight(p.getBottom()-p.getTop()),l.NODE_DIMENSIONS_INCLUDE_LABELS){var g=p.getRight()-p.getLeft(),m=p.getBottom()-p.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(g+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>g?(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(g+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(m+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>m?(this.rect.y-=(this.labelHeight-m)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(m+this.labelHeight))}}},d.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},d.prototype.transform=function(p){var g=this.rect.x;g>l.WORLD_BOUNDARY?g=l.WORLD_BOUNDARY:g<-l.WORLD_BOUNDARY&&(g=-l.WORLD_BOUNDARY);var m=this.rect.y;m>l.WORLD_BOUNDARY?m=l.WORLD_BOUNDARY:m<-l.WORLD_BOUNDARY&&(m=-l.WORLD_BOUNDARY);var y=new h(g,m),v=p.inverseTransformPoint(y);this.setLocation(v.x,v.y)},d.prototype.getLeft=function(){return this.rect.x},d.prototype.getRight=function(){return this.rect.x+this.rect.width},d.prototype.getTop=function(){return this.rect.y},d.prototype.getBottom=function(){return this.rect.y+this.rect.height},d.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},r.exports=d}),(function(r,n,i){var a=i(0);function s(){}for(var o in a)s[o]=a[o];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=s}),(function(r,n,i){function a(s,o){s==null&&o==null?(this.x=0,this.y=0):(this.x=s,this.y=o)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(s){this.x=s},a.prototype.setY=function(s){this.y=s},a.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},r.exports=a}),(function(r,n,i){var a=i(2),s=i(10),o=i(0),l=i(7),u=i(3),h=i(1),d=i(13),f=i(12),p=i(11);function g(y,v,T){a.call(this,T),this.estimatedSize=s.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=y,v!=null&&v instanceof l?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}g.prototype=Object.create(a.prototype);for(var m in a)g[m]=a[m];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(y,v,T){if(v==null&&T==null){var b=y;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(b)>-1)throw"Node already in graph!";return b.owner=this,this.getNodes().push(b),b}else{var w=y;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(v.owner==T.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=T.owner?null:(w.source=v,w.target=T,w.isInterGraph=!1,this.getEdges().push(w),v.edges.push(w),T!=v&&T.edges.push(w),w)}},g.prototype.remove=function(y){var v=y;if(y instanceof u){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=v.edges.slice(),b,w=T.length,C=0;C<w;C++)b=T[C],b.isInterGraph?this.graphManager.remove(b):b.source.owner.remove(b);var S=this.nodes.indexOf(v);if(S==-1)throw"Node not in owner node list!";this.nodes.splice(S,1)}else if(y instanceof h){var b=y;if(b==null)throw"Edge is null!";if(!(b.source!=null&&b.target!=null))throw"Source and/or target is null!";if(!(b.source.owner!=null&&b.target.owner!=null&&b.source.owner==this&&b.target.owner==this))throw"Source and/or target owner is invalid!";var k=b.source.edges.indexOf(b),E=b.target.edges.indexOf(b);if(!(k>-1&&E>-1))throw"Source and/or target doesn't know this edge!";b.source.edges.splice(k,1),b.target!=b.source&&b.target.edges.splice(E,1);var S=b.source.owner.getEdges().indexOf(b);if(S==-1)throw"Not in owner's edge list!";b.source.owner.getEdges().splice(S,1)}},g.prototype.updateLeftTop=function(){for(var y=s.MAX_VALUE,v=s.MAX_VALUE,T,b,w,C=this.getNodes(),S=C.length,k=0;k<S;k++){var E=C[k];T=E.getTop(),b=E.getLeft(),y>T&&(y=T),v>b&&(v=b)}return y==s.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?w=C[0].getParent().paddingLeft:w=this.margin,this.left=v-w,this.top=y-w,new f(this.left,this.top))},g.prototype.updateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,C,S,k,E,_,M=this.nodes,L=M.length,P=0;P<L;P++){var D=M[P];y&&D.child!=null&&D.updateBounds(),C=D.getLeft(),S=D.getRight(),k=D.getTop(),E=D.getBottom(),v>C&&(v=C),T<S&&(T=S),b>k&&(b=k),w<E&&(w=E)}var R=new d(v,b,T-v,w-b);v==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),M[0].getParent().paddingLeft!=null?_=M[0].getParent().paddingLeft:_=this.margin,this.left=R.x-_,this.right=R.x+R.width+_,this.top=R.y-_,this.bottom=R.y+R.height+_},g.calculateBounds=function(y){for(var v=s.MAX_VALUE,T=-s.MAX_VALUE,b=s.MAX_VALUE,w=-s.MAX_VALUE,C,S,k,E,_=y.length,M=0;M<_;M++){var L=y[M];C=L.getLeft(),S=L.getRight(),k=L.getTop(),E=L.getBottom(),v>C&&(v=C),T<S&&(T=S),b>k&&(b=k),w<E&&(w=E)}var P=new d(v,b,T-v,w-b);return P},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var y=0,v=this.nodes,T=v.length,b=0;b<T;b++){var w=v[b];y+=w.calcEstimatedSize()}return y==0?this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=y/Math.sqrt(this.nodes.length),this.estimatedSize},g.prototype.updateConnected=function(){var y=this;if(this.nodes.length==0){this.isConnected=!0;return}var v=new p,T=new Set,b=this.nodes[0],w,C,S=b.withChildren();for(S.forEach(function(P){v.push(P),T.add(P)});v.length!==0;){b=v.shift(),w=b.getEdges();for(var k=w.length,E=0;E<k;E++){var _=w[E];if(C=_.getOtherEndInGraph(b,this),C!=null&&!T.has(C)){var M=C.withChildren();M.forEach(function(P){v.push(P),T.add(P)})}}}if(this.isConnected=!1,T.size>=this.nodes.length){var L=0;T.forEach(function(P){P.owner==y&&L++}),L==this.nodes.length&&(this.isConnected=!0)}},r.exports=g}),(function(r,n,i){var a,s=i(1);function o(l){a=i(6),this.layout=l,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},o.prototype.add=function(l,u,h,d,f){if(h==null&&d==null&&f==null){if(l==null)throw"Graph is null!";if(u==null)throw"Parent node is null!";if(this.graphs.indexOf(l)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(l),l.parent!=null)throw"Already has a parent!";if(u.child!=null)throw"Already has a child!";return l.parent=u,u.child=l,l}else{f=h,d=u,h=l;var p=d.getOwner(),g=f.getOwner();if(!(p!=null&&p.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(p==g)return h.isInterGraph=!1,p.add(h,d,f);if(h.isInterGraph=!0,h.source=d,h.target=f,this.edges.indexOf(h)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(h),!(h.source!=null&&h.target!=null))throw"Edge source and/or target is null!";if(!(h.source.edges.indexOf(h)==-1&&h.target.edges.indexOf(h)==-1))throw"Edge already in source and/or target incidency list!";return h.source.edges.push(h),h.target.edges.push(h),h}},o.prototype.remove=function(l){if(l instanceof a){var u=l;if(u.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(u==this.rootGraph||u.parent!=null&&u.parent.graphManager==this))throw"Invalid parent node!";var h=[];h=h.concat(u.getEdges());for(var d,f=h.length,p=0;p<f;p++)d=h[p],u.remove(d);var g=[];g=g.concat(u.getNodes());var m;f=g.length;for(var p=0;p<f;p++)m=g[p],u.remove(m);u==this.rootGraph&&this.setRootGraph(null);var y=this.graphs.indexOf(u);this.graphs.splice(y,1),u.parent=null}else if(l instanceof s){if(d=l,d==null)throw"Edge is null!";if(!d.isInterGraph)throw"Not an inter-graph edge!";if(!(d.source!=null&&d.target!=null))throw"Source and/or target is null!";if(!(d.source.edges.indexOf(d)!=-1&&d.target.edges.indexOf(d)!=-1))throw"Source and/or target doesn't know this edge!";var y=d.source.edges.indexOf(d);if(d.source.edges.splice(y,1),y=d.target.edges.indexOf(d),d.target.edges.splice(y,1),!(d.source.owner!=null&&d.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(d.source.owner.getGraphManager().edges.indexOf(d)==-1)throw"Not in owner graph manager's edge list!";var y=d.source.owner.getGraphManager().edges.indexOf(d);d.source.owner.getGraphManager().edges.splice(y,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(this.allNodes==null){for(var l=[],u=this.getGraphs(),h=u.length,d=0;d<h;d++)l=l.concat(u[d].getNodes());this.allNodes=l}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){var l=[],u=this.getGraphs();u.length;for(var h=0;h<u.length;h++)l=l.concat(u[h].getEdges());l=l.concat(this.edges),this.allEdges=l}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(l){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=l},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(l){if(l.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=l,l.parent==null&&(l.parent=this.layout.newNode("Root node"))},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(l,u){if(!(l!=null&&u!=null))throw"assert failed";if(l==u)return!0;var h=l.getOwner(),d;do{if(d=h.getParent(),d==null)break;if(d==u)return!0;if(h=d.getOwner(),h==null)break}while(!0);h=u.getOwner();do{if(d=h.getParent(),d==null)break;if(d==l)return!0;if(h=d.getOwner(),h==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){for(var l,u,h,d,f,p=this.getAllEdges(),g=p.length,m=0;m<g;m++){if(l=p[m],u=l.source,h=l.target,l.lca=null,l.sourceInLca=u,l.targetInLca=h,u==h){l.lca=u.getOwner();continue}for(d=u.getOwner();l.lca==null;){for(l.targetInLca=h,f=h.getOwner();l.lca==null;){if(f==d){l.lca=f;break}if(f==this.rootGraph)break;if(l.lca!=null)throw"assert failed";l.targetInLca=f.getParent(),f=l.targetInLca.getOwner()}if(d==this.rootGraph)break;l.lca==null&&(l.sourceInLca=d.getParent(),d=l.sourceInLca.getOwner())}if(l.lca==null)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(l,u){if(l==u)return l.getOwner();var h=l.getOwner();do{if(h==null)break;var d=u.getOwner();do{if(d==null)break;if(d==h)return d;d=d.getParent().getOwner()}while(!0);h=h.getParent().getOwner()}while(!0);return h},o.prototype.calcInclusionTreeDepths=function(l,u){l==null&&u==null&&(l=this.rootGraph,u=1);for(var h,d=l.getNodes(),f=d.length,p=0;p<f;p++)h=d[p],h.inclusionTreeDepth=u,h.child!=null&&this.calcInclusionTreeDepths(h.child,u+1)},o.prototype.includesInvalidEdge=function(){for(var l,u=[],h=this.edges.length,d=0;d<h;d++)l=this.edges[d],this.isOneAncestorOfOther(l.source,l.target)&&u.push(l);for(var d=0;d<u.length;d++)this.remove(u[d]);return!1},r.exports=o}),(function(r,n,i){var a=i(12);function s(){}s.calcSeparationAmount=function(o,l,u,h){if(!o.intersects(l))throw"assert failed";var d=new Array(2);this.decideDirectionsForOverlappingNodes(o,l,d),u[0]=Math.min(o.getRight(),l.getRight())-Math.max(o.x,l.x),u[1]=Math.min(o.getBottom(),l.getBottom())-Math.max(o.y,l.y),o.getX()<=l.getX()&&o.getRight()>=l.getRight()?u[0]+=Math.min(l.getX()-o.getX(),o.getRight()-l.getRight()):l.getX()<=o.getX()&&l.getRight()>=o.getRight()&&(u[0]+=Math.min(o.getX()-l.getX(),l.getRight()-o.getRight())),o.getY()<=l.getY()&&o.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-o.getY(),o.getBottom()-l.getBottom()):l.getY()<=o.getY()&&l.getBottom()>=o.getBottom()&&(u[1]+=Math.min(o.getY()-l.getY(),l.getBottom()-o.getBottom()));var f=Math.abs((l.getCenterY()-o.getCenterY())/(l.getCenterX()-o.getCenterX()));l.getCenterY()===o.getCenterY()&&l.getCenterX()===o.getCenterX()&&(f=1);var p=f*u[0],g=u[1]/f;u[0]<g?g=u[0]:p=u[1],u[0]=-1*d[0]*(g/2+h),u[1]=-1*d[1]*(p/2+h)},s.decideDirectionsForOverlappingNodes=function(o,l,u){o.getCenterX()<l.getCenterX()?u[0]=-1:u[0]=1,o.getCenterY()<l.getCenterY()?u[1]=-1:u[1]=1},s.getIntersection2=function(o,l,u){var h=o.getCenterX(),d=o.getCenterY(),f=l.getCenterX(),p=l.getCenterY();if(o.intersects(l))return u[0]=h,u[1]=d,u[2]=f,u[3]=p,!0;var g=o.getX(),m=o.getY(),y=o.getRight(),v=o.getX(),T=o.getBottom(),b=o.getRight(),w=o.getWidthHalf(),C=o.getHeightHalf(),S=l.getX(),k=l.getY(),E=l.getRight(),_=l.getX(),M=l.getBottom(),L=l.getRight(),P=l.getWidthHalf(),D=l.getHeightHalf(),R=!1,I=!1;if(h===f){if(d>p)return u[0]=h,u[1]=m,u[2]=f,u[3]=M,!1;if(d<p)return u[0]=h,u[1]=T,u[2]=f,u[3]=k,!1}else if(d===p){if(h>f)return u[0]=g,u[1]=d,u[2]=E,u[3]=p,!1;if(h<f)return u[0]=y,u[1]=d,u[2]=S,u[3]=p,!1}else{var $=o.height/o.width,O=l.height/l.width,N=(p-d)/(f-h),F=void 0,z=void 0,V=void 0,B=void 0,G=void 0,H=void 0;if(-$===N?h>f?(u[0]=v,u[1]=T,R=!0):(u[0]=y,u[1]=m,R=!0):$===N&&(h>f?(u[0]=g,u[1]=m,R=!0):(u[0]=b,u[1]=T,R=!0)),-O===N?f>h?(u[2]=_,u[3]=M,I=!0):(u[2]=E,u[3]=k,I=!0):O===N&&(f>h?(u[2]=S,u[3]=k,I=!0):(u[2]=L,u[3]=M,I=!0)),R&&I)return!1;if(h>f?d>p?(F=this.getCardinalDirection($,N,4),z=this.getCardinalDirection(O,N,2)):(F=this.getCardinalDirection(-$,N,3),z=this.getCardinalDirection(-O,N,1)):d>p?(F=this.getCardinalDirection(-$,N,1),z=this.getCardinalDirection(-O,N,3)):(F=this.getCardinalDirection($,N,2),z=this.getCardinalDirection(O,N,4)),!R)switch(F){case 1:B=m,V=h+-C/N,u[0]=V,u[1]=B;break;case 2:V=b,B=d+w*N,u[0]=V,u[1]=B;break;case 3:B=T,V=h+C/N,u[0]=V,u[1]=B;break;case 4:V=v,B=d+-w*N,u[0]=V,u[1]=B;break}if(!I)switch(z){case 1:H=k,G=f+-D/N,u[2]=G,u[3]=H;break;case 2:G=L,H=p+P*N,u[2]=G,u[3]=H;break;case 3:H=M,G=f+D/N,u[2]=G,u[3]=H;break;case 4:G=_,H=p+-P*N,u[2]=G,u[3]=H;break}}return!1},s.getCardinalDirection=function(o,l,u){return o>l?u:1+u%4},s.getIntersection=function(o,l,u,h){if(h==null)return this.getIntersection2(o,l,u);var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,T=h.y,b=void 0,w=void 0,C=void 0,S=void 0,k=void 0,E=void 0,_=void 0,M=void 0,L=void 0;return C=g-f,k=d-p,_=p*f-d*g,S=T-y,E=m-v,M=v*y-m*T,L=C*E-S*k,L===0?null:(b=(k*M-E*_)/L,w=(S*_-C*M)/L,new a(b,w))},s.angleOfVector=function(o,l,u,h){var d=void 0;return o!==u?(d=Math.atan((h-l)/(u-o)),u<o?d+=Math.PI:h<l&&(d+=this.TWO_PI)):h<l?d=this.ONE_AND_HALF_PI:d=this.HALF_PI,d},s.doIntersect=function(o,l,u,h){var d=o.x,f=o.y,p=l.x,g=l.y,m=u.x,y=u.y,v=h.x,T=h.y,b=(p-d)*(T-y)-(v-m)*(g-f);if(b===0)return!1;var w=((T-y)*(v-d)+(m-v)*(T-f))/b,C=((f-g)*(v-d)+(p-d)*(T-f))/b;return 0<w&&w<1&&0<C&&C<1},s.findCircleLineIntersections=function(o,l,u,h,d,f,p){var g=(u-o)*(u-o)+(h-l)*(h-l),m=2*((o-d)*(u-o)+(l-f)*(h-l)),y=(o-d)*(o-d)+(l-f)*(l-f)-p*p,v=m*m-4*g*y;if(v>=0){var T=(-m+Math.sqrt(m*m-4*g*y))/(2*g),b=(-m-Math.sqrt(m*m-4*g*y))/(2*g),w=null;return T>=0&&T<=1?[T]:b>=0&&b<=1?[b]:w}else return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,r.exports=s}),(function(r,n,i){function a(){}a.sign=function(s){return s>0?1:s<0?-1:0},a.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},a.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},r.exports=a}),(function(r,n,i){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,r.exports=a}),(function(r,n,i){var a=(function(){function d(f,p){for(var g=0;g<p.length;g++){var m=p[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(f,m.key,m)}}return function(f,p,g){return p&&d(f.prototype,p),g&&d(f,g),f}})();function s(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}var o=function(f){return{value:f,next:null,prev:null}},l=function(f,p,g,m){return f!==null?f.next=p:m.head=p,g!==null?g.prev=p:m.tail=p,p.prev=f,p.next=g,m.length++,p},u=function(f,p){var g=f.prev,m=f.next;return g!==null?g.next=m:p.head=m,m!==null?m.prev=g:p.tail=g,f.prev=f.next=null,p.length--,f},h=(function(){function d(f){var p=this;s(this,d),this.length=0,this.head=null,this.tail=null,f!=null&&f.forEach(function(g){return p.push(g)})}return a(d,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(p,g){return l(g.prev,o(p),g,this)}},{key:"insertAfter",value:function(p,g){return l(g,o(p),g.next,this)}},{key:"insertNodeBefore",value:function(p,g){return l(g.prev,p,g,this)}},{key:"insertNodeAfter",value:function(p,g){return l(g,p,g.next,this)}},{key:"push",value:function(p){return l(this.tail,o(p),null,this)}},{key:"unshift",value:function(p){return l(null,o(p),this.head,this)}},{key:"remove",value:function(p){return u(p,this)}},{key:"pop",value:function(){return u(this.tail,this).value}},{key:"popNode",value:function(){return u(this.tail,this)}},{key:"shift",value:function(){return u(this.head,this).value}},{key:"shiftNode",value:function(){return u(this.head,this)}},{key:"get_object_at",value:function(p){if(p<=this.length()){for(var g=1,m=this.head;g<p;)m=m.next,g++;return m.value}}},{key:"set_object_at",value:function(p,g){if(p<=this.length()){for(var m=1,y=this.head;m<p;)y=y.next,m++;y.value=g}}}]),d})();r.exports=h}),(function(r,n,i){function a(s,o,l){this.x=null,this.y=null,s==null&&o==null&&l==null?(this.x=0,this.y=0):typeof s=="number"&&typeof o=="number"&&l==null?(this.x=s,this.y=o):s.constructor.name=="Point"&&o==null&&l==null&&(l=s,this.x=l.x,this.y=l.y)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.getLocation=function(){return new a(this.x,this.y)},a.prototype.setLocation=function(s,o,l){s.constructor.name=="Point"&&o==null&&l==null?(l=s,this.setLocation(l.x,l.y)):typeof s=="number"&&typeof o=="number"&&l==null&&(parseInt(s)==s&&parseInt(o)==o?this.move(s,o):(this.x=Math.floor(s+.5),this.y=Math.floor(o+.5)))},a.prototype.move=function(s,o){this.x=s,this.y=o},a.prototype.translate=function(s,o){this.x+=s,this.y+=o},a.prototype.equals=function(s){if(s.constructor.name=="Point"){var o=s;return this.x==o.x&&this.y==o.y}return this==s},a.prototype.toString=function(){return new a().constructor.name+"[x="+this.x+",y="+this.y+"]"},r.exports=a}),(function(r,n,i){function a(s,o,l,u){this.x=0,this.y=0,this.width=0,this.height=0,s!=null&&o!=null&&l!=null&&u!=null&&(this.x=s,this.y=o,this.width=l,this.height=u)}a.prototype.getX=function(){return this.x},a.prototype.setX=function(s){this.x=s},a.prototype.getY=function(){return this.y},a.prototype.setY=function(s){this.y=s},a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(s){this.width=s},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(s){this.height=s},a.prototype.getRight=function(){return this.x+this.width},a.prototype.getBottom=function(){return this.y+this.height},a.prototype.intersects=function(s){return!(this.getRight()<s.x||this.getBottom()<s.y||s.getRight()<this.x||s.getBottom()<this.y)},a.prototype.getCenterX=function(){return this.x+this.width/2},a.prototype.getMinX=function(){return this.getX()},a.prototype.getMaxX=function(){return this.getX()+this.width},a.prototype.getCenterY=function(){return this.y+this.height/2},a.prototype.getMinY=function(){return this.getY()},a.prototype.getMaxY=function(){return this.getY()+this.height},a.prototype.getWidthHalf=function(){return this.width/2},a.prototype.getHeightHalf=function(){return this.height/2},r.exports=a}),(function(r,n,i){var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function s(){}s.lastID=0,s.createID=function(o){return s.isPrimitive(o)?o:(o.uniqueID!=null||(o.uniqueID=s.getString(),s.lastID++),o.uniqueID)},s.getString=function(o){return o==null&&(o=s.lastID),"Object#"+o},s.isPrimitive=function(o){var l=typeof o>"u"?"undefined":a(o);return o==null||l!="object"&&l!="function"},r.exports=s}),(function(r,n,i){function a(m){if(Array.isArray(m)){for(var y=0,v=Array(m.length);y<m.length;y++)v[y]=m[y];return v}else return Array.from(m)}var s=i(0),o=i(7),l=i(3),u=i(1),h=i(6),d=i(5),f=i(17),p=i(29);function g(m){p.call(this),this.layoutQuality=s.QUALITY,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=s.DEFAULT_INCREMENTAL,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,m!=null&&(this.isRemoteUse=m)}g.RANDOM_SEED=1,g.prototype=Object.create(p.prototype),g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},g.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},g.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},g.prototype.newGraphManager=function(){var m=new o(this);return this.graphManager=m,m},g.prototype.newGraph=function(m){return new h(null,this.graphManager,m)},g.prototype.newNode=function(m){return new l(this.graphManager,m)},g.prototype.newEdge=function(m){return new u(null,null,m)},g.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},g.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var m;return this.checkLayoutSuccess()?m=!1:m=this.layout(),s.ANIMATE==="during"?!1:(m&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,m)},g.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},g.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var m=this.graphManager.getAllEdges(),y=0;y<m.length;y++)m[y];for(var v=this.graphManager.getRoot().getNodes(),y=0;y<v.length;y++)v[y];this.update(this.graphManager.getRoot())}},g.prototype.update=function(m){if(m==null)this.update2();else if(m instanceof l){var y=m;if(y.getChild()!=null)for(var v=y.getChild().getNodes(),T=0;T<v.length;T++)update(v[T]);if(y.vGraphObject!=null){var b=y.vGraphObject;b.update(y)}}else if(m instanceof u){var w=m;if(w.vGraphObject!=null){var C=w.vGraphObject;C.update(w)}}else if(m instanceof h){var S=m;if(S.vGraphObject!=null){var k=S.vGraphObject;k.update(S)}}},g.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=s.QUALITY,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=s.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},g.prototype.transform=function(m){if(m==null)this.transform(new d(0,0));else{var y=new f,v=this.graphManager.getRoot().updateLeftTop();if(v!=null){y.setWorldOrgX(m.x),y.setWorldOrgY(m.y),y.setDeviceOrgX(v.x),y.setDeviceOrgY(v.y);for(var T=this.getAllNodes(),b,w=0;w<T.length;w++)b=T[w],b.transform(y)}}},g.prototype.positionNodesRandomly=function(m){if(m==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var y,v,T=m.getNodes(),b=0;b<T.length;b++)y=T[b],v=y.getChild(),v==null||v.getNodes().length==0?y.scatter():(this.positionNodesRandomly(v),y.updateBounds())},g.prototype.getFlatForest=function(){for(var m=[],y=!0,v=this.graphManager.getRoot().getNodes(),T=!0,b=0;b<v.length;b++)v[b].getChild()!=null&&(T=!1);if(!T)return m;var w=new Set,C=[],S=new Map,k=[];for(k=k.concat(v);k.length>0&&y;){for(C.push(k[0]);C.length>0&&y;){var E=C[0];C.splice(0,1),w.add(E);for(var _=E.getEdges(),b=0;b<_.length;b++){var M=_[b].getOtherEnd(E);if(S.get(E)!=M)if(!w.has(M))C.push(M),S.set(M,E);else{y=!1;break}}}if(!y)m=[];else{var L=[].concat(a(w));m.push(L);for(var b=0;b<L.length;b++){var P=L[b],D=k.indexOf(P);D>-1&&k.splice(D,1)}w=new Set,S=new Map}}return m},g.prototype.createDummyNodesForBendpoints=function(m){for(var y=[],v=m.source,T=this.graphManager.calcLowestCommonAncestor(m.source,m.target),b=0;b<m.bendpoints.length;b++){var w=this.newNode(null);w.setRect(new Point(0,0),new Dimension(1,1)),T.add(w);var C=this.newEdge(null);this.graphManager.add(C,v,w),y.add(w),v=w}var C=this.newEdge(null);return this.graphManager.add(C,v,m.target),this.edgeToDummyNodes.set(m,y),m.isInterGraph()?this.graphManager.remove(m):T.remove(m),y},g.prototype.createBendpointsFromDummyNodes=function(){var m=[];m=m.concat(this.graphManager.getAllEdges()),m=[].concat(a(this.edgeToDummyNodes.keys())).concat(m);for(var y=0;y<m.length;y++){var v=m[y];if(v.bendpoints.length>0){for(var T=this.edgeToDummyNodes.get(v),b=0;b<T.length;b++){var w=T[b],C=new d(w.getCenterX(),w.getCenterY()),S=v.bendpoints.get(b);S.x=C.x,S.y=C.y,w.getOwner().remove(w)}this.graphManager.add(v,v.source,v.target)}}},g.transform=function(m,y,v,T){if(v!=null&&T!=null){var b=y;if(m<=50){var w=y/v;b-=(y-w)/50*(50-m)}else{var C=y*T;b+=(C-y)/50*(m-50)}return b}else{var S,k;return m<=50?(S=9*y/500,k=y/10):(S=9*y/50,k=-8*y),S*m+k}},g.findCenterOfTree=function(m){var y=[];y=y.concat(m);var v=[],T=new Map,b=!1,w=null;(y.length==1||y.length==2)&&(b=!0,w=y[0]);for(var C=0;C<y.length;C++){var S=y[C],k=S.getNeighborsList().size;T.set(S,S.getNeighborsList().size),k==1&&v.push(S)}var E=[];for(E=E.concat(v);!b;){var _=[];_=_.concat(E),E=[];for(var C=0;C<y.length;C++){var S=y[C],M=y.indexOf(S);M>=0&&y.splice(M,1);var L=S.getNeighborsList();L.forEach(function(R){if(v.indexOf(R)<0){var I=T.get(R),$=I-1;$==1&&E.push(R),T.set(R,$)}})}v=v.concat(E),(y.length==1||y.length==2)&&(b=!0,w=y[0])}return w},g.prototype.setGraphManager=function(m){this.graphManager=m},r.exports=g}),(function(r,n,i){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},r.exports=a}),(function(r,n,i){var a=i(5);function s(o,l){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(o){this.lworldExtX=o},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(o){this.lworldExtY=o},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},s.prototype.transformX=function(o){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/u),l},s.prototype.transformY=function(o){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/u),l},s.prototype.inverseTransformX=function(o){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/u),l},s.prototype.inverseTransformY=function(o){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/u),l},s.prototype.inverseTransformPoint=function(o){var l=new a(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return l},r.exports=s}),(function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);g<p.length;g++)m[g]=p[g];return m}else return Array.from(p)}var s=i(15),o=i(4),l=i(0),u=i(8),h=i(9);function d(){s.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}d.prototype=Object.create(s.prototype);for(var f in s)d[f]=s[f];d.prototype.initParameters=function(){s.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},d.prototype.calcIdealEdgeLengths=function(){for(var p,g,m,y,v,T,b,w=this.getGraphManager().getAllEdges(),C=0;C<w.length;C++)p=w[C],g=p.idealLength,p.isInterGraph&&(y=p.getSource(),v=p.getTarget(),T=p.getSourceInLca().getEstimatedSize(),b=p.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(p.idealLength+=T+b-2*l.SIMPLE_NODE_SIZE),m=p.getLca().getInclusionTreeDepth(),p.idealLength+=g*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(y.getInclusionTreeDepth()+v.getInclusionTreeDepth()-2*m))},d.prototype.initSpringEmbedder=function(){var p=this.getAllNodes().length;this.incremental?(p>o.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(p-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},d.prototype.calcSpringForces=function(){for(var p=this.getAllEdges(),g,m=0;m<p.length;m++)g=p[m],this.calcSpringForce(g,g.idealLength)},d.prototype.calcRepulsionForces=function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m,y,v,T,b=this.getAllNodes(),w;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&p&&this.updateGrid(),w=new Set,m=0;m<b.length;m++)v=b[m],this.calculateRepulsionForceOfANode(v,w,p,g),w.add(v);else for(m=0;m<b.length;m++)for(v=b[m],y=m+1;y<b.length;y++)T=b[y],v.getOwner()==T.getOwner()&&this.calcRepulsionForce(v,T)},d.prototype.calcGravitationalForces=function(){for(var p,g=this.getAllNodesToApplyGravitation(),m=0;m<g.length;m++)p=g[m],this.calcGravitationalForce(p)},d.prototype.moveNodes=function(){for(var p=this.getAllNodes(),g,m=0;m<p.length;m++)g=p[m],g.move()},d.prototype.calcSpringForce=function(p,g){var m=p.getSource(),y=p.getTarget(),v,T,b,w;if(this.uniformLeafNodeSizes&&m.getChild()==null&&y.getChild()==null)p.updateLengthSimple();else if(p.updateLength(),p.isOverlapingSourceAndTarget)return;v=p.getLength(),v!=0&&(T=p.edgeElasticity*(v-g),b=T*(p.lengthX/v),w=T*(p.lengthY/v),m.springForceX+=b,m.springForceY+=w,y.springForceX-=b,y.springForceY-=w)},d.prototype.calcRepulsionForce=function(p,g){var m=p.getRect(),y=g.getRect(),v=new Array(2),T=new Array(4),b,w,C,S,k,E,_;if(m.intersects(y)){u.calcSeparationAmount(m,y,v,o.DEFAULT_EDGE_LENGTH/2),E=2*v[0],_=2*v[1];var M=p.noOfChildren*g.noOfChildren/(p.noOfChildren+g.noOfChildren);p.repulsionForceX-=M*E,p.repulsionForceY-=M*_,g.repulsionForceX+=M*E,g.repulsionForceY+=M*_}else this.uniformLeafNodeSizes&&p.getChild()==null&&g.getChild()==null?(b=y.getCenterX()-m.getCenterX(),w=y.getCenterY()-m.getCenterY()):(u.getIntersection(m,y,T),b=T[2]-T[0],w=T[3]-T[1]),Math.abs(b)<o.MIN_REPULSION_DIST&&(b=h.sign(b)*o.MIN_REPULSION_DIST),Math.abs(w)<o.MIN_REPULSION_DIST&&(w=h.sign(w)*o.MIN_REPULSION_DIST),C=b*b+w*w,S=Math.sqrt(C),k=(p.nodeRepulsion/2+g.nodeRepulsion/2)*p.noOfChildren*g.noOfChildren/C,E=k*b/S,_=k*w/S,p.repulsionForceX-=E,p.repulsionForceY-=_,g.repulsionForceX+=E,g.repulsionForceY+=_},d.prototype.calcGravitationalForce=function(p){var g,m,y,v,T,b,w,C;g=p.getOwner(),m=(g.getRight()+g.getLeft())/2,y=(g.getTop()+g.getBottom())/2,v=p.getCenterX()-m,T=p.getCenterY()-y,b=Math.abs(v)+p.getWidth()/2,w=Math.abs(T)+p.getHeight()/2,p.getOwner()==this.graphManager.getRoot()?(C=g.getEstimatedSize()*this.gravityRangeFactor,(b>C||w>C)&&(p.gravitationForceX=-this.gravityConstant*v,p.gravitationForceY=-this.gravityConstant*T)):(C=g.getEstimatedSize()*this.compoundGravityRangeFactor,(b>C||w>C)&&(p.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,p.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},d.prototype.isConverged=function(){var p,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),p=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,p||g},d.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},d.prototype.calcNoOfChildrenForAllNodes=function(){for(var p,g=this.graphManager.getAllNodes(),m=0;m<g.length;m++)p=g[m],p.noOfChildren=p.getNoOfChildren()},d.prototype.calcGrid=function(p){var g=0,m=0;g=parseInt(Math.ceil((p.getRight()-p.getLeft())/this.repulsionRange)),m=parseInt(Math.ceil((p.getBottom()-p.getTop())/this.repulsionRange));for(var y=new Array(g),v=0;v<g;v++)y[v]=new Array(m);for(var v=0;v<g;v++)for(var T=0;T<m;T++)y[v][T]=new Array;return y},d.prototype.addNodeToGrid=function(p,g,m){var y=0,v=0,T=0,b=0;y=parseInt(Math.floor((p.getRect().x-g)/this.repulsionRange)),v=parseInt(Math.floor((p.getRect().width+p.getRect().x-g)/this.repulsionRange)),T=parseInt(Math.floor((p.getRect().y-m)/this.repulsionRange)),b=parseInt(Math.floor((p.getRect().height+p.getRect().y-m)/this.repulsionRange));for(var w=y;w<=v;w++)for(var C=T;C<=b;C++)this.grid[w][C].push(p),p.setGridCoordinates(y,v,T,b)},d.prototype.updateGrid=function(){var p,g,m=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),p=0;p<m.length;p++)g=m[p],this.addNodeToGrid(g,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},d.prototype.calculateRepulsionForceOfANode=function(p,g,m,y){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&m||y){var v=new Set;p.surrounding=new Array;for(var T,b=this.grid,w=p.startX-1;w<p.finishX+2;w++)for(var C=p.startY-1;C<p.finishY+2;C++)if(!(w<0||C<0||w>=b.length||C>=b[0].length)){for(var S=0;S<b[w][C].length;S++)if(T=b[w][C][S],!(p.getOwner()!=T.getOwner()||p==T)&&!g.has(T)&&!v.has(T)){var k=Math.abs(p.getCenterX()-T.getCenterX())-(p.getWidth()/2+T.getWidth()/2),E=Math.abs(p.getCenterY()-T.getCenterY())-(p.getHeight()/2+T.getHeight()/2);k<=this.repulsionRange&&E<=this.repulsionRange&&v.add(T)}}p.surrounding=[].concat(a(v))}for(w=0;w<p.surrounding.length;w++)this.calcRepulsionForce(p,p.surrounding[w])},d.prototype.calcRepulsionRange=function(){return 0},r.exports=d}),(function(r,n,i){var a=i(1),s=i(4);function o(u,h,d){a.call(this,u,h,d),this.idealLength=s.DEFAULT_EDGE_LENGTH,this.edgeElasticity=s.DEFAULT_SPRING_STRENGTH}o.prototype=Object.create(a.prototype);for(var l in a)o[l]=a[l];r.exports=o}),(function(r,n,i){var a=i(3),s=i(4);function o(u,h,d,f){a.call(this,u,h,d,f),this.nodeRepulsion=s.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}o.prototype=Object.create(a.prototype);for(var l in a)o[l]=a[l];o.prototype.setGridCoordinates=function(u,h,d,f){this.startX=u,this.finishX=h,this.startY=d,this.finishY=f},r.exports=o}),(function(r,n,i){function a(s,o){this.width=0,this.height=0,s!==null&&o!==null&&(this.height=o,this.width=s)}a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(s){this.width=s},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(s){this.height=s},r.exports=a}),(function(r,n,i){var a=i(14);function s(){this.map={},this.keys=[]}s.prototype.put=function(o,l){var u=a.createID(o);this.contains(u)||(this.map[u]=l,this.keys.push(o))},s.prototype.contains=function(o){return a.createID(o),this.map[o]!=null},s.prototype.get=function(o){var l=a.createID(o);return this.map[l]},s.prototype.keySet=function(){return this.keys},r.exports=s}),(function(r,n,i){var a=i(14);function s(){this.set={}}s.prototype.add=function(o){var l=a.createID(o);this.contains(l)||(this.set[l]=o)},s.prototype.remove=function(o){delete this.set[a.createID(o)]},s.prototype.clear=function(){this.set={}},s.prototype.contains=function(o){return this.set[a.createID(o)]==o},s.prototype.isEmpty=function(){return this.size()===0},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAllTo=function(o){for(var l=Object.keys(this.set),u=l.length,h=0;h<u;h++)o.push(this.set[l[h]])},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAll=function(o){for(var l=o.length,u=0;u<l;u++){var h=o[u];this.add(h)}},r.exports=s}),(function(r,n,i){function a(){}a.multMat=function(s,o){for(var l=[],u=0;u<s.length;u++){l[u]=[];for(var h=0;h<o[0].length;h++){l[u][h]=0;for(var d=0;d<s[0].length;d++)l[u][h]+=s[u][d]*o[d][h]}}return l},a.transpose=function(s){for(var o=[],l=0;l<s[0].length;l++){o[l]=[];for(var u=0;u<s.length;u++)o[l][u]=s[u][l]}return o},a.multCons=function(s,o){for(var l=[],u=0;u<s.length;u++)l[u]=s[u]*o;return l},a.minusOp=function(s,o){for(var l=[],u=0;u<s.length;u++)l[u]=s[u]-o[u];return l},a.dotProduct=function(s,o){for(var l=0,u=0;u<s.length;u++)l+=s[u]*o[u];return l},a.mag=function(s){return Math.sqrt(this.dotProduct(s,s))},a.normalize=function(s){for(var o=[],l=this.mag(s),u=0;u<s.length;u++)o[u]=s[u]/l;return o},a.multGamma=function(s){for(var o=[],l=0,u=0;u<s.length;u++)l+=s[u];l*=-1/s.length;for(var h=0;h<s.length;h++)o[h]=l+s[h];return o},a.multL=function(s,o,l){for(var u=[],h=[],d=[],f=0;f<o[0].length;f++){for(var p=0,g=0;g<o.length;g++)p+=-.5*o[g][f]*s[g];h[f]=p}for(var m=0;m<l.length;m++){for(var y=0,v=0;v<l.length;v++)y+=l[m][v]*h[v];d[m]=y}for(var T=0;T<o.length;T++){for(var b=0,w=0;w<o[0].length;w++)b+=o[T][w]*d[w];u[T]=b}return u},r.exports=a}),(function(r,n,i){var a=(function(){function u(h,d){for(var f=0;f<d.length;f++){var p=d[f];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(h,p.key,p)}}return function(h,d,f){return d&&u(h.prototype,d),f&&u(h,f),h}})();function s(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}var o=i(11),l=(function(){function u(h,d){s(this,u),(d!==null||d!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var f=void 0;h instanceof o?f=h.size():f=h.length,this._quicksort(h,0,f-1)}return a(u,[{key:"_quicksort",value:function(d,f,p){if(f<p){var g=this._partition(d,f,p);this._quicksort(d,f,g),this._quicksort(d,g+1,p)}}},{key:"_partition",value:function(d,f,p){for(var g=this._get(d,f),m=f,y=p;;){for(;this.compareFunction(g,this._get(d,y));)y--;for(;this.compareFunction(this._get(d,m),g);)m++;if(m<y)this._swap(d,m,y),m++,y--;else return y}}},{key:"_get",value:function(d,f){return d instanceof o?d.get_object_at(f):d[f]}},{key:"_set",value:function(d,f,p){d instanceof o?d.set_object_at(f,p):d[f]=p}},{key:"_swap",value:function(d,f,p){var g=this._get(d,f);this._set(d,f,this._get(d,p)),this._set(d,p,g)}},{key:"_defaultCompareFunction",value:function(d,f){return f>d}}]),u})();r.exports=l}),(function(r,n,i){function a(){}a.svd=function(s){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=s.length,this.n=s[0].length;var o=Math.min(this.m,this.n);this.s=(function(vt){for(var ot=[];vt-- >0;)ot.push(0);return ot})(Math.min(this.m+1,this.n)),this.U=(function(vt){var ot=function pe(Ct){if(Ct.length==0)return 0;for(var lt=[],st=0;st<Ct[0];st++)lt.push(pe(Ct.slice(1)));return lt};return ot(vt)})([this.m,o]),this.V=(function(vt){var ot=function pe(Ct){if(Ct.length==0)return 0;for(var lt=[],st=0;st<Ct[0];st++)lt.push(pe(Ct.slice(1)));return lt};return ot(vt)})([this.n,this.n]);for(var l=(function(vt){for(var ot=[];vt-- >0;)ot.push(0);return ot})(this.n),u=(function(vt){for(var ot=[];vt-- >0;)ot.push(0);return ot})(this.m),h=!0,d=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),p=0;p<Math.max(d,f);p++){if(p<d){this.s[p]=0;for(var g=p;g<this.m;g++)this.s[p]=a.hypot(this.s[p],s[g][p]);if(this.s[p]!==0){s[p][p]<0&&(this.s[p]=-this.s[p]);for(var m=p;m<this.m;m++)s[m][p]/=this.s[p];s[p][p]+=1}this.s[p]=-this.s[p]}for(var y=p+1;y<this.n;y++){if((function(vt,ot){return vt&&ot})(p<d,this.s[p]!==0)){for(var v=0,T=p;T<this.m;T++)v+=s[T][p]*s[T][y];v=-v/s[p][p];for(var b=p;b<this.m;b++)s[b][y]+=v*s[b][p]}l[y]=s[p][y]}if((function(vt,ot){return ot})(h,p<d))for(var w=p;w<this.m;w++)this.U[w][p]=s[w][p];if(p<f){l[p]=0;for(var C=p+1;C<this.n;C++)l[p]=a.hypot(l[p],l[C]);if(l[p]!==0){l[p+1]<0&&(l[p]=-l[p]);for(var S=p+1;S<this.n;S++)l[S]/=l[p];l[p+1]+=1}if(l[p]=-l[p],(function(vt,ot){return vt&&ot})(p+1<this.m,l[p]!==0)){for(var k=p+1;k<this.m;k++)u[k]=0;for(var E=p+1;E<this.n;E++)for(var _=p+1;_<this.m;_++)u[_]+=l[E]*s[_][E];for(var M=p+1;M<this.n;M++)for(var L=-l[M]/l[p+1],P=p+1;P<this.m;P++)s[P][M]+=L*u[P]}for(var D=p+1;D<this.n;D++)this.V[D][p]=l[D]}}var R=Math.min(this.n,this.m+1);d<this.n&&(this.s[d]=s[d][d]),this.m<R&&(this.s[R-1]=0),f+1<R&&(l[f]=s[f][R-1]),l[R-1]=0;{for(var I=d;I<o;I++){for(var $=0;$<this.m;$++)this.U[$][I]=0;this.U[I][I]=1}for(var O=d-1;O>=0;O--)if(this.s[O]!==0){for(var N=O+1;N<o;N++){for(var F=0,z=O;z<this.m;z++)F+=this.U[z][O]*this.U[z][N];F=-F/this.U[O][O];for(var V=O;V<this.m;V++)this.U[V][N]+=F*this.U[V][O]}for(var B=O;B<this.m;B++)this.U[B][O]=-this.U[B][O];this.U[O][O]=1+this.U[O][O];for(var G=0;G<O-1;G++)this.U[G][O]=0}else{for(var H=0;H<this.m;H++)this.U[H][O]=0;this.U[O][O]=1}}for(var q=this.n-1;q>=0;q--){if((function(vt,ot){return vt&&ot})(q<f,l[q]!==0))for(var Z=q+1;Z<o;Z++){for(var Y=0,ie=q+1;ie<this.n;ie++)Y+=this.V[ie][q]*this.V[ie][Z];Y=-Y/this.V[q+1][q];for(var K=q+1;K<this.n;K++)this.V[K][Z]+=Y*this.V[K][q]}for(var Q=0;Q<this.n;Q++)this.V[Q][q]=0;this.V[q][q]=1}for(var te=R-1,J=Math.pow(2,-52),ge=Math.pow(2,-966);R>0;){var ee=void 0,Re=void 0;for(ee=R-2;ee>=-1&&ee!==-1;ee--)if(Math.abs(l[ee])<=ge+J*(Math.abs(this.s[ee])+Math.abs(this.s[ee+1]))){l[ee]=0;break}if(ee===R-2)Re=4;else{var Ie=void 0;for(Ie=R-1;Ie>=ee&&Ie!==ee;Ie--){var Be=(Ie!==R?Math.abs(l[Ie]):0)+(Ie!==ee+1?Math.abs(l[Ie-1]):0);if(Math.abs(this.s[Ie])<=ge+J*Be){this.s[Ie]=0;break}}Ie===ee?Re=3:Ie===R-1?Re=1:(Re=2,ee=Ie)}switch(ee++,Re){case 1:{var ce=l[R-2];l[R-2]=0;for(var oe=R-2;oe>=ee;oe--){var be=a.hypot(this.s[oe],ce),fe=this.s[oe]/be,Pe=ce/be;this.s[oe]=be,oe!==ee&&(ce=-Pe*l[oe-1],l[oe-1]=fe*l[oe-1]);for(var ve=0;ve<this.n;ve++)be=fe*this.V[ve][oe]+Pe*this.V[ve][R-1],this.V[ve][R-1]=-Pe*this.V[ve][oe]+fe*this.V[ve][R-1],this.V[ve][oe]=be}}break;case 2:{var Ce=l[ee-1];l[ee-1]=0;for(var Ve=ee;Ve<R;Ve++){var se=a.hypot(this.s[Ve],Ce),de=this.s[Ve]/se,Te=Ce/se;this.s[Ve]=se,Ce=-Te*l[Ve],l[Ve]=de*l[Ve];for(var ae=0;ae<this.m;ae++)se=de*this.U[ae][Ve]+Te*this.U[ae][ee-1],this.U[ae][ee-1]=-Te*this.U[ae][Ve]+de*this.U[ae][ee-1],this.U[ae][Ve]=se}}break;case 3:{var he=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[R-1]),Math.abs(this.s[R-2])),Math.abs(l[R-2])),Math.abs(this.s[ee])),Math.abs(l[ee])),W=this.s[R-1]/he,ne=this.s[R-2]/he,j=l[R-2]/he,ue=this.s[ee]/he,X=l[ee]/he,Oe=((ne+W)*(ne-W)+j*j)/2,xe=W*j*(W*j),Ge=0;(function(vt,ot){return vt||ot})(Oe!==0,xe!==0)&&(Ge=Math.sqrt(Oe*Oe+xe),Oe<0&&(Ge=-Ge),Ge=xe/(Oe+Ge));for(var _e=(ue+W)*(ue-W)+Ge,$e=ue*X,Me=ee;Me<R-1;Me++){var He=a.hypot(_e,$e),De=_e/He,Ke=$e/He;Me!==ee&&(l[Me-1]=He),_e=De*this.s[Me]+Ke*l[Me],l[Me]=De*l[Me]-Ke*this.s[Me],$e=Ke*this.s[Me+1],this.s[Me+1]=De*this.s[Me+1];for(var Ae=0;Ae<this.n;Ae++)He=De*this.V[Ae][Me]+Ke*this.V[Ae][Me+1],this.V[Ae][Me+1]=-Ke*this.V[Ae][Me]+De*this.V[Ae][Me+1],this.V[Ae][Me]=He;if(He=a.hypot(_e,$e),De=_e/He,Ke=$e/He,this.s[Me]=He,_e=De*l[Me]+Ke*this.s[Me+1],this.s[Me+1]=-Ke*l[Me]+De*this.s[Me+1],$e=Ke*l[Me+1],l[Me+1]=De*l[Me+1],Me<this.m-1)for(var at=0;at<this.m;at++)He=De*this.U[at][Me]+Ke*this.U[at][Me+1],this.U[at][Me+1]=-Ke*this.U[at][Me]+De*this.U[at][Me+1],this.U[at][Me]=He}l[R-2]=_e}break;case 4:{if(this.s[ee]<=0){this.s[ee]=this.s[ee]<0?-this.s[ee]:0;for(var Ee=0;Ee<=te;Ee++)this.V[Ee][ee]=-this.V[Ee][ee]}for(;ee<te&&!(this.s[ee]>=this.s[ee+1]);){var pt=this.s[ee];if(this.s[ee]=this.s[ee+1],this.s[ee+1]=pt,ee<this.n-1)for(var ht=0;ht<this.n;ht++)pt=this.V[ht][ee+1],this.V[ht][ee+1]=this.V[ht][ee],this.V[ht][ee]=pt;if(ee<this.m-1)for(var rt=0;rt<this.m;rt++)pt=this.U[rt][ee+1],this.U[rt][ee+1]=this.U[rt][ee],this.U[rt][ee]=pt;ee++}R--}break}}var Et={U:this.U,V:this.V,S:this.s};return Et},a.hypot=function(s,o){var l=void 0;return Math.abs(s)>Math.abs(o)?(l=o/s,l=Math.abs(s)*Math.sqrt(1+l*l)):o!=0?(l=s/o,l=Math.abs(o)*Math.sqrt(1+l*l)):l=0,l},r.exports=a}),(function(r,n,i){var a=(function(){function l(u,h){for(var d=0;d<h.length;d++){var f=h[d];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(u,f.key,f)}}return function(u,h,d){return h&&l(u.prototype,h),d&&l(u,d),u}})();function s(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var o=(function(){function l(u,h){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,l),this.sequence1=u,this.sequence2=h,this.match_score=d,this.mismatch_penalty=f,this.gap_penalty=p,this.iMax=u.length+1,this.jMax=h.length+1,this.grid=new Array(this.iMax);for(var g=0;g<this.iMax;g++){this.grid[g]=new Array(this.jMax);for(var m=0;m<this.jMax;m++)this.grid[g][m]=0}this.tracebackGrid=new Array(this.iMax);for(var y=0;y<this.iMax;y++){this.tracebackGrid[y]=new Array(this.jMax);for(var v=0;v<this.jMax;v++)this.tracebackGrid[y][v]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return a(l,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var h=1;h<this.jMax;h++)this.grid[0][h]=this.grid[0][h-1]+this.gap_penalty,this.tracebackGrid[0][h]=[!1,!1,!0];for(var d=1;d<this.iMax;d++)this.grid[d][0]=this.grid[d-1][0]+this.gap_penalty,this.tracebackGrid[d][0]=[!1,!0,!1];for(var f=1;f<this.iMax;f++)for(var p=1;p<this.jMax;p++){var g=void 0;this.sequence1[f-1]===this.sequence2[p-1]?g=this.grid[f-1][p-1]+this.match_score:g=this.grid[f-1][p-1]+this.mismatch_penalty;var m=this.grid[f-1][p]+this.gap_penalty,y=this.grid[f][p-1]+this.gap_penalty,v=[g,m,y],T=this.arrayAllMaxIndexes(v);this.grid[f][p]=v[T[0]],this.tracebackGrid[f][p]=[T.includes(0),T.includes(1),T.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var h=[];for(h.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});h[0];){var d=h[0],f=this.tracebackGrid[d.pos[0]][d.pos[1]];f[0]&&h.push({pos:[d.pos[0]-1,d.pos[1]-1],seq1:this.sequence1[d.pos[0]-1]+d.seq1,seq2:this.sequence2[d.pos[1]-1]+d.seq2}),f[1]&&h.push({pos:[d.pos[0]-1,d.pos[1]],seq1:this.sequence1[d.pos[0]-1]+d.seq1,seq2:"-"+d.seq2}),f[2]&&h.push({pos:[d.pos[0],d.pos[1]-1],seq1:"-"+d.seq1,seq2:this.sequence2[d.pos[1]-1]+d.seq2}),d.pos[0]===0&&d.pos[1]===0&&this.alignments.push({sequence1:d.seq1,sequence2:d.seq2}),h.shift()}return this.alignments}},{key:"getAllIndexes",value:function(h,d){for(var f=[],p=-1;(p=h.indexOf(d,p+1))!==-1;)f.push(p);return f}},{key:"arrayAllMaxIndexes",value:function(h){return this.getAllIndexes(h,Math.max.apply(null,h))}}]),l})();r.exports=o}),(function(r,n,i){var a=function(){};a.FDLayout=i(18),a.FDLayoutConstants=i(4),a.FDLayoutEdge=i(19),a.FDLayoutNode=i(20),a.DimensionD=i(21),a.HashMap=i(22),a.HashSet=i(23),a.IGeometry=i(8),a.IMath=i(9),a.Integer=i(10),a.Point=i(12),a.PointD=i(5),a.RandomSeed=i(16),a.RectangleD=i(13),a.Transform=i(17),a.UniqueIDGeneretor=i(14),a.Quicksort=i(25),a.LinkedList=i(11),a.LGraphObject=i(2),a.LGraph=i(6),a.LEdge=i(1),a.LGraphManager=i(7),a.LNode=i(3),a.Layout=i(15),a.LayoutConstants=i(0),a.NeedlemanWunsch=i(27),a.Matrix=i(24),a.SVD=i(26),r.exports=a}),(function(r,n,i){function a(){this.listeners=[]}var s=a.prototype;s.addListener=function(o,l){this.listeners.push({event:o,callback:l})},s.removeListener=function(o,l){for(var u=this.listeners.length;u>=0;u--){var h=this.listeners[u];h.event===o&&h.callback===l&&this.listeners.splice(u,1)}},s.emit=function(o,l){for(var u=0;u<this.listeners.length;u++){var h=this.listeners[u];o===h.event&&h.callback(l)}},r.exports=a})])})})(n5)),n5.exports}var RNt=r5.exports,sae;function LNt(){return sae||(sae=1,(function(t,e){(function(n,i){t.exports=i(_Nt())})(RNt,function(r){return(()=>{var n={45:((o,l,u)=>{var h={};h.layoutBase=u(551),h.CoSEConstants=u(806),h.CoSEEdge=u(767),h.CoSEGraph=u(880),h.CoSEGraphManager=u(578),h.CoSELayout=u(765),h.CoSENode=u(991),h.ConstraintHandler=u(902),o.exports=h}),806:((o,l,u)=>{var h=u(551).FDLayoutConstants;function d(){}for(var f in h)d[f]=h[f];d.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,d.DEFAULT_RADIAL_SEPARATION=h.DEFAULT_EDGE_LENGTH,d.DEFAULT_COMPONENT_SEPERATION=60,d.TILE=!0,d.TILING_PADDING_VERTICAL=10,d.TILING_PADDING_HORIZONTAL=10,d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0,d.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,d.TREE_REDUCTION_ON_INCREMENTAL=!0,d.PURE_INCREMENTAL=d.DEFAULT_INCREMENTAL,o.exports=d}),767:((o,l,u)=>{var h=u(551).FDLayoutEdge;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),880:((o,l,u)=>{var h=u(551).LGraph;function d(p,g,m){h.call(this,p,g,m)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),578:((o,l,u)=>{var h=u(551).LGraphManager;function d(p){h.call(this,p)}d.prototype=Object.create(h.prototype);for(var f in h)d[f]=h[f];o.exports=d}),765:((o,l,u)=>{var h=u(551).FDLayout,d=u(578),f=u(880),p=u(991),g=u(767),m=u(806),y=u(902),v=u(551).FDLayoutConstants,T=u(551).LayoutConstants,b=u(551).Point,w=u(551).PointD,C=u(551).DimensionD,S=u(551).Layout,k=u(551).Integer,E=u(551).IGeometry,_=u(551).LGraph,M=u(551).Transform,L=u(551).LinkedList;function P(){h.call(this),this.toBeTiled={},this.constraints={}}P.prototype=Object.create(h.prototype);for(var D in h)P[D]=h[D];P.prototype.newGraphManager=function(){var R=new d(this);return this.graphManager=R,R},P.prototype.newGraph=function(R){return new f(null,this.graphManager,R)},P.prototype.newNode=function(R){return new p(this.graphManager,R)},P.prototype.newEdge=function(R){return new g(null,null,R)},P.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.isSubLayout||(m.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=m.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=m.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=v.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=v.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=v.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},P.prototype.initSpringEmbedder=function(){h.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/v.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},P.prototype.layout=function(){var R=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return R&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},P.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(m.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes()),$=this.nodesWithGravity.filter(function(F){return I.has(F)});this.graphManager.setAllNodesToApplyGravitation($)}}else{var R=this.getFlatForest();if(R.length>0)this.positionNodesRadially(R);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes()),$=this.nodesWithGravity.filter(function(O){return I.has(O)});this.graphManager.setAllNodesToApplyGravitation($),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(y.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),m.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},P.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%v.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var R=new Set(this.getAllNodes()),I=this.nodesWithGravity.filter(function(N){return R.has(N)});this.graphManager.setAllNodesToApplyGravitation(I),this.graphManager.updateBounds(),this.updateGrid(),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),m.PURE_INCREMENTAL?this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=v.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var $=!this.isTreeGrowing&&!this.isGrowthFinished,O=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces($,O),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},P.prototype.getPositionsData=function(){for(var R=this.graphManager.getAllNodes(),I={},$=0;$<R.length;$++){var O=R[$].rect,N=R[$].id;I[N]={id:N,x:O.getCenterX(),y:O.getCenterY(),w:O.width,h:O.height}}return I},P.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var R=!1;if(v.ANIMATE==="during")this.emit("layoutstarted");else{for(;!R;)R=this.tick();this.graphManager.updateBounds()}},P.prototype.moveNodes=function(){for(var R=this.getAllNodes(),I,$=0;$<R.length;$++)I=R[$],I.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var $=0;$<R.length;$++)I=R[$],I.move()},P.prototype.initConstraintVariables=function(){var R=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var I=this.graphManager.getAllNodes(),$=0;$<I.length;$++){var O=I[$];this.idToNodeMap.set(O.id,O)}var N=function K(Q){for(var te=Q.getChild().getNodes(),J,ge=0,ee=0;ee<te.length;ee++)J=te[ee],J.getChild()==null?R.fixedNodeSet.has(J.id)&&(ge+=100):ge+=K(J);return ge};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(te){R.fixedNodeSet.add(te.nodeId)});for(var I=this.graphManager.getAllNodes(),O,$=0;$<I.length;$++)if(O=I[$],O.getChild()!=null){var F=N(O);F>0&&(O.fixedNodeWeight=F)}}if(this.constraints.relativePlacementConstraint){var z=new Map,V=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(K){R.fixedNodesOnHorizontal.add(K),R.fixedNodesOnVertical.add(K)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var B=this.constraints.alignmentConstraint.vertical,$=0;$<B.length;$++)this.dummyToNodeForVerticalAlignment.set("dummy"+$,[]),B[$].forEach(function(Q){z.set(Q,"dummy"+$),R.dummyToNodeForVerticalAlignment.get("dummy"+$).push(Q),R.fixedNodeSet.has(Q)&&R.fixedNodesOnHorizontal.add("dummy"+$)});if(this.constraints.alignmentConstraint.horizontal)for(var G=this.constraints.alignmentConstraint.horizontal,$=0;$<G.length;$++)this.dummyToNodeForHorizontalAlignment.set("dummy"+$,[]),G[$].forEach(function(Q){V.set(Q,"dummy"+$),R.dummyToNodeForHorizontalAlignment.get("dummy"+$).push(Q),R.fixedNodeSet.has(Q)&&R.fixedNodesOnVertical.add("dummy"+$)})}if(m.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(K){var Q,te,J;for(J=K.length-1;J>=2*K.length/3;J--)Q=Math.floor(Math.random()*(J+1)),te=K[J],K[J]=K[Q],K[Q]=te;return K},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(K){if(K.left){var Q=z.has(K.left)?z.get(K.left):K.left,te=z.has(K.right)?z.get(K.right):K.right;R.nodesInRelativeHorizontal.includes(Q)||(R.nodesInRelativeHorizontal.push(Q),R.nodeToRelativeConstraintMapHorizontal.set(Q,[]),R.dummyToNodeForVerticalAlignment.has(Q)?R.nodeToTempPositionMapHorizontal.set(Q,R.idToNodeMap.get(R.dummyToNodeForVerticalAlignment.get(Q)[0]).getCenterX()):R.nodeToTempPositionMapHorizontal.set(Q,R.idToNodeMap.get(Q).getCenterX())),R.nodesInRelativeHorizontal.includes(te)||(R.nodesInRelativeHorizontal.push(te),R.nodeToRelativeConstraintMapHorizontal.set(te,[]),R.dummyToNodeForVerticalAlignment.has(te)?R.nodeToTempPositionMapHorizontal.set(te,R.idToNodeMap.get(R.dummyToNodeForVerticalAlignment.get(te)[0]).getCenterX()):R.nodeToTempPositionMapHorizontal.set(te,R.idToNodeMap.get(te).getCenterX())),R.nodeToRelativeConstraintMapHorizontal.get(Q).push({right:te,gap:K.gap}),R.nodeToRelativeConstraintMapHorizontal.get(te).push({left:Q,gap:K.gap})}else{var J=V.has(K.top)?V.get(K.top):K.top,ge=V.has(K.bottom)?V.get(K.bottom):K.bottom;R.nodesInRelativeVertical.includes(J)||(R.nodesInRelativeVertical.push(J),R.nodeToRelativeConstraintMapVertical.set(J,[]),R.dummyToNodeForHorizontalAlignment.has(J)?R.nodeToTempPositionMapVertical.set(J,R.idToNodeMap.get(R.dummyToNodeForHorizontalAlignment.get(J)[0]).getCenterY()):R.nodeToTempPositionMapVertical.set(J,R.idToNodeMap.get(J).getCenterY())),R.nodesInRelativeVertical.includes(ge)||(R.nodesInRelativeVertical.push(ge),R.nodeToRelativeConstraintMapVertical.set(ge,[]),R.dummyToNodeForHorizontalAlignment.has(ge)?R.nodeToTempPositionMapVertical.set(ge,R.idToNodeMap.get(R.dummyToNodeForHorizontalAlignment.get(ge)[0]).getCenterY()):R.nodeToTempPositionMapVertical.set(ge,R.idToNodeMap.get(ge).getCenterY())),R.nodeToRelativeConstraintMapVertical.get(J).push({bottom:ge,gap:K.gap}),R.nodeToRelativeConstraintMapVertical.get(ge).push({top:J,gap:K.gap})}});else{var H=new Map,q=new Map;this.constraints.relativePlacementConstraint.forEach(function(K){if(K.left){var Q=z.has(K.left)?z.get(K.left):K.left,te=z.has(K.right)?z.get(K.right):K.right;H.has(Q)?H.get(Q).push(te):H.set(Q,[te]),H.has(te)?H.get(te).push(Q):H.set(te,[Q])}else{var J=V.has(K.top)?V.get(K.top):K.top,ge=V.has(K.bottom)?V.get(K.bottom):K.bottom;q.has(J)?q.get(J).push(ge):q.set(J,[ge]),q.has(ge)?q.get(ge).push(J):q.set(ge,[J])}});var Z=function(Q,te){var J=[],ge=[],ee=new L,Re=new Set,Ie=0;return Q.forEach(function(Be,ce){if(!Re.has(ce)){J[Ie]=[],ge[Ie]=!1;var oe=ce;for(ee.push(oe),Re.add(oe),J[Ie].push(oe);ee.length!=0;){oe=ee.shift(),te.has(oe)&&(ge[Ie]=!0);var be=Q.get(oe);be.forEach(function(fe){Re.has(fe)||(ee.push(fe),Re.add(fe),J[Ie].push(fe))})}Ie++}}),{components:J,isFixed:ge}},Y=Z(H,R.fixedNodesOnHorizontal);this.componentsOnHorizontal=Y.components,this.fixedComponentsOnHorizontal=Y.isFixed;var ie=Z(q,R.fixedNodesOnVertical);this.componentsOnVertical=ie.components,this.fixedComponentsOnVertical=ie.isFixed}}},P.prototype.updateDisplacements=function(){var R=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(ie){var K=R.idToNodeMap.get(ie.nodeId);K.displacementX=0,K.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var I=this.constraints.alignmentConstraint.vertical,$=0;$<I.length;$++){for(var O=0,N=0;N<I[$].length;N++){if(this.fixedNodeSet.has(I[$][N])){O=0;break}O+=this.idToNodeMap.get(I[$][N]).displacementX}for(var F=O/I[$].length,N=0;N<I[$].length;N++)this.idToNodeMap.get(I[$][N]).displacementX=F}if(this.constraints.alignmentConstraint.horizontal)for(var z=this.constraints.alignmentConstraint.horizontal,$=0;$<z.length;$++){for(var V=0,N=0;N<z[$].length;N++){if(this.fixedNodeSet.has(z[$][N])){V=0;break}V+=this.idToNodeMap.get(z[$][N]).displacementY}for(var B=V/z[$].length,N=0;N<z[$].length;N++)this.idToNodeMap.get(z[$][N]).displacementY=B}}if(this.constraints.relativePlacementConstraint)if(m.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(ie){if(!R.fixedNodesOnHorizontal.has(ie)){var K=0;R.dummyToNodeForVerticalAlignment.has(ie)?K=R.idToNodeMap.get(R.dummyToNodeForVerticalAlignment.get(ie)[0]).displacementX:K=R.idToNodeMap.get(ie).displacementX,R.nodeToRelativeConstraintMapHorizontal.get(ie).forEach(function(Q){if(Q.right){var te=R.nodeToTempPositionMapHorizontal.get(Q.right)-R.nodeToTempPositionMapHorizontal.get(ie)-K;te<Q.gap&&(K-=Q.gap-te)}else{var te=R.nodeToTempPositionMapHorizontal.get(ie)-R.nodeToTempPositionMapHorizontal.get(Q.left)+K;te<Q.gap&&(K+=Q.gap-te)}}),R.nodeToTempPositionMapHorizontal.set(ie,R.nodeToTempPositionMapHorizontal.get(ie)+K),R.dummyToNodeForVerticalAlignment.has(ie)?R.dummyToNodeForVerticalAlignment.get(ie).forEach(function(Q){R.idToNodeMap.get(Q).displacementX=K}):R.idToNodeMap.get(ie).displacementX=K}}),this.nodesInRelativeVertical.forEach(function(ie){if(!R.fixedNodesOnHorizontal.has(ie)){var K=0;R.dummyToNodeForHorizontalAlignment.has(ie)?K=R.idToNodeMap.get(R.dummyToNodeForHorizontalAlignment.get(ie)[0]).displacementY:K=R.idToNodeMap.get(ie).displacementY,R.nodeToRelativeConstraintMapVertical.get(ie).forEach(function(Q){if(Q.bottom){var te=R.nodeToTempPositionMapVertical.get(Q.bottom)-R.nodeToTempPositionMapVertical.get(ie)-K;te<Q.gap&&(K-=Q.gap-te)}else{var te=R.nodeToTempPositionMapVertical.get(ie)-R.nodeToTempPositionMapVertical.get(Q.top)+K;te<Q.gap&&(K+=Q.gap-te)}}),R.nodeToTempPositionMapVertical.set(ie,R.nodeToTempPositionMapVertical.get(ie)+K),R.dummyToNodeForHorizontalAlignment.has(ie)?R.dummyToNodeForHorizontalAlignment.get(ie).forEach(function(Q){R.idToNodeMap.get(Q).displacementY=K}):R.idToNodeMap.get(ie).displacementY=K}});else{for(var $=0;$<this.componentsOnHorizontal.length;$++){var G=this.componentsOnHorizontal[$];if(this.fixedComponentsOnHorizontal[$])for(var N=0;N<G.length;N++)this.dummyToNodeForVerticalAlignment.has(G[N])?this.dummyToNodeForVerticalAlignment.get(G[N]).forEach(function(Q){R.idToNodeMap.get(Q).displacementX=0}):this.idToNodeMap.get(G[N]).displacementX=0;else{for(var H=0,q=0,N=0;N<G.length;N++)if(this.dummyToNodeForVerticalAlignment.has(G[N])){var Z=this.dummyToNodeForVerticalAlignment.get(G[N]);H+=Z.length*this.idToNodeMap.get(Z[0]).displacementX,q+=Z.length}else H+=this.idToNodeMap.get(G[N]).displacementX,q++;for(var Y=H/q,N=0;N<G.length;N++)this.dummyToNodeForVerticalAlignment.has(G[N])?this.dummyToNodeForVerticalAlignment.get(G[N]).forEach(function(Q){R.idToNodeMap.get(Q).displacementX=Y}):this.idToNodeMap.get(G[N]).displacementX=Y}}for(var $=0;$<this.componentsOnVertical.length;$++){var G=this.componentsOnVertical[$];if(this.fixedComponentsOnVertical[$])for(var N=0;N<G.length;N++)this.dummyToNodeForHorizontalAlignment.has(G[N])?this.dummyToNodeForHorizontalAlignment.get(G[N]).forEach(function(te){R.idToNodeMap.get(te).displacementY=0}):this.idToNodeMap.get(G[N]).displacementY=0;else{for(var H=0,q=0,N=0;N<G.length;N++)if(this.dummyToNodeForHorizontalAlignment.has(G[N])){var Z=this.dummyToNodeForHorizontalAlignment.get(G[N]);H+=Z.length*this.idToNodeMap.get(Z[0]).displacementY,q+=Z.length}else H+=this.idToNodeMap.get(G[N]).displacementY,q++;for(var Y=H/q,N=0;N<G.length;N++)this.dummyToNodeForHorizontalAlignment.has(G[N])?this.dummyToNodeForHorizontalAlignment.get(G[N]).forEach(function(ee){R.idToNodeMap.get(ee).displacementY=Y}):this.idToNodeMap.get(G[N]).displacementY=Y}}}},P.prototype.calculateNodesToApplyGravitationTo=function(){var R=[],I,$=this.graphManager.getGraphs(),O=$.length,N;for(N=0;N<O;N++)I=$[N],I.updateConnected(),I.isConnected||(R=R.concat(I.getNodes()));return R},P.prototype.createBendpoints=function(){var R=[];R=R.concat(this.graphManager.getAllEdges());var I=new Set,$;for($=0;$<R.length;$++){var O=R[$];if(!I.has(O)){var N=O.getSource(),F=O.getTarget();if(N==F)O.getBendpoints().push(new w),O.getBendpoints().push(new w),this.createDummyNodesForBendpoints(O),I.add(O);else{var z=[];if(z=z.concat(N.getEdgeListToNode(F)),z=z.concat(F.getEdgeListToNode(N)),!I.has(z[0])){if(z.length>1){var V;for(V=0;V<z.length;V++){var B=z[V];B.getBendpoints().push(new w),this.createDummyNodesForBendpoints(B)}}z.forEach(function(G){I.add(G)})}}}if(I.size==R.length)break}},P.prototype.positionNodesRadially=function(R){for(var I=new b(0,0),$=Math.ceil(Math.sqrt(R.length)),O=0,N=0,F=0,z=new w(0,0),V=0;V<R.length;V++){V%$==0&&(F=0,N=O,V!=0&&(N+=m.DEFAULT_COMPONENT_SEPERATION),O=0);var B=R[V],G=S.findCenterOfTree(B);I.x=F,I.y=N,z=P.radialLayout(B,G,I),z.y>O&&(O=Math.floor(z.y)),F=Math.floor(z.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new w(T.WORLD_CENTER_X-z.x/2,T.WORLD_CENTER_Y-z.y/2))},P.radialLayout=function(R,I,$){var O=Math.max(this.maxDiagonalInTree(R),m.DEFAULT_RADIAL_SEPARATION);P.branchRadialLayout(I,null,0,359,0,O);var N=_.calculateBounds(R),F=new M;F.setDeviceOrgX(N.getMinX()),F.setDeviceOrgY(N.getMinY()),F.setWorldOrgX($.x),F.setWorldOrgY($.y);for(var z=0;z<R.length;z++){var V=R[z];V.transform(F)}var B=new w(N.getMaxX(),N.getMaxY());return F.inverseTransformPoint(B)},P.branchRadialLayout=function(R,I,$,O,N,F){var z=(O-$+1)/2;z<0&&(z+=180);var V=(z+$)%360,B=V*E.TWO_PI/360,G=N*Math.cos(B),H=N*Math.sin(B);R.setCenter(G,H);var q=[];q=q.concat(R.getEdges());var Z=q.length;I!=null&&Z--;for(var Y=0,ie=q.length,K,Q=R.getEdgesBetween(I);Q.length>1;){var te=Q[0];Q.splice(0,1);var J=q.indexOf(te);J>=0&&q.splice(J,1),ie--,Z--}I!=null?K=(q.indexOf(Q[0])+1)%ie:K=0;for(var ge=Math.abs(O-$)/Z,ee=K;Y!=Z;ee=++ee%ie){var Re=q[ee].getOtherEnd(R);if(Re!=I){var Ie=($+Y*ge)%360,Be=(Ie+ge)%360;P.branchRadialLayout(Re,R,Ie,Be,N+F,F),Y++}}},P.maxDiagonalInTree=function(R){for(var I=k.MIN_VALUE,$=0;$<R.length;$++){var O=R[$],N=O.getDiagonal();N>I&&(I=N)}return I},P.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},P.prototype.groupZeroDegreeMembers=function(){var R=this,I={};this.memberGroups={},this.idToDummyNode={};for(var $=[],O=this.graphManager.getAllNodes(),N=0;N<O.length;N++){var F=O[N],z=F.getParent();this.getNodeDegreeWithChildren(F)===0&&(z.id==null||!this.getToBeTiled(z))&&$.push(F)}for(var N=0;N<$.length;N++){var F=$[N],V=F.getParent().id;typeof I[V]>"u"&&(I[V]=[]),I[V]=I[V].concat(F)}Object.keys(I).forEach(function(B){if(I[B].length>1){var G="DummyCompound_"+B;R.memberGroups[G]=I[B];var H=I[B][0].getParent(),q=new p(R.graphManager);q.id=G,q.paddingLeft=H.paddingLeft||0,q.paddingRight=H.paddingRight||0,q.paddingBottom=H.paddingBottom||0,q.paddingTop=H.paddingTop||0,R.idToDummyNode[G]=q;var Z=R.getGraphManager().add(R.newGraph(),q),Y=H.getChild();Y.add(q);for(var ie=0;ie<I[B].length;ie++){var K=I[B][ie];Y.remove(K),Z.add(K)}}})},P.prototype.clearCompounds=function(){var R={},I={};this.performDFSOnCompounds();for(var $=0;$<this.compoundOrder.length;$++)I[this.compoundOrder[$].id]=this.compoundOrder[$],R[this.compoundOrder[$].id]=[].concat(this.compoundOrder[$].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[$].getChild()),this.compoundOrder[$].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(R,I)},P.prototype.clearZeroDegreeMembers=function(){var R=this,I=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function($){var O=R.idToDummyNode[$];if(I[$]=R.tileNodes(R.memberGroups[$],O.paddingLeft+O.paddingRight),O.rect.width=I[$].width,O.rect.height=I[$].height,O.setCenter(I[$].centerX,I[$].centerY),O.labelMarginLeft=0,O.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var N=O.rect.width,F=O.rect.height;O.labelWidth&&(O.labelPosHorizontal=="left"?(O.rect.x-=O.labelWidth,O.setWidth(N+O.labelWidth),O.labelMarginLeft=O.labelWidth):O.labelPosHorizontal=="center"&&O.labelWidth>N?(O.rect.x-=(O.labelWidth-N)/2,O.setWidth(O.labelWidth),O.labelMarginLeft=(O.labelWidth-N)/2):O.labelPosHorizontal=="right"&&O.setWidth(N+O.labelWidth)),O.labelHeight&&(O.labelPosVertical=="top"?(O.rect.y-=O.labelHeight,O.setHeight(F+O.labelHeight),O.labelMarginTop=O.labelHeight):O.labelPosVertical=="center"&&O.labelHeight>F?(O.rect.y-=(O.labelHeight-F)/2,O.setHeight(O.labelHeight),O.labelMarginTop=(O.labelHeight-F)/2):O.labelPosVertical=="bottom"&&O.setHeight(F+O.labelHeight))}})},P.prototype.repopulateCompounds=function(){for(var R=this.compoundOrder.length-1;R>=0;R--){var I=this.compoundOrder[R],$=I.id,O=I.paddingLeft,N=I.paddingTop,F=I.labelMarginLeft,z=I.labelMarginTop;this.adjustLocations(this.tiledMemberPack[$],I.rect.x,I.rect.y,O,N,F,z)}},P.prototype.repopulateZeroDegreeMembers=function(){var R=this,I=this.tiledZeroDegreePack;Object.keys(I).forEach(function($){var O=R.idToDummyNode[$],N=O.paddingLeft,F=O.paddingTop,z=O.labelMarginLeft,V=O.labelMarginTop;R.adjustLocations(I[$],O.rect.x,O.rect.y,N,F,z,V)})},P.prototype.getToBeTiled=function(R){var I=R.id;if(this.toBeTiled[I]!=null)return this.toBeTiled[I];var $=R.getChild();if($==null)return this.toBeTiled[I]=!1,!1;for(var O=$.getNodes(),N=0;N<O.length;N++){var F=O[N];if(this.getNodeDegree(F)>0)return this.toBeTiled[I]=!1,!1;if(F.getChild()==null){this.toBeTiled[F.id]=!1;continue}if(!this.getToBeTiled(F))return this.toBeTiled[I]=!1,!1}return this.toBeTiled[I]=!0,!0},P.prototype.getNodeDegree=function(R){R.id;for(var I=R.getEdges(),$=0,O=0;O<I.length;O++){var N=I[O];N.getSource().id!==N.getTarget().id&&($=$+1)}return $},P.prototype.getNodeDegreeWithChildren=function(R){var I=this.getNodeDegree(R);if(R.getChild()==null)return I;for(var $=R.getChild().getNodes(),O=0;O<$.length;O++){var N=$[O];I+=this.getNodeDegreeWithChildren(N)}return I},P.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},P.prototype.fillCompexOrderByDFS=function(R){for(var I=0;I<R.length;I++){var $=R[I];$.getChild()!=null&&this.fillCompexOrderByDFS($.getChild().getNodes()),this.getToBeTiled($)&&this.compoundOrder.push($)}},P.prototype.adjustLocations=function(R,I,$,O,N,F,z){I+=O+F,$+=N+z;for(var V=I,B=0;B<R.rows.length;B++){var G=R.rows[B];I=V;for(var H=0,q=0;q<G.length;q++){var Z=G[q];Z.rect.x=I,Z.rect.y=$,I+=Z.rect.width+R.horizontalPadding,Z.rect.height>H&&(H=Z.rect.height)}$+=H+R.verticalPadding}},P.prototype.tileCompoundMembers=function(R,I){var $=this;this.tiledMemberPack=[],Object.keys(R).forEach(function(O){var N=I[O];if($.tiledMemberPack[O]=$.tileNodes(R[O],N.paddingLeft+N.paddingRight),N.rect.width=$.tiledMemberPack[O].width,N.rect.height=$.tiledMemberPack[O].height,N.setCenter($.tiledMemberPack[O].centerX,$.tiledMemberPack[O].centerY),N.labelMarginLeft=0,N.labelMarginTop=0,m.NODE_DIMENSIONS_INCLUDE_LABELS){var F=N.rect.width,z=N.rect.height;N.labelWidth&&(N.labelPosHorizontal=="left"?(N.rect.x-=N.labelWidth,N.setWidth(F+N.labelWidth),N.labelMarginLeft=N.labelWidth):N.labelPosHorizontal=="center"&&N.labelWidth>F?(N.rect.x-=(N.labelWidth-F)/2,N.setWidth(N.labelWidth),N.labelMarginLeft=(N.labelWidth-F)/2):N.labelPosHorizontal=="right"&&N.setWidth(F+N.labelWidth)),N.labelHeight&&(N.labelPosVertical=="top"?(N.rect.y-=N.labelHeight,N.setHeight(z+N.labelHeight),N.labelMarginTop=N.labelHeight):N.labelPosVertical=="center"&&N.labelHeight>z?(N.rect.y-=(N.labelHeight-z)/2,N.setHeight(N.labelHeight),N.labelMarginTop=(N.labelHeight-z)/2):N.labelPosVertical=="bottom"&&N.setHeight(z+N.labelHeight))}})},P.prototype.tileNodes=function(R,I){var $=this.tileNodesByFavoringDim(R,I,!0),O=this.tileNodesByFavoringDim(R,I,!1),N=this.getOrgRatio($),F=this.getOrgRatio(O),z;return F<N?z=O:z=$,z},P.prototype.getOrgRatio=function(R){var I=R.width,$=R.height,O=I/$;return O<1&&(O=1/O),O},P.prototype.calcIdealRowWidth=function(R,I){var $=m.TILING_PADDING_VERTICAL,O=m.TILING_PADDING_HORIZONTAL,N=R.length,F=0,z=0,V=0;R.forEach(function(ie){F+=ie.getWidth(),z+=ie.getHeight(),ie.getWidth()>V&&(V=ie.getWidth())});var B=F/N,G=z/N,H=Math.pow($-O,2)+4*(B+O)*(G+$)*N,q=(O-$+Math.sqrt(H))/(2*(B+O)),Z;I?(Z=Math.ceil(q),Z==q&&Z++):Z=Math.floor(q);var Y=Z*(B+O)-O;return V>Y&&(Y=V),Y+=O*2,Y},P.prototype.tileNodesByFavoringDim=function(R,I,$){var O=m.TILING_PADDING_VERTICAL,N=m.TILING_PADDING_HORIZONTAL,F=m.TILING_COMPARE_BY,z={rows:[],rowWidth:[],rowHeight:[],width:0,height:I,verticalPadding:O,horizontalPadding:N,centerX:0,centerY:0};F&&(z.idealRowWidth=this.calcIdealRowWidth(R,$));var V=function(K){return K.rect.width*K.rect.height},B=function(K,Q){return V(Q)-V(K)};R.sort(function(ie,K){var Q=B;return z.idealRowWidth?(Q=F,Q(ie.id,K.id)):Q(ie,K)});for(var G=0,H=0,q=0;q<R.length;q++){var Z=R[q];G+=Z.getCenterX(),H+=Z.getCenterY()}z.centerX=G/R.length,z.centerY=H/R.length;for(var q=0;q<R.length;q++){var Z=R[q];if(z.rows.length==0)this.insertNodeToRow(z,Z,0,I);else if(this.canAddHorizontal(z,Z.rect.width,Z.rect.height)){var Y=z.rows.length-1;z.idealRowWidth||(Y=this.getShortestRowIndex(z)),this.insertNodeToRow(z,Z,Y,I)}else this.insertNodeToRow(z,Z,z.rows.length,I);this.shiftToLastRow(z)}return z},P.prototype.insertNodeToRow=function(R,I,$,O){var N=O;if($==R.rows.length){var F=[];R.rows.push(F),R.rowWidth.push(N),R.rowHeight.push(0)}var z=R.rowWidth[$]+I.rect.width;R.rows[$].length>0&&(z+=R.horizontalPadding),R.rowWidth[$]=z,R.width<z&&(R.width=z);var V=I.rect.height;$>0&&(V+=R.verticalPadding);var B=0;V>R.rowHeight[$]&&(B=R.rowHeight[$],R.rowHeight[$]=V,B=R.rowHeight[$]-B),R.height+=B,R.rows[$].push(I)},P.prototype.getShortestRowIndex=function(R){for(var I=-1,$=Number.MAX_VALUE,O=0;O<R.rows.length;O++)R.rowWidth[O]<$&&(I=O,$=R.rowWidth[O]);return I},P.prototype.getLongestRowIndex=function(R){for(var I=-1,$=Number.MIN_VALUE,O=0;O<R.rows.length;O++)R.rowWidth[O]>$&&(I=O,$=R.rowWidth[O]);return I},P.prototype.canAddHorizontal=function(R,I,$){if(R.idealRowWidth){var O=R.rows.length-1,N=R.rowWidth[O];return N+I+R.horizontalPadding<=R.idealRowWidth}var F=this.getShortestRowIndex(R);if(F<0)return!0;var z=R.rowWidth[F];if(z+R.horizontalPadding+I<=R.width)return!0;var V=0;R.rowHeight[F]<$&&F>0&&(V=$+R.verticalPadding-R.rowHeight[F]);var B;R.width-z>=I+R.horizontalPadding?B=(R.height+V)/(z+I+R.horizontalPadding):B=(R.height+V)/R.width,V=$+R.verticalPadding;var G;return R.width<I?G=(R.height+V)/I:G=(R.height+V)/R.width,G<1&&(G=1/G),B<1&&(B=1/B),B<G},P.prototype.shiftToLastRow=function(R){var I=this.getLongestRowIndex(R),$=R.rowWidth.length-1,O=R.rows[I],N=O[O.length-1],F=N.width+R.horizontalPadding;if(R.width-R.rowWidth[$]>F&&I!=$){O.splice(-1,1),R.rows[$].push(N),R.rowWidth[I]=R.rowWidth[I]-F,R.rowWidth[$]=R.rowWidth[$]+F,R.width=R.rowWidth[instance.getLongestRowIndex(R)];for(var z=Number.MIN_VALUE,V=0;V<O.length;V++)O[V].height>z&&(z=O[V].height);I>0&&(z+=R.verticalPadding);var B=R.rowHeight[I]+R.rowHeight[$];R.rowHeight[I]=z,R.rowHeight[$]<N.height+R.verticalPadding&&(R.rowHeight[$]=N.height+R.verticalPadding);var G=R.rowHeight[I]+R.rowHeight[$];R.height+=G-B,this.shiftToLastRow(R)}},P.prototype.tilingPreLayout=function(){m.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},P.prototype.tilingPostLayout=function(){m.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},P.prototype.reduceTrees=function(){for(var R=[],I=!0,$;I;){var O=this.graphManager.getAllNodes(),N=[];I=!1;for(var F=0;F<O.length;F++)if($=O[F],$.getEdges().length==1&&!$.getEdges()[0].isInterGraph&&$.getChild()==null){if(m.PURE_INCREMENTAL){var z=$.getEdges()[0].getOtherEnd($),V=new C($.getCenterX()-z.getCenterX(),$.getCenterY()-z.getCenterY());N.push([$,$.getEdges()[0],$.getOwner(),V])}else N.push([$,$.getEdges()[0],$.getOwner()]);I=!0}if(I==!0){for(var B=[],G=0;G<N.length;G++)N[G][0].getEdges().length==1&&(B.push(N[G]),N[G][0].getOwner().remove(N[G][0]));R.push(B),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=R},P.prototype.growTree=function(R){for(var I=R.length,$=R[I-1],O,N=0;N<$.length;N++)O=$[N],this.findPlaceforPrunedNode(O),O[2].add(O[0]),O[2].add(O[1],O[1].source,O[1].target);R.splice(R.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},P.prototype.findPlaceforPrunedNode=function(R){var I,$,O=R[0];if(O==R[1].source?$=R[1].target:$=R[1].source,m.PURE_INCREMENTAL)O.setCenter($.getCenterX()+R[3].getWidth(),$.getCenterY()+R[3].getHeight());else{var N=$.startX,F=$.finishX,z=$.startY,V=$.finishY,B=0,G=0,H=0,q=0,Z=[B,H,G,q];if(z>0)for(var Y=N;Y<=F;Y++)Z[0]+=this.grid[Y][z-1].length+this.grid[Y][z].length-1;if(F<this.grid.length-1)for(var Y=z;Y<=V;Y++)Z[1]+=this.grid[F+1][Y].length+this.grid[F][Y].length-1;if(V<this.grid[0].length-1)for(var Y=N;Y<=F;Y++)Z[2]+=this.grid[Y][V+1].length+this.grid[Y][V].length-1;if(N>0)for(var Y=z;Y<=V;Y++)Z[3]+=this.grid[N-1][Y].length+this.grid[N][Y].length-1;for(var ie=k.MAX_VALUE,K,Q,te=0;te<Z.length;te++)Z[te]<ie?(ie=Z[te],K=1,Q=te):Z[te]==ie&&K++;if(K==3&&ie==0)Z[0]==0&&Z[1]==0&&Z[2]==0?I=1:Z[0]==0&&Z[1]==0&&Z[3]==0?I=0:Z[0]==0&&Z[2]==0&&Z[3]==0?I=3:Z[1]==0&&Z[2]==0&&Z[3]==0&&(I=2);else if(K==2&&ie==0){var J=Math.floor(Math.random()*2);Z[0]==0&&Z[1]==0?J==0?I=0:I=1:Z[0]==0&&Z[2]==0?J==0?I=0:I=2:Z[0]==0&&Z[3]==0?J==0?I=0:I=3:Z[1]==0&&Z[2]==0?J==0?I=1:I=2:Z[1]==0&&Z[3]==0?J==0?I=1:I=3:J==0?I=2:I=3}else if(K==4&&ie==0){var J=Math.floor(Math.random()*4);I=J}else I=Q;I==0?O.setCenter($.getCenterX(),$.getCenterY()-$.getHeight()/2-v.DEFAULT_EDGE_LENGTH-O.getHeight()/2):I==1?O.setCenter($.getCenterX()+$.getWidth()/2+v.DEFAULT_EDGE_LENGTH+O.getWidth()/2,$.getCenterY()):I==2?O.setCenter($.getCenterX(),$.getCenterY()+$.getHeight()/2+v.DEFAULT_EDGE_LENGTH+O.getHeight()/2):O.setCenter($.getCenterX()-$.getWidth()/2-v.DEFAULT_EDGE_LENGTH-O.getWidth()/2,$.getCenterY())}},o.exports=P}),991:((o,l,u)=>{var h=u(551).FDLayoutNode,d=u(551).IMath;function f(g,m,y,v){h.call(this,g,m,y,v)}f.prototype=Object.create(h.prototype);for(var p in h)f[p]=h[p];f.prototype.calculateDisplacement=function(){var g=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*d.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(g,m){for(var y=this.getChild().getNodes(),v,T=0;T<y.length;T++)v=y[T],v.getChild()==null?(v.displacementX+=g,v.displacementY+=m):v.propogateDisplacementToChildren(g,m)},f.prototype.move=function(){var g=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},f.prototype.setPred1=function(g){this.pred1=g},f.prototype.getPred1=function(){return pred1},f.prototype.getPred2=function(){return pred2},f.prototype.setNext=function(g){this.next=g},f.prototype.getNext=function(){return next},f.prototype.setProcessed=function(g){this.processed=g},f.prototype.isProcessed=function(){return processed},o.exports=f}),902:((o,l,u)=>{function h(y){if(Array.isArray(y)){for(var v=0,T=Array(y.length);v<y.length;v++)T[v]=y[v];return T}else return Array.from(y)}var d=u(806),f=u(551).LinkedList,p=u(551).Matrix,g=u(551).SVD;function m(){}m.handleConstraints=function(y){var v={};v.fixedNodeConstraint=y.constraints.fixedNodeConstraint,v.alignmentConstraint=y.constraints.alignmentConstraint,v.relativePlacementConstraint=y.constraints.relativePlacementConstraint;for(var T=new Map,b=new Map,w=[],C=[],S=y.getAllNodes(),k=0,E=0;E<S.length;E++){var _=S[E];_.getChild()==null&&(b.set(_.id,k++),w.push(_.getCenterX()),C.push(_.getCenterY()),T.set(_.id,_))}v.relativePlacementConstraint&&v.relativePlacementConstraint.forEach(function(ne){!ne.gap&&ne.gap!=0&&(ne.left?ne.gap=d.DEFAULT_EDGE_LENGTH+T.get(ne.left).getWidth()/2+T.get(ne.right).getWidth()/2:ne.gap=d.DEFAULT_EDGE_LENGTH+T.get(ne.top).getHeight()/2+T.get(ne.bottom).getHeight()/2)});var M=function(j,ue){return{x:j.x-ue.x,y:j.y-ue.y}},L=function(j){var ue=0,X=0;return j.forEach(function(Oe){ue+=w[b.get(Oe)],X+=C[b.get(Oe)]}),{x:ue/j.size,y:X/j.size}},P=function(j,ue,X,Oe,xe){function Ge(at,Ee){var pt=new Set(at),ht=!0,rt=!1,Et=void 0;try{for(var vt=Ee[Symbol.iterator](),ot;!(ht=(ot=vt.next()).done);ht=!0){var pe=ot.value;pt.add(pe)}}catch(Ct){rt=!0,Et=Ct}finally{try{!ht&&vt.return&&vt.return()}finally{if(rt)throw Et}}return pt}var _e=new Map;j.forEach(function(at,Ee){_e.set(Ee,0)}),j.forEach(function(at,Ee){at.forEach(function(pt){_e.set(pt.id,_e.get(pt.id)+1)})});var $e=new Map,Me=new Map,He=new f;_e.forEach(function(at,Ee){at==0?(He.push(Ee),X||(ue=="horizontal"?$e.set(Ee,b.has(Ee)?w[b.get(Ee)]:Oe.get(Ee)):$e.set(Ee,b.has(Ee)?C[b.get(Ee)]:Oe.get(Ee)))):$e.set(Ee,Number.NEGATIVE_INFINITY),X&&Me.set(Ee,new Set([Ee]))}),X&&xe.forEach(function(at){var Ee=[];if(at.forEach(function(rt){X.has(rt)&&Ee.push(rt)}),Ee.length>0){var pt=0;Ee.forEach(function(rt){ue=="horizontal"?($e.set(rt,b.has(rt)?w[b.get(rt)]:Oe.get(rt)),pt+=$e.get(rt)):($e.set(rt,b.has(rt)?C[b.get(rt)]:Oe.get(rt)),pt+=$e.get(rt))}),pt=pt/Ee.length,at.forEach(function(rt){X.has(rt)||$e.set(rt,pt)})}else{var ht=0;at.forEach(function(rt){ue=="horizontal"?ht+=b.has(rt)?w[b.get(rt)]:Oe.get(rt):ht+=b.has(rt)?C[b.get(rt)]:Oe.get(rt)}),ht=ht/at.length,at.forEach(function(rt){$e.set(rt,ht)})}});for(var De=function(){var Ee=He.shift(),pt=j.get(Ee);pt.forEach(function(ht){if($e.get(ht.id)<$e.get(Ee)+ht.gap)if(X&&X.has(ht.id)){var rt=void 0;if(ue=="horizontal"?rt=b.has(ht.id)?w[b.get(ht.id)]:Oe.get(ht.id):rt=b.has(ht.id)?C[b.get(ht.id)]:Oe.get(ht.id),$e.set(ht.id,rt),rt<$e.get(Ee)+ht.gap){var Et=$e.get(Ee)+ht.gap-rt;Me.get(Ee).forEach(function(vt){$e.set(vt,$e.get(vt)-Et)})}}else $e.set(ht.id,$e.get(Ee)+ht.gap);_e.set(ht.id,_e.get(ht.id)-1),_e.get(ht.id)==0&&He.push(ht.id),X&&Me.set(ht.id,Ge(Me.get(Ee),Me.get(ht.id)))})};He.length!=0;)De();if(X){var Ke=new Set;j.forEach(function(at,Ee){at.length==0&&Ke.add(Ee)});var Ae=[];Me.forEach(function(at,Ee){if(Ke.has(Ee)){var pt=!1,ht=!0,rt=!1,Et=void 0;try{for(var vt=at[Symbol.iterator](),ot;!(ht=(ot=vt.next()).done);ht=!0){var pe=ot.value;X.has(pe)&&(pt=!0)}}catch(st){rt=!0,Et=st}finally{try{!ht&&vt.return&&vt.return()}finally{if(rt)throw Et}}if(!pt){var Ct=!1,lt=void 0;Ae.forEach(function(st,mt){st.has([].concat(h(at))[0])&&(Ct=!0,lt=mt)}),Ct?at.forEach(function(st){Ae[lt].add(st)}):Ae.push(new Set(at))}}}),Ae.forEach(function(at,Ee){var pt=Number.POSITIVE_INFINITY,ht=Number.POSITIVE_INFINITY,rt=Number.NEGATIVE_INFINITY,Et=Number.NEGATIVE_INFINITY,vt=!0,ot=!1,pe=void 0;try{for(var Ct=at[Symbol.iterator](),lt;!(vt=(lt=Ct.next()).done);vt=!0){var st=lt.value,mt=void 0;ue=="horizontal"?mt=b.has(st)?w[b.get(st)]:Oe.get(st):mt=b.has(st)?C[b.get(st)]:Oe.get(st);var _r=$e.get(st);mt<pt&&(pt=mt),mt>rt&&(rt=mt),_r<ht&&(ht=_r),_r>Et&&(Et=_r)}}catch(vr){ot=!0,pe=vr}finally{try{!vt&&Ct.return&&Ct.return()}finally{if(ot)throw pe}}var Se=(pt+rt)/2-(ht+Et)/2,Ue=!0,tt=!1,kt=void 0;try{for(var Nt=at[Symbol.iterator](),sr;!(Ue=(sr=Nt.next()).done);Ue=!0){var Qt=sr.value;$e.set(Qt,$e.get(Qt)+Se)}}catch(vr){tt=!0,kt=vr}finally{try{!Ue&&Nt.return&&Nt.return()}finally{if(tt)throw kt}}})}return $e},D=function(j){var ue=0,X=0,Oe=0,xe=0;if(j.forEach(function(Me){Me.left?w[b.get(Me.left)]-w[b.get(Me.right)]>=0?ue++:X++:C[b.get(Me.top)]-C[b.get(Me.bottom)]>=0?Oe++:xe++}),ue>X&&Oe>xe)for(var Ge=0;Ge<b.size;Ge++)w[Ge]=-1*w[Ge],C[Ge]=-1*C[Ge];else if(ue>X)for(var _e=0;_e<b.size;_e++)w[_e]=-1*w[_e];else if(Oe>xe)for(var $e=0;$e<b.size;$e++)C[$e]=-1*C[$e]},R=function(j){var ue=[],X=new f,Oe=new Set,xe=0;return j.forEach(function(Ge,_e){if(!Oe.has(_e)){ue[xe]=[];var $e=_e;for(X.push($e),Oe.add($e),ue[xe].push($e);X.length!=0;){$e=X.shift();var Me=j.get($e);Me.forEach(function(He){Oe.has(He.id)||(X.push(He.id),Oe.add(He.id),ue[xe].push(He.id))})}xe++}}),ue},I=function(j){var ue=new Map;return j.forEach(function(X,Oe){ue.set(Oe,[])}),j.forEach(function(X,Oe){X.forEach(function(xe){ue.get(Oe).push(xe),ue.get(xe.id).push({id:Oe,gap:xe.gap,direction:xe.direction})})}),ue},$=function(j){var ue=new Map;return j.forEach(function(X,Oe){ue.set(Oe,[])}),j.forEach(function(X,Oe){X.forEach(function(xe){ue.get(xe.id).push({id:Oe,gap:xe.gap,direction:xe.direction})})}),ue},O=[],N=[],F=!1,z=!1,V=new Set,B=new Map,G=new Map,H=[];if(v.fixedNodeConstraint&&v.fixedNodeConstraint.forEach(function(ne){V.add(ne.nodeId)}),v.relativePlacementConstraint&&(v.relativePlacementConstraint.forEach(function(ne){ne.left?(B.has(ne.left)?B.get(ne.left).push({id:ne.right,gap:ne.gap,direction:"horizontal"}):B.set(ne.left,[{id:ne.right,gap:ne.gap,direction:"horizontal"}]),B.has(ne.right)||B.set(ne.right,[])):(B.has(ne.top)?B.get(ne.top).push({id:ne.bottom,gap:ne.gap,direction:"vertical"}):B.set(ne.top,[{id:ne.bottom,gap:ne.gap,direction:"vertical"}]),B.has(ne.bottom)||B.set(ne.bottom,[]))}),G=I(B),H=R(G)),d.TRANSFORM_ON_CONSTRAINT_HANDLING){if(v.fixedNodeConstraint&&v.fixedNodeConstraint.length>1)v.fixedNodeConstraint.forEach(function(ne,j){O[j]=[ne.position.x,ne.position.y],N[j]=[w[b.get(ne.nodeId)],C[b.get(ne.nodeId)]]}),F=!0;else if(v.alignmentConstraint)(function(){var ne=0;if(v.alignmentConstraint.vertical){for(var j=v.alignmentConstraint.vertical,ue=function($e){var Me=new Set;j[$e].forEach(function(Ke){Me.add(Ke)});var He=new Set([].concat(h(Me)).filter(function(Ke){return V.has(Ke)})),De=void 0;He.size>0?De=w[b.get(He.values().next().value)]:De=L(Me).x,j[$e].forEach(function(Ke){O[ne]=[De,C[b.get(Ke)]],N[ne]=[w[b.get(Ke)],C[b.get(Ke)]],ne++})},X=0;X<j.length;X++)ue(X);F=!0}if(v.alignmentConstraint.horizontal){for(var Oe=v.alignmentConstraint.horizontal,xe=function($e){var Me=new Set;Oe[$e].forEach(function(Ke){Me.add(Ke)});var He=new Set([].concat(h(Me)).filter(function(Ke){return V.has(Ke)})),De=void 0;He.size>0?De=w[b.get(He.values().next().value)]:De=L(Me).y,Oe[$e].forEach(function(Ke){O[ne]=[w[b.get(Ke)],De],N[ne]=[w[b.get(Ke)],C[b.get(Ke)]],ne++})},Ge=0;Ge<Oe.length;Ge++)xe(Ge);F=!0}v.relativePlacementConstraint&&(z=!0)})();else if(v.relativePlacementConstraint){for(var q=0,Z=0,Y=0;Y<H.length;Y++)H[Y].length>q&&(q=H[Y].length,Z=Y);if(q<G.size/2)D(v.relativePlacementConstraint),F=!1,z=!1;else{var ie=new Map,K=new Map,Q=[];H[Z].forEach(function(ne){B.get(ne).forEach(function(j){j.direction=="horizontal"?(ie.has(ne)?ie.get(ne).push(j):ie.set(ne,[j]),ie.has(j.id)||ie.set(j.id,[]),Q.push({left:ne,right:j.id})):(K.has(ne)?K.get(ne).push(j):K.set(ne,[j]),K.has(j.id)||K.set(j.id,[]),Q.push({top:ne,bottom:j.id}))})}),D(Q),z=!1;var te=P(ie,"horizontal"),J=P(K,"vertical");H[Z].forEach(function(ne,j){N[j]=[w[b.get(ne)],C[b.get(ne)]],O[j]=[],te.has(ne)?O[j][0]=te.get(ne):O[j][0]=w[b.get(ne)],J.has(ne)?O[j][1]=J.get(ne):O[j][1]=C[b.get(ne)]}),F=!0}}if(F){for(var ge=void 0,ee=p.transpose(O),Re=p.transpose(N),Ie=0;Ie<ee.length;Ie++)ee[Ie]=p.multGamma(ee[Ie]),Re[Ie]=p.multGamma(Re[Ie]);var Be=p.multMat(ee,p.transpose(Re)),ce=g.svd(Be);ge=p.multMat(ce.V,p.transpose(ce.U));for(var oe=0;oe<b.size;oe++){var be=[w[oe],C[oe]],fe=[ge[0][0],ge[1][0]],Pe=[ge[0][1],ge[1][1]];w[oe]=p.dotProduct(be,fe),C[oe]=p.dotProduct(be,Pe)}z&&D(v.relativePlacementConstraint)}}if(d.ENFORCE_CONSTRAINTS){if(v.fixedNodeConstraint&&v.fixedNodeConstraint.length>0){var ve={x:0,y:0};v.fixedNodeConstraint.forEach(function(ne,j){var ue={x:w[b.get(ne.nodeId)],y:C[b.get(ne.nodeId)]},X=ne.position,Oe=M(X,ue);ve.x+=Oe.x,ve.y+=Oe.y}),ve.x/=v.fixedNodeConstraint.length,ve.y/=v.fixedNodeConstraint.length,w.forEach(function(ne,j){w[j]+=ve.x}),C.forEach(function(ne,j){C[j]+=ve.y}),v.fixedNodeConstraint.forEach(function(ne){w[b.get(ne.nodeId)]=ne.position.x,C[b.get(ne.nodeId)]=ne.position.y})}if(v.alignmentConstraint){if(v.alignmentConstraint.vertical)for(var Ce=v.alignmentConstraint.vertical,Ve=function(j){var ue=new Set;Ce[j].forEach(function(xe){ue.add(xe)});var X=new Set([].concat(h(ue)).filter(function(xe){return V.has(xe)})),Oe=void 0;X.size>0?Oe=w[b.get(X.values().next().value)]:Oe=L(ue).x,ue.forEach(function(xe){V.has(xe)||(w[b.get(xe)]=Oe)})},se=0;se<Ce.length;se++)Ve(se);if(v.alignmentConstraint.horizontal)for(var de=v.alignmentConstraint.horizontal,Te=function(j){var ue=new Set;de[j].forEach(function(xe){ue.add(xe)});var X=new Set([].concat(h(ue)).filter(function(xe){return V.has(xe)})),Oe=void 0;X.size>0?Oe=C[b.get(X.values().next().value)]:Oe=L(ue).y,ue.forEach(function(xe){V.has(xe)||(C[b.get(xe)]=Oe)})},ae=0;ae<de.length;ae++)Te(ae)}v.relativePlacementConstraint&&(function(){var ne=new Map,j=new Map,ue=new Map,X=new Map,Oe=new Map,xe=new Map,Ge=new Set,_e=new Set;if(V.forEach(function(yt){Ge.add(yt),_e.add(yt)}),v.alignmentConstraint){if(v.alignmentConstraint.vertical)for(var $e=v.alignmentConstraint.vertical,Me=function(it){ue.set("dummy"+it,[]),$e[it].forEach(function(xt){ne.set(xt,"dummy"+it),ue.get("dummy"+it).push(xt),V.has(xt)&&Ge.add("dummy"+it)}),Oe.set("dummy"+it,w[b.get($e[it][0])])},He=0;He<$e.length;He++)Me(He);if(v.alignmentConstraint.horizontal)for(var De=v.alignmentConstraint.horizontal,Ke=function(it){X.set("dummy"+it,[]),De[it].forEach(function(xt){j.set(xt,"dummy"+it),X.get("dummy"+it).push(xt),V.has(xt)&&_e.add("dummy"+it)}),xe.set("dummy"+it,C[b.get(De[it][0])])},Ae=0;Ae<De.length;Ae++)Ke(Ae)}var at=new Map,Ee=new Map,pt=function(it){B.get(it).forEach(function(xt){var nt=void 0,Ht=void 0;xt.direction=="horizontal"?(nt=ne.get(it)?ne.get(it):it,ne.get(xt.id)?Ht={id:ne.get(xt.id),gap:xt.gap,direction:xt.direction}:Ht=xt,at.has(nt)?at.get(nt).push(Ht):at.set(nt,[Ht]),at.has(Ht.id)||at.set(Ht.id,[])):(nt=j.get(it)?j.get(it):it,j.get(xt.id)?Ht={id:j.get(xt.id),gap:xt.gap,direction:xt.direction}:Ht=xt,Ee.has(nt)?Ee.get(nt).push(Ht):Ee.set(nt,[Ht]),Ee.has(Ht.id)||Ee.set(Ht.id,[]))})},ht=!0,rt=!1,Et=void 0;try{for(var vt=B.keys()[Symbol.iterator](),ot;!(ht=(ot=vt.next()).done);ht=!0){var pe=ot.value;pt(pe)}}catch(yt){rt=!0,Et=yt}finally{try{!ht&&vt.return&&vt.return()}finally{if(rt)throw Et}}var Ct=I(at),lt=I(Ee),st=R(Ct),mt=R(lt),_r=$(at),Se=$(Ee),Ue=[],tt=[];st.forEach(function(yt,it){Ue[it]=[],yt.forEach(function(xt){_r.get(xt).length==0&&Ue[it].push(xt)})}),mt.forEach(function(yt,it){tt[it]=[],yt.forEach(function(xt){Se.get(xt).length==0&&tt[it].push(xt)})});var kt=P(at,"horizontal",Ge,Oe,Ue),Nt=P(Ee,"vertical",_e,xe,tt),sr=function(it){ue.get(it)?ue.get(it).forEach(function(xt){w[b.get(xt)]=kt.get(it)}):w[b.get(it)]=kt.get(it)},Qt=!0,vr=!1,nr=void 0;try{for(var Rr=kt.keys()[Symbol.iterator](),Zt;!(Qt=(Zt=Rr.next()).done);Qt=!0){var gr=Zt.value;sr(gr)}}catch(yt){vr=!0,nr=yt}finally{try{!Qt&&Rr.return&&Rr.return()}finally{if(vr)throw nr}}var Dr=function(it){X.get(it)?X.get(it).forEach(function(xt){C[b.get(xt)]=Nt.get(it)}):C[b.get(it)]=Nt.get(it)},Qe=!0,ct=!1,It=void 0;try{for(var cr=Nt.keys()[Symbol.iterator](),Or;!(Qe=(Or=cr.next()).done);Qe=!0){var gr=Or.value;Dr(gr)}}catch(yt){ct=!0,It=yt}finally{try{!Qe&&cr.return&&cr.return()}finally{if(ct)throw It}}})()}for(var he=0;he<S.length;he++){var W=S[he];W.getChild()==null&&W.setCenter(w[b.get(W.id)],C[b.get(W.id)])}},o.exports=m}),551:(o=>{o.exports=r})},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(45);return s})()})})(r5)),r5.exports}var MNt=t5.exports,oae;function INt(){return oae||(oae=1,(function(t,e){(function(n,i){t.exports=i(LNt())})(MNt,function(r){return(()=>{var n={658:(o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(l){for(var u=arguments.length,h=Array(u>1?u-1:0),d=1;d<u;d++)h[d-1]=arguments[d];return h.forEach(function(f){Object.keys(f).forEach(function(p){return l[p]=f[p]})}),l}}),548:((o,l,u)=>{var h=(function(){function p(g,m){var y=[],v=!0,T=!1,b=void 0;try{for(var w=g[Symbol.iterator](),C;!(v=(C=w.next()).done)&&(y.push(C.value),!(m&&y.length===m));v=!0);}catch(S){T=!0,b=S}finally{try{!v&&w.return&&w.return()}finally{if(T)throw b}}return y}return function(g,m){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return p(g,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),d=u(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(p){for(var g={},m=0;m<p.length;m++)g[p[m].id()]=!0;var y=p.filter(function(v,T){typeof v=="number"&&(v=T);for(var b=v.parent()[0];b!=null;){if(g[b.id()])return!1;b=b.parent()[0]}return!0});return y},f.connectComponents=function(p,g,m,y){var v=new d,T=new Set,b=[],w=void 0,C=void 0,S=void 0,k=!1,E=1,_=[],M=[],L=function(){var D=p.collection();M.push(D);var R=m[0],I=p.collection();I.merge(R).merge(R.descendants().intersection(g)),b.push(R),I.forEach(function(N){v.push(N),T.add(N),D.merge(N)});for(var $=function(){R=v.shift();var F=p.collection();R.neighborhood().nodes().forEach(function(G){g.intersection(R.edgesWith(G)).length>0&&F.merge(G)});for(var z=0;z<F.length;z++){var V=F[z];if(w=m.intersection(V.union(V.ancestors())),w!=null&&!T.has(w[0])){var B=w.union(w.descendants());B.forEach(function(G){v.push(G),T.add(G),D.merge(G),m.has(G)&&b.push(G)})}}};v.length!=0;)$();if(D.forEach(function(N){g.intersection(N.connectedEdges()).forEach(function(F){D.has(F.source())&&D.has(F.target())&&D.merge(F)})}),b.length==m.length&&(k=!0),!k||k&&E>1){C=b[0],S=C.connectedEdges().length,b.forEach(function(N){N.connectedEdges().length<S&&(S=N.connectedEdges().length,C=N)}),_.push(C.id());var O=p.collection();O.merge(b[0]),b.forEach(function(N){O.merge(N)}),b=[],m=m.difference(O),E++}};do L();while(!k);return y&&_.length>0&&y.set("dummy"+(y.size+1),_),M},f.relocateComponent=function(p,g,m){if(!m.fixedNodeConstraint){var y=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var w=!0,C=!1,S=void 0;try{for(var k=g.nodeIndexes[Symbol.iterator](),E;!(w=(E=k.next()).done);w=!0){var _=E.value,M=h(_,2),L=M[0],P=M[1],D=m.cy.getElementById(L);if(D){var R=D.boundingBox(),I=g.xCoords[P]-R.w/2,$=g.xCoords[P]+R.w/2,O=g.yCoords[P]-R.h/2,N=g.yCoords[P]+R.h/2;I<y&&(y=I),$>v&&(v=$),O<T&&(T=O),N>b&&(b=N)}}}catch(G){C=!0,S=G}finally{try{!w&&k.return&&k.return()}finally{if(C)throw S}}var F=p.x-(v+y)/2,z=p.y-(b+T)/2;g.xCoords=g.xCoords.map(function(G){return G+F}),g.yCoords=g.yCoords.map(function(G){return G+z})}else{Object.keys(g).forEach(function(G){var H=g[G],q=H.getRect().x,Z=H.getRect().x+H.getRect().width,Y=H.getRect().y,ie=H.getRect().y+H.getRect().height;q<y&&(y=q),Z>v&&(v=Z),Y<T&&(T=Y),ie>b&&(b=ie)});var V=p.x-(v+y)/2,B=p.y-(b+T)/2;Object.keys(g).forEach(function(G){var H=g[G];H.setCenter(H.getCenterX()+V,H.getCenterY()+B)})}}},f.calcBoundingBox=function(p,g,m,y){for(var v=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,b=Number.MAX_SAFE_INTEGER,w=Number.MIN_SAFE_INTEGER,C=void 0,S=void 0,k=void 0,E=void 0,_=p.descendants().not(":parent"),M=_.length,L=0;L<M;L++){var P=_[L];C=g[y.get(P.id())]-P.width()/2,S=g[y.get(P.id())]+P.width()/2,k=m[y.get(P.id())]-P.height()/2,E=m[y.get(P.id())]+P.height()/2,v>C&&(v=C),T<S&&(T=S),b>k&&(b=k),w<E&&(w=E)}var D={};return D.topLeftX=v,D.topLeftY=b,D.width=T-v,D.height=w-b,D},f.calcParentsWithoutChildren=function(p,g){var m=p.collection();return g.nodes(":parent").forEach(function(y){var v=!1;y.children().forEach(function(T){T.css("display")!="none"&&(v=!0)}),v||m.merge(y)}),m},o.exports=f}),816:((o,l,u)=>{var h=u(548),d=u(140).CoSELayout,f=u(140).CoSENode,p=u(140).layoutBase.PointD,g=u(140).layoutBase.DimensionD,m=u(140).layoutBase.LayoutConstants,y=u(140).layoutBase.FDLayoutConstants,v=u(140).CoSEConstants,T=function(w,C){var S=w.cy,k=w.eles,E=k.nodes(),_=k.edges(),M=void 0,L=void 0,P=void 0,D={};w.randomize&&(M=C.nodeIndexes,L=C.xCoords,P=C.yCoords);var R=function(G){return typeof G=="function"},I=function(G,H){return R(G)?G(H):G},$=h.calcParentsWithoutChildren(S,k),O=function B(G,H,q,Z){for(var Y=H.length,ie=0;ie<Y;ie++){var K=H[ie],Q=null;K.intersection($).length==0&&(Q=K.children());var te=void 0,J=K.layoutDimensions({nodeDimensionsIncludeLabels:Z.nodeDimensionsIncludeLabels});if(K.outerWidth()!=null&&K.outerHeight()!=null)if(Z.randomize)if(!K.isParent())te=G.add(new f(q.graphManager,new p(L[M.get(K.id())]-J.w/2,P[M.get(K.id())]-J.h/2),new g(parseFloat(J.w),parseFloat(J.h))));else{var ge=h.calcBoundingBox(K,L,P,M);K.intersection($).length==0?te=G.add(new f(q.graphManager,new p(ge.topLeftX,ge.topLeftY),new g(ge.width,ge.height))):te=G.add(new f(q.graphManager,new p(ge.topLeftX,ge.topLeftY),new g(parseFloat(J.w),parseFloat(J.h))))}else te=G.add(new f(q.graphManager,new p(K.position("x")-J.w/2,K.position("y")-J.h/2),new g(parseFloat(J.w),parseFloat(J.h))));else te=G.add(new f(this.graphManager));if(te.id=K.data("id"),te.nodeRepulsion=I(Z.nodeRepulsion,K),te.paddingLeft=parseInt(K.css("padding")),te.paddingTop=parseInt(K.css("padding")),te.paddingRight=parseInt(K.css("padding")),te.paddingBottom=parseInt(K.css("padding")),Z.nodeDimensionsIncludeLabels&&(te.labelWidth=K.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,te.labelHeight=K.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,te.labelPosVertical=K.css("text-valign"),te.labelPosHorizontal=K.css("text-halign")),D[K.data("id")]=te,isNaN(te.rect.x)&&(te.rect.x=0),isNaN(te.rect.y)&&(te.rect.y=0),Q!=null&&Q.length>0){var ee=void 0;ee=q.getGraphManager().add(q.newGraph(),te),B(ee,Q,q,Z)}}},N=function(G,H,q){for(var Z=0,Y=0,ie=0;ie<q.length;ie++){var K=q[ie],Q=D[K.data("source")],te=D[K.data("target")];if(Q&&te&&Q!==te&&Q.getEdgesBetween(te).length==0){var J=H.add(G.newEdge(),Q,te);J.id=K.id(),J.idealLength=I(w.idealEdgeLength,K),J.edgeElasticity=I(w.edgeElasticity,K),Z+=J.idealLength,Y++}}w.idealEdgeLength!=null&&(Y>0?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=Z/Y:R(w.idealEdgeLength)?v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=50:v.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=w.idealEdgeLength,v.MIN_REPULSION_DIST=y.MIN_REPULSION_DIST=y.DEFAULT_EDGE_LENGTH/10,v.DEFAULT_RADIAL_SEPARATION=y.DEFAULT_EDGE_LENGTH)},F=function(G,H){H.fixedNodeConstraint&&(G.constraints.fixedNodeConstraint=H.fixedNodeConstraint),H.alignmentConstraint&&(G.constraints.alignmentConstraint=H.alignmentConstraint),H.relativePlacementConstraint&&(G.constraints.relativePlacementConstraint=H.relativePlacementConstraint)};w.nestingFactor!=null&&(v.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=w.nestingFactor),w.gravity!=null&&(v.DEFAULT_GRAVITY_STRENGTH=y.DEFAULT_GRAVITY_STRENGTH=w.gravity),w.numIter!=null&&(v.MAX_ITERATIONS=y.MAX_ITERATIONS=w.numIter),w.gravityRange!=null&&(v.DEFAULT_GRAVITY_RANGE_FACTOR=y.DEFAULT_GRAVITY_RANGE_FACTOR=w.gravityRange),w.gravityCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=w.gravityCompound),w.gravityRangeCompound!=null&&(v.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=w.gravityRangeCompound),w.initialEnergyOnIncremental!=null&&(v.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.DEFAULT_COOLING_FACTOR_INCREMENTAL=w.initialEnergyOnIncremental),w.tilingCompareBy!=null&&(v.TILING_COMPARE_BY=w.tilingCompareBy),w.quality=="proof"?m.QUALITY=2:m.QUALITY=0,v.NODE_DIMENSIONS_INCLUDE_LABELS=y.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=w.nodeDimensionsIncludeLabels,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!w.randomize,v.ANIMATE=y.ANIMATE=m.ANIMATE=w.animate,v.TILE=w.tile,v.TILING_PADDING_VERTICAL=typeof w.tilingPaddingVertical=="function"?w.tilingPaddingVertical.call():w.tilingPaddingVertical,v.TILING_PADDING_HORIZONTAL=typeof w.tilingPaddingHorizontal=="function"?w.tilingPaddingHorizontal.call():w.tilingPaddingHorizontal,v.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!0,v.PURE_INCREMENTAL=!w.randomize,m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=w.uniformNodeDimensions,w.step=="transformed"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!1),w.step=="enforced"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!1),w.step=="cose"&&(v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!1,v.APPLY_LAYOUT=!0),w.step=="all"&&(w.randomize?v.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:v.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,v.ENFORCE_CONSTRAINTS=!0,v.APPLY_LAYOUT=!0),w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint?v.TREE_REDUCTION_ON_INCREMENTAL=!1:v.TREE_REDUCTION_ON_INCREMENTAL=!0;var z=new d,V=z.newGraphManager();return O(V.addRoot(),h.getTopMostNodes(E),z,w),N(z,V,_),F(z,w),z.runLayout(),D};o.exports={coseLayout:T}}),212:((o,l,u)=>{var h=(function(){function w(C,S){for(var k=0;k<S.length;k++){var E=S[k];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(C,E.key,E)}}return function(C,S,k){return S&&w(C.prototype,S),k&&w(C,k),C}})();function d(w,C){if(!(w instanceof C))throw new TypeError("Cannot call a class as a function")}var f=u(658),p=u(548),g=u(657),m=g.spectralLayout,y=u(816),v=y.coseLayout,T=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(C){return 4500},idealEdgeLength:function(C){return 50},edgeElasticity:function(C){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),b=(function(){function w(C){d(this,w),this.options=f({},T,C)}return h(w,[{key:"run",value:function(){var S=this,k=this.options,E=k.cy,_=k.eles,M=[],L=[],P=void 0,D=[];k.fixedNodeConstraint&&(!Array.isArray(k.fixedNodeConstraint)||k.fixedNodeConstraint.length==0)&&(k.fixedNodeConstraint=void 0),k.alignmentConstraint&&(k.alignmentConstraint.vertical&&(!Array.isArray(k.alignmentConstraint.vertical)||k.alignmentConstraint.vertical.length==0)&&(k.alignmentConstraint.vertical=void 0),k.alignmentConstraint.horizontal&&(!Array.isArray(k.alignmentConstraint.horizontal)||k.alignmentConstraint.horizontal.length==0)&&(k.alignmentConstraint.horizontal=void 0)),k.relativePlacementConstraint&&(!Array.isArray(k.relativePlacementConstraint)||k.relativePlacementConstraint.length==0)&&(k.relativePlacementConstraint=void 0);var R=k.fixedNodeConstraint||k.alignmentConstraint||k.relativePlacementConstraint;R&&(k.tile=!1,k.packComponents=!1);var I=void 0,$=!1;if(E.layoutUtilities&&k.packComponents&&(I=E.layoutUtilities("get"),I||(I=E.layoutUtilities()),$=!0),_.nodes().length>0)if($){var F=p.getTopMostNodes(k.eles.nodes());if(P=p.connectComponents(E,k.eles,F),P.forEach(function(Be){var ce=Be.boundingBox();D.push({x:ce.x1+ce.w/2,y:ce.y1+ce.h/2})}),k.randomize&&P.forEach(function(Be){k.eles=Be,M.push(m(k))}),k.quality=="default"||k.quality=="proof"){var z=E.collection();if(k.tile){var V=new Map,B=[],G=[],H=0,q={nodeIndexes:V,xCoords:B,yCoords:G},Z=[];if(P.forEach(function(Be,ce){Be.edges().length==0&&(Be.nodes().forEach(function(oe,be){z.merge(Be.nodes()[be]),oe.isParent()||(q.nodeIndexes.set(Be.nodes()[be].id(),H++),q.xCoords.push(Be.nodes()[0].position().x),q.yCoords.push(Be.nodes()[0].position().y))}),Z.push(ce))}),z.length>1){var Y=z.boundingBox();D.push({x:Y.x1+Y.w/2,y:Y.y1+Y.h/2}),P.push(z),M.push(q);for(var ie=Z.length-1;ie>=0;ie--)P.splice(Z[ie],1),M.splice(Z[ie],1),D.splice(Z[ie],1)}}P.forEach(function(Be,ce){k.eles=Be,L.push(v(k,M[ce])),p.relocateComponent(D[ce],L[ce],k)})}else P.forEach(function(Be,ce){p.relocateComponent(D[ce],M[ce],k)});var K=new Set;if(P.length>1){var Q=[],te=_.filter(function(Be){return Be.css("display")=="none"});P.forEach(function(Be,ce){var oe=void 0;if(k.quality=="draft"&&(oe=M[ce].nodeIndexes),Be.nodes().not(te).length>0){var be={};be.edges=[],be.nodes=[];var fe=void 0;Be.nodes().not(te).forEach(function(Pe){if(k.quality=="draft")if(!Pe.isParent())fe=oe.get(Pe.id()),be.nodes.push({x:M[ce].xCoords[fe]-Pe.boundingbox().w/2,y:M[ce].yCoords[fe]-Pe.boundingbox().h/2,width:Pe.boundingbox().w,height:Pe.boundingbox().h});else{var ve=p.calcBoundingBox(Pe,M[ce].xCoords,M[ce].yCoords,oe);be.nodes.push({x:ve.topLeftX,y:ve.topLeftY,width:ve.width,height:ve.height})}else L[ce][Pe.id()]&&be.nodes.push({x:L[ce][Pe.id()].getLeft(),y:L[ce][Pe.id()].getTop(),width:L[ce][Pe.id()].getWidth(),height:L[ce][Pe.id()].getHeight()})}),Be.edges().forEach(function(Pe){var ve=Pe.source(),Ce=Pe.target();if(ve.css("display")!="none"&&Ce.css("display")!="none")if(k.quality=="draft"){var Ve=oe.get(ve.id()),se=oe.get(Ce.id()),de=[],Te=[];if(ve.isParent()){var ae=p.calcBoundingBox(ve,M[ce].xCoords,M[ce].yCoords,oe);de.push(ae.topLeftX+ae.width/2),de.push(ae.topLeftY+ae.height/2)}else de.push(M[ce].xCoords[Ve]),de.push(M[ce].yCoords[Ve]);if(Ce.isParent()){var he=p.calcBoundingBox(Ce,M[ce].xCoords,M[ce].yCoords,oe);Te.push(he.topLeftX+he.width/2),Te.push(he.topLeftY+he.height/2)}else Te.push(M[ce].xCoords[se]),Te.push(M[ce].yCoords[se]);be.edges.push({startX:de[0],startY:de[1],endX:Te[0],endY:Te[1]})}else L[ce][ve.id()]&&L[ce][Ce.id()]&&be.edges.push({startX:L[ce][ve.id()].getCenterX(),startY:L[ce][ve.id()].getCenterY(),endX:L[ce][Ce.id()].getCenterX(),endY:L[ce][Ce.id()].getCenterY()})}),be.nodes.length>0&&(Q.push(be),K.add(ce))}});var J=I.packComponents(Q,k.randomize).shifts;if(k.quality=="draft")M.forEach(function(Be,ce){var oe=Be.xCoords.map(function(fe){return fe+J[ce].dx}),be=Be.yCoords.map(function(fe){return fe+J[ce].dy});Be.xCoords=oe,Be.yCoords=be});else{var ge=0;K.forEach(function(Be){Object.keys(L[Be]).forEach(function(ce){var oe=L[Be][ce];oe.setCenter(oe.getCenterX()+J[ge].dx,oe.getCenterY()+J[ge].dy)}),ge++})}}}else{var O=k.eles.boundingBox();if(D.push({x:O.x1+O.w/2,y:O.y1+O.h/2}),k.randomize){var N=m(k);M.push(N)}k.quality=="default"||k.quality=="proof"?(L.push(v(k,M[0])),p.relocateComponent(D[0],L[0],k)):p.relocateComponent(D[0],M[0],k)}var ee=function(ce,oe){if(k.quality=="default"||k.quality=="proof"){typeof ce=="number"&&(ce=oe);var be=void 0,fe=void 0,Pe=ce.data("id");return L.forEach(function(Ce){Pe in Ce&&(be={x:Ce[Pe].getRect().getCenterX(),y:Ce[Pe].getRect().getCenterY()},fe=Ce[Pe])}),k.nodeDimensionsIncludeLabels&&(fe.labelWidth&&(fe.labelPosHorizontal=="left"?be.x+=fe.labelWidth/2:fe.labelPosHorizontal=="right"&&(be.x-=fe.labelWidth/2)),fe.labelHeight&&(fe.labelPosVertical=="top"?be.y+=fe.labelHeight/2:fe.labelPosVertical=="bottom"&&(be.y-=fe.labelHeight/2))),be==null&&(be={x:ce.position("x"),y:ce.position("y")}),{x:be.x,y:be.y}}else{var ve=void 0;return M.forEach(function(Ce){var Ve=Ce.nodeIndexes.get(ce.id());Ve!=null&&(ve={x:Ce.xCoords[Ve],y:Ce.yCoords[Ve]})}),ve==null&&(ve={x:ce.position("x"),y:ce.position("y")}),{x:ve.x,y:ve.y}}};if(k.quality=="default"||k.quality=="proof"||k.randomize){var Re=p.calcParentsWithoutChildren(E,_),Ie=_.filter(function(Be){return Be.css("display")=="none"});k.eles=_.not(Ie),_.nodes().not(":parent").not(Ie).layoutPositions(S,k,ee),Re.length>0&&Re.forEach(function(Be){Be.position(ee(Be))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),w})();o.exports=b}),657:((o,l,u)=>{var h=u(548),d=u(140).layoutBase.Matrix,f=u(140).layoutBase.SVD,p=function(m){var y=m.cy,v=m.eles,T=v.nodes(),b=v.nodes(":parent"),w=new Map,C=new Map,S=new Map,k=[],E=[],_=[],M=[],L=[],P=[],D=[],R=[],I=void 0,$=1e8,O=1e-9,N=m.piTol,F=m.samplingType,z=m.nodeSeparation,V=void 0,B=function(){for(var j=0,ue=0,X=!1;ue<V;){j=Math.floor(Math.random()*I),X=!1;for(var Oe=0;Oe<ue;Oe++)if(M[Oe]==j){X=!0;break}if(!X)M[ue]=j,ue++;else continue}},G=function(j,ue,X){for(var Oe=[],xe=0,Ge=0,_e=0,$e=void 0,Me=[],He=0,De=1,Ke=0;Ke<I;Ke++)Me[Ke]=$;for(Oe[Ge]=j,Me[j]=0;Ge>=xe;){_e=Oe[xe++];for(var Ae=k[_e],at=0;at<Ae.length;at++)$e=C.get(Ae[at]),Me[$e]==$&&(Me[$e]=Me[_e]+1,Oe[++Ge]=$e);P[_e][ue]=Me[_e]*z}if(X){for(var Ee=0;Ee<I;Ee++)P[Ee][ue]<L[Ee]&&(L[Ee]=P[Ee][ue]);for(var pt=0;pt<I;pt++)L[pt]>He&&(He=L[pt],De=pt)}return De},H=function(j){var ue=void 0;if(j){ue=Math.floor(Math.random()*I);for(var Oe=0;Oe<I;Oe++)L[Oe]=$;for(var xe=0;xe<V;xe++)M[xe]=ue,ue=G(ue,xe,j)}else{B();for(var X=0;X<V;X++)G(M[X],X,j)}for(var Ge=0;Ge<I;Ge++)for(var _e=0;_e<V;_e++)P[Ge][_e]*=P[Ge][_e];for(var $e=0;$e<V;$e++)D[$e]=[];for(var Me=0;Me<V;Me++)for(var He=0;He<V;He++)D[Me][He]=P[M[He]][Me]},q=function(){for(var j=f.svd(D),ue=j.S,X=j.U,Oe=j.V,xe=ue[0]*ue[0]*ue[0],Ge=[],_e=0;_e<V;_e++){Ge[_e]=[];for(var $e=0;$e<V;$e++)Ge[_e][$e]=0,_e==$e&&(Ge[_e][$e]=ue[_e]/(ue[_e]*ue[_e]+xe/(ue[_e]*ue[_e])))}R=d.multMat(d.multMat(Oe,Ge),d.transpose(X))},Z=function(){for(var j=void 0,ue=void 0,X=[],Oe=[],xe=[],Ge=[],_e=0;_e<I;_e++)X[_e]=Math.random(),Oe[_e]=Math.random();X=d.normalize(X),Oe=d.normalize(Oe);for(var $e=O,Me=O,He=void 0;;){for(var De=0;De<I;De++)xe[De]=X[De];if(X=d.multGamma(d.multL(d.multGamma(xe),P,R)),j=d.dotProduct(xe,X),X=d.normalize(X),$e=d.dotProduct(xe,X),He=Math.abs($e/Me),He<=1+N&&He>=1)break;Me=$e}for(var Ke=0;Ke<I;Ke++)xe[Ke]=X[Ke];for(Me=O;;){for(var Ae=0;Ae<I;Ae++)Ge[Ae]=Oe[Ae];if(Ge=d.minusOp(Ge,d.multCons(xe,d.dotProduct(xe,Ge))),Oe=d.multGamma(d.multL(d.multGamma(Ge),P,R)),ue=d.dotProduct(Ge,Oe),Oe=d.normalize(Oe),$e=d.dotProduct(Ge,Oe),He=Math.abs($e/Me),He<=1+N&&He>=1)break;Me=$e}for(var at=0;at<I;at++)Ge[at]=Oe[at];E=d.multCons(xe,Math.sqrt(Math.abs(j))),_=d.multCons(Ge,Math.sqrt(Math.abs(ue)))};h.connectComponents(y,v,h.getTopMostNodes(T),w),b.forEach(function(ne){h.connectComponents(y,v,h.getTopMostNodes(ne.descendants().intersection(v)),w)});for(var Y=0,ie=0;ie<T.length;ie++)T[ie].isParent()||C.set(T[ie].id(),Y++);var K=!0,Q=!1,te=void 0;try{for(var J=w.keys()[Symbol.iterator](),ge;!(K=(ge=J.next()).done);K=!0){var ee=ge.value;C.set(ee,Y++)}}catch(ne){Q=!0,te=ne}finally{try{!K&&J.return&&J.return()}finally{if(Q)throw te}}for(var Re=0;Re<C.size;Re++)k[Re]=[];b.forEach(function(ne){for(var j=ne.children().intersection(v);j.nodes(":childless").length==0;)j=j.nodes()[0].children().intersection(v);var ue=0,X=j.nodes(":childless")[0].connectedEdges().length;j.nodes(":childless").forEach(function(Oe,xe){Oe.connectedEdges().length<X&&(X=Oe.connectedEdges().length,ue=xe)}),S.set(ne.id(),j.nodes(":childless")[ue].id())}),T.forEach(function(ne){var j=void 0;ne.isParent()?j=C.get(S.get(ne.id())):j=C.get(ne.id()),ne.neighborhood().nodes().forEach(function(ue){v.intersection(ne.edgesWith(ue)).length>0&&(ue.isParent()?k[j].push(S.get(ue.id())):k[j].push(ue.id()))})});var Ie=function(j){var ue=C.get(j),X=void 0;w.get(j).forEach(function(Oe){y.getElementById(Oe).isParent()?X=S.get(Oe):X=Oe,k[ue].push(X),k[C.get(X)].push(j)})},Be=!0,ce=!1,oe=void 0;try{for(var be=w.keys()[Symbol.iterator](),fe;!(Be=(fe=be.next()).done);Be=!0){var Pe=fe.value;Ie(Pe)}}catch(ne){ce=!0,oe=ne}finally{try{!Be&&be.return&&be.return()}finally{if(ce)throw oe}}I=C.size;var ve=void 0;if(I>2){V=I<m.sampleSize?I:m.sampleSize;for(var Ce=0;Ce<I;Ce++)P[Ce]=[];for(var Ve=0;Ve<V;Ve++)R[Ve]=[];return m.quality=="draft"||m.step=="all"?(H(F),q(),Z(),ve={nodeIndexes:C,xCoords:E,yCoords:_}):(C.forEach(function(ne,j){E.push(y.getElementById(j).position("x")),_.push(y.getElementById(j).position("y"))}),ve={nodeIndexes:C,xCoords:E,yCoords:_}),ve}else{var se=C.keys(),de=y.getElementById(se.next().value),Te=de.position(),ae=de.outerWidth();if(E.push(Te.x),_.push(Te.y),I==2){var he=y.getElementById(se.next().value),W=he.outerWidth();E.push(Te.x+ae/2+W/2+m.idealEdgeLength),_.push(Te.y)}return ve={nodeIndexes:C,xCoords:E,yCoords:_},ve}};o.exports={spectralLayout:p}}),579:((o,l,u)=>{var h=u(212),d=function(p){p&&p("layout","fcose",h)};typeof cytoscape<"u"&&d(cytoscape),o.exports=d}),140:(o=>{o.exports=r})},i={};function a(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return n[o](u,u.exports,a),u.exports}var s=a(579);return s})()})})(t5)),t5.exports}var NNt=INt();const DNt=eg(NNt);var lae={L:"left",R:"right",T:"top",B:"bottom"},cae={L:x(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:x(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:x(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:x(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},R4={L:x((t,e)=>t-e+2,"L"),R:x((t,e)=>t-2,"R"),T:x((t,e)=>t-e+2,"T"),B:x((t,e)=>t-2,"B")},ONt=x(function(t){return Ns(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),uae=x(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),Ns=x(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),bf=x(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),jU=x(function(t,e){const r=Ns(t)&&bf(e),n=bf(t)&&Ns(e);return r||n},"isArchitectureDirectionXY"),$Nt=x(function(t){const e=t[0],r=t[1],n=Ns(e)&&bf(r),i=bf(e)&&Ns(r);return n||i},"isArchitecturePairXY"),PNt=x(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),lF=x(function(t,e){const r=`${t}${e}`;return PNt(r)?r:void 0},"getArchitectureDirectionPair"),BNt=x(function([t,e],r){const n=r[0],i=r[1];return Ns(n)?bf(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:Ns(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),FNt=x(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),zNt=x(function(t,e){return jU(t,e)?"bend":Ns(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),VNt=x(function(t){return t.type==="service"},"isArchitectureService"),GNt=x(function(t){return t.type==="junction"},"isArchitectureJunction"),pRe=x((t,e)=>{const[r,n]=[t,e].sort();return`${JSON.stringify(r)}-${JSON.stringify(n)}`},"architectureGroupAlignmentKey"),gRe=x(t=>t.data(),"edgeData"),sy=x(t=>t.data(),"nodeData"),WNt=Vr.architecture,lb,mRe=(lb=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=Hn,this.getAccTitle=ni,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.getAccDescription=ai,this.setAccDescription=ii,this.clear()}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",On()}addService({id:e,icon:r,in:n,title:i,iconText:a}){if(this.registeredIds.has(e))throw new Error(`The service id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw new Error(`The service [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw new Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(n)==="node")throw new Error(`The service [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"service",icon:r,iconText:a,title:i,edges:[],in:n})}getServices(){return[...this.nodes.values()].filter(VNt)}addJunction({id:e,in:r}){if(this.registeredIds.has(e))throw new Error(`The junction id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(r!==void 0){if(e===r)throw new Error(`The junction [${e}] cannot be placed within itself`);if(!this.registeredIds.has(r))throw new Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(r)==="node")throw new Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"junction",edges:[],in:r})}getJunctions(){return[...this.nodes.values()].filter(GNt)}getNodes(){return[...this.nodes.values()]}getNode(e){return this.nodes.get(e)??null}addGroup({id:e,icon:r,in:n,title:i}){if(this.registeredIds.has(e))throw new Error(`The group id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw new Error(`The group [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw new Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(n)==="node")throw new Error(`The group [${e}]'s parent is not a group`)}this.registeredIds.set(e,"group"),this.groups.set(e,{id:e,icon:r,title:i,in:n})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:e,rhsId:r,lhsDir:n,rhsDir:i,lhsInto:a,rhsInto:s,lhsGroup:o,rhsGroup:l,title:u}){if(!uae(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!uae(i))throw new Error(`Invalid direction given for right hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(i)}`);if(!this.nodes.has(e)&&!this.groups.has(e))throw new Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(r)&&!this.groups.has(r))throw new Error(`The right-hand id [${r}] does not yet exist. Please create the service/group before declaring an edge to it.`);const h=this.nodes.get(e).in,d=this.nodes.get(r).in;if(o&&h&&d&&h==d)throw new Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(l&&h&&d&&h==d)throw new Error(`The right-hand id [${r}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const f={lhsId:e,lhsDir:n,lhsInto:a,lhsGroup:o,rhsId:r,rhsDir:i,rhsInto:s,rhsGroup:l,title:u};this.edges.push(f);const p=this.nodes.get(e),g=this.nodes.get(r);p&&g&&(p.edges.push(this.edges[this.edges.length-1]),g.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2)throw new Error(`An align directive requires at least two members; got ${e.members.length}`);const r=new Set;e.members.forEach(n=>{if(this.registeredIds.get(n)!=="node")throw new Error(`align ${e.direction} references [${n}], which is not a service or junction`);if(r.has(n))throw new Error(`align ${e.direction} lists [${n}] more than once`);r.add(n)}),this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){var e,r;if(this.dataStructures===void 0){const n=new Map,i=new Map;for(const[u,h]of this.nodes.entries()){const d=new Map;for(const f of h.edges){const p=(e=this.getNode(f.lhsId))==null?void 0:e.in,g=(r=this.getNode(f.rhsId))==null?void 0:r.in;if(p&&g&&p!==g){const m=zNt(f.lhsDir,f.rhsDir);m!=="bend"&&n.set(pRe(p,g),m)}if(f.lhsId===u){const m=lF(f.lhsDir,f.rhsDir);m&&d.set(m,f.rhsId)}else{const m=lF(f.rhsDir,f.lhsDir);m&&d.set(m,f.lhsId)}}i.set(u,d)}const a=new Set,s=new Set(i.keys()),o=x(u=>{const h=new Map([[u,[0,0]]]),d=[u];for(;d.length>0;){const f=d.shift();if(f){a.add(f),s.delete(f);const p=i.get(f);if(!p)throw new Error(`BFS error: adjacency list for id ${f} not found. Please report this as a bug.`);const g=h.get(f);if(!g)throw new Error(`BFS error: position for id ${f} not found in spatial map. Please report this as a bug.`);const[m,y]=g;p.forEach((v,T)=>{a.has(v)||(h.set(v,BNt([m,y],T)),d.push(v))})}}return h},"BFS"),l=[];for(;s.size>0;){const u=s.values().next().value;l.push(o(u))}this.dataStructures={adjList:i,spatialMaps:l,groupAlignments:n}}return this.dataStructures}setElementForId(e,r){this.elements.set(e,r)}getElementById(e){return this.elements.get(e)}getConfig(){return ri({...WNt,...Xt().architecture})}getConfigField(e){return this.getConfig()[e]}},x(lb,"ArchitectureDB"),lb),HNt=x((t,e)=>{var r;eo(t,e),t.groups.map(n=>e.addGroup(n)),t.services.map(n=>e.addService({...n,type:"service"})),t.junctions.map(n=>e.addJunction({...n,type:"junction"})),t.edges.map(n=>e.addEdge(n)),(r=t.alignments)==null||r.map(n=>e.addLayoutHint({direction:n.direction,members:[...n.members]}))},"populateDb"),yRe={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Al("architecture",t);le.debug(e);const r=(n=yRe.parser)==null?void 0:n.yy;if(!(r instanceof mRe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");HNt(e,r)},"parse")},qNt=x(t=>`
.edge {
stroke-width: ${t.archEdgeWidth};
stroke: ${t.archEdgeColor};
fill: none;
}
.arrow {
fill: ${t.archEdgeArrowColor};
}
.node-bkg {
fill: none;
stroke: ${t.archGroupBorderColor};
stroke-width: ${t.archGroupBorderWidth};
stroke-dasharray: 8;
}
.node-icon-text {
display: flex;
align-items: center;
}
.node-icon-text > div {
color: #fff;
margin: 1px;
height: fit-content;
text-align: center;
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
}
`,"getStyles"),UNt=qNt;function cF(t,e){if(t===0)return e();const r=Math.random;let n=t>>>0;Math.random=function(){n=n+1831565813>>>0;let i=n;return i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61),((i^i>>>14)>>>0)/4294967296};try{return e()}finally{Math.random=r}}x(cF,"withSeededRandom");var um=x(t=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${t}</g>`,"wrapIcon"),Ok={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:um('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:um('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:um('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:um('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:um('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:Ode,blank:{body:um("")}}},YNt=x(async function(t,e,r,n){const i=r.getConfigField("padding"),a=r.getConfigField("iconSize"),s=a/2,o=a/6,l=o/2;await Promise.all(e.edges().map(async u=>{var M,L;const{source:h,sourceDir:d,sourceArrow:f,sourceGroup:p,target:g,targetDir:m,targetArrow:y,targetGroup:v,label:T}=gRe(u);let{x:b,y:w}=u[0].sourceEndpoint();const{x:C,y:S}=u[0].midpoint();let{x:k,y:E}=u[0].targetEndpoint();const _=i+4;if(p&&(Ns(d)?b+=d==="L"?-_:_:w+=d==="T"?-_:_+18),v&&(Ns(m)?k+=m==="L"?-_:_:E+=m==="T"?-_:_+18),!p&&((M=r.getNode(h))==null?void 0:M.type)==="junction"&&(Ns(d)?b+=d==="L"?s:-s:w+=d==="T"?s:-s),!v&&((L=r.getNode(g))==null?void 0:L.type)==="junction"&&(Ns(m)?k+=m==="L"?s:-s:E+=m==="T"?s:-s),u[0]._private.rscratch){const P=t.insert("g");if(P.insert("path").attr("d",`M ${b},${w} L ${C},${S} L${k},${E} `).attr("class","edge").attr("id",`${n}-${dy(h,g,{prefix:"L"})}`),f){const D=Ns(d)?R4[d](b,o):b-l,R=bf(d)?R4[d](w,o):w-l;P.insert("polygon").attr("points",cae[d](o)).attr("transform",`translate(${D},${R})`).attr("class","arrow")}if(y){const D=Ns(m)?R4[m](k,o):k-l,R=bf(m)?R4[m](E,o):E-l;P.insert("polygon").attr("points",cae[m](o)).attr("transform",`translate(${D},${R})`).attr("class","arrow")}if(T){const D=jU(d,m)?"XY":Ns(d)?"X":"Y";let R=0;D==="X"?R=Math.abs(b-k):D==="Y"?R=Math.abs(w-E)/1.5:R=Math.abs(b-k)/2;const I=P.append("g");if(await ws(I,T,{useHtmlLabels:!1,width:R,classes:"architecture-service-label"},Fe()),I.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),D==="X")I.attr("transform","translate("+C+", "+S+")");else if(D==="Y")I.attr("transform","translate("+C+", "+S+") rotate(-90)");else if(D==="XY"){const $=lF(d,m);if($&&$Nt($)){const O=I.node().getBoundingClientRect(),[N,F]=FNt($);I.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*N*F*45})`);const z=I.node().getBoundingClientRect();I.attr("transform",`
translate(${C}, ${S-O.height/2})
translate(${N*z.width/2}, ${F*z.height/2})
rotate(${-1*N*F*45}, 0, ${O.height/2})
`)}}}}}))},"drawEdges"),XNt=x(async function(t,e,r,n){const a=r.getConfigField("padding")*.75,s=r.getConfigField("fontSize"),l=r.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async u=>{const h=sy(u);if(h.type==="group"){const{h:d,w:f,x1:p,y1:g}=u.boundingBox(),m=t.append("rect");m.attr("id",`${n}-group-${h.id}`).attr("x",p+l).attr("y",g+l).attr("width",f).attr("height",d).attr("class","node-bkg");const y=t.append("g");let v=p,T=g;if(h.icon){const b=y.append("g");b.html(`<g>${await bh(h.icon,{height:a,width:a,fallbackPrefix:Ok.prefix})}</g>`),b.attr("transform","translate("+(v+l+1)+", "+(T+l+1)+")"),v+=a,T+=s/2-1-2}if(h.label){const b=y.append("g");await ws(b,h.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},Fe()),b.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),b.attr("transform","translate("+(v+l+4)+", "+(T+l+2)+")")}r.setElementForId(h.id,m)}}))},"drawGroups"),jNt=x(async function(t,e,r,n){const i=Fe();for(const a of r){const s=e.append("g"),o=t.getConfigField("iconSize");if(a.title){const d=s.append("g");await ws(d,a.title,{useHtmlLabels:!1,width:o*1.5,classes:"architecture-service-label"},i),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),d.attr("transform","translate("+o/2+", "+o+")")}const l=s.append("g");if(a.icon)l.html(`<g>${await bh(a.icon,{height:o,width:o,fallbackPrefix:Ok.prefix})}</g>`);else if(a.iconText){l.html(`<g>${await bh("blank",{height:o,width:o,fallbackPrefix:Ok.prefix})}</g>`);const p=l.append("g").append("foreignObject").attr("width",o).attr("height",o).append("div").attr("class","node-icon-text").attr("style",`height: ${o}px;`).append("div").html(Wr(a.iconText,i)),g=parseInt(window.getComputedStyle(p.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;p.attr("style",`-webkit-line-clamp: ${Math.floor((o-2)/g)};`)}else l.append("path").attr("class","node-bkg").attr("id",`${n}-node-${a.id}`).attr("d",`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);s.attr("id",`${n}-service-${a.id}`).attr("class","architecture-service");const{width:u,height:h}=s.node().getBBox();a.width=u,a.height=h,t.setElementForId(a.id,s)}return 0},"drawServices"),KNt=x(function(t,e,r,n){r.forEach(i=>{const a=e.append("g"),s=t.getConfigField("iconSize");a.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",s).attr("height",s),a.attr("class","architecture-junction");const{width:l,height:u}=a._groups[0][0].getBBox();a.width=l,a.height=u,t.setElementForId(i.id,a)})},"drawJunctions");pV([{name:Ok.prefix,icons:Ok}]);eu.use(DNt);function vRe(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"service",id:n.id,icon:n.icon,label:n.title,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-service"})})}x(vRe,"addServices");function bRe(t,e,r){t.forEach(n=>{e.add({group:"nodes",data:{type:"junction",id:n.id,parent:n.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-junction"})})}x(bRe,"addJunctions");function xRe(t,e){e.nodes().map(r=>{const n=sy(r);if(n.type==="group")return;n.x=r.position().x,n.y=r.position().y,t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}x(xRe,"positionNodes");function TRe(t,e){t.forEach(r=>{e.add({group:"nodes",data:{type:"group",id:r.id,icon:r.icon,label:r.title,parent:r.in},classes:"node-group"})})}x(TRe,"addGroups");function wRe(t,e){t.forEach(r=>{const{lhsId:n,rhsId:i,lhsInto:a,lhsGroup:s,rhsInto:o,lhsDir:l,rhsDir:u,rhsGroup:h,title:d}=r,f=jU(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:d,source:n,sourceDir:l,sourceArrow:a,sourceGroup:s,sourceEndpoint:l==="L"?"0 50%":l==="R"?"100% 50%":l==="T"?"50% 0":"50% 100%",target:i,targetDir:u,targetArrow:o,targetGroup:h,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:p,classes:f})})}x(wRe,"addEdges");function CRe(t,e,r,n=[]){const i=x((f,p)=>{const g=new Map;for(const[m,y]of f.entries()){const v=`${m}`;let T=0;const b=[...y.entries()];if(b.length===1){g.set(v,b[0][1]);continue}for(let w=0;w<b.length-1;w++)for(let C=w+1;C<b.length;C++){const[S,k]=b[w],[E,_]=b[C];if(r.get(pRe(S,E))===p)g.set(v,[...g.get(v)??[],...k,..._]);else if(S==="default"||E==="default")g.set(v,[...g.get(v)??[],...k,..._]);else{const L=`${v}-${T++}`;g.set(L,k);const P=`${v}-${T++}`;g.set(P,_)}}}return g},"flattenAlignments"),a=e.map(f=>{const p=new Map,g=new Map;return f.forEach(([m,y],v)=>{var C;const T=((C=t.getNode(v))==null?void 0:C.in)??"default",b=p.get(y)??new Map;p.has(y)||p.set(y,b);const w=g.get(m)??new Map;g.has(m)||g.set(m,w);for(const S of[b,w]){const k=S.get(T)??[];S.has(T)||S.set(T,k),k.push(v)}}),{horiz:[...i(p,"horizontal").values()].filter(m=>m.length>1),vert:[...i(g,"vertical").values()].filter(m=>m.length>1)}}),[s,o]=a.reduce(([f,p],{horiz:g,vert:m})=>[[...f,...g],[...p,...m]],[[],[]]),l=new Set;n.forEach(f=>f.members.forEach(p=>l.add(p)));const u=x(f=>f.filter(p=>!p.some(g=>l.has(g))),"dropOverlapping"),h=u(s),d=u(o);return n.forEach(f=>{f.members.length<2||(f.direction==="row"?h.push([...f.members]):d.push([...f.members]))}),{horizontal:h,vertical:d}}x(CRe,"getAlignments");function kRe(t,e,r=[]){const n=[],i=e.getConfigField("iconSize"),a=e.getConfigField("idealEdgeLengthMultiplier"),s=a*i,o=new Set;r.forEach(h=>{for(let d=0;d<h.members.length-1;d++){const f=h.members[d],p=h.members[d+1];o.add(`${f}|${p}`),o.add(`${p}|${f}`),h.direction==="row"?n.push({left:f,right:p,gap:s}):n.push({top:f,bottom:p,gap:s})}});const l=x(h=>`${h[0]},${h[1]}`,"posToStr"),u=x(h=>h.split(",").map(d=>parseInt(d)),"strToPos");return t.forEach(h=>{const d=new Map([...h.entries()].map(([m,y])=>[l(y),m])),f=[l([0,0])],p={},g={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;f.length>0;){const m=f.shift();if(m){p[m]=1;const y=d.get(m);if(y){const v=u(m);Object.entries(g).forEach(([T,b])=>{const w=l([v[0]+b[0],v[1]+b[1]]),C=d.get(w);if(C&&!p[w]){if(f.push(w),o.has(`${y}|${C}`))return;n.push({[lae[T]]:C,[lae[ONt(T)]]:y,gap:a*i})}})}}}}),n}x(kRe,"getRelativeConstraints");function SRe(t,e,r,n,i,{spatialMaps:a,groupAlignments:s}){return new Promise(o=>{const l=ut("body").append("div").attr("id","cy").attr("style","display:none"),u=eu({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${i.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${i.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});l.remove(),TRe(r,u),vRe(t,u,i),bRe(e,u,i),wRe(n,u);const h=i.getLayoutHints(),d=CRe(i,a,s,h),f=kRe(a,i,h),p=i.getConfigField("iconSize"),g=i.getConfigField("idealEdgeLengthMultiplier")*p,m=.5*p,y=i.getConfigField("edgeElasticity"),v=i.getConfigField("seed"),T=u.layout({name:"fcose",quality:"proof",randomize:i.getConfigField("randomize"),nodeSeparation:i.getConfigField("nodeSeparation"),numIter:i.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(b){const[w,C]=b.connectedNodes(),{parent:S}=sy(w),{parent:k}=sy(C);return S===k?g:m},edgeElasticity(b){const[w,C]=b.connectedNodes(),{parent:S}=sy(w),{parent:k}=sy(C);return S===k?y:.001},alignmentConstraint:d,relativePlacementConstraint:f});T.one("layoutstop",()=>{var w;function b(C,S,k,E){let _,M;const{x:L,y:P}=C,{x:D,y:R}=S;M=(E-P+(L-k)*(P-R)/(L-D))/Math.sqrt(1+Math.pow((P-R)/(L-D),2)),_=Math.sqrt(Math.pow(E-P,2)+Math.pow(k-L,2)-Math.pow(M,2));const I=Math.sqrt(Math.pow(D-L,2)+Math.pow(R-P,2));_=_/I;let $=(D-L)*(E-P)-(R-P)*(k-L);switch(!0){case $>=0:$=1;break;case $<0:$=-1;break}let O=(D-L)*(k-L)+(R-P)*(E-P);switch(!0){case O>=0:O=1;break;case O<0:O=-1;break}return M=Math.abs(M)*$,_=_*O,{distances:M,weights:_}}x(b,"getSegmentWeights"),u.startBatch();for(const C of Object.values(u.edges()))if((w=C.data)!=null&&w.call(C)){const{x:S,y:k}=C.source().position(),{x:E,y:_}=C.target().position();if(S!==E&&k!==_){const M=C.sourceEndpoint(),L=C.targetEndpoint(),{sourceDir:P}=gRe(C),[D,R]=bf(P)?[M.x,L.y]:[L.x,M.y],{weights:I,distances:$}=b(M,L,D,R);C.style("segment-distances",$),C.style("segment-weights",I)}}u.endBatch(),cF(v,()=>T.run())});try{cF(v,()=>T.run())}catch(b){throw b instanceof RangeError&&b.message.includes("Invalid array length")?new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):b}u.ready(b=>{le.info("Ready",b),o(u)})})}x(SRe,"layoutArchitecture");var ZNt=x(async(t,e,r,n)=>{const i=n.db;i.setDiagramId(e);const a=i.getServices(),s=i.getJunctions(),o=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),h=xs(e),d=h.append("g");d.attr("class","architecture-edges");const f=h.append("g");f.attr("class","architecture-services");const p=h.append("g");p.attr("class","architecture-groups"),await jNt(i,f,a,e),KNt(i,f,s,e);const g=await SRe(a,s,o,l,i,u);await YNt(d,g,i,e),await XNt(p,g,i,e),xRe(i,g),mx(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),QNt={draw:ZNt},JNt={parser:yRe,get db(){return new mRe},renderer:QNt,styles:UNt};const eDt=Object.freeze(Object.defineProperty({__proto__:null,diagram:JNt},Symbol.toStringTag,{value:"Module"}));var ERe="position frame",ARe="frame positioned",uF="position relation",_Re="relation positioned",tDt=x(function(t){le.debug("options str",t)},"setOptions"),rDt=x(function(){return{}},"getOptions"),nDt=x(function(){RRe(),On()},"clear");function RRe(){KU={}}x(RRe,"reset");var iDt=Vr.eventmodeling,aDt=x(()=>ri({...iDt,...Xt().eventmodeling}),"getConfig"),KU={};function LRe(){let t=sDt;const{ast:e}=KU,r=ZU();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const a=PRe(n,e.dataEntities,r);t=a5(t,{$kind:ERe,index:i,frame:n,textProps:a});let s;WRe(n)?(le.debug("source frame",n.sourceFrames),s=e.frames.filter(o=>n.sourceFrames.some(l=>l.$refText===o.name)),s.forEach(o=>{t=a5(t,{$kind:uF,index:i,frame:n,sourceFrame:o})})):t=a5(t,{$kind:uF,index:i,frame:n})}),t={...t,sortedSwimlanesArray:QU(t.swimlanes)},t}x(LRe,"getState");function MRe(t){KU.ast=t}x(MRe,"setAst");var hn={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function ZU(){return hn}x(ZU,"getDiagramProps");var sDt={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function IRe(t){const e=t.split(".");if(e.length===2)return e[0]}x(IRe,"extractNamespace");function NRe(t){const e=t.split(".");return e.length===2?e[1]:t}x(NRe,"extractName");function DRe(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}x(DRe,"findSwimlaneByNamespace");function i5(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&i<r}).map(n=>Number.parseInt(n)))+1}x(i5,"findNextAvailableIndex");function ORe(t,e){const r=IRe(t.entityIdentifier),n=DRe(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||hn.labelUiAutomation}:r?{index:i5(e,0,100),label:hn.labelUiAutomationPrefix+r}:{index:0,label:hn.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||hn.labelCommandReadModel}:r?{index:i5(e,100,200),label:hn.labelCommandReadModelPrefix+r}:{index:100,label:hn.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||hn.labelEvents}:r?{index:i5(e,200,300),label:hn.labelEventsPrefix+r}:{index:200,label:hn.labelEvents}}}x(ORe,"calculateSwimlaneProps");function $Re(t){const{themeVariables:e}=Xt();switch(t.modelEntityType){case"ui":return{fill:e.emUiFill??"white",stroke:e.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:e.emProcessorFill??"#edb3f6",stroke:e.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:e.emReadModelFill??"#d3f1a2",stroke:e.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:e.emCommandFill??"#bcd6fe",stroke:e.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:e.emEventFill??"#ffb778",stroke:e.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}x($Re,"calculateEntityVisualProps");function PRe(t,e,r){const n=Xt(),i=Wr(NRe(t.entityIdentifier)??"",n);let a;const s={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"};let l=`<b>${Fw(i,r.textMaxWidth,s)}</b>`;if(t.dataInlineValue&&(a=t.dataInlineValue,a=a.substring(a.indexOf("{")+1),a=a.substring(0,a.lastIndexOf("}")-1),a=Wr(a,n),a=Fw(a,r.textMaxWidth,s),a=a.replaceAll(" ","&nbsp;")),t.dataReference){const g=e.find(m=>{var y;return m.name===((y=t.dataReference)==null?void 0:y.$refText)});g&&(a=g.dataBlockValue,a=a.substring(a.indexOf(`{
`)+2),a=a.substring(0,a.lastIndexOf("}")-1),a=Wr(a,n),a=Fw(a,r.textMaxWidth,s),a=a.replaceAll(" ","&nbsp;"),a+="<br/>")}const u=a!==void 0;u&&(l+=`<br/><br/><code style="text-align: left; display: block;max-width:${r.textMaxWidth}px">${a}</code>`);const h={fontSize:s.fontSize,fontWeight:s.fontWeight,fontFamily:s.fontFamily},d=pR(l,h),f=u?d.width/3:d.width,p={content:l,width:f,height:d.height};return le.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}x(PRe,"calculateTextProps");function BRe(t,e){const r=e,n=$Re(r.frame),i={width:r.textProps.width+2*hn.boxTextPadding,height:r.textProps.height+2*hn.boxTextPadding};return[{$kind:ARe,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}x(BRe,"decidePositionFrame");function FRe(t,e,r){return e===void 0?hn.contentStartX:e.index===t.index&&t.r?t.r+hn.boxPadding:r===void 0?hn.contentStartX:r.r-hn.boxOverlap+hn.boxPadding}x(FRe,"calculateX");function zRe(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}x(zRe,"calculateMaxRight");function QU(t){return Object.values(t).sort((e,r)=>e.index-r.index)}x(QU,"sortedSwimlanesArray");function VRe(t,e){const r=e,n=ORe(r.frame,t.swimlanes);let i;n.index in t.swimlanes?i=t.swimlanes[n.index]:i={index:n.index,label:n.label,r:0,y:n.index*hn.swimlaneMinHeight+hn.swimlaneGap,height:hn.swimlaneMinHeight,maxHeight:hn.swimlaneMinHeight};const a=t.boxes.length>0?t.boxes[t.boxes.length-1]:void 0,s=t.previousSwimlaneNumber!==void 0?t.swimlanes[t.previousSwimlaneNumber]:void 0,o={width:Math.max(hn.boxMinWidth,Math.min(hn.boxMaxWidth,r.dimension.width))+2*hn.boxPadding,height:Math.max(hn.boxMinHeight,Math.min(hn.boxMaxHeight,r.dimension.height))+2*hn.boxPadding},l=FRe(i,s,a),u=l+o.width+hn.boxPadding,h=zRe(Object.values(t.swimlanes),u);i.r=l+o.width,i.maxHeight=Math.max(i.maxHeight,o.height),i.height=Math.max(hn.swimlaneMinHeight,i.maxHeight)+2*hn.swimlanePadding;const d={x:l,y:hn.swimlanePadding+i.y,r:u,dimension:o,leftSibling:!1,swimlane:i,visual:r.visual,text:r.textProps.content,frame:r.frame,index:r.index},f={...t,boxes:[...t.boxes,d],swimlanes:{...t.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:n.index,previousFrame:r.frame,maxR:h},p=QU(f.swimlanes);p.length>0&&(p[0].y=0);for(let g=1;g<p.length;g++){const m=p[g],y=p[g-1];m.y=y.y+y.height+hn.swimlaneGap}return f}x(VRe,"evolveFramePositioned");function GRe(t,e){return t===0&&e.sourceFrames.length===0}x(GRe,"isFirstFrame");function WRe(t){return t.sourceFrames!==void 0&&t.sourceFrames!==null&&t.sourceFrames.length>0}x(WRe,"hasSourceFrame");function hF(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}x(hF,"findBoxByFrame");function HRe(t,e,r){if(!(r<0))for(let n=r;n>=0;n--){const i=t[n];if(i.swimlane.index!==e)return i}}x(HRe,"findBoxByLineIndex");function qRe(t,e){const r=e;if(eAe(r.frame)||GRe(r.index,r.frame))return[];const n=hF(t.boxes,r.frame);if(n===void 0)throw new Error(`Target box not found for frame ${r.frame.name}`);let i;return r.sourceFrame?i=hF(t.boxes,r.sourceFrame):i=HRe(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:_Re,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}x(qRe,"decidePositionRelation");function URe(t,e){const r=e,n={visual:{fill:"none",stroke:"#000"},source:{x:r.sourceBox.x,y:r.sourceBox.y},target:{x:r.targetBox.x,y:r.targetBox.y},sourceBox:r.sourceBox,targetBox:r.targetBox};return{...t,relations:[...t.relations,n]}}x(URe,"evolveRelationPositioned");var oDt={[ERe]:BRe,[uF]:qRe},lDt={[ARe]:VRe,[_Re]:URe};function YRe(t,e){const r=oDt[e.$kind];if(r==null)return[];const n=r(t,e);return le.debug("decided events",n),n}x(YRe,"decide");function XRe(t,e){const r=e.reduce((n,i)=>{const a=lDt[i.$kind];return a==null?n:a(n,i)},t);return le.debug("evolve events",{state:t,newState:r,events:e}),r}x(XRe,"evolve");function a5(t,e){const r=YRe(t,e);return XRe(t,r)}x(a5,"dispatch");var dF={getConfig:aDt,setOptions:tDt,getOptions:rDt,clear:nDt,setAccTitle:Hn,getAccTitle:ni,getAccDescription:ai,setAccDescription:ii,setDiagramTitle:ti,getDiagramTitle:Yn,setAst:MRe,getDiagramProps:ZU,getState:LRe},cDt={parse:x(async t=>{const e=await Al("eventmodeling",t);le.debug(e),dF.setAst(e),eo(e,dF)},"parse")},XN=Fe(),uDt=XN==null?void 0:XN.eventmodeling;function jRe(t,e){return r=>{const n=r.swimlane.y+e.swimlanePadding,i=t.append("g").attr("class","em-box");i.append("rect").attr("x",r.x).attr("y",n).attr("rx","3").attr("width",r.dimension.width).attr("height",r.dimension.height).attr("stroke",r.visual.stroke).attr("fill",r.visual.fill),i.append("foreignObject").attr("x",r.x+e.boxPadding).attr("y",n+10).attr("width",r.dimension.width-2*e.boxPadding).attr("height",r.dimension.height-2*e.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(r.text)}}x(jRe,"renderD3Box");function KRe(t,e){return t>e}x(KRe,"dirUpwards");function ZRe(t,e,r,n){return i=>{const a=i.sourceBox.swimlane.y+e.swimlanePadding,s=i.targetBox.swimlane.y+e.swimlanePadding,o=KRe(a,s),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3;let h,d;le.debug(`rendering relation up=${o} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),o?(h=a,d=s+i.targetBox.dimension.height):(h=a+i.sourceBox.dimension.height,d=s);const f=n.emRelationStroke??i.visual.stroke;t.append("path").attr("class","em-relation").attr("fill",i.visual.fill).attr("stroke",f).attr("stroke-width","1").attr("marker-end",`url(#${r})`).attr("d",`M${l} ${h} L${u} ${d}`)}}x(ZRe,"renderD3Relation");function QRe(t,e,r,n){return i=>{const a=t.append("g").attr("class","em-swimlane"),s=n.emSwimlaneBackgroundOdd??"rgb(250,250,250)",o=n.emSwimlaneBackgroundStroke??"rgb(240,240,240)";a.append("rect").attr("x",0).attr("y",i.y).attr("rx","3").attr("width",e+r.swimlanePadding).attr("height",i.height).attr("fill",s).attr("stroke",o),a.append("text").attr("font-weight",r.swimlaneTextFontWeight).attr("x",30).attr("y",i.y+30).text(i.label)}}x(QRe,"renderD3Swimlane");var hDt=x(function(t,e,r,n){if(le.debug("in eventmodeling renderer",t+`
`,"id:",e,r),!uDt)throw new Error("EventModeling config not found");const i=n.db,{themeVariables:a,eventmodeling:s}=Fe(),o=ut(`[id="${e}"]`),l=i.getDiagramProps(),u=i.getState(),h=`em-arrowhead-${e}`,d=a.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(QRe(o,u.maxR,l,a)),u.boxes.forEach(jRe(o,l)),u.relations.forEach(ZRe(o,l,h,a)),o.append("defs").append("marker").attr("id",h).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",d),Mz(void 0,o,(s==null?void 0:s.padding)??30,s==null?void 0:s.useMaxWidth)},"draw"),dDt={draw:hDt},fDt=x(t=>"","getStyles"),pDt=fDt,gDt={parser:cDt,db:dF,renderer:dDt,styles:pDt};const mDt=Object.freeze(Object.defineProperty({__proto__:null,diagram:gDt},Symbol.toStringTag,{value:"Module"}));var fF=(function(){var t=x(function(v,T,b,w){for(b=b||{},w=v.length;w--;b[v[w]]=T);return b},"o"),e=[1,4],r=[1,14],n=[1,12],i=[1,13],a=[6,7,8],s=[1,20],o=[1,18],l=[1,19],u=[6,7,11],h=[1,6,13,14],d=[1,23],f=[1,24],p=[1,6,7,11,13,14],g={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:x(function(T,b,w,C,S,k,E){var _=k.length-1;switch(S){case 6:case 7:return C;case 15:C.addNode(k[_-1].length,k[_].trim());break;case 16:C.addNode(0,k[_].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:n,14:i},t(a,[2,3]),{1:[2,2]},t(a,[2,4]),t(a,[2,5]),{1:[2,6],6:r,12:15,13:n,14:i},{6:r,9:16,12:11,13:n,14:i},{6:s,7:o,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:s,7:o,10:22,11:l},{1:[2,7],6:r,12:15,13:n,14:i},t(h,[2,14],{7:d,11:f}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(u,[2,15]),t(h,[2,13],{7:d,11:f}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:x(function(T,b){if(b.recoverable)this.trace(T);else{var w=new Error(T);throw w.hash=b,w}},"parseError"),parse:x(function(T){var b=this,w=[0],C=[],S=[null],k=[],E=this.table,_="",M=0,L=0,P=2,D=1,R=k.slice.call(arguments,1),I=Object.create(this.lexer),$={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&($.yy[O]=this.yy[O]);I.setInput(T,$.yy),$.yy.lexer=I,$.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var N=I.yylloc;k.push(N);var F=I.options&&I.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function z(J){w.length=w.length-2*J,S.length=S.length-J,k.length=k.length-J}x(z,"popStack");function V(){var J;return J=C.pop()||I.lex()||D,typeof J!="number"&&(J instanceof Array&&(C=J,J=C.pop()),J=b.symbols_[J]||J),J}x(V,"lex");for(var B,G,H,q,Z={},Y,ie,K,Q;;){if(G=w[w.length-1],this.defaultActions[G]?H=this.defaultActions[G]:((B===null||typeof B>"u")&&(B=V()),H=E[G]&&E[G][B]),typeof H>"u"||!H.length||!H[0]){var te="";Q=[];for(Y in E[G])this.terminals_[Y]&&Y>P&&Q.push("'"+this.terminals_[Y]+"'");I.showPosition?te="Parse error on line "+(M+1)+`:
`+I.showPosition()+`
Expecting `+Q.join(", ")+", got '"+(this.terminals_[B]||B)+"'":te="Parse error on line "+(M+1)+": Unexpected "+(B==D?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(te,{text:I.match,token:this.terminals_[B]||B,line:I.yylineno,loc:N,expected:Q})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+B);switch(H[0]){case 1:w.push(B),S.push(I.yytext),k.push(I.yylloc),w.push(H[1]),B=null,L=I.yyleng,_=I.yytext,M=I.yylineno,N=I.yylloc;break;case 2:if(ie=this.productions_[H[1]][1],Z.$=S[S.length-ie],Z._$={first_line:k[k.length-(ie||1)].first_line,last_line:k[k.length-1].last_line,first_column:k[k.length-(ie||1)].first_column,last_column:k[k.length-1].last_column},F&&(Z._$.range=[k[k.length-(ie||1)].range[0],k[k.length-1].range[1]]),q=this.performAction.apply(Z,[_,L,M,$.yy,H[1],S,k].concat(R)),typeof q<"u")return q;ie&&(w=w.slice(0,-1*ie*2),S=S.slice(0,-1*ie),k=k.slice(0,-1*ie)),w.push(this.productions_[H[1]][0]),S.push(Z.$),k.push(Z._$),K=E[w[w.length-2]][w[w.length-1]],w.push(K);break;case 3:return!0}}return!0},"parse")},m=(function(){var v={EOF:1,parseError:x(function(b,w){if(this.yy.parser)this.yy.parser.parseError(b,w);else throw new Error(b)},"parseError"),setInput:x(function(T,b){return this.yy=b||this.yy||{},this._input=T,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var T=this._input[0];this.yytext+=T,this.yyleng++,this.offset++,this.match+=T,this.matched+=T;var b=T.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),T},"input"),unput:x(function(T){var b=T.length,w=T.split(/(?:\r\n?|\n)/g);this._input=T+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var C=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),w.length-1&&(this.yylineno-=w.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:w?(w.length===C.length?this.yylloc.first_column:0)+C[C.length-w.length].length-w[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(T){this.unput(this.match.slice(T))},"less"),pastInput:x(function(){var T=this.matched.substr(0,this.matched.length-this.match.length);return(T.length>20?"...":"")+T.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var T=this.match;return T.length<20&&(T+=this._input.substr(0,20-T.length)),(T.substr(0,20)+(T.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var T=this.pastInput(),b=new Array(T.length+1).join("-");return T+this.upcomingInput()+`
`+b+"^"},"showPosition"),test_match:x(function(T,b){var w,C,S;if(this.options.backtrack_lexer&&(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(S.yylloc.range=this.yylloc.range.slice(0))),C=T[0].match(/(?:\r\n?|\n).*/g),C&&(this.yylineno+=C.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:C?C[C.length-1].length-C[C.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+T[0].length},this.yytext+=T[0],this.match+=T[0],this.matches=T,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(T[0].length),this.matched+=T[0],w=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),w)return w;if(this._backtrack){for(var k in S)this[k]=S[k];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var T,b,w,C;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),k=0;k<S.length;k++)if(w=this._input.match(this.rules[S[k]]),w&&(!b||w[0].length>b[0].length)){if(b=w,C=k,this.options.backtrack_lexer){if(T=this.test_match(w,S[k]),T!==!1)return T;if(this._backtrack){b=!1;continue}else return!1}else if(!this.options.flex)break}return b?(T=this.test_match(b,S[C]),T!==!1?T:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var b=this.next();return b||this.lex()},"lex"),begin:x(function(b){this.conditionStack.push(b)},"begin"),popState:x(function(){var b=this.conditionStack.length-1;return b>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(b){return b=this.conditionStack.length-1-Math.abs(b||0),b>=0?this.conditionStack[b]:"INITIAL"},"topState"),pushState:x(function(b){this.begin(b)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(b,w,C,S){switch(C){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return v})();g.lexer=m;function y(){this.yy={}}return x(y,"Parser"),y.prototype=g,g.Parser=y,new y})();fF.parser=fF;var yDt=fF,cb,vDt=(cb=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,On()}getRoot(){return this.root}addNode(e,r){const n=At.sanitizeText(r,Fe());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],ti(n);return}this.baseLevel??(this.baseLevel=e);let i=e-this.baseLevel+1;for(i<=0&&(i=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=i;)this.stack.pop();const a=this.stack[this.stack.length-1].node,s={text:n,children:[]};a.children.push(s),this.stack.push({level:i,node:s})}getAccTitle(){return ni()}setAccTitle(e){Hn(e)}getAccDescription(){return ai()}setAccDescription(e){ii(e)}getDiagramTitle(){return Yn()}setDiagramTitle(e){ti(e)}},x(cb,"IshikawaDB"),cb),bDt=14,hm=250,xDt=30,TDt=60,wDt=5,JRe=82*Math.PI/180,hae=Math.cos(JRe),dae=Math.sin(JRe),fae=x((t,e,r)=>{const n=t.node().getBBox(),i=n.width+e*2,a=n.height+e*2;Ai(t,a,i,r),t.attr("viewBox",`${n.x-e} ${n.y-e} ${i} ${a}`)},"applyPaddedViewBox"),CDt=x((t,e,r,n)=>{var $,O;const a=n.db.getRoot();if(!a)return;const s=Fe(),{look:o,handDrawnSeed:l,themeVariables:u}=s,h=Oh(s.fontSize)[0]??bDt,d=o==="handDrawn",f=a.children??[],p=(($=s.ishikawa)==null?void 0:$.diagramPadding)??20,g=((O=s.ishikawa)==null?void 0:O.useMaxWidth)??!1,m=xs(e),y=m.append("g").attr("class","ishikawa"),v=d?Gt.svg(m.node()):void 0,T=v?{roughSvg:v,seed:l??0,lineColor:(u==null?void 0:u.lineColor)??"#333",fillColor:(u==null?void 0:u.mainBkg)??"#fff"}:void 0,b=`ishikawa-arrow-${e}`;d||y.append("defs").append("marker").attr("id",b).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let w=0,C=hm;const S=d?void 0:Ry(y,w,C,w,C,"ishikawa-spine");if(kDt(y,w,C,a.text,h,T),!f.length){d&&Ry(y,w,C,w,C,"ishikawa-spine",T),fae(m,p,g);return}w-=20;const k=f.filter((N,F)=>F%2===0),E=f.filter((N,F)=>F%2===1),_=pae(k),M=pae(E),L=_.total+M.total;let P=hm,D=hm;if(L>0){const N=hm*2,F=hm*.3;P=Math.max(F,N*(_.total/L)),D=Math.max(F,N*(M.total/L))}const R=h*2;P=Math.max(P,_.max*R),D=Math.max(D,M.max*R),C=Math.max(P,hm),S&&S.attr("y1",C).attr("y2",C),y.select(".ishikawa-head-group").attr("transform",`translate(0,${C})`);const I=Math.ceil(f.length/2);for(let N=0;N<I;N++){const F=y.append("g").attr("class","ishikawa-pair");for(const[z,V,B]of[[f[N*2],-1,P],[f[N*2+1],1,D]])z&&ADt(F,z,w,C,V,B,h,T);w=F.selectAll("text").nodes().reduce((z,V)=>Math.min(z,V.getBBox().x),1/0)}if(d)Ry(y,w,C,0,C,"ishikawa-spine",T);else{S.attr("x1",w);const N=`url(#${b})`;y.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",N)}fae(m,p,g)},"draw"),pae=x(t=>{const e=x(r=>r.children.reduce((n,i)=>n+1+e(i),0),"countDescendants");return t.reduce((r,n)=>{const i=e(n);return r.total+=i,r.max=Math.max(r.max,i),r},{total:0,max:0})},"sideStats"),kDt=x((t,e,r,n,i,a)=>{const s=Math.max(6,Math.floor(110/(i*.6))),o=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${r})`),l=R6(o,eLe(n,s),0,0,"ishikawa-head-label","start",i),u=l.node().getBBox(),h=Math.max(60,u.width+6),d=Math.max(40,u.height*2+40),f=`M 0 ${-d/2} L 0 ${d/2} Q ${h*2.4} 0 0 ${-d/2} Z`;if(a){const p=a.roughSvg.path(f,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});o.insert(()=>p,":first-child").attr("class","ishikawa-head")}else o.insert("path",":first-child").attr("class","ishikawa-head").attr("d",f);l.attr("transform",`translate(${(h-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),SDt=x((t,e)=>{const r=[],n=[],i=x((a,s,o)=>{const l=e===-1?[...a].reverse():a;for(const u of l){const h=r.length,d=u.children??[];r.push({depth:o,text:eLe(u.text,15),parentIndex:s,childCount:d.length}),o%2===0?(n.push(h),d.length&&i(d,h,o+1)):(d.length&&i(d,h,o+1),n.push(h))}},"walk");return i(t,-1,2),{entries:r,yOrder:n}},"flattenTree"),EDt=x((t,e,r,n,i,a,s)=>{const o=t.append("g").attr("class","ishikawa-label-group"),u=R6(o,e,r,n+11*i,"ishikawa-label cause","middle",a).node().getBBox();if(s){const h=s.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:s.seed,fill:s.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:s.lineColor,strokeWidth:2});o.insert(()=>h,":first-child").attr("class","ishikawa-label-box")}else o.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),jN=x((t,e,r,n,i,a)=>{const s=Math.sqrt(n*n+i*i);if(s===0)return;const o=n/s,l=i/s,u=6,h=-l*u,d=o*u,f=e,p=r,g=`M ${f} ${p} L ${f-o*u*2+h} ${p-l*u*2+d} L ${f-o*u*2-h} ${p-l*u*2-d} Z`,m=a.roughSvg.path(g,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});t.append(()=>m)},"drawArrowMarker"),ADt=x((t,e,r,n,i,a,s,o)=>{const l=e.children??[],u=a*(l.length?1:.2),h=-hae*u,d=dae*u*i,f=r+h,p=n+d;if(Ry(t,r,n,f,p,"ishikawa-branch",o),o&&jN(t,r,n,r-f,n-p,o),EDt(t,e.text,f,p,i,s,o),!l.length)return;const{entries:g,yOrder:m}=SDt(l,i),y=g.length,v=new Array(y);for(const[S,k]of m.entries())v[k]=n+d*((S+1)/(y+1));const T=new Map;T.set(-1,{x0:r,y0:n,x1:f,y1:p,childCount:l.length,childrenDrawn:0});const b=-hae,w=dae*i,C=i<0?"ishikawa-label up":"ishikawa-label down";for(const[S,k]of g.entries()){const E=v[S],_=T.get(k.parentIndex),M=t.append("g").attr("class","ishikawa-sub-group");let L=0,P=0,D=0;if(k.depth%2===0){const R=_.y1-_.y0;L=gae(_.x0,_.x1,R?(E-_.y0)/R:.5),P=E,D=L-(k.childCount>0?TDt+k.childCount*wDt:xDt),Ry(M,L,E,D,E,"ishikawa-sub-branch",o),o&&jN(M,L,E,1,0,o),R6(M,k.text,D,E,"ishikawa-label align","end",s)}else{const R=_.childrenDrawn++;L=gae(_.x0,_.x1,(_.childCount-R)/(_.childCount+1)),P=_.y0,D=L+b*((E-P)/w),Ry(M,L,P,D,E,"ishikawa-sub-branch",o),o&&jN(M,L,P,L-D,P-E,o),R6(M,k.text,D,E,C,"end",s)}k.childCount>0&&T.set(S,{x0:L,y0:P,x1:D,y1:E,childCount:k.childCount,childrenDrawn:0})}},"drawBranch"),_Dt=x(t=>t.split(/<br\s*\/?>|\n/),"splitLines"),eLe=x((t,e)=>{if(t.length<=e)return t;const r=[];for(const n of t.split(/\s+/)){const i=r.length-1;i>=0&&r[i].length+1+n.length<=e?r[i]+=" "+n:r.push(n)}return r.join(`
`)},"wrapText"),R6=x((t,e,r,n,i,a,s)=>{const o=_Dt(e),l=s*1.05,u=t.append("text").attr("class",i).attr("text-anchor",a).attr("x",r).attr("y",n-(o.length-1)*l/2);for(const[h,d]of o.entries())u.append("tspan").attr("x",r).attr("dy",h===0?0:l).text(d);return u},"drawMultilineText"),gae=x((t,e,r)=>t+(e-t)*r,"lerp"),Ry=x((t,e,r,n,i,a,s)=>{if(s){const o=s.roughSvg.line(e,r,n,i,{roughness:1.5,seed:s.seed,stroke:s.lineColor,strokeWidth:2});t.append(()=>o).attr("class",a);return}return t.append("line").attr("class",a).attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i)},"drawLine"),RDt={draw:CDt},LDt=x(t=>`
.ishikawa .ishikawa-spine,
.ishikawa .ishikawa-branch,
.ishikawa .ishikawa-sub-branch {
stroke: ${t.lineColor};
stroke-width: 2;
fill: none;
}
.ishikawa .ishikawa-sub-branch {
stroke-width: 1;
}
.ishikawa .ishikawa-arrow {
fill: ${t.lineColor};
}
.ishikawa .ishikawa-head {
fill: ${t.mainBkg};
stroke: ${t.lineColor};
stroke-width: 2;
}
.ishikawa .ishikawa-label-box {
fill: ${t.mainBkg};
stroke: ${t.lineColor};
stroke-width: 2;
}
.ishikawa text {
font-family: ${t.fontFamily};
font-size: ${t.fontSize};
fill: ${t.textColor};
}
.ishikawa .ishikawa-head-label {
font-weight: 600;
text-anchor: middle;
dominant-baseline: middle;
font-size: 14px;
}
.ishikawa .ishikawa-label {
text-anchor: end;
}
.ishikawa .ishikawa-label.cause {
text-anchor: middle;
dominant-baseline: middle;
}
.ishikawa .ishikawa-label.align {
text-anchor: end;
dominant-baseline: middle;
}
.ishikawa .ishikawa-label.up {
dominant-baseline: baseline;
}
.ishikawa .ishikawa-label.down {
dominant-baseline: hanging;
}
`,"getStyles"),MDt=LDt,IDt={parser:yDt,get db(){return new vDt},renderer:RDt,styles:MDt};const NDt=Object.freeze(Object.defineProperty({__proto__:null,diagram:IDt},Symbol.toStringTag,{value:"Module"})),tLe=1e-10;function H7(t,e){const r=ODt(t),n=r.filter(o=>DDt(o,t));let i=0,a=0;const s=[];if(n.length>1){const o=nLe(n);for(let u=0;u<n.length;++u){const h=n[u];h.angle=Math.atan2(h.x-o.x,h.y-o.y)}n.sort((u,h)=>h.angle-u.angle);let l=n[n.length-1];for(let u=0;u<n.length;++u){const h=n[u];a+=(l.x+h.x)*(h.y-l.y);const d={x:(h.x+l.x)/2,y:(h.y+l.y)/2};let f=null;for(let p=0;p<h.parentIndex.length;++p)if(l.parentIndex.includes(h.parentIndex[p])){const g=t[h.parentIndex[p]],m=Math.atan2(h.x-g.x,h.y-g.y),y=Math.atan2(l.x-g.x,l.y-g.y);let v=y-m;v<0&&(v+=2*Math.PI);const T=y-v/2;let b=xo(d,{x:g.x+g.radius*Math.sin(T),y:g.y+g.radius*Math.cos(T)});b>g.radius*2&&(b=g.radius*2),(f==null||f.width>b)&&(f={circle:g,width:b,p1:h,p2:l,large:b>g.radius,sweep:!0})}f!=null&&(s.push(f),i+=pF(f.circle.radius,f.width),l=h)}}else{let o=t[0];for(let u=1;u<t.length;++u)t[u].radius<o.radius&&(o=t[u]);let l=!1;for(let u=0;u<t.length;++u)if(xo(t[u],o)>Math.abs(o.radius-t[u].radius)){l=!0;break}l?i=a=0:(i=o.radius*o.radius*Math.PI,s.push({circle:o,p1:{x:o.x,y:o.y+o.radius},p2:{x:o.x-tLe,y:o.y+o.radius},width:o.radius*2,large:!0,sweep:!0}))}return a/=2,e&&(e.area=i+a,e.arcArea=i,e.polygonArea=a,e.arcs=s,e.innerPoints=n,e.intersectionPoints=r),i+a}function DDt(t,e){return e.every(r=>xo(t,r)<r.radius+tLe)}function ODt(t){const e=[];for(let r=0;r<t.length;++r)for(let n=r+1;n<t.length;++n){const i=rLe(t[r],t[n]);for(const a of i)a.parentIndex=[r,n],e.push(a)}return e}function pF(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function xo(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function JU(t,e,r){if(r>=t+e)return 0;if(r<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const n=t-(r*r-e*e+t*t)/(2*r),i=e-(r*r-t*t+e*e)/(2*r);return pF(t,n)+pF(e,i)}function rLe(t,e){const r=xo(t,e),n=t.radius,i=e.radius;if(r>=n+i||r<=Math.abs(n-i))return[];const a=(n*n-i*i+r*r)/(2*r),s=Math.sqrt(n*n-a*a),o=t.x+a*(e.x-t.x)/r,l=t.y+a*(e.y-t.y)/r,u=-(e.y-t.y)*(s/r),h=-(e.x-t.x)*(s/r);return[{x:o+u,y:l-h},{x:o-u,y:l+h}]}function nLe(t){const e={x:0,y:0};for(const r of t)e.x+=r.x,e.y+=r.y;return e.x/=t.length,e.y/=t.length,e}function $Dt(t,e,r,n){n=n||{};const i=n.maxIterations||100,a=n.tolerance||1e-10,s=t(e),o=t(r);let l=r-e;if(s*o>0)throw"Initial bisect points must have opposite signs";if(s===0)return e;if(o===0)return r;for(let u=0;u<i;++u){l/=2;const h=e+l,d=t(h);if(d*s>=0&&(e=h),Math.abs(l)<a||d===0)return h}return e+l}function gF(t){const e=new Array(t);for(let r=0;r<t;++r)e[r]=0;return e}function mae(t,e){return gF(t).map(()=>gF(e))}function Ly(t,e){let r=0;for(let n=0;n<t.length;++n)r+=t[n]*e[n];return r}function mF(t){return Math.sqrt(Ly(t,t))}function yF(t,e,r){for(let n=0;n<e.length;++n)t[n]=e[n]*r}function Xu(t,e,r,n,i){for(let a=0;a<t.length;++a)t[a]=e*r[a]+n*i[a]}function iLe(t,e,r){r=r||{};const n=r.maxIterations||e.length*200,i=r.nonZeroDelta||1.05,a=r.zeroDelta||.001,s=r.minErrorDelta||1e-6,o=r.minErrorDelta||1e-5,l=r.rho!==void 0?r.rho:1,u=r.chi!==void 0?r.chi:2,h=r.psi!==void 0?r.psi:-.5,d=r.sigma!==void 0?r.sigma:.5;let f;const p=e.length,g=new Array(p+1);g[0]=e,g[0].fx=t(e),g[0].id=0;for(let C=0;C<p;++C){const S=e.slice();S[C]=S[C]?S[C]*i:a,g[C+1]=S,g[C+1].fx=t(S),g[C+1].id=C+1}function m(C){for(let S=0;S<C.length;S++)g[p][S]=C[S];g[p].fx=C.fx}const y=(C,S)=>C.fx-S.fx,v=e.slice(),T=e.slice(),b=e.slice(),w=e.slice();for(let C=0;C<n;++C){if(g.sort(y),r.history){const k=g.map(E=>{const _=E.slice();return _.fx=E.fx,_.id=E.id,_});k.sort((E,_)=>E.id-_.id),r.history.push({x:g[0].slice(),fx:g[0].fx,simplex:k})}f=0;for(let k=0;k<p;++k)f=Math.max(f,Math.abs(g[0][k]-g[1][k]));if(Math.abs(g[0].fx-g[p].fx)<s&&f<o)break;for(let k=0;k<p;++k){v[k]=0;for(let E=0;E<p;++E)v[k]+=g[E][k];v[k]/=p}const S=g[p];if(Xu(T,1+l,v,-l,S),T.fx=t(T),T.fx<g[0].fx)Xu(w,1+u,v,-u,S),w.fx=t(w),w.fx<T.fx?m(w):m(T);else if(T.fx>=g[p-1].fx){let k=!1;if(T.fx>S.fx?(Xu(b,1+h,v,-h,S),b.fx=t(b),b.fx<S.fx?m(b):k=!0):(Xu(b,1-h*l,v,h*l,S),b.fx=t(b),b.fx<T.fx?m(b):k=!0),k){if(d>=1)break;for(let E=1;E<g.length;++E)Xu(g[E],1-d,g[0],d,g[E]),g[E].fx=t(g[E])}}else m(T)}return g.sort(y),{fx:g[0].fx,x:g[0]}}function PDt(t,e,r,n,i,a,s){const o=r.fx,l=Ly(r.fxprime,e);let u=o,h=o,d=l,f=0;i=i||1,a=a||1e-6,s=s||.1;function p(g,m,y){for(let v=0;v<16;++v)if(i=(g+m)/2,Xu(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=Ly(n.fxprime,e),u>o+a*i*l||u>=y)m=i;else{if(Math.abs(d)<=-s*l)return i;d*(m-g)>=0&&(m=g),g=i,y=u}return 0}for(let g=0;g<10;++g){if(Xu(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=Ly(n.fxprime,e),u>o+a*i*l||g&&u>=h)return p(f,i,h);if(Math.abs(d)<=-s*l)return i;if(d>=0)return p(i,f,u);h=u,f=i,i*=2}return i}function BDt(t,e,r){let n={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const a=e.slice();let s,o,l=1,u;r=r||{},u=r.maxIterations||e.length*20,n.fx=t(n.x,n.fxprime),s=n.fxprime.slice(),yF(s,n.fxprime,-1);for(let h=0;h<u;++h){if(l=PDt(t,s,n,i,l),r.history&&r.history.push({x:n.x.slice(),fx:n.fx,fxprime:n.fxprime.slice(),alpha:l}),!l)yF(s,n.fxprime,-1);else{Xu(a,1,i.fxprime,-1,n.fxprime);const d=Ly(n.fxprime,n.fxprime),f=Math.max(0,Ly(a,i.fxprime)/d);Xu(s,f,s,-1,i.fxprime),o=n,n=i,i=o}if(mF(n.fxprime)<=1e-5)break}return r.history&&r.history.push({x:n.x.slice(),fx:n.fx,fxprime:n.fxprime.slice(),alpha:l}),n}function aLe(t,e={}){e.maxIterations=e.maxIterations||500;const r=e.initialLayout||GDt,n=e.lossFunction||dx,i=FDt(t,e),a=r(i,e),s=Object.keys(a),o=[];for(const h of s)o.push(a[h].x),o.push(a[h].y);const u=iLe(h=>{const d={};for(let f=0;f<s.length;++f){const p=s[f];d[p]={x:h[2*f],y:h[2*f+1],radius:a[p].radius}}return n(d,i)},o,e).x;for(let h=0;h<s.length;++h){const d=s[h];a[d].x=u[2*h],a[d].y=u[2*h+1]}return a}const sLe=1e-10;function vF(t,e,r){return Math.min(t,e)*Math.min(t,e)*Math.PI<=r+sLe?Math.abs(t-e):$Dt(n=>JU(t,e,n)-r,0,t+e)}function FDt(t,e={}){const r=e.distinct,n=t.map(o=>Object.assign({},o));function i(o){return o.join(";")}if(r){const o=new Map;for(const l of n)for(let u=0;u<l.sets.length;u++){const h=String(l.sets[u]);o.set(h,l.size+(o.get(h)||0));for(let d=u+1;d<l.sets.length;d++){const f=String(l.sets[d]),p=`${h};${f}`,g=`${f};${h}`;o.set(p,l.size+(o.get(p)||0)),o.set(g,l.size+(o.get(g)||0))}}for(const l of n)l.sets.length<3&&(l.size=o.get(i(l.sets)))}const a=[],s=new Set;for(const o of n)if(o.sets.length===1)a.push(o.sets[0]);else if(o.sets.length===2){const l=o.sets[0],u=o.sets[1];s.add(i(o.sets)),s.add(i([u,l]))}a.sort((o,l)=>o===l?0:o<l?-1:1);for(let o=0;o<a.length;++o){const l=a[o];for(let u=o+1;u<a.length;++u){const h=a[u];s.has(i([l,h]))||n.push({sets:[l,h],size:0})}}return n}function zDt(t,e,r){const n=mae(e.length,e.length),i=mae(e.length,e.length);return t.filter(a=>a.sets.length===2).forEach(a=>{const s=r[a.sets[0]],o=r[a.sets[1]],l=Math.sqrt(e[s].size/Math.PI),u=Math.sqrt(e[o].size/Math.PI),h=vF(l,u,a.size);n[s][o]=n[o][s]=h;let d=0;a.size+1e-10>=Math.min(e[s].size,e[o].size)?d=1:a.size<=1e-10&&(d=-1),i[s][o]=i[o][s]=d}),{distances:n,constraints:i}}function VDt(t,e,r,n){for(let a=0;a<e.length;++a)e[a]=0;let i=0;for(let a=0;a<r.length;++a){const s=t[2*a],o=t[2*a+1];for(let l=a+1;l<r.length;++l){const u=t[2*l],h=t[2*l+1],d=r[a][l],f=n[a][l],p=(u-s)*(u-s)+(h-o)*(h-o),g=Math.sqrt(p),m=p-d*d;f>0&&g<=d||f<0&&g>=d||(i+=2*m*m,e[2*a]+=4*m*(s-u),e[2*a+1]+=4*m*(o-h),e[2*l]+=4*m*(u-s),e[2*l+1]+=4*m*(h-o))}}return i}function GDt(t,e={}){let r=HDt(t,e);const n=e.lossFunction||dx;if(t.length>=8){const i=WDt(t,e),a=n(i,t),s=n(r,t);a+1e-8<s&&(r=i)}return r}function WDt(t,e={}){const r=e.restarts||10,n=[],i={};for(const f of t)f.sets.length===1&&(i[f.sets[0]]=n.length,n.push(f));let{distances:a,constraints:s}=zDt(t,n,i);const o=mF(a.map(mF))/a.length;a=a.map(f=>f.map(p=>p/o));const l=(f,p)=>VDt(f,p,a,s);let u=null;for(let f=0;f<r;++f){const p=gF(a.length*2).map(Math.random),g=BDt(l,p,e);(!u||g.fx<u.fx)&&(u=g)}const h=u.x,d={};for(let f=0;f<n.length;++f){const p=n[f];d[p.sets[0]]={x:h[2*f]*o,y:h[2*f+1]*o,radius:Math.sqrt(p.size/Math.PI)}}if(e.history)for(const f of e.history)yF(f.x,o);return d}function HDt(t,e){const r=e&&e.lossFunction?e.lossFunction:dx,n={},i={};for(const d of t)if(d.sets.length===1){const f=d.sets[0];n[f]={x:1e10,y:1e10,rowid:n.length,size:d.size,radius:Math.sqrt(d.size/Math.PI)},i[f]=[]}t=t.filter(d=>d.sets.length===2);for(const d of t){let f=d.weight!=null?d.weight:1;const p=d.sets[0],g=d.sets[1];d.size+sLe>=Math.min(n[p].size,n[g].size)&&(f=0),i[p].push({set:g,size:d.size,weight:f}),i[g].push({set:p,size:d.size,weight:f})}const a=[];Object.keys(i).forEach(d=>{let f=0;for(let p=0;p<i[d].length;++p)f+=i[d][p].size*i[d][p].weight;a.push({set:d,size:f})});function s(d,f){return f.size-d.size}a.sort(s);const o={};function l(d){return d.set in o}function u(d,f){n[f].x=d.x,n[f].y=d.y,o[f]=!0}u({x:0,y:0},a[0].set);for(let d=1;d<a.length;++d){const f=a[d].set,p=i[f].filter(l),g=n[f];if(p.sort(s),p.length===0)throw"ERROR: missing pairwise overlap information";const m=[];for(var h=0;h<p.length;++h){const T=n[p[h].set],b=vF(g.radius,T.radius,p[h].size);m.push({x:T.x+b,y:T.y}),m.push({x:T.x-b,y:T.y}),m.push({y:T.y+b,x:T.x}),m.push({y:T.y-b,x:T.x});for(let w=h+1;w<p.length;++w){const C=n[p[w].set],S=vF(g.radius,C.radius,p[w].size),k=rLe({x:T.x,y:T.y,radius:b},{x:C.x,y:C.y,radius:S});m.push(...k)}}let y=1e50,v=m[0];for(const T of m){n[f].x=T.x,n[f].y=T.y;const b=r(n,t);b<y&&(y=b,v=T)}u(v,f)}return n}function dx(t,e){let r=0;for(const n of e){if(n.sets.length===1)continue;let i;if(n.sets.length===2){const s=t[n.sets[0]],o=t[n.sets[1]];i=JU(s.radius,o.radius,xo(s,o))}else i=H7(n.sets.map(s=>t[s]));const a=n.weight!=null?n.weight:1;r+=a*(i-n.size)*(i-n.size)}return r}function oLe(t,e){let r=0;for(const n of e){if(n.sets.length===1)continue;let i;if(n.sets.length===2){const o=t[n.sets[0]],l=t[n.sets[1]];i=JU(o.radius,l.radius,xo(o,l))}else i=H7(n.sets.map(o=>t[o]));const a=n.weight!=null?n.weight:1,s=Math.log((i+1)/(n.size+1));r+=a*s*s}return r}function qDt(t,e,r){if(r==null?t.sort((i,a)=>a.radius-i.radius):t.sort(r),t.length>0){const i=t[0].x,a=t[0].y;for(const s of t)s.x-=i,s.y-=a}if(t.length===2&&xo(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-e,a=Math.cos(i),s=Math.sin(i);for(const o of t){const l=o.x,u=o.y;o.x=a*l-s*u,o.y=s*l+a*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-e;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const a=t[1].y/(1e-10+t[1].x);for(const s of t){var n=(s.x+a*s.y)/(1+a*a);s.x=2*n-s.x,s.y=2*n*a-s.y}}}}function UDt(t){t.forEach(i=>{i.parent=i});function e(i){return i.parent!==i&&(i.parent=e(i.parent)),i.parent}function r(i,a){const s=e(i),o=e(a);s.parent=o}for(let i=0;i<t.length;++i)for(let a=i+1;a<t.length;++a){const s=t[i].radius+t[a].radius;xo(t[i],t[a])+1e-10<s&&r(t[a],t[i])}const n=new Map;for(let i=0;i<t.length;++i){const a=e(t[i]).parent.setid;n.has(a)||n.set(a,[]),n.get(a).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(n.values())}function bF(t){const e=r=>{const n=t.reduce((a,s)=>Math.max(a,s[r]+s.radius),Number.NEGATIVE_INFINITY),i=t.reduce((a,s)=>Math.min(a,s[r]-s.radius),Number.POSITIVE_INFINITY);return{max:n,min:i}};return{xRange:e("x"),yRange:e("y")}}function lLe(t,e,r){e==null&&(e=Math.PI/2);let n=hLe(t).map(u=>Object.assign({},u));const i=UDt(n);for(const u of i){qDt(u,e,r);const h=bF(u);u.size=(h.xRange.max-h.xRange.min)*(h.yRange.max-h.yRange.min),u.bounds=h}i.sort((u,h)=>h.size-u.size),n=i[0];let a=n.bounds;const s=(a.xRange.max-a.xRange.min)/50;function o(u,h,d){if(!u)return;const f=u.bounds;let p,g;if(h)p=a.xRange.max-f.xRange.min+s;else{p=a.xRange.max-f.xRange.max;const m=(f.xRange.max-f.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;m<0&&(p+=m)}if(d)g=a.yRange.max-f.yRange.min+s;else{g=a.yRange.max-f.yRange.max;const m=(f.yRange.max-f.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;m<0&&(g+=m)}for(const m of u)m.x+=p,m.y+=g,n.push(m)}let l=1;for(;l<i.length;)o(i[l],!0,!1),o(i[l+1],!1,!0),o(i[l+2],!0,!0),l+=3,a=bF(n);return uLe(n)}function cLe(t,e,r,n,i){const a=hLe(t);e-=2*n,r-=2*n;const{xRange:s,yRange:o}=bF(a);if(s.max===s.min||o.max===o.min)return console.log("not scaling solution: zero size detected"),t;let l,u;if(i){const p=Math.sqrt(i/Math.PI)*2;l=e/p,u=r/p}else l=e/(s.max-s.min),u=r/(o.max-o.min);const h=Math.min(u,l),d=(e-(s.max-s.min)*h)/2,f=(r-(o.max-o.min)*h)/2;return uLe(a.map(p=>({radius:h*p.radius,x:n+d+(p.x-s.min)*h,y:n+f+(p.y-o.min)*h,setid:p.setid})))}function uLe(t){const e={};for(const r of t)e[r.setid]=r;return e}function hLe(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function YDt(t={}){let e=!1,r=600,n=350,i=15,a=1e3,s=Math.PI/2,o=!0,l=null,u=!0,h=!0,d=null,f=null,p=!1,g=null,m=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,y={},v=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],T=0,b=function(k){if(k in y)return y[k];var E=y[k]=v[T];return T+=1,T>=v.length&&(T=0),E},w=aLe,C=dx;function S(k){let E=k.datum();const _=new Set;E.forEach(Y=>{Y.size==0&&Y.sets.length==1&&_.add(Y.sets[0])}),E=E.filter(Y=>!Y.sets.some(ie=>_.has(ie)));let M={},L={};if(E.length>0){let Y=w(E,{lossFunction:C,distinct:p});o&&(Y=lLe(Y,s,f)),M=cLe(Y,r,n,i,l),L=fLe(M,E,m)}const P={};E.forEach(Y=>{Y.label&&(P[Y.sets]=Y.label)});function D(Y){if(Y.sets in P)return P[Y.sets];if(Y.sets.length==1)return""+Y.sets[0]}k.selectAll("svg").data([M]).enter().append("svg");const R=k.select("svg");e?R.attr("viewBox",`0 0 ${r} ${n}`):R.attr("width",r).attr("height",n);const I={};let $=!1;R.selectAll(".venn-area path").each(function(Y){const ie=this.getAttribute("d");Y.sets.length==1&&ie&&!p&&($=!0,I[Y.sets[0]]=KDt(ie))});function O(Y){return ie=>{const K=Y.sets.map(Q=>{let te=I[Q],J=M[Q];return te||(te={x:r/2,y:n/2,radius:1}),J||(J={x:r/2,y:n/2,radius:1}),{x:te.x*(1-ie)+J.x*ie,y:te.y*(1-ie)+J.y*ie,radius:te.radius*(1-ie)+J.radius*ie}});return yae(K,g)}}const N=R.selectAll(".venn-area").data(E,Y=>Y.sets),F=N.enter().append("g").attr("class",Y=>`venn-area venn-${Y.sets.length==1?"circle":"intersection"}${Y.colour||Y.color?" venn-coloured":""}`).attr("data-venn-sets",Y=>Y.sets.join("_")),z=F.append("path"),V=F.append("text").attr("class","label").text(Y=>D(Y)).attr("text-anchor","middle").attr("dy",".35em").attr("x",r/2).attr("y",n/2);h&&(z.style("fill-opacity","0").filter(Y=>Y.sets.length==1).style("fill",Y=>Y.colour?Y.colour:Y.color?Y.color:b(Y.sets)).style("fill-opacity",".25"),V.style("fill",Y=>Y.colour||Y.color?"#FFF":t.textFill?t.textFill:Y.sets.length==1?b(Y.sets):"#444"));function B(Y){return typeof Y.transition=="function"?Y.transition("venn").duration(a):Y}let G=k;$&&typeof G.transition=="function"?(G=B(k),G.selectAll("path").attrTween("d",O)):G.selectAll("path").attr("d",Y=>yae(Y.sets.map(ie=>M[ie])),g);const H=G.selectAll("text").filter(Y=>Y.sets in L).text(Y=>D(Y)).attr("x",Y=>Math.floor(L[Y.sets].x)).attr("y",Y=>Math.floor(L[Y.sets].y));u&&($?"on"in H?H.on("end",KN(M,D)):H.each("end",KN(M,D)):H.each(KN(M,D)));const q=B(N.exit()).remove();typeof N.transition=="function"&&q.selectAll("path").attrTween("d",O);const Z=q.selectAll("text").attr("x",r/2).attr("y",n/2);return d!==null&&(V.style("font-size","0px"),H.style("font-size",d),Z.style("font-size","0px")),{circles:M,textCentres:L,nodes:N,enter:F,update:G,exit:q}}return S.wrap=function(k){return arguments.length?(u=k,S):u},S.useViewBox=function(){return e=!0,S},S.width=function(k){return arguments.length?(r=k,S):r},S.height=function(k){return arguments.length?(n=k,S):n},S.padding=function(k){return arguments.length?(i=k,S):i},S.distinct=function(k){return arguments.length?(p=k,S):p},S.colours=function(k){return arguments.length?(b=k,S):b},S.colors=function(k){return arguments.length?(b=k,S):b},S.fontSize=function(k){return arguments.length?(d=k,S):d},S.round=function(k){return arguments.length?(g=k,S):g},S.duration=function(k){return arguments.length?(a=k,S):a},S.layoutFunction=function(k){return arguments.length?(w=k,S):w},S.normalize=function(k){return arguments.length?(o=k,S):o},S.scaleToFit=function(k){return arguments.length?(l=k,S):l},S.styled=function(k){return arguments.length?(h=k,S):h},S.orientation=function(k){return arguments.length?(s=k,S):s},S.orientationOrder=function(k){return arguments.length?(f=k,S):f},S.lossFunction=function(k){return arguments.length?(C=k==="default"?dx:k==="logRatio"?oLe:k,S):C},S}function KN(t,e){return function(r){const n=this,i=t[r.sets[0]].radius||50,a=e(r)||"",s=a.split(/\s+/).reverse(),l=(a.length+s.length)/3;let u=s.pop(),h=[u],d=0;const f=1.1;n.textContent=null;const p=[];function g(b){const w=n.ownerDocument.createElementNS(n.namespaceURI,"tspan");return w.textContent=b,p.push(w),n.append(w),w}let m=g(u);for(;u=s.pop(),!!u;){h.push(u);const b=h.join(" ");m.textContent=b,b.length>l&&m.getComputedTextLength()>i&&(h.pop(),m.textContent=h.join(" "),h=[u],m=g(u),d++)}const y=.35-d*f/2,v=n.getAttribute("x"),T=n.getAttribute("y");p.forEach((b,w)=>{b.setAttribute("x",v),b.setAttribute("y",T),b.setAttribute("dy",`${y+w*f}em`)})}}function ZN(t,e,r){let n=e[0].radius-xo(e[0],t);for(let i=1;i<e.length;++i){const a=e[i].radius-xo(e[i],t);a<=n&&(n=a)}for(let i=0;i<r.length;++i){const a=xo(r[i],t)-r[i].radius;a<=n&&(n=a)}return n}function dLe(t,e,r){const n=[];for(const h of t)n.push({x:h.x,y:h.y}),n.push({x:h.x+h.radius/2,y:h.y}),n.push({x:h.x-h.radius/2,y:h.y}),n.push({x:h.x,y:h.y+h.radius/2}),n.push({x:h.x,y:h.y-h.radius/2});let i=n[0],a=ZN(n[0],t,e);for(let h=1;h<n.length;++h){const d=ZN(n[h],t,e);d>=a&&(i=n[h],a=d)}const s=iLe(h=>-1*ZN({x:h[0],y:h[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,o={x:r?0:s[0],y:s[1]};let l=!0;for(const h of t)if(xo(o,h)>h.radius){l=!1;break}for(const h of e)if(xo(o,h)<h.radius){l=!1;break}if(l)return o;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return H7(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:e.length?dLe(t,[]):nLe(u.arcs.map(h=>h.p1))}function XDt(t){const e={},r=Object.keys(t);for(const n of r)e[n]=[];for(let n=0;n<r.length;n++){const i=r[n],a=t[i];for(let s=n+1;s<r.length;++s){const o=r[s],l=t[o],u=xo(a,l);u+l.radius<=a.radius+1e-10?e[o].push(i):u+a.radius<=l.radius+1e-10&&e[i].push(o)}}return e}function fLe(t,e,r){const n={},i=XDt(t);for(let a=0;a<e.length;++a){const s=e[a].sets,o={},l={};for(let f=0;f<s.length;++f){o[s[f]]=!0;const p=i[s[f]];for(let g=0;g<p.length;++g)l[p[g]]=!0}const u=[],h=[];for(let f in t)f in o?u.push(t[f]):f in l||h.push(t[f]);const d=dLe(u,h,r);n[s]=d,d.disjoint&&e[a].size>0&&console.log("WARNING: area "+s+" not represented on screen")}return n}function jDt(t,e,r){const n=[];return n.push(`
M`,t,e),n.push(`
m`,-r,0),n.push(`
a`,r,r,0,1,0,r*2,0),n.push(`
a`,r,r,0,1,0,-r*2,0),n.join(" ")}function KDt(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function pLe(t){if(t.length===0)return[];const e={};return H7(t,e),e.arcs}function gLe(t,e){if(t.length===0)return"M 0 0";const r=Math.pow(10,e||0),n=e!=null?a=>Math.round(a*r)/r:a=>a;if(t.length==1){const a=t[0].circle;return jDt(n(a.x),n(a.y),n(a.radius))}const i=[`
M`,n(t[0].p2.x),n(t[0].p2.y)];for(const a of t){const s=n(a.circle.radius);i.push(`
A`,s,s,0,a.large?1:0,a.sweep?1:0,n(a.p1.x),n(a.p1.y))}return i.join(" ")}function yae(t,e){return gLe(pLe(t),e)}function ZDt(t,e={}){const{lossFunction:r,layoutFunction:n=aLe,normalize:i=!0,orientation:a=Math.PI/2,orientationOrder:s,width:o=600,height:l=350,padding:u=15,scaleToFit:h=!1,symmetricalTextCentre:d=!1,distinct:f,round:p=2}=e;let g=n(t,{lossFunction:r==="default"||!r?dx:r==="logRatio"?oLe:r,distinct:f});i&&(g=lLe(g,a,s));const m=cLe(g,o,l,u,h),y=fLe(m,t,d),v=new Map(Object.keys(m).map(w=>[w,{set:w,x:m[w].x,y:m[w].y,radius:m[w].radius}])),T=t.map(w=>{const C=w.sets.map(E=>v.get(E)),S=pLe(C),k=gLe(S,p);return{circles:C,arcs:S,path:k,area:w,has:new Set(w.sets)}});function b(w){let C="";for(const S of T)S.has.size>w.length&&w.every(k=>S.has.has(k))&&(C+=" "+S.path);return C}return T.map(({circles:w,arcs:C,path:S,area:k})=>({data:k,text:y[k.sets],circles:w,arcs:C,path:S,distinctPath:S+b(k.sets)}))}var xF=(function(){var t=x(function(T,b,w,C){for(w=w||{},C=T.length;C--;w[T[C]]=b);return w},"o"),e=[5,8],r=[7,8,11,12,17,19,22,24],n=[1,17],i=[1,18],a=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],s=[1,31],o=[1,39],l=[7,8,11,12,17,19,22,24,27],u=[1,57],h=[1,56],d=[1,58],f=[1,59],p=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],m={trace:x(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:x(function(b,w,C,S,k,E,_){var M=E.length-1;switch(k){case 1:return E[M-1];case 2:case 3:case 4:this.$=[];break;case 5:E[M-1].push(E[M]),this.$=E[M-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=E[M];break;case 8:S.setDiagramTitle(E[M].substr(6)),this.$=E[M].substr(6);break;case 9:S.addSubsetData([E[M]],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 10:S.addSubsetData([E[M-1]],E[M],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 11:S.addSubsetData([E[M-2]],void 0,parseFloat(E[M])),S.setIndentMode&&S.setIndentMode(!0);break;case 12:S.addSubsetData([E[M-3]],E[M-2],parseFloat(E[M])),S.setIndentMode&&S.setIndentMode(!0);break;case 13:if(E[M].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[M]),S.addSubsetData(E[M],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 14:if(E[M-1].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[M-1]),S.addSubsetData(E[M-1],E[M],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 15:if(E[M-2].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[M-2]),S.addSubsetData(E[M-2],void 0,parseFloat(E[M])),S.setIndentMode&&S.setIndentMode(!0);break;case 16:if(E[M-3].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(E[M-3]),S.addSubsetData(E[M-3],E[M-2],parseFloat(E[M])),S.setIndentMode&&S.setIndentMode(!0);break;case 17:case 18:case 19:S.addTextData(E[M-1],E[M],void 0);break;case 20:case 21:S.addTextData(E[M-2],E[M-1],E[M]);break;case 23:S.addStyleData(E[M-1],E[M]);break;case 24:case 25:case 26:var L=S.getCurrentSets();if(!L)throw new Error("text requires set");S.addTextData(L,E[M],void 0);break;case 27:case 28:var L=S.getCurrentSets();if(!L)throw new Error("text requires set");S.addTextData(L,E[M-1],E[M]);break;case 29:case 41:this.$=[E[M]];break;case 30:case 42:this.$=[...E[M-2],E[M]];break;case 31:this.$=[E[M-2],E[M]];break;case 33:this.$=E[M].join(" ");break;case 34:this.$=[E[M]];break;case 35:E[M-1].push(E[M]),this.$=E[M-1];break;case 43:case 44:this.$=E[M];break}},"anonymous"),table:[t(e,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(r,[2,4],{6:5}),t(e,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(r,[2,5]),t(r,[2,6]),t(r,[2,7]),t(r,[2,8]),{13:16,20:n,21:i},{13:20,18:19,20:n,21:i},{13:20,18:21,20:n,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:n,21:i},t(r,[2,9],{14:[1,27],15:[1,28]}),t(a,[2,43]),t(a,[2,44]),t(r,[2,13],{14:[1,29],15:[1,30],27:s}),t(a,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:s},t(r,[2,22]),t(r,[2,24],{14:[1,35]}),t(r,[2,25],{14:[1,36]}),t(r,[2,26]),{20:o,25:37,26:38,27:s},t(r,[2,10],{15:[1,40]}),{16:[1,41]},t(r,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:n,21:i},t(r,[2,17],{14:[1,45]}),t(r,[2,18],{14:[1,46]}),t(r,[2,19]),t(r,[2,27]),t(r,[2,28]),t(r,[2,23],{27:[1,47]}),t(l,[2,29]),{15:[1,48]},{16:[1,49]},t(r,[2,11]),{16:[1,50]},t(r,[2,15]),t(a,[2,42]),t(r,[2,20]),t(r,[2,21]),{20:o,26:51},{16:u,20:h,21:[1,53],28:52,29:54,30:55,31:d,32:f,33:p},t(r,[2,12]),t(r,[2,16]),t(l,[2,30]),t(l,[2,31]),t(l,[2,32]),t(l,[2,33],{30:61,16:u,20:h,31:d,32:f,33:p}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:x(function(b,w){if(w.recoverable)this.trace(b);else{var C=new Error(b);throw C.hash=w,C}},"parseError"),parse:x(function(b){var w=this,C=[0],S=[],k=[null],E=[],_=this.table,M="",L=0,P=0,D=2,R=1,I=E.slice.call(arguments,1),$=Object.create(this.lexer),O={yy:{}};for(var N in this.yy)Object.prototype.hasOwnProperty.call(this.yy,N)&&(O.yy[N]=this.yy[N]);$.setInput(b,O.yy),O.yy.lexer=$,O.yy.parser=this,typeof $.yylloc>"u"&&($.yylloc={});var F=$.yylloc;E.push(F);var z=$.options&&$.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V(ge){C.length=C.length-2*ge,k.length=k.length-ge,E.length=E.length-ge}x(V,"popStack");function B(){var ge;return ge=S.pop()||$.lex()||R,typeof ge!="number"&&(ge instanceof Array&&(S=ge,ge=S.pop()),ge=w.symbols_[ge]||ge),ge}x(B,"lex");for(var G,H,q,Z,Y={},ie,K,Q,te;;){if(H=C[C.length-1],this.defaultActions[H]?q=this.defaultActions[H]:((G===null||typeof G>"u")&&(G=B()),q=_[H]&&_[H][G]),typeof q>"u"||!q.length||!q[0]){var J="";te=[];for(ie in _[H])this.terminals_[ie]&&ie>D&&te.push("'"+this.terminals_[ie]+"'");$.showPosition?J="Parse error on line "+(L+1)+`:
`+$.showPosition()+`
Expecting `+te.join(", ")+", got '"+(this.terminals_[G]||G)+"'":J="Parse error on line "+(L+1)+": Unexpected "+(G==R?"end of input":"'"+(this.terminals_[G]||G)+"'"),this.parseError(J,{text:$.match,token:this.terminals_[G]||G,line:$.yylineno,loc:F,expected:te})}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+H+", token: "+G);switch(q[0]){case 1:C.push(G),k.push($.yytext),E.push($.yylloc),C.push(q[1]),G=null,P=$.yyleng,M=$.yytext,L=$.yylineno,F=$.yylloc;break;case 2:if(K=this.productions_[q[1]][1],Y.$=k[k.length-K],Y._$={first_line:E[E.length-(K||1)].first_line,last_line:E[E.length-1].last_line,first_column:E[E.length-(K||1)].first_column,last_column:E[E.length-1].last_column},z&&(Y._$.range=[E[E.length-(K||1)].range[0],E[E.length-1].range[1]]),Z=this.performAction.apply(Y,[M,P,L,O.yy,q[1],k,E].concat(I)),typeof Z<"u")return Z;K&&(C=C.slice(0,-1*K*2),k=k.slice(0,-1*K),E=E.slice(0,-1*K)),C.push(this.productions_[q[1]][0]),k.push(Y.$),E.push(Y._$),Q=_[C[C.length-2]][C[C.length-1]],C.push(Q);break;case 3:return!0}}return!0},"parse")},y=(function(){var T={EOF:1,parseError:x(function(w,C){if(this.yy.parser)this.yy.parser.parseError(w,C);else throw new Error(w)},"parseError"),setInput:x(function(b,w){return this.yy=w||this.yy||{},this._input=b,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var w=b.match(/(?:\r\n?|\n).*/g);return w?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),b},"input"),unput:x(function(b){var w=b.length,C=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-w),this.offset-=w;var S=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),C.length-1&&(this.yylineno-=C.length-1);var k=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:C?(C.length===S.length?this.yylloc.first_column:0)+S[S.length-C.length].length-C[0].length:this.yylloc.first_column-w},this.options.ranges&&(this.yylloc.range=[k[0],k[0]+this.yyleng-w]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:x(function(b){this.unput(this.match.slice(b))},"less"),pastInput:x(function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var b=this.match;return b.length<20&&(b+=this._input.substr(0,20-b.length)),(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var b=this.pastInput(),w=new Array(b.length+1).join("-");return b+this.upcomingInput()+`
`+w+"^"},"showPosition"),test_match:x(function(b,w){var C,S,k;if(this.options.backtrack_lexer&&(k={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(k.yylloc.range=this.yylloc.range.slice(0))),S=b[0].match(/(?:\r\n?|\n).*/g),S&&(this.yylineno+=S.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:S?S[S.length-1].length-S[S.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],C=this.performAction.call(this,this.yy,this,w,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),C)return C;if(this._backtrack){for(var E in k)this[E]=k[E];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var b,w,C,S;this._more||(this.yytext="",this.match="");for(var k=this._currentRules(),E=0;E<k.length;E++)if(C=this._input.match(this.rules[k[E]]),C&&(!w||C[0].length>w[0].length)){if(w=C,S=E,this.options.backtrack_lexer){if(b=this.test_match(C,k[E]),b!==!1)return b;if(this._backtrack){w=!1;continue}else return!1}else if(!this.options.flex)break}return w?(b=this.test_match(w,k[S]),b!==!1?b:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:x(function(){var w=this.next();return w||this.lex()},"lex"),begin:x(function(w){this.conditionStack.push(w)},"begin"),popState:x(function(){var w=this.conditionStack.length-1;return w>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:x(function(w){return w=this.conditionStack.length-1-Math.abs(w||0),w>=0?this.conditionStack[w]:"INITIAL"},"topState"),pushState:x(function(w){this.begin(w)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(w,C,S,k){switch(S){case 0:break;case 1:break;case 2:break;case 3:if(w.getIndentMode&&w.getIndentMode())return w.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:w.setIndentMode&&w.setIndentMode(!1),this.begin("INITIAL"),this.unput(C.yytext);break;case 6:return this.begin("bol"),8;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(w.consumeIndentText)w.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return C.yytext=C.yytext.slice(2,-2),14;case 17:return C.yytext=C.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return T})();m.lexer=y;function v(){this.yy={}}return x(v,"Parser"),v.prototype=m,m.Parser=v,new v})();xF.parser=xF;var QDt=xF,eY=[],tY=[],rY=[],nY=new Set,iY,aY=!1,JDt=x((t,e,r)=>{const n=q7(t).sort(),i=r??10/Math.pow(t.length,2);iY=n,n.length===1&&nY.add(n[0]),eY.push({sets:n,size:i,label:e?$k(e):void 0})},"addSubsetData"),eOt=x(()=>eY,"getSubsetData"),$k=x(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),tOt=x(t=>t&&$k(t),"normalizeStyleValue"),rOt=x((t,e,r)=>{const n=$k(e);tY.push({sets:q7(t).sort(),id:n,label:r?$k(r):void 0})},"addTextData"),nOt=x((t,e)=>{const r=q7(t).sort(),n={};for(const[i,a]of e)n[i]=tOt(a)??a;rY.push({targets:r,styles:n})},"addStyleData"),iOt=x(()=>rY,"getStyleData"),q7=x(t=>t.map(e=>$k(e)),"normalizeIdentifierList"),aOt=x(t=>{const r=q7(t).filter(n=>!nY.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),sOt=x(()=>tY,"getTextData"),oOt=x(()=>iY,"getCurrentSets"),lOt=x(()=>aY,"getIndentMode"),cOt=x(t=>{aY=t},"setIndentMode"),uOt=Vr.venn;function mLe(){return ri(uOt,Xt().venn)}x(mLe,"getConfig");var hOt=x(()=>{On(),eY.length=0,tY.length=0,rY.length=0,nY.clear(),iY=void 0,aY=!1},"customClear"),dOt={getConfig:mLe,clear:hOt,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,getAccDescription:ai,setAccDescription:ii,addSubsetData:JDt,getSubsetData:eOt,addTextData:rOt,addStyleData:nOt,validateUnionIdentifiers:aOt,getTextData:sOt,getStyleData:iOt,getCurrentSets:oOt,getIndentMode:lOt,setIndentMode:cOt},fOt=x(t=>`
.venn-title {
font-size: 32px;
fill: ${t.vennTitleTextColor};
font-family: ${t.fontFamily};
}
.venn-circle text {
font-size: 48px;
font-family: ${t.fontFamily};
}
.venn-intersection text {
font-size: 48px;
fill: ${t.vennSetTextColor};
font-family: ${t.fontFamily};
}
.venn-text-node {
font-family: ${t.fontFamily};
color: ${t.vennSetTextColor};
}
`,"getStyles"),pOt=fOt;function yLe(t){const e=new Map;for(const r of t){const n=r.targets.join("|"),i=e.get(n);i?Object.assign(i,r.styles):e.set(n,{...r.styles})}return e}x(yLe,"buildStyleByKey");var gOt=x((t,e,r,n)=>{var I,$,O;const i=n.db,a=(I=i.getConfig)==null?void 0:I.call(i),{themeVariables:s,look:o,handDrawnSeed:l}=Xt(),u=o==="handDrawn",h=[s.venn1,s.venn2,s.venn3,s.venn4,s.venn5,s.venn6,s.venn7,s.venn8].filter(Boolean),d=($=i.getDiagramTitle)==null?void 0:$.call(i),f=i.getSubsetData(),p=i.getTextData(),g=yLe(i.getStyleData()),m=bLe(f),y=(a==null?void 0:a.width)??800,v=(a==null?void 0:a.height)??450,b=y/1600,w=d?48*b:0,C=s.primaryTextColor??s.textColor,S=xs(e);S.attr("viewBox",`0 0 ${y} ${v}`),d&&S.append("text").text(d).attr("class","venn-title").attr("font-size",`${32*b}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*b).style("fill",s.vennTitleTextColor||s.titleColor);const k=ut(document.createElement("div")),E=YDt().width(y).height(v-w);k.datum(m).call(E);const _=u?Gt.svg(k.select("svg").node()):void 0,M=ZDt(m,{width:y,height:v-w,padding:(a==null?void 0:a.padding)??15}),L=new Map;for(const N of M){const F=Td([...N.data.sets].sort());L.set(F,N)}p.length>0&&vLe(a,L,k,p,b,g);const P=Zs(s.background||"#f4f4f4");k.selectAll(".venn-circle").each(function(N,F){var K;const z=ut(this),B=Td([...N.sets].sort()),G=g.get(B),H=(G==null?void 0:G.fill)||h[F%h.length]||s.primaryColor;z.classed(`venn-set-${F%8}`,!0);const q=(G==null?void 0:G["fill-opacity"])??.1,Z=(G==null?void 0:G.stroke)||H,Y=(G==null?void 0:G["stroke-width"])||`${5*b}`;if(u&&_){const Q=L.get(B);if(Q&&Q.circles.length>0){const te=Q.circles[0],J=_.circle(te.x,te.y,te.radius*2,{roughness:.7,seed:l,fill:aj(H,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+F*60,stroke:Z,strokeWidth:parseFloat(String(Y))});z.select("path").remove(),(K=z.node())==null||K.insertBefore(J,z.select("text").node())}}else z.select("path").style("fill",H).style("fill-opacity",q).style("stroke",Z).style("stroke-width",Y).style("stroke-opacity",.95);const ie=(G==null?void 0:G.color)||(P?Je(H,30):et(H,30));z.select("text").style("font-size",`${48*b}px`).style("fill",ie)}),u&&_?k.selectAll(".venn-intersection").each(function(N){var H;const F=ut(this),V=Td([...N.sets].sort()),B=g.get(V),G=B==null?void 0:B.fill;if(G){const q=F.select("path"),Z=q.attr("d");if(Z){const Y=_.path(Z,{roughness:.7,seed:l,fill:aj(G,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),ie=q.node();(H=ie==null?void 0:ie.parentNode)==null||H.insertBefore(Y,ie),q.remove()}}else F.select("path").style("fill-opacity",0);F.select("text").style("font-size",`${48*b}px`).style("fill",(B==null?void 0:B.color)??s.vennSetTextColor??C)}):(k.selectAll(".venn-intersection text").style("font-size",`${48*b}px`).style("fill",N=>{var V;const z=Td([...N.sets].sort());return((V=g.get(z))==null?void 0:V.color)??s.vennSetTextColor??C}),k.selectAll(".venn-intersection path").style("fill-opacity",N=>{var V;const z=Td([...N.sets].sort());return(V=g.get(z))!=null&&V.fill?1:0}).style("fill",N=>{var V;const z=Td([...N.sets].sort());return((V=g.get(z))==null?void 0:V.fill)??"transparent"}));const D=S.append("g").attr("transform",`translate(0, ${w})`),R=k.select("svg").node();if(R&&"childNodes"in R)for(const N of[...R.childNodes])(O=D.node())==null||O.appendChild(N);Ai(S,v,y,(a==null?void 0:a.useMaxWidth)??!0)},"draw");function Td(t){return t.join("|")}x(Td,"stableSetsKey");function vLe(t,e,r,n,i,a){var h;const s=(t==null?void 0:t.useDebugLayout)??!1,l=r.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const d of n){const f=Td(d.sets),p=u.get(f);p?p.push(d):u.set(f,[d])}for(const[d,f]of u.entries()){const p=e.get(d);if(!(p!=null&&p.text))continue;const g=p.text.x,m=p.text.y,y=Math.min(...p.circles.map(I=>I.radius)),v=Math.min(...p.circles.map(I=>I.radius-Math.hypot(g-I.x,m-I.y)));let T=Number.isFinite(v)?Math.max(0,v):0;T===0&&Number.isFinite(y)&&(T=y*.6);const b=l.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);s&&b.append("circle").attr("class","venn-text-debug-circle").attr("cx",g).attr("cy",m).attr("r",T).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const w=Math.max(80*i,T*2*.95),C=Math.max(60*i,T*2*.95),E=(p.data.label&&p.data.label.length>0?Math.min(32*i,T*.25):0)+(f.length<=2?30*i:0),_=g-w/2,M=m-C/2+E,L=Math.max(1,Math.ceil(Math.sqrt(f.length))),P=Math.max(1,Math.ceil(f.length/L)),D=w/L,R=C/P;for(const[I,$]of f.entries()){const O=I%L,N=Math.floor(I/L),F=_+D*(O+.5),z=M+R*(N+.5);s&&b.append("rect").attr("class","venn-text-debug-cell").attr("x",_+D*O).attr("y",M+R*N).attr("width",D).attr("height",R).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const V=D*.9,B=R*.9,G=b.append("foreignObject").attr("class","venn-text-node-fo").attr("width",V).attr("height",B).attr("x",F-V/2).attr("y",z-B/2).attr("overflow","visible"),H=(h=a.get($.id))==null?void 0:h.color,q=G.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text($.label??$.id);H&&q.style("color",H)}}}x(vLe,"renderTextNodes");function bLe(t){const e=new Set(t.map(i=>[...i.sets].sort().join("|"))),r=new Map(t.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size])),n=[];for(const i of t){if(i.sets.length<3)continue;const a=[...i.sets].sort();for(let s=0;s<a.length-1;s++)for(let o=s+1;o<a.length;o++){const l=[a[s],a[o]],u=l.join("|");if(!e.has(u)){e.add(u);const h=r.get(l[0]),d=r.get(l[1]),f=h!==void 0&&d!==void 0?Math.min(h,d)/4:2.5;n.push({sets:l,size:f,label:""})}}}return n.length>0?[...t,...n]:t}x(bLe,"ensurePairwiseSubsets");var mOt={draw:gOt},yOt={parser:QDt,db:dOt,renderer:mOt,styles:pOt};const vOt=Object.freeze(Object.defineProperty({__proto__:null,diagram:yOt},Symbol.toStringTag,{value:"Module"}));var ub,xLe=(ub=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Hn,this.getAccTitle=ni,this.setDiagramTitle=ti,this.getDiagramTitle=Yn,this.getAccDescription=ai,this.setAccDescription=ii}getNodes(){return this.nodes}getConfig(){const e=Vr,r=Xt();return ri({...e.treemap,...r.treemap??{}})}addNode(e,r){this.nodes.push(e),this.levels.set(e,r),r===0&&(this.outerNodes.push(e),this.root??(this.root=e))}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,r){const n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},i=r.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");i&&i.forEach(a=>{tV(a)&&(n!=null&&n.textStyles?n.textStyles.push(a):n.textStyles=[a]),n!=null&&n.styles?n.styles.push(a):n.styles=[a]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){var r;return((r=this.classes.get(e))==null?void 0:r.styles)??[]}clear(){On(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},x(ub,"TreeMapDB"),ub);function TLe(t){if(!t.length)return[];const e=[],r=[];return t.forEach(n=>{const i={name:n.name,children:n.type==="Leaf"?void 0:[]};for(i.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(i.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(i.value=n.value);r.length>0&&r[r.length-1].level>=n.level;)r.pop();if(r.length===0)e.push(i);else{const a=r[r.length-1].node;a.children?a.children.push(i):a.children=[i]}n.type!=="Leaf"&&r.push({node:i,level:n.level})}),e}x(TLe,"buildHierarchy");var bOt=x((t,e)=>{eo(t,e);const r=[];for(const a of t.TreemapRows??[])a.$type==="ClassDefStatement"&&e.addClass(a.className??"",a.styleText??"");for(const a of t.TreemapRows??[]){const s=a.item;if(!s)continue;const o=a.indent?parseInt(a.indent):0,l=xOt(s),u=s.classSelector?e.getStylesForClass(s.classSelector):[],h=u.length>0?u:void 0,d={level:o,name:l,type:s.$type,value:s.value,classSelector:s.classSelector,cssCompiledStyles:h};r.push(d)}const n=TLe(r),i=x((a,s)=>{for(const o of a)e.addNode(o,s),o.children&&o.children.length>0&&i(o.children,s+1)},"addNodesRecursively");i(n,0)},"populate"),xOt=x(t=>t.name?String(t.name):"","getItemName"),wLe={parser:{yy:void 0},parse:x(async t=>{var e;try{const n=await Al("treemap",t);le.debug("Treemap AST:",n);const i=(e=wLe.parser)==null?void 0:e.yy;if(!(i instanceof xLe))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");bOt(n,i)}catch(r){throw le.error("Error parsing treemap:",r),r}},"parse")},TOt=10,dm=10,IT=25,wOt=x((t,e,r,n)=>{const i=n.db,a=i.getConfig(),s=a.padding??TOt,o=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=Xt();if(!l)return;const h=o?30:0,d=xs(e),f=a.nodeWidth?a.nodeWidth*dm:960,p=a.nodeHeight?a.nodeHeight*dm:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),Ai(d,m,g,a.useMaxWidth);let y;try{const B=a.valueFormat||",";if(B==="$0,0")y=x(G=>"$"+Cp(",")(G),"valueFormat");else if(B.startsWith("$")&&B.includes(",")){const G=/\.\d+/.exec(B),H=G?G[0]:"";y=x(q=>"$"+Cp(","+H)(q),"valueFormat")}else if(B.startsWith("$")){const G=B.substring(1);y=x(H=>"$"+Cp(G||"")(H),"valueFormat")}else y=Cp(B)}catch(B){le.error("Error creating format function:",B),y=Cp(",")}const v=h0().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]),T=h0().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]),b=h0().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);o&&d.append("text").attr("x",g/2).attr("y",h/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(o);const w=d.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),C=zz(l).sum(B=>B.value??0).sort((B,G)=>(G.value??0)-(B.value??0)),k=EHe().size([f,p]).paddingTop(B=>B.children&&B.children.length>0?IT+dm:0).paddingInner(s).paddingLeft(B=>B.children&&B.children.length>0?dm:0).paddingRight(B=>B.children&&B.children.length>0?dm:0).paddingBottom(B=>B.children&&B.children.length>0?dm:0).round(!0)(C),E=k.descendants().filter(B=>B.children&&B.children.length>0),_=w.selectAll(".treemapSection").data(E).enter().append("g").attr("class","treemapSection").attr("transform",B=>`translate(${B.x0},${B.y0})`);_.append("rect").attr("width",B=>B.x1-B.x0).attr("height",IT).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",B=>B.depth===0?"display: none;":""),_.append("clipPath").attr("id",(B,G)=>`clip-section-${e}-${G}`).append("rect").attr("width",B=>Math.max(0,B.x1-B.x0-12)).attr("height",IT),_.append("rect").attr("width",B=>B.x1-B.x0).attr("height",B=>B.y1-B.y0).attr("class",(B,G)=>`treemapSection section${G}`).attr("fill",B=>v(B.data.name)).attr("fill-opacity",.6).attr("stroke",B=>T(B.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",B=>{if(B.depth===0)return"display: none;";const G=zt({cssCompiledStyles:B.data.cssCompiledStyles});return G.nodeStyles+";"+G.borderStyles.join(";")}),_.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",IT/2).attr("dominant-baseline","middle").text(B=>B.depth===0?"":B.data.name).attr("font-weight","bold").attr("clip-path",(B,G)=>`url(#clip-section-${e}-${G})`).attr("style",B=>{if(B.depth===0)return"display: none;";const G="dominant-baseline: middle; font-size: 12px; fill:"+b(B.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",H=zt({cssCompiledStyles:B.data.cssCompiledStyles});return G+H.labelStyles.replace("color:","fill:")}).each(function(B){if(B.depth===0)return;const G=ut(this),H=B.data.name;G.text(H);const q=B.x1-B.x0,Z=6;let Y;a.showValues!==!1&&B.value?Y=q-10-30-10-Z:Y=q-Z-6;const K=Math.max(15,Y),Q=G.node();if(Q.getComputedTextLength()>K){let ge=H;for(;ge.length>0;){if(ge=H.substring(0,ge.length-1),ge.length===0){G.text("..."),Q.getComputedTextLength()>K&&G.text("");break}if(G.text(ge+"..."),Q.getComputedTextLength()<=K)break}}}),a.showValues!==!1&&_.append("text").attr("class","treemapSectionValue").attr("x",B=>B.x1-B.x0-10).attr("y",IT/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(B=>B.value?y(B.value):"").attr("font-style","italic").attr("style",B=>{if(B.depth===0)return"display: none;";const G="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+b(B.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",H=zt({cssCompiledStyles:B.data.cssCompiledStyles});return G+H.labelStyles.replace("color:","fill:")});const M=k.leaves(),L=M.length>20,P=L?16:38,D=L?14:28,R=L?4:8,I=L?4:6,$=L?2:4,O=L?8:10,N=L?1:2,F=w.selectAll(".treemapLeafGroup").data(M).enter().append("g").attr("class",(B,G)=>`treemapNode treemapLeafGroup leaf${G}${B.data.classSelector?` ${B.data.classSelector}`:""}x`).attr("transform",B=>`translate(${B.x0},${B.y0})`);F.append("rect").attr("width",B=>B.x1-B.x0).attr("height",B=>B.y1-B.y0).attr("class","treemapLeaf").attr("fill",B=>B.parent?v(B.parent.data.name):v(B.data.name)).attr("style",B=>zt({cssCompiledStyles:B.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",B=>B.parent?v(B.parent.data.name):v(B.data.name)).attr("stroke-width",3),F.append("clipPath").attr("id",(B,G)=>`clip-${e}-${G}`).append("rect").attr("width",B=>Math.max(0,B.x1-B.x0-4)).attr("height",B=>Math.max(0,B.y1-B.y0-4)),F.append("text").attr("class","treemapLabel").attr("x",B=>(B.x1-B.x0)/2).attr("y",B=>(B.y1-B.y0)/2).attr("style",B=>{const G=`text-anchor: middle; dominant-baseline: middle; font-size: ${P}px;fill:`+b(B.data.name)+";",H=zt({cssCompiledStyles:B.data.cssCompiledStyles});return G+H.labelStyles.replace("color:","fill:")}).attr("clip-path",(B,G)=>`url(#clip-${e}-${G})`).text(B=>B.data.name).each(function(B){const G=ut(this),H=B.x1-B.x0,q=B.y1-B.y0,Z=G.node(),Y=H-2*$,ie=q-2*$;if(Y<O||ie<O){G.style("display","none");return}let K=parseInt(G.style("font-size"),10);const Q=.6;for(;Z.getComputedTextLength()>Y&&K>R;)K--,G.style("font-size",`${K}px`);let te=Math.max(I,Math.min(D,Math.round(K*Q))),J=K+N+te;for(;J>ie&&K>R&&(K--,te=Math.max(I,Math.min(D,Math.round(K*Q))),!(te<I&&K===R));)G.style("font-size",`${K}px`),J=K+N+te;G.style("font-size",`${K}px`),L?(K<R||ie<R)&&G.style("display","none"):(Z.getComputedTextLength()>Y||K<R||ie<K)&&G.style("display","none")}),a.showValues!==!1&&F.append("text").attr("class","treemapValue").attr("x",G=>(G.x1-G.x0)/2).attr("y",function(G){return(G.y1-G.y0)/2}).attr("style",G=>{const H=`text-anchor: middle; dominant-baseline: hanging; font-size: ${D}px;fill:`+b(G.data.name)+";",q=zt({cssCompiledStyles:G.data.cssCompiledStyles});return H+q.labelStyles.replace("color:","fill:")}).attr("clip-path",(G,H)=>`url(#clip-${e}-${H})`).text(G=>G.value?y(G.value):"").each(function(G){const H=ut(this),q=this.parentNode;if(!q){H.style("display","none");return}const Z=ut(q).select(".treemapLabel");if(Z.empty()||Z.style("display")==="none"){H.style("display","none");return}const Y=parseFloat(Z.style("font-size")),K=Math.max(I,Math.min(D,Math.round(Y*.6)));H.style("font-size",`${K}px`);const te=(G.y1-G.y0)/2+Y/2+N;H.attr("y",te);const J=G.x1-G.x0,Re=G.y1-G.y0-4,Ie=J-2*$;H.node().getComputedTextLength()>Ie||te+K>Re||K<I?H.style("display","none"):H.style("display",null)});const V=a.diagramPadding??8;mg(d,V,"flowchart",(a==null?void 0:a.useMaxWidth)||!1)},"draw"),COt=x(function(t,e){return e.db.getClasses()},"getClasses"),kOt={draw:wOt,getClasses:COt},SOt={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},EOt=x(({treemap:t}={})=>{const e=Dh(),r=Xt(),n=ri(e,r.themeVariables),i=ri(SOt,t),a=i.titleColor??n.titleColor,s=i.labelColor??n.textColor,o=i.valueColor??n.textColor;return`
.treemapNode.section {
stroke: ${i.sectionStrokeColor};
stroke-width: ${i.sectionStrokeWidth};
fill: ${i.sectionFillColor};
}
.treemapNode.leaf {
stroke: ${i.leafStrokeColor};
stroke-width: ${i.leafStrokeWidth};
fill: ${i.leafFillColor};
}
.treemapLabel {
fill: ${s};
font-size: ${i.labelFontSize};
}
.treemapValue {
fill: ${o};
font-size: ${i.valueFontSize};
}
.treemapTitle {
fill: ${a};
font-size: ${i.titleFontSize};
}
`},"getStyles"),AOt=EOt,_Ot={parser:wLe,get db(){return new xLe},renderer:kOt,styles:AOt};const ROt=Object.freeze(Object.defineProperty({__proto__:null,diagram:_Ot},Symbol.toStringTag,{value:"Module"}));var L6=x((t,e)=>{const r=t<=1?t*100:t;if(r<0||r>100)throw new Error(`${e} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${t}`);return r},"toPercent"),ip=x((t,e,r)=>({x:L6(e,`${r} evolution`),y:L6(t,`${r} visibility`)}),"toCoordinates"),vae=x(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),LOt=x(t=>{if(!(t!=null&&t.startsWith("+")))return{};const e=/^\+'([^']*)'/.exec(t),r=e==null?void 0:e[1];return t.includes("<>")?{flow:"bidirectional",label:r}:t.includes("<")?{flow:"backward",label:r}:t.includes(">")?{flow:"forward",label:r}:{label:r}},"extractFlowFromArrow"),MOt=x((t,e)=>{if(eo(t,e),t.size&&e.setSize(t.size.width,t.size.height),t.evolution){const r=t.evolution.stages.map(i=>i.secondName?`${i.name.trim()} / ${i.secondName.trim()}`:i.name.trim()),n=t.evolution.stages.filter(i=>i.boundary!==void 0).map(i=>i.boundary);e.updateAxes({stages:r,stageBoundaries:n})}if(t.anchors.forEach(r=>{const n=ip(r.visibility,r.evolution,`Anchor "${r.name}"`);e.addNode(r.name,r.name,n.x,n.y,"anchor")}),t.components.forEach(r=>{var o;const n=ip(r.visibility,r.evolution,`Component "${r.name}"`),i=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,a=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,s=(o=r.decorator)==null?void 0:o.strategy;e.addNode(r.name,r.name,n.x,n.y,"component",i,a,r.inertia,s)}),t.notes.forEach(r=>{const n=ip(r.visibility,r.evolution,`Note "${r.text}"`);e.addNote(r.text,n.x,n.y)}),t.pipelines.forEach(r=>{const n=e.getNode(r.parent);if(!n||typeof n.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const i=n.y;e.startPipeline(r.parent),r.components.forEach(a=>{const s=`${r.parent}_${a.name}`,o=a.label?(a.label.negX?-1:1)*a.label.offsetX:void 0,l=a.label?(a.label.negY?-1:1)*a.label.offsetY:void 0,u=L6(a.evolution,`Pipeline component "${a.name}" evolution`);e.addNode(s,a.name,u,i,"pipeline-component",o,l),e.addPipelineComponent(r.parent,s)})}),t.links.forEach(r=>{const n=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let i=vae(r.fromPort)??vae(r.toPort);const{flow:a,label:s}=LOt(r.arrow);!i&&a&&(i=a);const o=r.linkLabel,l=s??o;e.addLink(e.resolveNodeId(r.from),e.resolveNodeId(r.to),n,l,i)}),t.evolves.forEach(r=>{const n=e.getNode(r.component);if((n==null?void 0:n.y)!==void 0){const i=L6(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=ip(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=ip(r.x,r.y,`Annotation ${r.number}`);e.addAnnotation(r.number,[{x:n.x,y:n.y}],r.text)}),t.accelerators.forEach(r=>{const n=ip(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=ip(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),CLe={parser:{yy:void 0},parse:x(async t=>{var n;const e=await Al("wardley",t);le.debug(e);const r=(n=CLe.parser)==null?void 0:n.yy;if(!r||typeof r.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");MOt(e,r)},"parse")},hb,IOt=(hb=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(e){const r=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...r,...e,className:e.className??r.className,labelOffsetX:e.labelOffsetX??r.labelOffsetX,labelOffsetY:e.labelOffsetY??r.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const r=this.nodes.get(e);r&&(r.isPipelineParent=!0)}addPipelineComponent(e,r){const n=this.pipelines.get(e);n&&n.componentIds.push(r);const i=this.nodes.get(r);i&&(i.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,r){this.annotationsBox={x:e,y:r}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,r){this.size={width:e,height:r}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[r,n]of this.nodes)if(n.label===e)return r;return e}build(){const e=[];for(const r of this.nodes.values()){if(typeof r.x!="number"||typeof r.y!="number")throw new Error(`Node "${r.label}" is missing coordinates`);e.push(r)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},x(hb,"WardleyBuilder"),hb),ks=new IOt;function kLe(){return Fe()["wardley-beta"]}x(kLe,"getConfig");function SLe(t,e,r,n,i,a,s,o,l){ks.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:a,labelOffsetY:s,inertia:o,sourceStrategy:l})}x(SLe,"addNode");function ELe(t,e,r=!1,n,i){ks.addLink({source:t,target:e,dashed:r,label:n,flow:i})}x(ELe,"addLink");function ALe(t,e,r){ks.addTrend({nodeId:t,targetX:e,targetY:r})}x(ALe,"addTrend");function _Le(t,e,r){ks.addAnnotation({number:t,coordinates:e,text:r})}x(_Le,"addAnnotation");function RLe(t,e,r){ks.addNote({text:t,x:e,y:r})}x(RLe,"addNote");function LLe(t,e,r){ks.addAccelerator({name:t,x:e,y:r})}x(LLe,"addAccelerator");function MLe(t,e,r){ks.addDeaccelerator({name:t,x:e,y:r})}x(MLe,"addDeaccelerator");function ILe(t,e){ks.setAnnotationsBox(t,e)}x(ILe,"setAnnotationsBox");function NLe(t,e){ks.setSize(t,e)}x(NLe,"setSize");function DLe(t){ks.startPipeline(t)}x(DLe,"startPipeline");function OLe(t,e){ks.addPipelineComponent(t,e)}x(OLe,"addPipelineComponent");function $Le(t){ks.setAxes(t)}x($Le,"updateAxes");function PLe(t){return ks.getNode(t)}x(PLe,"getNode");function BLe(t){return ks.resolveNodeId(t)}x(BLe,"resolveNodeId");function FLe(){return ks.build()}x(FLe,"getWardleyData");function zLe(){ks.clear(),On()}x(zLe,"clear");var NOt={getConfig:kLe,addNode:SLe,addLink:ELe,addTrend:ALe,addAnnotation:_Le,addNote:RLe,addAccelerator:LLe,addDeaccelerator:MLe,setAnnotationsBox:ILe,setSize:NLe,startPipeline:DLe,addPipelineComponent:OLe,updateAxes:$Le,getNode:PLe,resolveNodeId:BLe,getWardleyData:FLe,clear:zLe,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,getAccDescription:ai,setAccDescription:ii},DOt=["Genesis","Custom Built","Product","Commodity"],OOt=x(()=>{var e,r,n,i,a,s,o,l,u,h,d,f;const{themeVariables:t}=Fe();return{backgroundColor:((e=t.wardley)==null?void 0:e.backgroundColor)??t.background??"#fff",axisColor:((r=t.wardley)==null?void 0:r.axisColor)??"#000",axisTextColor:((n=t.wardley)==null?void 0:n.axisTextColor)??t.primaryTextColor??"#222",gridColor:((i=t.wardley)==null?void 0:i.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((a=t.wardley)==null?void 0:a.componentFill)??"#fff",componentStroke:((s=t.wardley)==null?void 0:s.componentStroke)??"#000",componentLabelColor:((o=t.wardley)==null?void 0:o.componentLabelColor)??t.primaryTextColor??"#222",linkStroke:((l=t.wardley)==null?void 0:l.linkStroke)??"#000",evolutionStroke:((u=t.wardley)==null?void 0:u.evolutionStroke)??"#dc3545",annotationStroke:((h=t.wardley)==null?void 0:h.annotationStroke)??"#000",annotationTextColor:((d=t.wardley)==null?void 0:d.annotationTextColor)??t.primaryTextColor??"#222",annotationFill:((f=t.wardley)==null?void 0:f.annotationFill)??t.background??"#fff"}},"getTheme"),$Ot=x(()=>{const t=Fe()["wardley-beta"];return{width:(t==null?void 0:t.width)??900,height:(t==null?void 0:t.height)??600,padding:(t==null?void 0:t.padding)??48,nodeRadius:(t==null?void 0:t.nodeRadius)??6,nodeLabelOffset:(t==null?void 0:t.nodeLabelOffset)??8,axisFontSize:(t==null?void 0:t.axisFontSize)??12,labelFontSize:(t==null?void 0:t.labelFontSize)??10,showGrid:(t==null?void 0:t.showGrid)??!1,useMaxWidth:(t==null?void 0:t.useMaxWidth)??!0}},"getConfigValues"),POt=x((t,e,r,n)=>{var N,F;le.debug(`Rendering Wardley map
`+t);const i=$Ot(),a=OOt(),s=i.nodeRadius*1.6,o=n.db,l=o.getWardleyData(),u=o.getDiagramTitle(),h=((N=l.size)==null?void 0:N.width)??i.width,d=((F=l.size)==null?void 0:F.height)??i.height,f=xs(e);f.selectAll("*").remove(),Ai(f,d,h,i.useMaxWidth),f.attr("viewBox",`0 0 ${h} ${d}`);const p=f.append("g").attr("class","wardley-map"),g=f.append("defs");g.append("marker").attr("id",`arrow-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.evolutionStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-end-${e}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",a.linkStroke).attr("stroke","none"),g.append("marker").attr("id",`link-arrow-start-${e}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",a.linkStroke).attr("stroke","none"),p.append("rect").attr("class","wardley-background").attr("width",h).attr("height",d).attr("fill",a.backgroundColor);const m=h-i.padding*2,y=d-i.padding*2;u&&p.append("text").attr("class","wardley-title").attr("x",h/2).attr("y",i.padding/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const v=x(z=>i.padding+z/100*m,"projectX"),T=x(z=>d-i.padding-z/100*y,"projectY"),b=p.append("g").attr("class","wardley-axes");b.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1),b.append("line").attr("x1",i.padding).attr("x2",i.padding).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.axisColor).attr("stroke-width",1);const w=l.axes.xLabel??"Evolution",C=l.axes.yLabel??"Visibility";b.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",i.padding+m/2).attr("y",d-i.padding/4).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(w),b.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",i.padding/3).attr("y",i.padding+y/2).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${i.padding/3} ${i.padding+y/2})`).text(C);const S=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:DOt;if(S.length>0){const z=p.append("g").attr("class","wardley-stages"),V=l.axes.stageBoundaries,B=[];if(V&&V.length===S.length){let G=0;V.forEach(H=>{B.push({start:G,end:H}),G=H})}else{const G=1/S.length;S.forEach((H,q)=>{B.push({start:q*G,end:(q+1)*G})})}S.forEach((G,H)=>{const q=B[H],Z=i.padding+q.start*m,Y=i.padding+q.end*m,ie=(Z+Y)/2;H>0&&z.append("line").attr("x1",Z).attr("x2",Z).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),z.append("text").attr("class","wardley-stage-label").attr("x",ie).attr("y",d-i.padding/1.5).attr("fill",a.axisTextColor).attr("font-size",i.axisFontSize-2).attr("text-anchor","middle").text(G)})}if(i.showGrid){const z=p.append("g").attr("class","wardley-grid");for(let V=1;V<4;V++){const B=V/4,G=i.padding+m*B;z.append("line").attr("x1",G).attr("x2",G).attr("y1",i.padding).attr("y2",d-i.padding).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6"),z.append("line").attr("x1",i.padding).attr("x2",h-i.padding).attr("y1",d-i.padding-y*B).attr("y2",d-i.padding-y*B).attr("stroke",a.gridColor).attr("stroke-dasharray","2 6")}}const k=new Map;if(l.nodes.forEach(z=>{k.set(z.id,{x:v(z.x),y:T(z.y),node:z})}),l.pipelines.length>0){const z=p.append("g").attr("class","wardley-pipelines"),V=p.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(B=>{if(B.componentIds.length===0)return;const G=B.componentIds.map(Y=>({id:Y,pos:k.get(Y),node:l.nodes.find(ie=>ie.id===Y)})).filter(Y=>Y.pos&&Y.node).sort((Y,ie)=>Y.node.x-ie.node.x);for(let Y=0;Y<G.length-1;Y++){const ie=G[Y],K=G[Y+1];V.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",ie.pos.x).attr("y1",ie.pos.y).attr("x2",K.pos.x).attr("y2",K.pos.y).attr("stroke",a.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let H=1/0,q=-1/0,Z=0;if(B.componentIds.forEach(Y=>{const ie=k.get(Y);ie&&(H=Math.min(H,ie.x),q=Math.max(q,ie.x),Z=ie.y)}),H!==1/0&&q!==-1/0){const ie=i.nodeRadius*4,K=Z-ie/2,Q=k.get(B.nodeId);if(Q){const te=(H+q)/2;Q.x=te,Q.y=K-s/6}z.append("rect").attr("class","wardley-pipeline-box").attr("x",H-15).attr("y",K).attr("width",q-H+30).attr("height",ie).attr("fill","none").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const E=p.append("g").attr("class","wardley-links"),_=new Map;l.pipelines.forEach(z=>{_.set(z.nodeId,new Set(z.componentIds))});const M=l.links.filter(z=>{if(!k.has(z.source)||!k.has(z.target))return!1;const V=_.get(z.target);return!(V!=null&&V.has(z.source))});E.selectAll("line").data(M).enter().append("line").attr("class",z=>`wardley-link${z.dashed?" wardley-link--dashed":""}`).attr("x1",z=>{const V=k.get(z.source),B=k.get(z.target),H=l.nodes.find(ie=>ie.id===z.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,q=B.x-V.x,Z=B.y-V.y,Y=Math.sqrt(q*q+Z*Z);return V.x+q/Y*H}).attr("y1",z=>{const V=k.get(z.source),B=k.get(z.target),H=l.nodes.find(ie=>ie.id===z.source).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,q=B.x-V.x,Z=B.y-V.y,Y=Math.sqrt(q*q+Z*Z);return V.y+Z/Y*H}).attr("x2",z=>{const V=k.get(z.source),B=k.get(z.target),H=l.nodes.find(ie=>ie.id===z.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,q=V.x-B.x,Z=V.y-B.y,Y=Math.sqrt(q*q+Z*Z);return B.x+q/Y*H}).attr("y2",z=>{const V=k.get(z.source),B=k.get(z.target),H=l.nodes.find(ie=>ie.id===z.target).isPipelineParent?s/Math.sqrt(2):i.nodeRadius,q=V.x-B.x,Z=V.y-B.y,Y=Math.sqrt(q*q+Z*Z);return B.y+Z/Y*H}).attr("stroke",a.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",z=>z.dashed?"6 6":null).attr("marker-end",z=>z.flow==="forward"||z.flow==="bidirectional"?`url(#link-arrow-end-${e})`:null).attr("marker-start",z=>z.flow==="backward"||z.flow==="bidirectional"?`url(#link-arrow-start-${e})`:null),E.selectAll("text").data(M.filter(z=>z.label)).enter().append("text").attr("class","wardley-link-label").attr("x",z=>{const V=k.get(z.source),B=k.get(z.target),G=(V.x+B.x)/2,H=B.y-V.y,q=B.x-V.x,Z=Math.sqrt(q*q+H*H),Y=8,ie=H/Z;return G+ie*Y}).attr("y",z=>{const V=k.get(z.source),B=k.get(z.target),G=(V.y+B.y)/2,H=B.x-V.x,q=B.y-V.y,Z=Math.sqrt(H*H+q*q),Y=8,ie=-H/Z;return G+ie*Y}).attr("fill",a.axisTextColor).attr("font-size",i.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",z=>{const V=k.get(z.source),B=k.get(z.target),G=(V.x+B.x)/2,H=(V.y+B.y)/2,q=B.x-V.x,Z=B.y-V.y,Y=Math.sqrt(q*q+Z*Z),ie=8,K=Z/Y,Q=-q/Y,te=G+K*ie,J=H+Q*ie;let ge=Math.atan2(Z,q)*180/Math.PI;return(ge>90||ge<-90)&&(ge+=180),`rotate(${ge} ${te} ${J})`}).text(z=>z.label);const L=p.append("g").attr("class","wardley-trends"),P=l.trends.map(z=>{const V=k.get(z.nodeId);if(!V)return null;const B=v(z.targetX),G=T(z.targetY),H=B-V.x,q=G-V.y,Z=Math.sqrt(H*H+q*q),Y=i.nodeRadius+2,ie=Z>Y?B-H/Z*Y:B,K=Z>Y?G-q/Z*Y:G;return{origin:V,targetX:B,targetY:G,adjustedX2:ie,adjustedY2:K}}).filter(z=>z!==null);L.selectAll("line").data(P).enter().append("line").attr("class","wardley-trend").attr("x1",z=>z.origin.x).attr("y1",z=>z.origin.y).attr("x2",z=>z.adjustedX2).attr("y2",z=>z.adjustedY2).attr("stroke",a.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${e})`);const R=p.append("g").attr("class","wardley-nodes").selectAll("g").data(l.nodes).enter().append("g").attr("class",z=>["wardley-node",z.className?`wardley-node--${z.className}`:""].filter(Boolean).join(" "));R.filter(z=>z.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#666").attr("stroke",a.componentStroke).attr("stroke-width",1),R.filter(z=>z.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#ccc").attr("stroke",a.componentStroke).attr("stroke-width",1),R.filter(z=>z.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const I=R.filter(z=>z.sourceStrategy==="market");I.append("circle").attr("class","wardley-market-overlay").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius*2).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),R.filter(z=>!z.isPipelineParent&&z.sourceStrategy!=="market"&&z.className!=="anchor").append("circle").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y).attr("r",i.nodeRadius).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1);const $=i.nodeRadius*.7,O=i.nodeRadius*1.2;if(I.append("line").attr("class","wardley-market-line").attr("x1",z=>k.get(z.id).x).attr("y1",z=>k.get(z.id).y-O).attr("x2",z=>k.get(z.id).x-O*Math.cos(Math.PI/6)).attr("y2",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",z=>k.get(z.id).x-O*Math.cos(Math.PI/6)).attr("y1",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("x2",z=>k.get(z.id).x+O*Math.cos(Math.PI/6)).attr("y2",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("line").attr("class","wardley-market-line").attr("x1",z=>k.get(z.id).x+O*Math.cos(Math.PI/6)).attr("y1",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("x2",z=>k.get(z.id).x).attr("y2",z=>k.get(z.id).y-O).attr("stroke",a.componentStroke).attr("stroke-width",1),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>k.get(z.id).x).attr("cy",z=>k.get(z.id).y-O).attr("r",$).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>k.get(z.id).x-O*Math.cos(Math.PI/6)).attr("cy",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("r",$).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),I.append("circle").attr("class","wardley-market-dot").attr("cx",z=>k.get(z.id).x+O*Math.cos(Math.PI/6)).attr("cy",z=>k.get(z.id).y+O*Math.sin(Math.PI/6)).attr("r",$).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",2),R.filter(z=>z.isPipelineParent===!0).append("rect").attr("x",z=>k.get(z.id).x-s/2).attr("y",z=>k.get(z.id).y-s/2).attr("width",s).attr("height",s).attr("fill",a.componentFill).attr("stroke",a.componentStroke).attr("stroke-width",1),R.filter(z=>z.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",z=>{const V=k.get(z.id);let B=z.isPipelineParent?s/2+15:i.nodeRadius+15;return z.sourceStrategy&&(B+=i.nodeRadius+10),V.x+B}).attr("y1",z=>{const V=k.get(z.id),B=z.isPipelineParent?s:i.nodeRadius*2;return V.y-B/2}).attr("x2",z=>{const V=k.get(z.id);let B=z.isPipelineParent?s/2+15:i.nodeRadius+15;return z.sourceStrategy&&(B+=i.nodeRadius+10),V.x+B}).attr("y2",z=>{const V=k.get(z.id),B=z.isPipelineParent?s:i.nodeRadius*2;return V.y+B/2}).attr("stroke",a.componentStroke).attr("stroke-width",6),R.append("text").attr("x",z=>{const V=k.get(z.id);if(z.className==="anchor")return z.labelOffsetX!==void 0?V.x+z.labelOffsetX:V.x;let B=i.nodeLabelOffset;z.sourceStrategy&&z.labelOffsetX===void 0&&(B+=10);const G=z.labelOffsetX??B;return V.x+G}).attr("y",z=>{const V=k.get(z.id);if(z.className==="anchor")return z.labelOffsetY!==void 0?V.y+z.labelOffsetY:V.y-3;let B=-i.nodeLabelOffset;z.sourceStrategy&&z.labelOffsetY===void 0&&(B-=10);const G=z.labelOffsetY??B;return V.y+G}).attr("class","wardley-node-label").attr("fill",z=>z.className==="evolved"?a.evolutionStroke:z.className==="anchor"?"#000":a.componentLabelColor).attr("font-size",i.labelFontSize).attr("font-weight",z=>z.className==="anchor"?"bold":"normal").attr("text-anchor",z=>z.className==="anchor"?"middle":"start").attr("dominant-baseline",z=>z.className==="anchor"?"middle":"auto").text(z=>z.label),l.annotations.length>0){const z=p.append("g").attr("class","wardley-annotations");if(l.annotations.forEach(V=>{const B=V.coordinates.map(G=>({x:v(G.x),y:T(G.y)}));if(B.length>1)for(let G=0;G<B.length-1;G++)z.append("line").attr("class","wardley-annotation-line").attr("x1",B[G].x).attr("y1",B[G].y).attr("x2",B[G+1].x).attr("y2",B[G+1].y).attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");B.forEach(G=>{const H=z.append("g").attr("class","wardley-annotation");H.append("circle").attr("cx",G.x).attr("cy",G.y).attr("r",10).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5),H.append("text").attr("x",G.x).attr("y",G.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(V.number)})}),l.annotationsBox){let V=v(l.annotationsBox.x),B=T(l.annotationsBox.y);const G=10,H=16,q=11,Z=z.append("g").attr("class","wardley-annotations-box"),Y=[...l.annotations].filter(K=>K.text).sort((K,Q)=>K.number-Q.number),ie=[];if(Y.forEach((K,Q)=>{const te=Z.append("text").attr("x",V+G).attr("y",B+G+(Q+1)*H).attr("font-size",q).attr("fill",a.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${K.number}. ${K.text}`);ie.push(te)}),ie.length>0){let K=0,Q=0;ie.forEach(Be=>{const ce=Be.node(),oe=ce.getComputedTextLength();K=Math.max(K,oe);const be=ce.getBBox();Q=Math.max(Q,be.height)});const te=K+G*2+105,J=Y.length*H+G*2+Q/2,ge=i.padding,ee=h-i.padding-te,Re=i.padding,Ie=d-i.padding-J;V=Math.max(ge,Math.min(V,ee)),B=Math.max(Re,Math.min(B,Ie)),ie.forEach((Be,ce)=>{Be.attr("x",V+G).attr("y",B+G+(ce+1)*H)}),Z.insert("rect","text").attr("x",V).attr("y",B).attr("width",te).attr("height",J).attr("fill","white").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(l.notes.length>0){const z=p.append("g").attr("class","wardley-notes");l.notes.forEach(V=>{const B=v(V.x),G=T(V.y);z.append("text").attr("x",B).attr("y",G).attr("text-anchor","start").attr("font-size",11).attr("fill",a.axisTextColor).attr("font-weight","bold").text(V.text)})}if(l.accelerators.length>0){const z=p.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(V=>{const B=v(V.x),G=T(V.y),H=60,q=30,Z=20,Y=`
M ${B} ${G-q/2}
L ${B+H-Z} ${G-q/2}
L ${B+H-Z} ${G-q/2-8}
L ${B+H} ${G}
L ${B+H-Z} ${G+q/2+8}
L ${B+H-Z} ${G+q/2}
L ${B} ${G+q/2}
Z
`;z.append("path").attr("d",Y).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),z.append("text").attr("x",B+H/2).attr("y",G+q/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(V.name)})}if(l.deaccelerators.length>0){const z=p.append("g").attr("class","wardley-deaccelerators");l.deaccelerators.forEach(V=>{const B=v(V.x),G=T(V.y),H=60,q=30,Z=20,Y=`
M ${B+H} ${G-q/2}
L ${B+Z} ${G-q/2}
L ${B+Z} ${G-q/2-8}
L ${B} ${G}
L ${B+Z} ${G+q/2+8}
L ${B+Z} ${G+q/2}
L ${B+H} ${G+q/2}
Z
`;z.append("path").attr("d",Y).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),z.append("text").attr("x",B+H/2).attr("y",G+q/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(V.name)})}},"draw"),BOt={draw:POt},FOt=x(({wardley:t}={})=>{const e=Dh(),r=Xt(),n=ri(e,r.themeVariables),i=ri(n.wardley,t);return`
.wardley-background {
fill: ${i.backgroundColor};
}
.wardley-axes line, .wardley-axes path {
stroke: ${i.axisColor};
}
.wardley-axis-label {
fill: ${i.axisTextColor};
}
.wardley-stage-label {
fill: ${i.axisTextColor};
}
.wardley-grid line {
stroke: ${i.gridColor};
}
.wardley-node circle {
fill: ${i.componentFill};
stroke: ${i.componentStroke};
}
.wardley-node-label {
fill: ${i.componentLabelColor};
}
.wardley-link {
stroke: ${i.linkStroke};
}
.wardley-link--dashed {
stroke-dasharray: 4 4;
}
.wardley-link-label {
fill: ${i.axisTextColor};
}
.wardley-trend line {
stroke: ${i.evolutionStroke};
}
.wardley-annotation-line {
stroke: ${i.annotationStroke};
}
.wardley-annotation circle {
fill: ${i.annotationFill};
stroke: ${i.annotationStroke};
}
.wardley-annotation text {
fill: ${i.annotationTextColor};
}
.wardley-annotations-box rect {
fill: ${i.annotationFill};
stroke: ${i.annotationStroke};
}
.wardley-annotations-box text {
fill: ${i.annotationTextColor};
}
.wardley-pipeline-box {
stroke: ${i.componentStroke};
}
.wardley-notes text {
fill: ${i.axisTextColor};
}
`},"styles"),zOt={parser:CLe,db:NOt,renderer:BOt,styles:FOt};const VOt=Object.freeze(Object.defineProperty({__proto__:null,diagram:zOt},Symbol.toStringTag,{value:"Module"}));var VLe=x(()=>({domains:new Map,transitions:[]}),"createDefaultData"),KS=VLe(),GOt=x(()=>KS.domains,"getDomains"),WOt=x(()=>KS.transitions,"getTransitions"),HOt=x(t=>{if(t)for(const e of t){const r=e.domain,n=(e.items??[]).map(i=>({label:i.label}));KS.domains.set(r,{name:r,items:n})}},"setDomains"),qOt=x(t=>{t&&(KS.transitions=t.filter(e=>e.from===e.to?(le.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),UOt=x(()=>ri({...Vr.cynefin,...Xt().cynefin}),"getConfig"),YOt=x(()=>{On(),KS=VLe()},"clear"),s5={getDomains:GOt,getTransitions:WOt,setDomains:HOt,setTransitions:qOt,getConfig:UOt,clear:YOt,setAccTitle:Hn,getAccTitle:ni,setDiagramTitle:ti,getDiagramTitle:Yn,getAccDescription:ai,setAccDescription:ii},XOt=x(t=>{eo(t,s5),s5.setDomains(t.domains),s5.setTransitions(t.transitions)},"populate"),jOt={parse:x(async t=>{const e=await Al("cynefin",t);le.debug(e),XOt(e)},"parse")};function Pk(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}x(Pk,"seededRandom");function GLe(t){let e=0;for(let r=0;r<t.length;r++){const n=t.charCodeAt(r);e=(e<<5)-e+n,e|=0}return e}x(GLe,"hashString");function WLe(t,e){return typeof t=="number"&&Number.isFinite(t)&&t!==0?t:GLe(e)}x(WLe,"resolveSeed");function HLe(t,e,r,n){const i=t/2,a=n??t*.015,s=7,o=e/s,l=[];for(let h=0;h<=s;h++){const d=Pk(r+h*17)*a*2-a;l.push({x:i+d,y:h*o})}let u=`M${l[0].x},${l[0].y}`;for(let h=0;h<l.length-1;h++){const d=l[h],f=l[h+1],p=(d.y+f.y)/2,g=h%2===0?1:-1,m=a*1.5*g*Pk(r+h*31+7),y=d.x+m,v=p,T=f.x-m;u+=` C${y},${v} ${T},${p} ${f.x},${f.y}`}return u}x(HLe,"generateFoldPath");function qLe(t,e,r,n){const i=e/2,a=n??e*.015,s=7,o=t/s,l=[];for(let h=0;h<=s;h++){const d=Pk(r+h*23)*a*2-a;l.push({x:h*o,y:i+d})}let u=`M${l[0].x},${l[0].y}`;for(let h=0;h<l.length-1;h++){const d=l[h],f=l[h+1],p=(d.x+f.x)/2,g=h%2===0?1:-1,m=a*1.5*g*Pk(r+h*37+11),y=p,v=d.y+m,T=p,b=f.y-m;u+=` C${y},${v} ${T},${b} ${f.x},${f.y}`}return u}x(qLe,"generateHorizontalBoundary");function ULe(t,e){const r=t/2,n=e*.5,i=e,a=t*.03;return[`M${r},${n}`,`C${r+a},${n+(i-n)*.2}`,`${r-a*1.5},${n+(i-n)*.55}`,`${r+a*.5},${n+(i-n)*.75}`,`C${r-a},${n+(i-n)*.85}`,`${r+a*.3},${n+(i-n)*.95}`,`${r},${i}`].join(" ")}x(ULe,"generateCliffPath");function YLe(t,e,r,n){return[`M${t-r},${e}`,`A${r},${n} 0 1,1 ${t+r},${e}`,`A${r},${n} 0 1,1 ${t-r},${e}`,"Z"].join(" ")}x(YLe,"generateConfusionPath");var bae={complex:{model:"Probe → Sense → Respond",practice:"Emergent Practices"},complicated:{model:"Sense → Analyse → Respond",practice:"Good Practices"},clear:{model:"Sense → Categorise → Respond",practice:"Best Practices"},chaotic:{model:"Act → Sense → Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},KOt=x((t,e)=>{const r=t/2,n=e/2;return{complex:{cx:r/2,cy:n/2,x:0,y:0,w:r,h:n},complicated:{cx:r+r/2,cy:n/2,x:r,y:0,w:r,h:n},chaotic:{cx:r/2,cy:n+n/2,x:0,y:n,w:r,h:n},clear:{cx:r+r/2,cy:n+n/2,x:r,y:n,w:r,h:n},confusion:{cx:r,cy:n,x:r*.7,y:n*.7,w:r*.6,h:n*.6}}},"getDomainLayouts"),ZOt=x(()=>{const t=Dh(),e=Xt();return ri(t,e.themeVariables).cynefin},"getCynefinDomainColors"),QN=3,QOt=x((t,e,r,n)=>{const i=n.db,a=i.getDomains(),s=i.getTransitions(),o=i.getDiagramTitle(),l=i.getAccTitle(),u=i.getAccDescription(),h=i.getConfig(),d=ZOt();le.debug("Rendering Cynefin diagram");const f=h.width,p=h.height,g=h.padding,m=h.showDomainDescriptions,y=h.boundaryAmplitude,v=f+g*2,T=p+g*2,b={complex:d.complexBg,complicated:d.complicatedBg,clear:d.clearBg,chaotic:d.chaoticBg,confusion:d.confusionBg},w=xs(e);Ai(w,T,v,h.useMaxWidth??!0),w.attr("viewBox",`0 0 ${v} ${T}`),l&&w.append("title").text(l),u&&w.append("desc").text(u);const C=w.append("g").attr("transform",`translate(${g}, ${g})`),S=KOt(f,p),k=WLe(h.seed,e),E=C.append("g").attr("class","cynefin-backgrounds"),_=["complex","complicated","chaotic","clear"];for(const N of _){const F=S[N];E.append("rect").attr("class","cynefinDomain").attr("x",F.x).attr("y",F.y).attr("width",F.w).attr("height",F.h).attr("fill",b[N]).attr("fill-opacity",.4).attr("stroke","none")}const M=C.append("g").attr("class","cynefin-boundaries");M.append("path").attr("class","cynefinBoundary").attr("d",HLe(f,p,k,y)).attr("fill","none"),M.append("path").attr("class","cynefinBoundary").attr("d",qLe(f,p,k+100,y)).attr("fill","none"),M.append("path").attr("class","cynefinCliff").attr("d",ULe(f,p)).attr("fill","none");const L=f*.15,P=p*.15;C.append("path").attr("class","cynefinConfusion").attr("d",YLe(f/2,p/2,L,P)).attr("fill",b.confusion).attr("fill-opacity",.5);const D=C.append("g").attr("class","cynefin-labels");for(const N of _){const F=S[N];D.append("text").attr("class","cynefinDomainLabel").attr("x",F.cx).attr("y",m?F.cy-30:F.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(N.charAt(0).toUpperCase()+N.slice(1))}if(D.append("text").attr("class","cynefinDomainLabel").attr("x",f/2).attr("y",m?p/2-10:p/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),m){const N=C.append("g").attr("class","cynefin-subtitles");for(const F of _){const z=S[F],V=bae[F];N.append("text").attr("class","cynefinSubtitle").attr("x",z.cx).attr("y",z.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(V.model),N.append("text").attr("class","cynefinSubtitle").attr("x",z.cx).attr("y",z.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(V.practice)}N.append("text").attr("class","cynefinSubtitle").attr("x",f/2).attr("y",p/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(bae.confusion.practice)}const R=C.append("g").attr("class","cynefin-items"),I=26,$=10,O=["complex","complicated","chaotic","clear","confusion"];for(const N of O){const F=a.get(N);if(!F||F.items.length===0)continue;const z=S[N],V=N==="confusion";let B=F.items,G=0;V&&F.items.length>QN&&(G=F.items.length-QN,B=F.items.slice(0,QN));let H;if(V){const q=m?22:14;H=z.cy+q}else H=z.cy+(m?25:15);if([...B].forEach((q,Z)=>{const Y=H+Z*(I+4),ie=R.append("g"),K=ie.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",I/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(q.label);let Q=q.label.length*7;const te=K.node();if(te&&typeof te.getBBox=="function"){const ee=te.getBBox();ee.width>0&&(Q=ee.width)}const J=Q+$*2,ge=z.cx-J/2;ie.attr("transform",`translate(${ge}, ${Y})`),ie.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",J).attr("height",I).attr("rx",4).attr("ry",4).attr("fill",b[N]).attr("fill-opacity",.95),K.attr("x",J/2).attr("y",I/2)}),G>0){const q=H+B.length*(I+4),Z=`+${G} more`,Y=R.append("g"),ie=Y.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",I/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(Z);let K=Z.length*7;const Q=ie.node();if(Q&&typeof Q.getBBox=="function"){const ge=Q.getBBox();ge.width>0&&(K=ge.width)}const te=K+$*2,J=z.cx-te/2;Y.attr("transform",`translate(${J}, ${q})`),Y.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",te).attr("height",I).attr("rx",4).attr("ry",4).attr("fill",b[N]).attr("fill-opacity",.6),ie.attr("x",te/2).attr("y",I/2)}}if(s.length>0){const N=w.select("defs").empty()?w.append("defs"):w.select("defs"),F=`cynefin-arrow-${e}`;N.append("marker").attr("id",F).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const z=C.append("g").attr("class","cynefin-arrows");s.forEach(V=>{const B=S[V.from],G=S[V.to];if(!B||!G)return;if(V.from===V.to){le.warn(`Cynefin renderer: skipping self-loop on domain "${V.from}"`);return}const H=B.cx,q=B.cy,Z=G.cx,Y=G.cy,ie=(H+Z)/2,K=(q+Y)/2,Q=Z-H,te=Y-q,J=Math.sqrt(Q*Q+te*te),ge=J*.15,ee=-te/J,Re=Q/J,Ie=ie+ee*ge,Be=K+Re*ge;z.append("path").attr("class","cynefinArrowLine").attr("d",`M${H},${q} Q${Ie},${Be} ${Z},${Y}`).attr("fill","none").attr("marker-end",`url(#${F})`),V.label&&z.append("text").attr("class","cynefinArrowLabel").attr("x",Ie).attr("y",Be-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(V.label)})}o&&C.append("text").attr("class","cynefinTitle").attr("x",f/2).attr("y",-g/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(o)},"draw"),JOt={draw:QOt},e$t=x(()=>{const t=Dh(),e=Xt();return ri(t,e.themeVariables).cynefin},"getCynefinTheme"),t$t=x(()=>{const t=e$t();return`
.cynefinDomain {
stroke: none;
}
.cynefinDomainLabel {
font-size: ${t.domainFontSize}px;
font-weight: bold;
fill: ${t.labelColor};
}
.cynefinSubtitle {
font-size: ${t.itemFontSize-1}px;
fill: ${t.textColor};
font-style: italic;
}
.cynefinItem {
fill-opacity: 0.95;
stroke: ${t.boundaryColor};
stroke-width: 1;
}
.cynefinItemText {
font-size: ${t.itemFontSize}px;
fill: ${t.textColor};
}
.cynefinItemOverflow {
fill-opacity: 0.6;
stroke: ${t.boundaryColor};
stroke-width: 1;
stroke-dasharray: 3 2;
}
.cynefinBoundary {
stroke: ${t.boundaryColor};
stroke-width: ${t.boundaryWidth};
stroke-dasharray: 6 3;
}
.cynefinCliff {
stroke: ${t.cliffColor};
stroke-width: ${t.cliffWidth};
}
.cynefinConfusion {
stroke: ${t.boundaryColor};
stroke-width: 1.5;
stroke-dasharray: 4 2;
}
.cynefinArrowLine {
stroke: ${t.arrowColor};
stroke-width: ${t.arrowWidth};
fill: none;
}
.cynefinArrowHead {
fill: ${t.arrowColor};
stroke: none;
}
.cynefinArrowLabel {
font-size: ${t.itemFontSize-1}px;
fill: ${t.textColor};
}
.cynefinTitle {
font-size: ${t.domainFontSize+2}px;
font-weight: bold;
fill: ${t.labelColor};
}
`},"styles"),r$t=t$t,n$t={parser:jOt,db:s5,renderer:JOt,styles:r$t};const i$t=Object.freeze(Object.defineProperty({__proto__:null,diagram:n$t},Symbol.toStringTag,{value:"Module"}));var sY="",oY="",lY="",cY=[],M6=new Map,Yd=x(t=>Wr(t,Fe()),"sanitizeText"),zm=x(t=>{switch(t.type){case"terminal":return{...t,value:Yd(t.value)};case"nonterminal":return{...t,name:Yd(t.name)};case"sequence":return{...t,elements:t.elements.map(zm)};case"choice":return{...t,alternatives:t.alternatives.map(zm)};case"optional":return{...t,element:zm(t.element)};case"repetition":return{...t,element:zm(t.element),separator:t.separator?zm(t.separator):void 0};case"special":return{...t,text:Yd(t.text)}}},"sanitizeAstNode"),a$t=x(()=>{sY="",oY="",lY="",cY.length=0,M6.clear(),On(),le.debug("[Railroad] Database cleared")},"clear"),XLe=x(t=>{sY=Yd(t),le.debug("[Railroad] Title set:",t)},"setTitle"),jLe=x(()=>sY,"getTitle"),s$t=x(t=>{const e={...t,name:Yd(t.name),definition:zm(t.definition),comment:t.comment?Yd(t.comment):void 0};le.debug("[Railroad] Adding rule:",e.name),M6.has(e.name)&&le.warn(`[Railroad] Rule '${e.name}' is already defined. Overwriting.`),cY.push(e),M6.set(e.name,e)},"addRule"),o$t=x(()=>cY,"getRules"),l$t=x(t=>M6.get(t),"getRule"),c$t=x(t=>{oY=Yd(t).replace(/^\s+/g,""),le.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),u$t=x(()=>oY,"getAccTitle"),h$t=x(t=>{lY=Yd(t).replace(/\n\s+/g,`
`),le.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),d$t=x(()=>lY,"getAccDescription"),f$t=XLe,p$t=jLe,ei={clear:a$t,setTitle:XLe,getTitle:jLe,addRule:s$t,getRules:o$t,getRule:l$t,setAccTitle:c$t,getAccTitle:u$t,setAccDescription:h$t,getAccDescription:d$t,setDiagramTitle:f$t,getDiagramTitle:p$t},$a={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},g$t=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,m$t=/^[\w "',.-]+$/,y$t=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),KLe=x(t=>t?Object.keys(t).every(e=>e==="railroad"||y$t.has(e)):!1,"isRailroadStyleOptions"),v$t=x(t=>t?"railroad"in t&&t.railroad?t.railroad:KLe(t)?t:{}:{},"extractRailroadOverrides"),b$t=x(t=>{if(!t||KLe(t))return{};const{railroad:e,svgId:r,theme:n,look:i,...a}=t;return a},"extractThemeOverrides"),Ln=x((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return g$t.test(r)?r:e},"sanitizeColorValue"),ZLe=x((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return m$t.test(r)?r:e},"sanitizeFontFamilyValue"),ap=x((t,e)=>{const r=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(r)&&r>=0?r:e},"sanitizeNumberValue"),x$t=x(t=>{const e=typeof t=="number"?t:typeof t=="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(e)&&e>0?e:void 0},"parseThemeFontSize"),T$t=x(t=>{const e=ZLe(t.fontFamily,$a.fontFamily),r=x$t(t.fontSize)??$a.fontSize;return{...$a,fontFamily:e,fontSize:r,terminalFill:Ln(t.secondBkg??t.secondaryColor,$a.terminalFill),terminalStroke:Ln(t.secondaryBorderColor??t.lineColor,$a.terminalStroke),terminalTextColor:Ln(t.secondaryTextColor??t.textColor,$a.terminalTextColor),nonTerminalFill:Ln(t.mainBkg??t.background,$a.nonTerminalFill),nonTerminalStroke:Ln(t.primaryBorderColor??t.lineColor,$a.nonTerminalStroke),nonTerminalTextColor:Ln(t.primaryTextColor??t.textColor,$a.nonTerminalTextColor),lineColor:Ln(t.lineColor,$a.lineColor),markerFill:Ln(t.lineColor,$a.markerFill),commentFill:Ln(t.labelBackground??t.tertiaryColor,$a.commentFill),commentStroke:Ln(t.tertiaryBorderColor??t.lineColor,$a.commentStroke),commentTextColor:Ln(t.tertiaryTextColor??t.textColor,$a.commentTextColor),specialFill:Ln(t.tertiaryColor??t.secondaryColor,$a.specialFill),specialStroke:Ln(t.tertiaryBorderColor??t.secondaryBorderColor,$a.specialStroke),ruleNameColor:Ln(t.titleColor??t.textColor,$a.ruleNameColor)}},"buildThemeDefaults"),uY=x(t=>{const e=Xt(),r={...Dh(),...e.themeVariables??{},...b$t(t)},n=T$t(r),i={...e.railroad??{},...v$t(t)};return{compactMode:i.compactMode??n.compactMode,padding:ap(i.padding,n.padding),verticalSeparation:ap(i.verticalSeparation,n.verticalSeparation),horizontalSeparation:ap(i.horizontalSeparation,n.horizontalSeparation),arcRadius:ap(i.arcRadius,n.arcRadius),fontSize:ap(i.fontSize,n.fontSize),fontFamily:ZLe(i.fontFamily,n.fontFamily),terminalFill:Ln(i.terminalFill,n.terminalFill),terminalStroke:Ln(i.terminalStroke,n.terminalStroke),terminalTextColor:Ln(i.terminalTextColor,n.terminalTextColor),nonTerminalFill:Ln(i.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:Ln(i.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:Ln(i.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:Ln(i.lineColor,n.lineColor),strokeWidth:ap(i.strokeWidth,n.strokeWidth),markerFill:Ln(i.markerFill,n.markerFill),commentFill:Ln(i.commentFill,n.commentFill),commentStroke:Ln(i.commentStroke,n.commentStroke),commentTextColor:Ln(i.commentTextColor,n.commentTextColor),specialFill:Ln(i.specialFill,n.specialFill),specialStroke:Ln(i.specialStroke,n.specialStroke),ruleNameColor:Ln(i.ruleNameColor,n.ruleNameColor),showMarkers:i.showMarkers??n.showMarkers,markerRadius:ap(i.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),U7=x(t=>{const{fontFamily:e,fontSize:r,terminalFill:n,terminalStroke:i,terminalTextColor:a,nonTerminalFill:s,nonTerminalStroke:o,nonTerminalTextColor:l,lineColor:u,strokeWidth:h,markerFill:d,commentFill:f,commentStroke:p,commentTextColor:g,specialFill:m,specialStroke:y,ruleNameColor:v}=uY(t);return`
.railroad-diagram {
font-family: ${e};
font-size: ${r}px;
}
.railroad-terminal rect {
fill: ${n};
stroke: ${i};
stroke-width: ${h}px;
}
.railroad-terminal text {
fill: ${a};
font-family: ${e};
font-size: ${r}px;
text-anchor: middle;
dominant-baseline: middle;
}
.railroad-nonterminal rect {
fill: ${s};
stroke: ${o};
stroke-width: ${h}px;
}
.railroad-nonterminal text {
fill: ${l};
font-family: ${e};
font-size: ${r}px;
text-anchor: middle;
dominant-baseline: middle;
}
.railroad-line {
stroke: ${u};
stroke-width: ${h}px;
fill: none;
}
.railroad-start circle,
.railroad-end circle {
fill: ${d};
}
.railroad-comment ellipse {
fill: ${f};
stroke: ${p};
stroke-width: ${h}px;
}
.railroad-comment text {
fill: ${g};
font-style: italic;
font-family: ${e};
font-size: ${r}px;
text-anchor: middle;
dominant-baseline: middle;
}
.railroad-special rect {
fill: ${m};
stroke: ${y};
stroke-width: ${h}px;
stroke-dasharray: 5,3;
}
.railroad-special text {
fill: ${l};
font-family: ${e};
font-size: ${r}px;
text-anchor: middle;
dominant-baseline: middle;
}
.railroad-rule-name {
font-weight: bold;
fill: ${v};
font-family: ${e};
font-size: ${r}px;
}
.railroad-group {
/* Grouping container, no specific styles */
}
`},"getStyles"),db,tl=(db=class{constructor(){this.d=""}moveTo(e,r){return this.d+=`M ${e} ${r} `,this}lineTo(e,r){return this.d+=`L ${e} ${r} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,r,n,i,a,s,o){return this.d+=`A ${e} ${r} ${n} ${i?1:0} ${a?1:0} ${s} ${o} `,this}build(){return this.d.trim()}},x(db,"PathBuilder"),db),fb,w$t=(fb=class{constructor(e,r=uY()){this.textCache=new Map,this.svg=e,this.config=r}measureText(e){if(this.textCache.has(e))return this.textCache.get(e);const r=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e),n=r.node().getBBox(),i={width:n.width,height:n.height};return r.remove(),this.textCache.set(e,i),i}renderTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-terminal");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a).attr("rx",10).attr("ry",10),s.append("text").attr("x",i/2).attr("y",a/2).text(r),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderNonTerminal(e,r){const n=this.measureText(r),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-nonterminal");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a),s.append("text").attr("x",i/2).attr("y",a/2).text(r),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderSequence(e,r){const n=r.map(u=>this.renderExpression(e,u));let i=0,a=0,s=0;for(const u of n)i+=u.dimensions.width,a=Math.max(a,u.dimensions.up),s=Math.max(s,u.dimensions.down);i+=(n.length-1)*this.config.horizontalSeparation;const o=e.append("g").attr("class","railroad-sequence");let l=0;for(let u=0;u<n.length;u++){const h=n[u],d=a-h.dimensions.up;if(o.node().appendChild(h.element).setAttribute("transform",`translate(${l}, ${d})`),u<n.length-1){const p=l+h.dimensions.width,g=p+this.config.horizontalSeparation,m=a;o.append("path").attr("class","railroad-line").attr("d",new tl().moveTo(p,m).lineTo(g,m).build())}l+=h.dimensions.width+this.config.horizontalSeparation}return{element:o.node(),dimensions:{width:i,height:a+s,up:a,down:s}}}renderChoice(e,r){const n=r.map(f=>this.renderExpression(e,f));let i=0,a=0;for(const f of n)i=Math.max(i,f.dimensions.width),a+=f.dimensions.height;a+=(n.length-1)*this.config.verticalSeparation;const s=this.config.arcRadius,o=s*4,l=i+o,u=e.append("g").attr("class","railroad-choice");let h=0;const d=a/2;for(const f of n){const p=h,g=p+f.dimensions.up,m=s*2+(i-f.dimensions.width)/2;u.node().appendChild(f.element).setAttribute("transform",`translate(${m}, ${p})`);const v=new tl,T=g>d;g===d?v.moveTo(0,d).lineTo(m,g):v.moveTo(0,d).arcTo(s,s,0,!1,T,s,d+(T?s:-s)).lineTo(s,g-(T?s:-s)).arcTo(s,s,0,!1,!T,s*2,g).lineTo(m,g),u.append("path").attr("class","railroad-line").attr("d",v.build());const b=new tl,w=m+f.dimensions.width,C=l-s*2;g===d?b.moveTo(w,g).lineTo(l,d):b.moveTo(w,g).lineTo(C,g).arcTo(s,s,0,!1,!T,l-s,g+(T?-s:s)).lineTo(l-s,d+(T?s:-s)).arcTo(s,s,0,!1,T,l,d),u.append("path").attr("class","railroad-line").attr("d",b.build()),h+=f.dimensions.height+this.config.verticalSeparation}return{element:u.node(),dimensions:{width:l,height:a,up:d,down:a-d}}}renderOptional(e,r){const n=this.renderExpression(e,r),i=this.config.arcRadius,a=i*2,s=n.dimensions.width+i*4,o=n.dimensions.height+a,l=e.append("g").attr("class","railroad-optional"),u=i*2,h=a;l.node().appendChild(n.element).setAttribute("transform",`translate(${u}, ${h})`);const f=h+n.dimensions.up,p=new tl().moveTo(0,f).lineTo(i*2,f);l.append("path").attr("class","railroad-line").attr("d",p.build());const g=new tl().moveTo(u+n.dimensions.width,f).lineTo(s,f);l.append("path").attr("class","railroad-line").attr("d",g.build());const m=new tl().moveTo(0,f).arcTo(i,i,0,!1,!1,i,f-i).lineTo(i,i).arcTo(i,i,0,!1,!0,i*2,0).lineTo(s-i*2,0).arcTo(i,i,0,!1,!0,s-i,i).lineTo(s-i,f-i).arcTo(i,i,0,!1,!1,s,f);return l.append("path").attr("class","railroad-line").attr("d",m.build()),{element:l.node(),dimensions:{width:s,height:o,up:f,down:o-f}}}renderRepetition(e,r,n){const i=this.renderExpression(e,r),a=this.config.arcRadius,s=a*2,o=i.dimensions.width+a*4,l=n===0,u=i.dimensions.height+s+(l?s:0),h=e.append("g").attr("class","railroad-repetition"),d=a*2,f=l?s:0;h.node().appendChild(i.element).setAttribute("transform",`translate(${d}, ${f})`);const g=f+i.dimensions.up;h.append("path").attr("class","railroad-line").attr("d",new tl().moveTo(0,g).lineTo(a*2,g).build()),h.append("path").attr("class","railroad-line").attr("d",new tl().moveTo(d+i.dimensions.width,g).lineTo(o,g).build());const m=f+i.dimensions.height+a,y=new tl().moveTo(d+i.dimensions.width,g).arcTo(a,a,0,!1,!0,d+i.dimensions.width+a,g+a).lineTo(d+i.dimensions.width+a,m).arcTo(a,a,0,!1,!0,d+i.dimensions.width,m+a).lineTo(a*2,m+a).arcTo(a,a,0,!1,!0,a,m).lineTo(a,g+a).arcTo(a,a,0,!1,!0,a*2,g);if(h.append("path").attr("class","railroad-line").attr("d",y.build()),l){const v=new tl().moveTo(0,g).arcTo(a,a,0,!1,!1,a,g-a).lineTo(a,a).arcTo(a,a,0,!1,!0,a*2,0).lineTo(o-a*2,0).arcTo(a,a,0,!1,!0,o-a,a).lineTo(o-a,g-a).arcTo(a,a,0,!1,!1,o,g);h.append("path").attr("class","railroad-line").attr("d",v.build())}return{element:h.node(),dimensions:{width:o,height:u,up:g,down:u-g}}}renderSpecial(e,r){const n=this.measureText("? "+r+" ?"),i=n.width+this.config.padding*2,a=n.height+this.config.padding*2,s=e.append("g").attr("class","railroad-special");return s.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a),s.append("text").attr("x",i/2).attr("y",a/2).text("? "+r+" ?"),{element:s.node(),dimensions:{width:i,height:a,up:a/2,down:a/2}}}renderExpression(e,r){switch(r.type){case"terminal":return this.renderTerminal(e,r.value);case"nonterminal":return this.renderNonTerminal(e,r.name);case"sequence":return this.renderSequence(e,r.elements);case"choice":return this.renderChoice(e,r.alternatives);case"optional":return this.renderOptional(e,r.element);case"repetition":return this.renderRepetition(e,r.element,r.min);case"special":return this.renderSpecial(e,r.text);default:throw new Error(`Unknown node type: ${r.type}`)}}renderRule(e,r){const n=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${r})`),i=e.name+" =",a=this.measureText(i).width+20,s=a+20,o=n.append("g"),l=this.renderExpression(o,e.definition),u=Math.max(20,l.dimensions.up),h=u-l.dimensions.up;return o.attr("transform",`translate(${s}, ${h})`),n.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",u).text(i),n.append("g").attr("class","railroad-start").append("circle").attr("cx",a).attr("cy",u).attr("r",this.config.markerRadius),n.append("g").attr("class","railroad-end").append("circle").attr("cx",s+l.dimensions.width+10).attr("cy",u).attr("r",this.config.markerRadius),n.append("path").attr("class","railroad-line").attr("d",new tl().moveTo(a+this.config.markerRadius,u).lineTo(s,u).build()),n.append("path").attr("class","railroad-line").attr("d",new tl().moveTo(s+l.dimensions.width,u).lineTo(s+l.dimensions.width+10-this.config.markerRadius,u).build()),{height:Math.max(40,h+l.dimensions.height+this.config.padding*2),width:s+l.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let r=this.config.padding,n=0;for(const i of e){const a=this.renderRule(i,r);r+=a.height+this.config.verticalSeparation,n=Math.max(n,a.width)}return{width:n+this.config.padding*2,height:r+this.config.padding}}},x(fb,"RailroadRenderer"),fb),xae=x((t,e,r)=>{Ai(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),C$t=x((t,e,r)=>{le.debug(`[Railroad] Rendering diagram
`+t);try{const n=xs(e);n.attr("class","railroad-diagram");const i=Xt().railroad,a=(i==null?void 0:i.useMaxWidth)??!0,s=ei.getRules();if(le.debug(`[Railroad] Rendering ${s.length} rules`),s.length===0){le.warn("[Railroad] No rules to render"),xae(n,{height:100,width:200},a);return}const l=new w$t(n,uY()).renderDiagram(s);xae(n,l,a),le.debug("[Railroad] Render complete")}catch(n){throw le.error("[Railroad] Render error:",n),n}},"draw"),Y7={draw:C$t},k$t=oU().Railroad.parser.LangiumParser,Vm=x(t=>{switch(t.$type){case"RailroadTerminalExpr":return{type:"terminal",value:t.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:t.name};case"RailroadSpecialExpr":return{type:"special",text:t.text};case"RailroadSequenceExpr":{const e=t.elements.map(Vm);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map(Vm);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:Vm(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:Vm(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:Vm(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),S$t=x(t=>({name:t.name,definition:Vm(t.definition)}),"transformRule"),E$t=x(t=>{eo(t,ei),t.title&&ei.setTitle(t.title),t.rules.map(e=>ei.addRule(S$t(e)))},"populateDb"),A$t={parse:x(t=>{ei.clear(),le.debug("[Railroad Parser] Starting Langium parse");const e=k$t.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new US(e);const r=e.value;le.debug("[Railroad Parser] Parsed rules:",r.rules.length),E$t(r),le.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:ei}},_$t={parser:A$t,db:ei,renderer:Y7,styles:U7};const R$t=Object.freeze(Object.defineProperty({__proto__:null,diagram:_$t},Symbol.toStringTag,{value:"Module"}));var L$t=lU().RailroadEbnf.parser.LangiumParser,o5=x(t=>{const e=t.alternatives.map(M$t);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),M$t=x(t=>{const e=t.elements.map(N$t);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),QLe=x(t=>{switch(t.$type){case"EbnfTerminal":return{type:"terminal",value:t.value};case"EbnfNonTerminal":return{type:"nonterminal",name:t.name};case"EbnfSpecial":return{type:"special",text:t.text};case"EbnfGroup":return o5(t.element);case"EbnfOptional":return{type:"optional",element:o5(t.element)};case"EbnfRepetition":return{type:"repetition",element:o5(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),I$t=x((t,e)=>{switch(e.$type){case"EbnfOptionalPostfix":return{type:"optional",element:t};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:t,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:t,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[t,{type:"terminal",value:"-"},QLe(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),N$t=x(t=>t.postfixes.reduce((e,r)=>I$t(e,r),QLe(t.base)),"transformTerm"),D$t=x(t=>({name:t.name,definition:o5(t.definition)}),"transformRule"),O$t=x(t=>{eo(t,ei),t.title&&ei.setTitle(t.title),t.rules.map(e=>ei.addRule(D$t(e)))},"populateDb"),$$t={parse:x(t=>{ei.clear(),le.debug("[EBNF Parser] Starting Langium parse");const e=L$t.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new US(e);const r=e.value;le.debug("[EBNF Parser] Parsed rules:",r.rules.length),O$t(r),le.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:ei}},P$t={parser:$$t,db:ei,renderer:Y7,styles:U7};const B$t=Object.freeze(Object.defineProperty({__proto__:null,diagram:P$t},Symbol.toStringTag,{value:"Module"}));var F$t=cU().RailroadAbnf.parser.LangiumParser,TF=x(t=>{const e=t.alternatives.map(z$t);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),z$t=x(t=>{const e=t.elements.map(G$t);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),V$t=x(t=>{if(t.includes("*")){const[r,n]=t.split("*"),i=r?parseInt(r,10):0,a=n?parseInt(n,10):1/0;return{min:i,max:a}}const e=parseInt(t,10);return{min:e,max:e}},"parseRepeat"),G$t=x(t=>{const e=W$t(t.primary);if(!t.repeat)return e;const{min:r,max:n}=V$t(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),W$t=x(t=>{switch(t.$type){case"AbnfStringLiteral":return{type:"terminal",value:t.value};case"AbnfNumVal":return{type:"terminal",value:t.value};case"AbnfRuleName":return{type:"nonterminal",name:t.name};case"AbnfGroup":return TF(t.element);case"AbnfOptionalGroup":return{type:"optional",element:TF(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),H$t=x(t=>({name:t.name,definition:TF(t.definition)}),"transformRule"),q$t=x(t=>{eo(t,ei),t.title&&ei.setTitle(t.title),t.rules.map(e=>ei.addRule(H$t(e)))},"populateDb"),U$t={parse:x(t=>{ei.clear(),le.debug("[ABNF Parser] Starting Langium parse");const e=F$t.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new US(e);const r=e.value;le.debug("[ABNF Parser] Parsed rules:",r.rules.length),q$t(r),le.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:ei}},Y$t={parser:U$t,db:ei,renderer:Y7,styles:U7};const X$t=Object.freeze(Object.defineProperty({__proto__:null,diagram:Y$t},Symbol.toStringTag,{value:"Module"}));var j$t=uU().RailroadPeg.parser.LangiumParser,JLe=x(t=>{const e=t.alternatives.map(K$t);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),K$t=x(t=>{const e=t.elements.map(Z$t);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),Z$t=x(t=>{const e=Q$t(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${Tae(e)}`:`!${Tae(e)}`}:e},"transformPrefix"),Tae=x(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),Q$t=x(t=>{const e=J$t(t.primary);if(!t.operator)return e;switch(t.operator){case"?":return{type:"optional",element:e};case"*":return{type:"repetition",element:e,min:0,max:1/0};case"+":return{type:"repetition",element:e,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${t.operator}`)}},"transformSuffix"),J$t=x(t=>{switch(t.$type){case"PegLiteral":return{type:"terminal",value:t.value};case"PegIdentifier":return{type:"nonterminal",name:t.name};case"PegGroup":return JLe(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),ePt=x(t=>({name:t.name,definition:JLe(t.definition)}),"transformRule"),tPt=x(t=>{eo(t,ei),t.title&&ei.setTitle(t.title),t.rules.map(e=>ei.addRule(ePt(e)))},"populateDb"),rPt={parse:x(t=>{ei.clear(),le.debug("[PEG Parser] Starting Langium parse");const e=j$t.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new US(e);const r=e.value;le.debug("[PEG Parser] Parsed rules:",r.rules.length),tPt(r),le.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:ei}},nPt={parser:rPt,db:ei,renderer:Y7,styles:U7};const iPt=Object.freeze(Object.defineProperty({__proto__:null,diagram:nPt},Symbol.toStringTag,{value:"Module"}));var aPt=1;function hY(){if(!(typeof globalThis>"u"))return globalThis}x(hY,"getCaptureGlobal");function e7e(){var t;return!!((t=hY())!=null&&t.mermaidCaptureSizes)}x(e7e,"shouldCaptureSizes");function t7e(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}x(t7e,"capturedFromLocation");function r7e(t,e){const r=hY();if(!r)return;const n=e.node(),i=(n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n,a=(i==null?void 0:i.id)??"(unknown)";r.mermaidCapturedSizes??(r.mermaidCapturedSizes=[]);const s={svgId:a,sizes:t};r.mermaidCapturedSizes.push(s),r.mermaidLastCapturedSizes=s}x(r7e,"emitCapturedSizes");function n7e(t,e){const r=[];for(const n of e.nodes)n.isGroup||r.push({id:n.id,width:n.width??0,height:n.height??0});r.length!==0&&r7e({metadata:{captureVersion:aPt,capturedAt:new Date().toISOString(),capturedFrom:t7e()},nodes:r},t)}x(n7e,"captureNodeSizes");const sPt=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:n7e,shouldCaptureSizes:e7e},Symbol.toStringTag,{value:"Module"})),oPt=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:yAe,createInfoServices:vAe},Symbol.toStringTag,{value:"Module"})),lPt=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:bAe,createPacketServices:xAe},Symbol.toStringTag,{value:"Module"})),cPt=Object.freeze(Object.defineProperty({__proto__:null,PieModule:TAe,createPieServices:wAe},Symbol.toStringTag,{value:"Module"})),uPt=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:CAe,createTreeViewServices:kAe},Symbol.toStringTag,{value:"Module"})),hPt=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:SAe,createArchitectureServices:EAe},Symbol.toStringTag,{value:"Module"})),dPt=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:gAe,createGitGraphServices:mAe},Symbol.toStringTag,{value:"Module"})),fPt=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:_Ae,createEventModelingServices:RAe},Symbol.toStringTag,{value:"Module"})),pPt=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:rAe,createRadarServices:nAe},Symbol.toStringTag,{value:"Module"})),gPt=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:iAe,createRailroadServices:oU},Symbol.toStringTag,{value:"Module"})),mPt=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:aAe,createRailroadEbnfServices:lU},Symbol.toStringTag,{value:"Module"})),yPt=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:sAe,createRailroadAbnfServices:cU},Symbol.toStringTag,{value:"Module"})),vPt=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:oAe,createRailroadPegServices:uU},Symbol.toStringTag,{value:"Module"})),bPt=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:cAe,createTreemapServices:uAe},Symbol.toStringTag,{value:"Module"})),xPt=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:hAe,createWardleyServices:dAe},Symbol.toStringTag,{value:"Module"})),TPt=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:fAe,createCynefinServices:pAe},Symbol.toStringTag,{value:"Module"}));</script>
<style rel="stylesheet" crossorigin>:root{color-scheme:light dark;--accent: #19ac73;--text: #0f172a;--muted: #64748b;--border: #f1f5f9;--toolbar-bg: #ffffff;--toolbar-fg: #64748b;--toolbar-active-bg: #ecfdf5;--toolbar-active-border: #bbf7d0;--toolbar-active-fg: #047857;--code-bg: color-mix(in srgb, CanvasText 7%, transparent);--placeholder: #94a3b8}html[data-theme=dark]{--text: #f8fafc;--muted: #cbd5e1;--border: #334155;--toolbar-bg: #0f172a;--toolbar-fg: #cbd5e1;--toolbar-active-bg: #14532d;--toolbar-active-border: #166534;--toolbar-active-fg: #86efac;--placeholder: #64748b}html,body{width:100%;max-width:100%;min-width:0;height:100%;margin:0;padding:0;overflow:hidden;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;color:var(--text);-webkit-text-size-adjust:100%}html[data-theme=dark],html[data-theme=dark] body{background:#0f172a}#shell{display:flex;flex-direction:column;width:100%;max-width:100%;min-width:0;height:100%;min-height:100%;overflow:hidden;background:inherit}#toolbar{display:none;flex:0 0 auto;flex-direction:row;align-items:center;gap:4px;width:100%;max-width:100%;min-height:38px;box-sizing:border-box;padding:6px 12px;border-bottom:1px solid var(--border);background:var(--toolbar-bg);overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:none;position:relative;z-index:5}#toolbar::-webkit-scrollbar{display:none}#toolbar.editor-mode{display:flex}#toolbar button{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;width:36px;min-height:32px;margin:0;padding:0;border:1px solid transparent;border-radius:999px;background:transparent;font-size:14px;font-weight:600;line-height:1;color:var(--toolbar-fg)}#toolbar button:active,#toolbar button.is-active{border-color:var(--toolbar-active-border);background:var(--toolbar-active-bg);color:var(--toolbar-active-fg)}#editor{flex:1 1 auto;min-height:0;min-width:0;width:100%;max-width:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.edgeever-prose,.tiptap,.ProseMirror{outline:none;box-sizing:border-box;width:100%;max-width:100%;min-width:0;min-height:100%;padding:12px 16px 48px;line-height:1.55;word-break:break-word;caret-color:#0f766e}.edgeever-prose p.is-editor-empty:first-child:before,.ProseMirror p.is-editor-empty:first-child:before{color:var(--placeholder);content:attr(data-placeholder);float:left;height:0;pointer-events:none}.edgeever-prose img,.ProseMirror img{max-width:100%;height:auto;border-radius:8px;display:block;margin:12px 0}.edgeever-image-node{position:relative;display:block;box-sizing:border-box;width:var(--ee-image-width, 100%);max-width:100%;margin:14px auto;line-height:0;-webkit-user-select:none;user-select:none;background:transparent}.edgeever-image-node.has-width{max-width:min(100%,var(--ee-image-width, 100%))}.edgeever-image-node.is-loading,.edgeever-image-node.is-failed{min-height:120px;overflow:hidden;border-radius:10px;background:#f1f5f9}.edgeever-image-loading{display:flex;min-height:120px;align-items:center;justify-content:center;gap:10px;padding:16px;color:#64748b;font-size:13px;font-weight:600;line-height:1.3}.edgeever-image-loading[hidden]{display:none}.edgeever-image-loading-label{text-align:center}.edgeever-image-node>img{display:block;width:100%;max-width:100%;height:auto;margin:0!important;border-radius:10px;vertical-align:top}.edgeever-image-node>img[hidden]{display:none}.edgeever-image-node.is-selected,.edgeever-image-node.ProseMirror-selectednode{outline:2px solid #0f766e;outline-offset:3px;background:transparent!important;box-shadow:none!important}.edgeever-image-node.is-selected>img,.edgeever-image-node.ProseMirror-selectednode>img{outline:none}.ProseMirror-selectednode{background:transparent!important}.edgeever-image-node::selection,.edgeever-image-node *::selection{background:transparent}.edgeever-image-actions{position:absolute;right:8px;bottom:8px;z-index:5;display:inline-flex;width:42px;height:42px;-moz-appearance:none;appearance:none;-webkit-appearance:none;align-items:center;justify-content:center;border:1px solid #cbd5e1;border-radius:999px;background:#ffffffeb;color:#334155;font-size:24px;font-weight:700;line-height:1;box-shadow:0 3px 12px #0f172a33;padding:0;pointer-events:auto;touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}.edgeever-image-actions[hidden]{display:none}.edgeever-image-size-controls{position:absolute;top:8px;left:50%;z-index:5;display:flex;width:max-content;max-width:calc(100% - 16px);align-items:center;gap:3px;transform:translate(-50%);border:1px solid #bbf7d0;border-radius:9px;padding:4px;background:#fffffff5;box-shadow:0 8px 24px #0f172a33;line-height:1.15;pointer-events:auto;touch-action:manipulation;-webkit-user-select:none;user-select:none}.edgeever-image-size-controls[hidden]{display:none!important}.edgeever-image-size-button{display:inline-flex;min-width:52px;min-height:38px;-moz-appearance:none;appearance:none;-webkit-appearance:none;align-items:center;justify-content:center;border:0;border-radius:7px;padding:4px 7px;background:transparent;color:#475569;font:inherit;font-size:12px;font-weight:700;pointer-events:auto;touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;cursor:pointer}.edgeever-image-size-button.is-active{background:#ccfbf1;color:#0f766e}.edgeever-image-upload-spinner{width:18px;height:18px;border:2px solid #cbd5e1;border-top-color:#0f766e;border-radius:999px;animation:edgeever-image-upload-spin .8s linear infinite}@keyframes edgeever-image-upload-spin{to{transform:rotate(360deg)}}html[data-theme=dark] .edgeever-image-node.is-loading,html[data-theme=dark] .edgeever-image-node.is-failed{background:#1e293b}html[data-theme=dark] .edgeever-image-actions{border-color:#475569;background:#0f172ae6;color:#e2e8f0}html[data-theme=dark] .edgeever-image-size-controls{border-color:#475569;background:#0f172af5}html[data-theme=dark] .edgeever-image-size-button{color:#cbd5e1}html[data-theme=dark] .edgeever-image-size-button.is-active{background:#134e4a;color:#99f6e4}.edgeever-prose pre,.ProseMirror pre{background:var(--code-bg);padding:10px 12px;border-radius:8px;overflow-x:auto;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.9em}.edgeever-prose blockquote,.ProseMirror blockquote{margin:.5em 0;padding-left:12px;border-left:3px solid var(--accent);color:var(--muted)}.edgeever-prose table,.ProseMirror table{border-collapse:collapse;width:100%;margin:8px 0}.edgeever-prose th,.edgeever-prose td,.ProseMirror th,.ProseMirror td{border:1px solid var(--border);padding:6px 8px}.edgeever-prose h1,.edgeever-prose h2,.edgeever-prose h3,.ProseMirror h1,.ProseMirror h2,.ProseMirror h3{line-height:1.25}.edgeever-mermaid{overflow-x:auto;margin:12px 0;padding:8px;border-radius:8px;background:var(--code-bg)}.edgeever-mermaid svg{max-width:100%;height:auto}body.viewer-mode #toolbar{display:none!important}</style>
</head>
<body>
<!--
Android-parity shell: toolbar is a non-scrolling flex child at the top.
Only #editor scrolls. Sticky/fixed toolbars break under WKWebView keyboard
(they jump to the bottom-right of the visual viewport).
-->
<div id="shell">
<div id="toolbar" role="toolbar" aria-label="格式"></div>
<div id="editor"></div>
</div>
</body>
</html>