mirror of
https://github.com/MervinPraison/PraisonAIUI.git
synced 2026-11-07 05:56:17 -10:00
deploy: 78493e0e17
This commit is contained in:
commit
ea615f9d88
284 files changed
+48807
No files matched your search
@@ -0,0 +1,28 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
|
||||
<script id="aiui-canonical-url">(function(){var p=location.pathname.replace(/\/+$/, '')||'/';if(p!==location.pathname){history.replaceState(null,'',p+location.search+location.hash);}})();</script>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="Documentation built with PraisonAIUI" />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:locale" content="en_US" />
|
||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
||||
<title>Documentation</title>
|
||||
<script>
|
||||
(function(){try{var t=localStorage.getItem('aiui-theme-preference');var d=true;if(t==='dark'||(t==='system'&&matchMedia('(prefers-color-scheme: dark)').matches)||(!t&&d))document.documentElement.classList.add('dark');else if(t==='light')document.documentElement.classList.remove('dark');}catch(e){}})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="/assets/theme.css">
|
||||
<script type="module" crossorigin src="/assets/index.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script src="/plugins/plugin-loader.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1 @@
|
||||
import{g as p,r as u,d as a}from"./chunk-SVP7TREG.js";import{p as f}from"./chunk-JWPE2WC7.js";import{_ as n,l as o}from"./mermaid.core.js";import{M as c,b as d}from"./cynefin-OW5HDTMX.js";import"./index.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
|
||||
@@ -0,0 +1 @@
|
||||
import{a0 as ln,a1 as an,a2 as H,a3 as q,a4 as B,a5 as un,a6 as y,a7 as tn,a8 as L,a9 as _,aa as rn,ab as o,ac as on,ad as sn,ae as fn}from"./mermaid.core.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,C,a){var O=I-l,i=D-h,n=C-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function W(l,h,I,D,v,A,C){var a=l-I,O=h-D,i=(C?A:-A)/L(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,F=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*L(on(0,T*T*R-P*P)),j=(P*g-m*S)/R,z=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=j-F,e=z-t,r=w-F,G=p-t;return x*x+e*e>r*r+G*G&&(j=w,z=p),{cx:j,cy:z,x01:-n,y01:-d,x11:j*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=yn,I=B(0),D=null,v=gn,A=dn,C=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,F=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(F>tn-y)a.moveTo(s*H(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*H(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=F,S=F,j=C.apply(this,arguments)/2,z=j>y&&(D?+D.apply(this,arguments):L(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if(z>y){var G=sn(z/u*q(j)),M=sn(z/s*q(j));(P-=G*2)>y?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(S-=M*2)>y?(M*=t?1:-1,m+=M,g-=M):(S=0,m=g=(f+c)/2)}var J=s*H(m),K=s*q(m),N=u*H(T),Q=u*q(T);if(w>y){var U=s*H(g),V=s*q(g),X=u*H(R),Y=u*q(R),E;if(F<an)if(E=pn(J,K,X,Y,U,V,N,Q)){var Z=J-E[0],$=K-E[1],b=U-E[0],k=V-E[1],nn=1/q(fn((Z*b+$*k)/(L(Z*Z+$*$)*L(b*b+k*k)))/2),en=L(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(J,K),a.arc(0,0,s,m,g,!t)):a.moveTo(J,K),!(u>y)||!(P>y)?a.lineTo(N,Q):p>y?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[H(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:B(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:B(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:B(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:B(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:B(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:B(+n),i):A},i.padAngle=function(n){return arguments.length?(C=typeof n=="function"?n:B(+n),i):C},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|
||||
@@ -0,0 +1,36 @@
|
||||
import{p as qe}from"./chunk-JWPE2WC7.js";import{_ as ct,D as Qe,Y as Je,l as Fe,b as Ke,a as je,n as _e,o as tr,g as er,s as rr,p as ir,A as ar,y as nr,B as or,c as Ee,b5 as Te,ak as pe,i as sr,j as hr,q as lr,al as fr,b6 as cr}from"./mermaid.core.js";import{p as gr}from"./cynefin-OW5HDTMX.js";import{c as be}from"./cytoscape.esm.js";import{g as ur}from"./index.js";var he={exports:{}},le={exports:{}},fe={exports:{}},dr=fe.exports,De;function vr(){return De||(De=1,(function(x,M){(function(R,T){x.exports=T()})(dr,function(){return(function(w){var R={};function T(v){if(R[v])return R[v].exports;var l=R[v]={i:v,l:!1,exports:{}};return w[v].call(l.exports,l,l.exports,T),l.l=!0,l.exports}return T.m=w,T.c=R,T.i=function(v){return v},T.d=function(v,l,i){T.o(v,l)||Object.defineProperty(v,l,{configurable:!1,enumerable:!0,get:i})},T.n=function(v){var l=v&&v.__esModule?function(){return v.default}:function(){return v};return T.d(l,"a",l),l},T.o=function(v,l){return Object.prototype.hasOwnProperty.call(v,l)},T.p="",T(T.s=28)})([(function(w,R,T){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1e3,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,w.exports=v}),(function(w,R,T){var v=T(2),l=T(8),i=T(9);function r(f,e,d){v.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=f,this.target=e}r.prototype=Object.create(v.prototype);for(var a in v)r[a]=v[a];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(f,e){for(var d=this.getOtherEnd(f),t=e.getGraphManager().getRoot();;){if(d.getOwner()==e)return d;if(d.getOwner()==t)break;d=d.getOwner().getParent()}return null},r.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=l.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.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=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},w.exports=r}),(function(w,R,T){function v(l){this.vGraphObject=l}w.exports=v}),(function(w,R,T){var v=T(2),l=T(10),i=T(13),r=T(0),a=T(16),f=T(5);function e(t,s,o,c){o==null&&c==null&&(c=s),v.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=l.MIN_VALUE,this.inclusionTreeDepth=l.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new i(s.x,s.y,o.width,o.height):this.rect=new i}e.prototype=Object.create(v.prototype);for(var d in v)e[d]=v[d];e.prototype.getEdges=function(){return this.edges},e.prototype.getChild=function(){return this.child},e.prototype.getOwner=function(){return this.owner},e.prototype.getWidth=function(){return this.rect.width},e.prototype.setWidth=function(t){this.rect.width=t},e.prototype.getHeight=function(){return this.rect.height},e.prototype.setHeight=function(t){this.rect.height=t},e.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},e.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},e.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},e.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},e.prototype.getRect=function(){return this.rect},e.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},e.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.reLine truncated
|
||||
.edge {
|
||||
stroke-width: ${x.archEdgeWidth};
|
||||
stroke: ${x.archEdgeColor};
|
||||
fill: none;
|
||||
}
|
||||
|
||||
.arrow {
|
||||
fill: ${x.archEdgeArrowColor};
|
||||
}
|
||||
|
||||
.node-bkg {
|
||||
fill: none;
|
||||
stroke: ${x.archGroupBorderColor};
|
||||
stroke-width: ${x.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"),Fr=Sr;function me(x,M){if(x===0)return M();const w=Math.random;let R=x>>>0;Math.random=function(){R=R+1831565813>>>0;let T=R;return T=Math.imul(T^T>>>15,T|1),T^=T+Math.imul(T^T>>>7,T|61),((T^T>>>14)>>>0)/4294967296};try{return M()}finally{Math.random=w}}ct(me,"withSeededRandom");var re=ct(x=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${x}</g>`,"wrapIcon"),ne={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:re('<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:re('<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:re('<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:re('<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; sLine truncated
|
||||
translate(${L}, ${F-E.height/2})
|
||||
translate(${p*y.width/2}, ${m*y.height/2})
|
||||
rotate(${-1*p*m*45}, 0, ${E.height/2})
|
||||
`)}}}}}))},"drawEdges"),Pr=ct(async function(x,M,w,R){const v=w.getConfigField("padding")*.75,l=w.getConfigField("fontSize"),r=w.getConfigField("iconSize")/2;await Promise.all(M.nodes().map(async a=>{const f=ie(a);if(f.type==="group"){const{h:e,w:d,x1:t,y1:s}=a.boundingBox(),o=x.append("rect");o.attr("id",`${R}-group-${f.id}`).attr("x",t+r).attr("y",s+r).attr("width",d).attr("height",e).attr("class","node-bkg");const c=x.append("g");let h=t,N=s;if(f.icon){const g=c.append("g");g.html(`<g>${await pe(f.icon,{height:v,width:v,fallbackPrefix:ne.prefix})}</g>`),g.attr("transform","translate("+(h+r+1)+", "+(N+r+1)+")"),h+=v,N+=l/2-1-2}if(f.label){const g=c.append("g");await Te(g,f.label,{useHtmlLabels:!1,width:d,classes:"architecture-service-label"},Ee()),g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),g.attr("transform","translate("+(h+r+4)+", "+(N+r+2)+")")}w.setElementForId(f.id,o)}}))},"drawGroups"),Gr=ct(async function(x,M,w,R){const T=Ee();for(const v of w){const l=M.append("g"),i=x.getConfigField("iconSize");if(v.title){const e=l.append("g");await Te(e,v.title,{useHtmlLabels:!1,width:i*1.5,classes:"architecture-service-label"},T),e.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),e.attr("transform","translate("+i/2+", "+i+")")}const r=l.append("g");if(v.icon)r.html(`<g>${await pe(v.icon,{height:i,width:i,fallbackPrefix:ne.prefix})}</g>`);else if(v.iconText){r.html(`<g>${await pe("blank",{height:i,width:i,fallbackPrefix:ne.prefix})}</g>`);const t=r.append("g").append("foreignObject").attr("width",i).attr("height",i).append("div").attr("class","node-icon-text").attr("style",`height: ${i}px;`).append("div").html(sr(v.iconText,T)),s=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((i-2)/s)};`)}else r.append("path").attr("class","node-bkg").attr("id",`${R}-node-${v.id}`).attr("d",`M0,${i} V5 Q0,0 5,0 H${i-5} Q${i},0 ${i},5 V${i} Z`);l.attr("id",`${R}-service-${v.id}`).attr("class","architecture-service");const{width:a,height:f}=l.node().getBBox();v.width=a,v.height=f,x.setElementForId(v.id,l)}return 0},"drawServices"),Ur=ct(function(x,M,w,R){w.forEach(T=>{const v=M.append("g"),l=x.getConfigField("iconSize");v.append("g").append("rect").attr("id",`${R}-node-${T.id}`).attr("fill-opacity","0").attr("width",l).attr("height",l),v.attr("class","architecture-junction");const{width:r,height:a}=v._groups[0][0].getBBox();v.width=r,v.height=a,x.setElementForId(T.id,v)})},"drawJunctions");fr([{name:ne.prefix,icons:ne}]);be.use(Nr);function Xe(x,M,w){x.forEach(R=>{M.add({group:"nodes",data:{type:"service",id:R.id,icon:R.icon,label:R.title,parent:R.in,width:w.getConfigField("iconSize"),height:w.getConfigField("iconSize")},classes:"node-service"})})}ct(Xe,"addServices");function He(x,M,w){x.forEach(R=>{M.add({group:"nodes",data:{type:"junction",id:R.id,parent:R.in,width:w.getConfigField("iconSize"),height:w.getConfigField("iconSize")},classes:"node-junction"})})}ct(He,"addJunctions");function We(x,M){M.nodes().map(w=>{const R=ie(w);if(R.type==="group")return;R.x=w.position().x,R.y=w.position().y,x.getElementById(R.id).attr("transform","translate("+(R.x||0)+","+(R.y||0)+")")})}ct(We,"positionNodes");function Ve(x,M){x.forEach(w=>{M.add({group:"nodes",data:{type:"group",id:w.id,icon:w.icon,label:w.title,parent:w.in},classes:"node-group"})})}ct(Ve,"addGroups");function $e(x,M){x.forEach(w=>{const{lhsId:R,rhsId:T,lhsInto:v,lhsGroup:l,rhsInto:i,lhsDir:r,rhsDir:a,rhsGroup:f,title:e}=w,d=Ne(w.lhsDir,w.rhsDir)?"segments":"straight",t={id:`${R}-${T}`,label:e,source:R,sourceDir:r,sourceArrow:v,sourceGroup:l,sourceEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%",target:T,targetDir:a,targetArrow:i,targetGroup:f,targetEndpoint:a==="L"?"0 50%":a==="R"?"100% 50%":a==="T"?"50% 0":"50% 100%"};M.add({group:"edges",data:t,classes:d})})}ct($e,"addEdges");function ze(x,M,w,R=[]){const T=ct((d,t)=>{const s=new Map;for(const[o,c]of d.entries()){const h=`${o}`;let N=0;const g=[...c.entries()];if(g.length===1){s.set(h,g[0][1]);continue}for(let u=0;u<g.length-1;u++)for(let L=u+1;L<g.length;L++){const[F,C]=g[u],[G,V]=g[L];if(w.get(Pe(F,G))===t)s.set(h,[...s.get(h)??[],...C,...V]);else if(F==="default"||G==="default")s.set(h,[...s.get(h)??[],...C,...V]);else{const $=`${h}-${N++}`;s.set($,C);const A=`${h}-${N++}`;s.set(A,V)}}}return s},"flattenAlignments"),v=M.map(d=>{const t=new Map,s=new Map;return d.forEach(([o,c],h)=>{const N=x.getNode(h)?.in??"default",g=t.get(c)??new Map;t.has(c)||t.set(c,g);const u=s.get(o)??new Map;s.has(o)||s.set(o,u);for(const L of[g,u]){const F=L.get(N)??[];L.has(N)||L.set(N,F),F.push(h)}}),{horiz:[...T(t,"horizontal").values()].filter(o=>o.length>1),vert:[...T(s,"vertical").values()].filter(o=>o.length>1)}}),[l,i]=v.reduce(([d,t],{horiz:s,vert:o})=>[[...d,Line truncated
|
||||
@@ -0,0 +1,129 @@
|
||||
import{g as Pe}from"./chunk-5VM5RSS4.js";import{aD as Fe,aE as xe,aF as Me,aG as Ke,aH as Ye,aI as We,aJ as Ve,aK as Ue,aL as He,aM as Xe,aN as je,aO as Ge,aP as qe,aQ as Je,aR as Ze,aS as Qe,aT as $e,aU as et,aV as tt,aW as st,aX as rt,aY as it,aZ as at,a_ as nt,a$ as ot,_ as u,y as Y,j as X,b0 as ct,d as lt,l as m,p as ut,r as gt,c as Le,Q as ht,az as dt,ay as pt,aA as ft,k as bt,b1 as St,ag as ye,ah as xt}from"./mermaid.core.js";import{c as Lt}from"./channel.js";import"./index.js";function yt(e){return Array.isArray(e)}function mt(e){if(Fe(e))return e;const a=xe(e);if(!wt(e))return{};if(yt(e)){const r=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(r.index=e.index,r.input=e.input),r}if(Me(e)){const r=e,l=r.constructor;return new l(r.buffer,r.byteOffset,r.length)}if(a==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(a==="[object DataView]"){const r=e,l=r.buffer,d=r.byteOffset,s=r.byteLength,h=new ArrayBuffer(s),x=new Uint8Array(l,d,s);return new Uint8Array(h).set(x),new DataView(h)}if(a==="[object Boolean]"||a==="[object Number]"||a==="[object String]"){const r=e.constructor,l=new r(e.valueOf());return a==="[object String]"?_t(l,e):se(l,e),l}if(a==="[object Date]")return new Date(Number(e));if(a==="[object RegExp]"){const r=e,l=new RegExp(r.source,r.flags);return l.lastIndex=r.lastIndex,l}if(a==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(a==="[object Map]"){const r=e,l=new Map;return r.forEach((d,s)=>{l.set(s,d)}),l}if(a==="[object Set]"){const r=e,l=new Set;return r.forEach(d=>{l.add(d)}),l}if(a==="[object Arguments]"){const r=e,l={};return se(l,r),l.length=r.length,l[Symbol.iterator]=r[Symbol.iterator],l}const o={};return kt(o,e),se(o,e),Et(o,e),o}function wt(e){switch(xe(e)){case ot:case nt:case at:case it:case rt:case st:case tt:case et:case $e:case Qe:case Ze:case Je:case qe:case Ge:case je:case Xe:case He:case Ue:case Ve:case We:case Ye:case Ke:return!0;default:return!1}}function se(e,a){for(const o in a)Object.hasOwn(a,o)&&(e[o]=a[o])}function Et(e,a){const o=Object.getOwnPropertySymbols(a);for(let r=0;r<o.length;r++){const l=o[r];Object.prototype.propertyIsEnumerable.call(a,l)&&(e[l]=a[l])}}function _t(e,a){const o=a.valueOf().length;for(const r in a)Object.hasOwn(a,r)&&(Number.isNaN(Number(r))||Number(r)>=o)&&(e[r]=a[r])}function kt(e,a){const o=Object.getPrototypeOf(a);o!==null&&typeof a.constructor=="function"&&Object.setPrototypeOf(e,o)}var ie=(function(){var e=u(function(v,g,i,c){for(i=i||{},c=v.length;c--;i[v[c]]=g);return i},"o"),a=[1,15],o=[1,7],r=[1,13],l=[1,14],d=[1,19],s=[1,16],h=[1,17],x=[1,18],y=[8,30],S=[8,10,21,28,29,30,31,39,43,46],f=[1,23],L=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],b=[8,10,15,16,21,27,28,29,30,31,39,43,46],k=[1,49],_={trace:u(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:u(function(g,i,c,p,E,t,M){var n=t.length-1;switch(E){case 4:p.getLogger().debug("Rule: separator (NL) ");break;case 5:p.getLogger().debug("Rule: separator (Space) ");break;case 6:p.getLogger().debug("Rule: separator (EOF) ");break;case 7:p.getLogger().debug("Rule: hierarchy: ",t[n-1]),p.setHierarchy(t[n-1]);break;case 8:p.getLogger().debug("Stop NL ");break;case 9:p.getLogger().debug("Stop EOF ");break;case 10:p.getLogger().debug("Stop NL2 ");break;case 11:p.getLogger().debug("Stop EOF2 ");break;case 12:p.getLogger().debug("Rule: statement: ",t[n]),typeof t[n].length=="number"?this.$=t[n]:this.$=[t[n]];break;case 13:p.getLogger().debug("Rule: statement #2: ",t[n-1]),this.$=[t[n-1]].concat(t[n]);break;case 14:p.getLogger().debug("Rule: link: ",Line truncated
|
||||
`+D.showPosition()+`
|
||||
Expecting `+H.join(", ")+", got '"+(this.terminals_[N]||N)+"'":te="Parse error on line "+(P+1)+": Unexpected "+(N==V?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(te,{text:D.match,token:this.terminals_[N]||N,line:D.yylineno,loc:$,expected:H})}if(C[0]instanceof Array&&C.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+N);switch(C[0]){case 1:c.push(N),E.push(D.yytext),t.push(D.yylloc),c.push(C[1]),N=null,W=D.yyleng,n=D.yytext,P=D.yylineno,$=D.yylloc;break;case 2:if(B=this.productions_[C[1]][1],F.$=E[E.length-B],F._$={first_line:t[t.length-(B||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(B||1)].first_column,last_column:t[t.length-1].last_column},Be&&(F._$.range=[t[t.length-(B||1)].range[0],t[t.length-1].range[1]]),ee=this.performAction.apply(F,[n,W,P,A.yy,C[1],E,t].concat(Z)),typeof ee<"u")return ee;B&&(c=c.slice(0,-1*B*2),E=E.slice(0,-1*B),t=t.slice(0,-1*B)),c.push(this.productions_[C[1]][0]),E.push(F.$),t.push(F._$),pe=M[c[c.length-2]][c[c.length-1]],c.push(pe);break;case 3:return!0}}return!0},"parse")},T=(function(){var v={EOF:1,parseError:u(function(i,c){if(this.yy.parser)this.yy.parser.parseError(i,c);else throw new Error(i)},"parseError"),setInput:u(function(g,i){return this.yy=i||this.yy||{},this._input=g,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:u(function(){var g=this._input[0];this.yytext+=g,this.yyleng++,this.offset++,this.match+=g,this.matched+=g;var i=g.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),g},"input"),unput:u(function(g){var i=g.length,c=g.split(/(?:\r\n?|\n)/g);this._input=g+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var p=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 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:c?(c.length===p.length?this.yylloc.first_column:0)+p[p.length-c.length].length-c[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(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:u(function(g){this.unput(this.match.slice(g))},"less"),pastInput:u(function(){var g=this.matched.substr(0,this.matched.length-this.match.length);return(g.length>20?"...":"")+g.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u(function(){var g=this.match;return g.length<20&&(g+=this._input.substr(0,20-g.length)),(g.substr(0,20)+(g.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:u(function(){var g=this.pastInput(),i=new Array(g.length+1).join("-");return g+this.upcomingInput()+`
|
||||
`+i+"^"},"showPosition"),test_match:u(function(g,i){var c,p,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))),p=g[0].match(/(?:\r\n?|\n).*/g),p&&(this.yylineno+=p.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+g[0].length},this.yytext+=g[0],this.match+=g[0],this.matches=g,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(g[0].length),this.matched+=g[0],c=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var t in E)this[t]=E[t];return!1}return!1},"test_match"),next:u(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var g,i,c,p;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),t=0;t<E.length;t++)if(c=this._input.match(this.rules[E[t]]),c&&(!i||c[0].length>i[0].length)){if(i=c,p=t,this.options.backtrack_lexer){if(g=this.test_match(c,E[t]),g!==!1)return g;if(this._backtrack){i=!1;continue}else return!1}else if(!this.options.flex)break}return i?(g=this.test_match(i,E[p]),g!==!1?g:!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:u(function(){var i=this.next();return i||this.lex()},"lex"),begin:u(function(i){this.conditionStack.push(i)},"begin"),popState:u(function(){var i=this.conditionStack.length-1;return i>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:u(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:u(function(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},"topState"),pushState:u(function(i){this.begin(i)},"pushState"),stateStackSize:u(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:u(function(i,c,p,E){switch(p){case 0:return i.getLogger().debug("Found block-beta"),10;case 1:return i.getLogger().debug("Found id-block"),29;case 2:return i.getLogger().debug("Found block"),10;case 3:i.getLogger().debug(".",c.yytext);break;case 4:i.getLogger().debug("_",c.yytext);break;case 5:return 5;case 6:return c.yytext=-1,28;case 7:return c.yytext=c.yytext.replace(/columns\s+/,""),i.getLogger().debug("COLUMNS (LEX)",c.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:i.getLogger().debug("LEX: POPPING STR:",c.yytext),this.popState();break;case 13:return i.getLogger().debug("LEX: STR end:",c.yytext),"STR";case 14:return c.yytext=c.yytext.replace(/space\:/,""),i.getLogger().debug("SPACE NUM (LEX)",c.yytext),21;case 15:return c.yytext="1",i.getLogger().debug("COLUMNS (LEX)",c.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(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),i.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),i.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),i.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),i.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),i.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),i.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),i.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),i.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),i.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),i.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),i.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),i.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return i.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return i.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return i.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return i.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return i.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return i.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return i.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.p
Line truncated
|
||||
font-family: ${e.fontFamily};
|
||||
color: ${e.nodeTextColor||e.textColor};
|
||||
}
|
||||
.cluster-label text {
|
||||
fill: ${e.titleColor};
|
||||
}
|
||||
.cluster-label span {
|
||||
color: ${e.titleColor};
|
||||
}
|
||||
|
||||
|
||||
|
||||
.label text,span {
|
||||
fill: ${e.nodeTextColor||e.textColor};
|
||||
color: ${e.nodeTextColor||e.textColor};
|
||||
}
|
||||
|
||||
.node rect,
|
||||
.node circle,
|
||||
.node ellipse,
|
||||
.node polygon,
|
||||
.node path {
|
||||
fill: ${e.mainBkg};
|
||||
stroke: ${e.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: ${e.arrowheadColor};
|
||||
}
|
||||
|
||||
.edgePaths .path {
|
||||
stroke: ${e.lineColor};
|
||||
stroke-width: 2.0px;
|
||||
}
|
||||
|
||||
.flowchart-link {
|
||||
stroke: ${e.lineColor};
|
||||
fill: none;
|
||||
}
|
||||
|
||||
.edgeLabel {
|
||||
background-color: ${e.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: ${e.edgeLabelBackground};
|
||||
fill: ${e.edgeLabelBackground};
|
||||
}
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* For html labels only */
|
||||
.labelBkg {
|
||||
background-color: ${e.edgeLabelBackground};
|
||||
}
|
||||
|
||||
.node .cluster {
|
||||
// fill: ${re(e.mainBkg,.5)};
|
||||
fill: ${re(e.clusterBkg,.5)};
|
||||
stroke: ${re(e.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: ${e.titleColor};
|
||||
}
|
||||
|
||||
.cluster span {
|
||||
color: ${e.titleColor};
|
||||
}
|
||||
/* .cluster div {
|
||||
color: ${e.titleColor};
|
||||
} */
|
||||
|
||||
div.mermaidTooltip {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
max-width: 200px;
|
||||
padding: 2px;
|
||||
font-family: ${e.fontFamily};
|
||||
font-size: 12px;
|
||||
background: ${e.tertiaryColor};
|
||||
border: 1px solid ${e.border2};
|
||||
border-radius: 2px;
|
||||
pointer-events: none;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.flowchartTitleText {
|
||||
text-anchor: middle;
|
||||
font-size: 18px;
|
||||
fill: ${e.textColor};
|
||||
}
|
||||
${Pe()}
|
||||
`,"getStyles"),Gt=jt;function ne(e,a){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(a<0||!Number.isInteger(a))throw new Error("Position must be a non-negative integer."+a);if(e<0)return{px:a,py:0};if(e===1)return{px:0,py:a};const o=a%e,r=Math.floor(a/e);return{px:o,py:r}}u(ne,"calculateBlockPosition");var qt=u(e=>{let a=0,o=0;for(const r of e.children){const{width:l,height:d,x:s,y:h}=r.size??{width:0,height:0,x:0,y:0};if(m.debug("getMaxChildSize abc95 child:",r.id,"width:",l,"height:",d,"x:",s,"y:",h,r.type),r.type==="space")continue;const x=l/(r.widthInColumns??1);x>a&&(a=x),d>o&&(o=d)}return{width:a,height:o}},"getMaxChildSize");function G(e,a,o=0,r=0,l=8){m.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",o),e?.size?.width||(e.size={width:o,height:r,x:0,y:0});let d=0,s=0;if(e.children?.length>0){for(const b of e.children)G(b,a,0,0,l);const h=qt(e);d=h.width,s=h.height,m.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",d,s);for(const b of e.children)b.size&&(m.debug(`abc95 Setting size of children of ${e.id} id=${b.id} ${d} ${s} ${JSON.stringify(b.size)}`),b.size.width=d*(b.widthInColumns??1)+l*((b.widthInColumns??1)-1),b.size.height=s,b.size.x=0,b.size.y=0,m.debug(`abc95 updating size of ${e.id} children child:${b.id} maxWidth:${d} maxHeight:${s}`));for(const b of e.children)G(b,a,d,s,l);const x=e.columns??-1;let y=0;for(const b of e.children)y+=b.widthInColumns??1;let S=e.children.length;x>0&&x<y&&(S=x);const f=Math.ceil(y/S);let L=S*(d+l)+l,w=f*(s+l)+l;if(L<o){m.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${o} siblingHeight ${r} width ${L}`),L=o,w=r;const b=(o-S*l-l)/S,k=(r-f*l-l)/f;m.debug("Size indata abc88",e.id,"childWidth",b,"maxWidth",d),m.debug("Size indata abc88",e.id,"childHeight",k,"maxHeight",s),m.debug("Size indata abc88 xSize",S,"padding",l);for(const _ of e.children)_.size&&(_.size.width=b,_.size.height=k,_.size.x=0,_.size.y=0)}if(m.debug(`abc95 (finale calc) ${e.id} xSize ${S} ySize ${f} columns ${x}${e.children.length} width=${Math.max(L,e.size?.width||0)}`),L<(e?.size?.width||0)){L=e?.size?.width||0;const b=x>0?Math.min(e.children.length,x):e.children.length;if(b>0){const k=(L-b*l-l)/b;m.debug("abc95 (growing to fit) width",e.id,L,e.size?.width,k);for(const _ of e.children)_.size&&(_.size.width=k)}}e.size={width:L,height:w,x:0,y:0}}m.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}u(G,"setBlockSizes");function ue(e,a,o=8){m.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const r=e.columns??-1;if(m.debug("layoutBlocks columns abc95",e.id,"=>",r,e),e.children&&e.children.length>0){const l=e?.children[0]?.size?.width??0,d=e.children.length*l+(e.children.length-1)*o;m.debug("widthOfChildren 88",d,"posX");const s=new Map;{let f=0;for(const L of e.children){if(!L.size)continue;const{py:w}=ne(r,f),b=s.get(w)??0;L.size.height>b&&s.set(w,L.size.height);let k=L?.widthInColumns??1;r>0&&(k=Math.min(k,r-f%r)),f+=k}}const h=new Map;{let f=0;const L=[...s.keys()].sort((w,b)=>w-b);for(const w of L)h.set(w,f),f+=(s.get(w)??0)+o}let x=0;m.debug("abc91 block?.size?.x",e.id,e?.size?.x);let y=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-o,S=0;for(const f of e.children){const L=e;if(!f.size)continue;const{width:w,height:b}=f.size,{px:k,py:_}=ne(r,x);if(_!=S&&(S=_,y=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-o,m.debug("New row in layout for block",e.id," and child ",f.id,S)),m.debug(`abc89 layout blocks (child) id: ${f.id} Pos: ${x} (px, py) ${k},${_} (${L?.size?.x},${L?.size?.y}) parent: ${L.id} width: ${w}${o}`),L.size){const O=w/2;f.size.x=y+o+O,m.debug(`abc91 layout blocks (calc) px, pyid:${f.id} startingPos=X${y} new startingPosX${f.size.x} ${O} padding=${o} width=${w} halfWidth=${O} => x:${f.size.x} y:${f.size.y} ${f.widthInColumns} (width * (child?.w || 1)) / 2 ${w*(f?.widthInColumns??1)/2}`),y=f.size.x+O;const v=h.get(_)??0,g=s.get(_)??b;f.size.y=L.size.y-L.size.height/2+v+g/2+o,m.debug(`abc88 layout blocks (calc) px, pyid:${f.id}startingPosX${y}${o}${O}=>x:${f.size.x}y:${f.size.y}${f.widthInColumns}(width * (child?.w || 1)) / 2${w*(f?.widthInColumns??1)/2}`)}f.children&&ue(f,a,o);let T=f?.widthInColumns??1;r>0&&(T=Math.min(T,r-x%r)),x+=T,m.debug("abc88 columnsPos",f,x)}}m.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}u(ue,"layoutBlocks");function ge(e,{minX:a,minY:o,maxX:r,maxY:l}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:d,y:s,width:h,height:x}=e.size;d-h/2<a&&(a=d-h/2),s-x/2<o&&(o=s-x/2),d+h/2>r&&(r=d+h/2),s+x/2>l&&(l=s+x/2)}if(e.children)for(const d of e.children)({minX:a,minY:o,maxX:r,maxY:l}=ge(d,{minX:a,minY:o,maxX:r,maxY:l}));return{minX:a,minY:o,maxX:r,maxY:l}}u(ge,"findBounds");function Ie(e){const a=e.getBlock("root");if(!a)return;const o=Le()?.block?.padding??8;G(a,e,0,0,o),ue(a,
Line truncated
|
||||
@@ -0,0 +1,38 @@
|
||||
import{d as Le}from"./chunk-F27PBJKO.js";import{s as Ie,g as Me,a as Be,b as Ve,_ as d,c as wt,l as he,d as Ye,e as Fe,f as Dt,h as Ue,i as be,j as Jt,w as je,k as $t,m as de}from"./mermaid.core.js";import"./index.js";var Ut=(function(){var t=d(function(yt,m,x,E){for(x=x||{},E=yt.length;E--;x[yt[E]]=m);return x},"o"),e=[1,24],s=[1,25],a=[1,26],u=[1,27],i=[1,28],n=[1,63],l=[1,64],r=[1,65],h=[1,66],y=[1,67],f=[1,68],b=[1,69],v=[1,29],w=[1,30],N=[1,31],O=[1,32],P=[1,33],I=[1,34],W=[1,35],X=[1,36],q=[1,37],H=[1,38],Q=[1,39],K=[1,40],G=[1,41],J=[1,42],Z=[1,43],$=[1,44],tt=[1,45],et=[1,46],nt=[1,47],st=[1,48],rt=[1,50],at=[1,51],it=[1,52],ot=[1,53],lt=[1,54],ct=[1,55],ut=[1,56],ht=[1,57],dt=[1,58],pt=[1,59],ft=[1,60],kt=[14,42],Wt=[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],Ot=[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],S=[1,82],k=[1,83],T=[1,84],C=[1,85],R=[12,14,42],ie=[12,14,33,42],Mt=[12,14,33,42,76,77,79,80],gt=[12,33],Xt=[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],qt={trace:d(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:d(function(m,x,E,_,D,o,Pt){var p=o.length-1;switch(D){case 3:_.setDirection("TB");break;case 4:_.setDirection("BT");break;case 5:_.setDirection("RL");break;case 6:_.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:_.setC4Type(o[p-3]);break;case 19:_.setTitle(o[p].substring(6)),this.$=o[p].substring(6);break;case 20:_.setAccDescription(o[p].substring(15)),this.$=o[p].substring(15);break;case 21:this.$=o[p].trim(),_.setTitle(this.$);break;case 22:case 23:this.$=o[p].trim(),_.setAccDescription(this.$);break;case 28:o[p].splice(2,0,"ENTERPRISE"),_.addPersonOrSystemBoundary(...o[p]),this.$=o[p];break;case 29:o[p].splice(2,0,"SYSTEM"),_.addPersonOrSystemBoundary(...o[p]),this.$=o[p];break;case 30:_.addPersonOrSystemBoundary(...o[p]),this.$=o[p];break;case 31:o[p].splice(2,0,"CONTAINER"),_.addContainerBoundary(...o[p]),this.$=o[p];break;case 32:_.addDeploymentNode("node",...Line truncated
|
||||
`+A.showPosition()+`
|
||||
Expecting `+Yt.join(", ")+", got '"+(this.terminals_[M]||M)+"'":Gt="Parse error on line "+(xt+1)+": Unexpected "+(M==le?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(Gt,{text:A.match,token:this.terminals_[M]||M,line:A.yylineno,loc:Qt,expected:Yt})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Et+", token: "+M);switch(V[0]){case 1:E.push(M),D.push(A.yytext),o.push(A.yylloc),E.push(V[1]),M=null,oe=A.yyleng,p=A.yytext,xt=A.yylineno,Qt=A.yylloc;break;case 2:if(j=this.productions_[V[1]][1],Tt.$=D[D.length-j],Tt._$={first_line:o[o.length-(j||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(j||1)].first_column,last_column:o[o.length-1].last_column},Ne&&(Tt._$.range=[o[o.length-(j||1)].range[0],o[o.length-1].range[1]]),Kt=this.performAction.apply(Tt,[p,oe,xt,vt.yy,V[1],D,o].concat(De)),typeof Kt<"u")return Kt;j&&(E=E.slice(0,-1*j*2),D=D.slice(0,-1*j),o=o.slice(0,-1*j)),E.push(this.productions_[V[1]][0]),D.push(Tt.$),o.push(Tt._$),ue=Pt[E[E.length-2]][E[E.length-1]],E.push(ue);break;case 3:return!0}}return!0},"parse")},Oe=(function(){var yt={EOF:1,parseError:d(function(x,E){if(this.yy.parser)this.yy.parser.parseError(x,E);else throw new Error(x)},"parseError"),setInput:d(function(m,x){return this.yy=x||this.yy||{},this._input=m,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:d(function(){var m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var x=m.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),m},"input"),unput:d(function(m){var x=m.length,E=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-x),this.offset-=x;var _=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),E.length-1&&(this.yylineno-=E.length-1);var D=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:E?(E.length===_.length?this.yylloc.first_column:0)+_[_.length-E.length].length-E[0].length:this.yylloc.first_column-x},this.options.ranges&&(this.yylloc.range=[D[0],D[0]+this.yyleng-x]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(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:d(function(m){this.unput(this.match.slice(m))},"less"),pastInput:d(function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var m=this.pastInput(),x=new Array(m.length+1).join("-");return m+this.upcomingInput()+`
|
||||
`+x+"^"},"showPosition"),test_match:d(function(m,x){var E,_,D;if(this.options.backtrack_lexer&&(D={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&&(D.yylloc.range=this.yylloc.range.slice(0))),_=m[0].match(/(?:\r\n?|\n).*/g),_&&(this.yylineno+=_.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_?_[_.length-1].length-_[_.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+m[0].length},this.yytext+=m[0],this.match+=m[0],this.matches=m,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(m[0].length),this.matched+=m[0],E=this.performAction.call(this,this.yy,this,x,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),E)return E;if(this._backtrack){for(var o in D)this[o]=D[o];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var m,x,E,_;this._more||(this.yytext="",this.match="");for(var D=this._currentRules(),o=0;o<D.length;o++)if(E=this._input.match(this.rules[D[o]]),E&&(!x||E[0].length>x[0].length)){if(x=E,_=o,this.options.backtrack_lexer){if(m=this.test_match(E,D[o]),m!==!1)return m;if(this._backtrack){x=!1;continue}else return!1}else if(!this.options.flex)break}return x?(m=this.test_match(x,D[_]),m!==!1?m:!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:d(function(){var x=this.next();return x||this.lex()},"lex"),begin:d(function(x){this.conditionStack.push(x)},"begin"),popState:d(function(){var x=this.conditionStack.length-1;return x>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(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:d(function(x){return x=this.conditionStack.length-1-Math.abs(x||0),x>=0?this.conditionStack[x]:"INITIAL"},"topState"),pushState:d(function(x){this.begin(x)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:d(function(x,E,_,D){switch(_){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\bLine truncated
|
||||
`)},"elementFontStyles"),W0=d(t=>`.person {
|
||||
stroke: ${t.personBorder};
|
||||
fill: ${t.personBkg};
|
||||
}
|
||||
${z0()}
|
||||
|
||||
/* The element font colour is set inline per element (default white); the
|
||||
label text takes it via currentColor. */
|
||||
.c4-shape .label,
|
||||
.c4-shape .label text {
|
||||
color: inherit;
|
||||
fill: currentColor;
|
||||
}
|
||||
/* Structurizr typography: bold name, smaller stereotype/type and description lines. */
|
||||
.c4-shape .label .c4-name {
|
||||
font-weight: bold;
|
||||
}
|
||||
.c4-shape .label .c4-type {
|
||||
font-size: 0.75em;
|
||||
}
|
||||
.c4-shape .label .c4-descr {
|
||||
font-size: 0.82em;
|
||||
}
|
||||
.c4-shape .basic,
|
||||
.c4-shape rect,
|
||||
.c4-shape path,
|
||||
.c4-shape circle,
|
||||
.c4-shape ellipse,
|
||||
.c4-shape line {
|
||||
stroke-width: 2px;
|
||||
}
|
||||
`,"getStyles"),X0=W0,K0={parser:ze,db:te,renderer:_e,styles:X0,init:d(({c4:t,wrap:e})=>{_e.setConf(t),te.setWrap(e)},"init")};export{K0 as diagram};
|
||||
@@ -0,0 +1 @@
|
||||
import{ai as o,aj as n}from"./mermaid.core.js";const t=(a,r)=>o.lang.round(n.parse(a)[r]);export{t as c};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as s}from"./mermaid.core.js";var t,e=(t=class{constructor(i){this.init=i,this.records=this.init()}reset(){this.records=this.init()}},s(t,"ImperativeState"),t);export{e as I};
|
||||
@@ -0,0 +1,15 @@
|
||||
import{_ as e}from"./mermaid.core.js";var l=e(()=>`
|
||||
/* 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");export{l as g};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as i,j as l,U as d,G as o}from"./mermaid.core.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("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")),r},"createTooltip");export{p as a,h as b,g as c,x as d,m as e,w as f,f as g,y as h};
|
||||
@@ -0,0 +1,231 @@
|
||||
import{g as ee}from"./chunk-XXDRQBXY.js";import{s as se}from"./chunk-POPQ4Y6H.js";import{_ as p,l as b,c as $,v as ie,x as re,a as ae,b as ne,g as oe,s as le,n as ce,o as he,T as ue,k as j,p as de,j as kt,O as fe}from"./mermaid.core.js";import{f as pe}from"./chunk-F27PBJKO.js";var Ct=(function(){var t=p(function(V,o,h,a){for(h=h||{},a=V.length;a--;h[V[a]]=o);return h},"o"),e=[1,2],s=[1,3],n=[1,4],r=[2,4],c=[1,9],u=[1,11],S=[1,16],d=[1,17],T=[1,18],E=[1,19],m=[1,33],L=[1,20],D=[1,21],f=[1,22],I=[1,23],R=[1,24],C=[1,26],F=[1,27],A=[1,28],P=[1,29],w=[1,30],z=[1,31],rt=[1,32],at=[1,35],nt=[1,36],ot=[1,37],lt=[1,38],K=[1,34],y=[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],ct=[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],Lt=[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],gt={trace:p(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:p(function(o,h,a,g,_,i,B){var l=i.length-1;switch(_){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const Z=i[l-1];Z.description=g.trimColon(i[l]),this.$=Z;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const Tt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:Tt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var Y=i[l],X=i[l-2].trim();if(i[l].match(":")){var ut=i[l].split(":");Y=ut[0],X=[X,ut[1]]}this.$={stmt:"state",id:Y,type:"default",description:X};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].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:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}Line truncated
|
||||
`+k.showPosition()+`
|
||||
Expecting `+ft.join(", ")+", got '"+(this.terminals_[x]||x)+"'":bt="Parse error on line "+(Y+1)+": Unexpected "+(x==Z?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(bt,{text:k.match,token:this.terminals_[x]||x,line:k.yylineno,loc:_t,expected:ft})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+x);switch(N[0]){case 1:a.push(x),_.push(k.yytext),i.push(k.yylloc),a.push(N[1]),x=null,X=k.yyleng,l=k.yytext,Y=k.yylineno,_t=k.yylloc;break;case 2:if(G=this.productions_[N[1]][1],J.$=_[_.length-G],J._$={first_line:i[i.length-(G||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(G||1)].first_column,last_column:i[i.length-1].last_column},Zt&&(J._$.range=[i[i.length-(G||1)].range[0],i[i.length-1].range[1]]),mt=this.performAction.apply(J,[l,X,Y,U.yy,N[1],_,i].concat(Tt)),typeof mt<"u")return mt;G&&(a=a.slice(0,-1*G*2),_=_.slice(0,-1*G),i=i.slice(0,-1*G)),a.push(this.productions_[N[1]][0]),_.push(J.$),i.push(J._$),wt=B[a[a.length-2]][a[a.length-1]],a.push(wt);break;case 3:return!0}}return!0},"parse")},Qt=(function(){var V={EOF:1,parseError:p(function(h,a){if(this.yy.parser)this.yy.parser.parseError(h,a);else throw new Error(h)},"parseError"),setInput:p(function(o,h){return this.yy=h||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:p(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var h=o.match(/(?:\r\n?|\n).*/g);return h?(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:p(function(o){var h=o.length,a=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;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),a.length-1&&(this.yylineno-=a.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:a?(a.length===g.length?this.yylloc.first_column:0)+g[g.length-a.length].length-a[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:p(function(){return this._more=!0,this},"more"),reject:p(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:p(function(o){this.unput(this.match.slice(o))},"less"),pastInput:p(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:p(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:p(function(){var o=this.pastInput(),h=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
|
||||
`+h+"^"},"showPosition"),test_match:p(function(o,h){var a,g,_;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))),g=o[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+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],a=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack){for(var i in _)this[i]=_[i];return!1}return!1},"test_match"),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,h,a,g;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),i=0;i<_.length;i++)if(a=this._input.match(this.rules[_[i]]),a&&(!h||a[0].length>h[0].length)){if(h=a,g=i,this.options.backtrack_lexer){if(o=this.test_match(a,_[i]),o!==!1)return o;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(o=this.test_match(h,_[g]),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:p(function(){var h=this.next();return h||this.lex()},"lex"),begin:p(function(h){this.conditionStack.push(h)},"begin"),popState:p(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:p(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:p(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:p(function(h){this.begin(h)},"pushState"),stateStackSize:p(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:p(function(h,a,g,_){function i(){const B=a.yytext.indexOf("%%");if(B===0)return!1;if(B>0){const l=a.yytext.slice(0,B),Y=a.yytext.slice(B);Y&&h.lexer.unput(Y),a.yytext=l}return!0}switch(p(i,"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(),a.yytext=a.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),a.yytext=a.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),a.yytext=a.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),a.yytext=a.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 i()?(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: "'+a.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 i()?(this.popState(),"ID"):void 0;case 66:return i()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),a.yytext=a.yytext.substr(2).trim(),31;case 68:return this.popState(),a.yytext=a.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 i()?24:void 0;case 74:return a.yytext=a.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,/^(?:.*directio
Line truncated
|
||||
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"),ze=Ye;export{He as S,We as a,je as b,ze as s};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as i}from"./mermaid.core.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as a,d as w,l as x}from"./mermaid.core.js";var B=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=d(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),d=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{B as s};
|
||||
@@ -0,0 +1,88 @@
|
||||
import{_ as p,l as C,D as H,y as B,p as q,E as G,d as U,i as j,c as K}from"./mermaid.core.js";var A="",M="",O="",D=[],b=new Map,v=p(e=>j(e,K()),"sanitizeText"),y=p(e=>{switch(e.type){case"terminal":return{...e,value:v(e.value)};case"nonterminal":return{...e,name:v(e.name)};case"sequence":return{...e,elements:e.elements.map(y)};case"choice":return{...e,alternatives:e.alternatives.map(y)};case"optional":return{...e,element:y(e.element)};case"repetition":return{...e,element:y(e.element),separator:e.separator?y(e.separator):void 0};case"special":return{...e,text:v(e.text)}}},"sanitizeAstNode"),J=p(()=>{A="",M="",O="",D.length=0,b.clear(),q(),C.debug("[Railroad] Database cleared")},"clear"),Y=p(e=>{A=v(e),C.debug("[Railroad] Title set:",e)},"setTitle"),P=p(()=>A,"getTitle"),Q=p(e=>{const i={...e,name:v(e.name),definition:y(e.definition),comment:e.comment?v(e.comment):void 0};C.debug("[Railroad] Adding rule:",i.name),b.has(i.name)&&C.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),D.push(i),b.set(i.name,i)},"addRule"),Z=p(()=>D,"getRules"),V=p(e=>b.get(e),"getRule"),ee=p(e=>{M=v(e).replace(/^\s+/g,""),C.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),te=p(()=>M,"getAccTitle"),re=p(e=>{O=v(e).replace(/\n\s+/g,`
|
||||
`),C.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ie=p(()=>O,"getAccDescription"),ne=Y,ae=P,oe={clear:J,setTitle:Y,getTitle:P,addRule:Q,getRules:Z,getRule:V,setAccTitle:ee,getAccTitle:te,setAccDescription:re,getAccDescription:ie,setDiagramTitle:ne,getDiagramTitle:ae},f={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},le=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,se=/^[\w "',.-]+$/,de=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"]),L=p(e=>e?Object.keys(e).every(i=>i==="railroad"||de.has(i)):!1,"isRailroadStyleOptions"),ce=p(e=>e?"railroad"in e&&e.railroad?e.railroad:L(e)?e:{}:{},"extractRailroadOverrides"),me=p(e=>{if(!e||L(e))return{};const{railroad:i,svgId:a,theme:n,look:t,...r}=e;return r},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return le.test(a)?a:i},"sanitizeColorValue"),I=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return se.test(a)?a:i},"sanitizeFontFamilyValue"),F=p((e,i)=>{const a=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(a)&&a>=0?a:i},"sanitizeNumberValue"),he=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),pe=p(e=>{const i=I(e.fontFamily,f.fontFamily),a=he(e.fontSize)??f.fontSize;return{...f,fontFamily:i,fontSize:a,terminalFill:m(e.secondBkg??e.secondaryColor,f.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,f.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,f.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,f.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,f.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,f.nonTerminalTextColor),lineColor:m(e.lineColor,f.lineColor),markerFill:m(e.lineColor,f.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,f.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,f.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,f.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,f.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,f.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,f.ruleNameColor)}},"buildThemeDefaults"),E=p(e=>{const i=B(),a={...G(),...i.themeVariables??{},...me(e)},n=pe(a),t={...i.railroad??{},...ce(e)};return{compactMode:t.compactMode??n.compactMode,padding:F(t.padding,n.padding),verticalSeparation:F(t.verticalSeparation,n.verticalSeparation),horizontalSeparation:F(t.horizontalSeparation,n.horizontalSeparation),arcRadius:F(t.arcRadius,n.arcRadius),fontSize:F(t.fontSize,n.fontSize),fontFamily:I(t.fontFamily,n.fontFamily),terminalFill:m(t.terminalFill,n.terminalFill),terminalStroke:m(t.terminalStroke,n.terminalStroke),terminalTextColor:m(t.terminalTextColor,n.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:m(t.lineColor,n.lineColor),strokeWidth:F(t.strokeWidth,n.strokeWidth),markerFill:m(t.markerFill,n.markerFill),commentFill:m(t.commentFill,n.commentFill),commentStroke:m(t.commentStroke,n.commentStroke),commentTextColor:m(t.commentTextColor,n.commentTextColor),specialFill:m(t.specialFill,n.specialFill),specialStroke:m(t.specialStroke,n.specialStroke),ruleNameColor:m(t.ruleNameColor,n.ruleNameColor),showMarkers:t.showMarkers??n.showMarkers,markerRadius:F(t.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),Te=p(e=>{const{fontFamily:i,fontSize:a,terminalFill:n,terminalStroke:t,terminalTextColor:r,nonTerminalFill:o,nonTerminalStroke:g,nonTerminalTextColor:l,lineColor:s,strokeWidth:h,markerFill:u,commentFill:c,commentStroke:w,commentTextColor:d,specialFill:T,specialStroke:z,ruleNameColor:S}=E(e);return`
|
||||
.railroad-diagram {
|
||||
font-family: ${i};
|
||||
font-size: ${a}px;
|
||||
}
|
||||
|
||||
.railroad-terminal rect {
|
||||
fill: ${n};
|
||||
stroke: ${t};
|
||||
stroke-width: ${h}px;
|
||||
}
|
||||
|
||||
.railroad-terminal text {
|
||||
fill: ${r};
|
||||
font-family: ${i};
|
||||
font-size: ${a}px;
|
||||
text-anchor: middle;
|
||||
dominant-baseline: middle;
|
||||
}
|
||||
|
||||
.railroad-nonterminal rect {
|
||||
fill: ${o};
|
||||
stroke: ${g};
|
||||
stroke-width: ${h}px;
|
||||
}
|
||||
|
||||
.railroad-nonterminal text {
|
||||
fill: ${l};
|
||||
font-family: ${i};
|
||||
font-size: ${a}px;
|
||||
text-anchor: middle;
|
||||
dominant-baseline: middle;
|
||||
}
|
||||
|
||||
.railroad-line {
|
||||
stroke: ${s};
|
||||
stroke-width: ${h}px;
|
||||
fill: none;
|
||||
}
|
||||
|
||||
.railroad-start circle,
|
||||
.railroad-end circle {
|
||||
fill: ${u};
|
||||
}
|
||||
|
||||
.railroad-comment ellipse {
|
||||
fill: ${c};
|
||||
stroke: ${w};
|
||||
stroke-width: ${h}px;
|
||||
}
|
||||
|
||||
.railroad-comment text {
|
||||
fill: ${d};
|
||||
font-style: italic;
|
||||
font-family: ${i};
|
||||
font-size: ${a}px;
|
||||
text-anchor: middle;
|
||||
dominant-baseline: middle;
|
||||
}
|
||||
|
||||
.railroad-special rect {
|
||||
fill: ${T};
|
||||
stroke: ${z};
|
||||
stroke-width: ${h}px;
|
||||
stroke-dasharray: 5,3;
|
||||
}
|
||||
|
||||
.railroad-special text {
|
||||
fill: ${l};
|
||||
font-family: ${i};
|
||||
font-size: ${a}px;
|
||||
text-anchor: middle;
|
||||
dominant-baseline: middle;
|
||||
}
|
||||
|
||||
.railroad-rule-name {
|
||||
font-weight: bold;
|
||||
fill: ${S};
|
||||
font-family: ${i};
|
||||
font-size: ${a}px;
|
||||
}
|
||||
|
||||
.railroad-group {
|
||||
/* Grouping container, no specific styles */
|
||||
}
|
||||
`},"getStyles"),R,x=(R=class{constructor(){this.d=""}moveTo(i,a){return this.d+=`M ${i} ${a} `,this}lineTo(i,a){return this.d+=`L ${i} ${a} `,this}horizontalTo(i){return this.d+=`H ${i} `,this}verticalTo(i){return this.d+=`V ${i} `,this}arcTo(i,a,n,t,r,o,g){return this.d+=`A ${i} ${a} ${n} ${t?1:0} ${r?1:0} ${o} ${g} `,this}build(){return this.d.trim()}},p(R,"PathBuilder"),R),$,ue=($=class{constructor(i,a=E()){this.textCache=new Map,this.svg=i,this.config=a}measureText(i){if(this.textCache.has(i))return this.textCache.get(i);const a=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(i),n=a.node().getBBox(),t={width:n.width,height:n.height};return a.remove(),this.textCache.set(i,t),t}renderTerminal(i,a){const n=this.measureText(a),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,o=i.append("g").attr("class","railroad-terminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r).attr("rx",10).attr("ry",10),o.append("text").attr("x",t/2).attr("y",r/2).text(a),{element:o.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderNonTerminal(i,a){const n=this.measureText(a),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,o=i.append("g").attr("class","railroad-nonterminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r),o.append("text").attr("x",t/2).attr("y",r/2).text(a),{element:o.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderSequence(i,a){const n=a.map(s=>this.renderExpression(i,s));let t=0,r=0,o=0;for(const s of n)t+=s.dimensions.width,r=Math.max(r,s.dimensions.up),o=Math.max(o,s.dimensions.down);t+=(n.length-1)*this.config.horizontalSeparation;const g=i.append("g").attr("class","railroad-sequence");let l=0;for(let s=0;s<n.length;s++){const h=n[s],u=r-h.dimensions.up;if(g.node().appendChild(h.element).setAttribute("transform",`translate(${l}, ${u})`),s<n.length-1){const w=l+h.dimensions.width,d=w+this.config.horizontalSeparation,T=r;g.append("path").attr("class","railroad-line").attr("d",new x().moveTo(w,T).lineTo(d,T).build())}l+=h.dimensions.width+this.config.horizontalSeparation}return{element:g.node(),dimensions:{width:t,height:r+o,up:r,down:o}}}renderChoice(i,a){const n=a.map(c=>this.renderExpression(i,c));let t=0,r=0;for(const c of n)t=Math.max(t,c.dimensions.width),r+=c.dimensions.height;r+=(n.length-1)*this.config.verticalSeparation;const o=this.config.arcRadius,g=o*4,l=t+g,s=i.append("g").attr("class","railroad-choice");let h=0;const u=r/2;for(const c of n){const w=h,d=w+c.dimensions.up,T=o*2+(t-c.dimensions.width)/2;s.node().appendChild(c.element).setAttribute("transform",`translate(${T}, ${w})`);const S=new x,k=d>u;d===u?S.moveTo(0,u).lineTo(T,d):S.moveTo(0,u).arcTo(o,o,0,!1,k,o,u+(k?o:-o)).lineTo(o,d-(k?o:-o)).arcTo(o,o,0,!1,!k,o*2,d).lineTo(T,d),s.append("path").attr("class","railroad-line").attr("d",S.build());const N=new x,_=T+c.dimensions.width,X=l-o*2;d===u?N.moveTo(_,d).lineTo(l,u):N.moveTo(_,d).lineTo(X,d).arcTo(o,o,0,!1,!k,l-o,d+(k?-o:o)).lineTo(l-o,u+(k?o:-o)).arcTo(o,o,0,!1,k,l,u),s.append("path").attr("class","railroad-line").attr("d",N.build()),h+=c.dimensions.height+this.config.verticalSeparation}return{element:s.node(),dimensions:{width:l,height:r,up:u,down:r-u}}}renderOptional(i,a){const n=this.renderExpression(i,a),t=this.config.arcRadius,r=t*2,o=n.dimensions.width+t*4,g=n.dimensions.height+r,l=i.append("g").attr("class","railroad-optional"),s=t*2,h=r;l.node().appendChild(n.element).setAttribute("transform",`translate(${s}, ${h})`);const c=h+n.dimensions.up,w=new x().moveTo(0,c).lineTo(t*2,c);l.append("path").attr("class","railroad-line").attr("d",w.build());const d=new x().moveTo(s+n.dimensions.width,c).lineTo(o,c);l.append("path").attr("class","railroad-line").attr("d",d.build());const T=new x().moveTo(0,c).arcTo(t,t,0,!1,!1,t,c-t).lineTo(t,t).arcTo(t,t,0,!1,!0,t*2,0).lineTo(o-t*2,0).arcTo(t,t,0,!1,!0,o-t,t).lineTo(o-t,c-t).arcTo(t,t,0,!1,!1,o,c);return l.append("path").attr("class","railroad-line").attr("d",T.build()),{element:l.node(),dimensions:{width:o,height:g,up:c,down:g-c}}}renderRepetition(i,a,n){const t=this.renderExpression(i,a),r=this.config.arcRadius,o=r*2,g=t.dimensions.width+r*4,l=n===0,s=t.dimensions.height+o+(l?o:0),h=i.append("g").attr("class","railroad-repetition"),u=r*2,c=l?o:0;h.node().appendChild(t.element).setAttribute("transform",`translate(${u}, ${c})`);const d=c+t.dimensions.up;h.append("path").attr("class","railroad-line").attr("d",new x().moveTo(0,d).lineTo(r*2,d).build()),h.append("path").attr("class","railroad-line").attr("d",new x().moveTo(u+t.dimensions.width,d).lineTo(g,d).build());const T=c+t.dimensions.height+r,z=new x().moveTo(u+t.dimensions.width,d).arcTo(r,r,0,!1,!0,u+t.dimensions.width+r,d+r).lineTo(u+t.dimensions.width+r,T).arcTo(r,r,0,!1,!0,u+t.dimensions.width,T+r).lineTo(r*2,T+r).arcTo(r,r,0,!1,!0,r,T).lineTo(r,d+r).arcTo(r,r,0,!1,!0,r*2,d);if(h.append("path").attr("cl
Line truncated
|
||||
`+e);try{const n=H(i);n.attr("class","railroad-diagram");const r=B().railroad?.useMaxWidth??!0,o=oe.getRules();if(C.debug(`[Railroad] Rendering ${o.length} rules`),o.length===0){C.warn("[Railroad] No rules to render"),W(n,{height:100,width:200},r);return}const l=new ue(n,E()).renderDiagram(o);W(n,l,r),C.debug("[Railroad] Render complete")}catch(n){throw C.error("[Railroad] Render error:",n),n}},"draw"),xe={draw:ge};export{oe as d,Te as g,xe as r};
|
||||
@@ -0,0 +1,206 @@
|
||||
import{g as st}from"./chunk-5VM5RSS4.js";import{g as it}from"./chunk-XXDRQBXY.js";import{s as at}from"./chunk-POPQ4Y6H.js";import{_ as f,l as we,c as F,u as nt,v as rt,x as Ve,j as Ae,O as ut,b as lt,a as ct,s as ot,g as ht,n as dt,o as pt,k as I,p as At,q as ft,i as gt,P as U}from"./mermaid.core.js";import{f as mt}from"./chunk-F27PBJKO.js";var Pe=(function(){var s=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],ge=[1,34],b=[1,45],me=[1,35],Ce=[1,36],be=[1,37],ke=[1,38],Ee=[1,27],Te=[1,28],ye=[1,29],De=[1,30],Fe=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],Be=[1,9],A=[1,8,9],ee=[1,58],te=[1,59],se=[1,60],ie=[1,61],ae=[1,62],_e=[1,63],Se=[1,64],_=[1,8,9,41],Me=[1,77],R=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ne=[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],re=[13,60,86,100,102,103],Y=[13,60,73,74,86,100,102,103],Re=[13,60,68,69,70,71,72,86,100,102,103],ue=[1,103],K=[1,121],W=[1,117],Q=[1,113],j=[1,119],X=[1,114],q=[1,115],H=[1,116],J=[1,118],Z=[1,120],Ge=[22,50,60,61,82,86,87,88,89,90],Ue=[1,128],le=[12,39],Ne=[1,8,9,39,41,44,46],ce=[1,8,9,22],ze=[1,153],Ye=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Le={trace:f(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:f(function(o,h,p,l,C,e,$){var t=e.length-1;switch(C){case 8:this.$=e[t-1];break;case 9:case 10:case 13:case 15:this.$=e[t];break;case 11:case 14:this.$=e[t-2]+"."+e[t];break;case 12:case 16:this.$=e[t-1]+e[t];break;case 17:case 18:this.$=e[t-1]+"~"+e[t]+"~";break;case 19:l.addRelation(e[t]);break;case 20:e[t-1].titlLine truncated
|
||||
`+D.showPosition()+`
|
||||
Expecting `+pe.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Oe="Parse error on line "+(he+1)+": Unexpected "+(B==We?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Oe,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:ve,expected:pe})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+B);switch(L[0]){case 1:p.push(B),C.push(D.yytext),e.push(D.yylloc),p.push(L[1]),B=null,Ke=D.yyleng,t=D.yytext,he=D.yylineno,ve=D.yylloc;break;case 2:if(v=this.productions_[L[1]][1],G.$=C[C.length-v],G._$={first_line:e[e.length-(v||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(v||1)].first_column,last_column:e[e.length-1].last_column},et&&(G._$.range=[e[e.length-(v||1)].range[0],e[e.length-1].range[1]]),Ie=this.performAction.apply(G,[t,Ke,he,V.yy,L[1],C,e].concat($e)),typeof Ie<"u")return Ie;v&&(p=p.slice(0,-1*v*2),C=C.slice(0,-1*v),e=e.slice(0,-1*v)),p.push(this.productions_[L[1]][0]),C.push(G.$),e.push(G._$),je=$[p[p.length-2]][p[p.length-1]],p.push(je);break;case 3:return!0}}return!0},"parse")},Je=(function(){var O={EOF:1,parseError:f(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:f(function(o,h){return this.yy=h||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:f(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var h=o.match(/(?:\r\n?|\n).*/g);return h?(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:f(function(o){var h=o.length,p=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;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),p.length-1&&(this.yylineno-=p.length-1);var C=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:p?(p.length===l.length?this.yylloc.first_column:0)+l[l.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(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:f(function(o){this.unput(this.match.slice(o))},"less"),pastInput:f(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:f(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:f(function(){var o=this.pastInput(),h=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
|
||||
`+h+"^"},"showPosition"),test_match:f(function(o,h){var p,l,C;if(this.options.backtrack_lexer&&(C={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&&(C.yylloc.range=this.yylloc.range.slice(0))),l=o[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+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],p=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),p)return p;if(this._backtrack){for(var e in C)this[e]=C[e];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,h,p,l;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),e=0;e<C.length;e++)if(p=this._input.match(this.rules[C[e]]),p&&(!h||p[0].length>h[0].length)){if(h=p,l=e,this.options.backtrack_lexer){if(o=this.test_match(p,C[e]),o!==!1)return o;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(o=this.test_match(h,C[l]),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:f(function(){var h=this.next();return h||this.lex()},"lex"),begin:f(function(h){this.conditionStack.push(h)},"begin"),popState:f(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(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:f(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:f(function(h){this.begin(h)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:f(function(h,p,l,C){switch(l){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]|[\uLine truncated
|
||||
fill: ${s.nodeBorder||s.classText};
|
||||
stroke: none;
|
||||
font-family: ${s.fontFamily};
|
||||
font-size: 10px;
|
||||
|
||||
.title {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.cluster-label text {
|
||||
fill: ${s.titleColor};
|
||||
}
|
||||
.cluster-label span {
|
||||
color: ${s.titleColor};
|
||||
}
|
||||
.cluster-label span p {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.cluster rect {
|
||||
fill: ${s.clusterBkg};
|
||||
stroke: ${s.clusterBorder};
|
||||
stroke-width: 1px;
|
||||
}
|
||||
|
||||
.cluster text {
|
||||
fill: ${s.titleColor};
|
||||
}
|
||||
|
||||
.cluster span {
|
||||
color: ${s.titleColor};
|
||||
}
|
||||
|
||||
.nodeLabel, .edgeLabel {
|
||||
color: ${s.classText};
|
||||
}
|
||||
|
||||
.noteLabel .nodeLabel, .noteLabel .edgeLabel {
|
||||
color: ${s.noteTextColor};
|
||||
}
|
||||
.edgeLabel .label rect {
|
||||
fill: ${s.mainBkg};
|
||||
}
|
||||
.label text {
|
||||
fill: ${s.classText};
|
||||
}
|
||||
|
||||
.labelBkg {
|
||||
background: ${s.mainBkg};
|
||||
}
|
||||
.edgeLabel .label span {
|
||||
background: ${s.mainBkg};
|
||||
}
|
||||
|
||||
.classTitle {
|
||||
font-weight: bolder;
|
||||
}
|
||||
.node rect,
|
||||
.node circle,
|
||||
.node ellipse,
|
||||
.node polygon,
|
||||
.node path {
|
||||
fill: ${s.mainBkg};
|
||||
stroke: ${s.nodeBorder};
|
||||
stroke-width: ${s.strokeWidth};
|
||||
}
|
||||
|
||||
|
||||
.divider {
|
||||
stroke: ${s.nodeBorder};
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
g.clickable {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
g.classGroup rect {
|
||||
fill: ${s.mainBkg};
|
||||
stroke: ${s.nodeBorder};
|
||||
}
|
||||
|
||||
g.classGroup line {
|
||||
stroke: ${s.nodeBorder};
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
.classLabel .box {
|
||||
stroke: none;
|
||||
stroke-width: 0;
|
||||
fill: ${s.mainBkg};
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.classLabel .label {
|
||||
fill: ${s.nodeBorder};
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.relation {
|
||||
stroke: ${s.lineColor};
|
||||
stroke-width: ${s.strokeWidth};
|
||||
fill: none;
|
||||
}
|
||||
|
||||
.dashed-line{
|
||||
stroke-dasharray: 3;
|
||||
}
|
||||
|
||||
.dotted-line{
|
||||
stroke-dasharray: 1 2;
|
||||
}
|
||||
|
||||
[id$="-compositionStart"], .composition {
|
||||
fill: ${s.lineColor} !important;
|
||||
stroke: ${s.lineColor} !important;
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
[id$="-compositionEnd"], .composition {
|
||||
fill: ${s.lineColor} !important;
|
||||
stroke: ${s.lineColor} !important;
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
[id$="-dependencyStart"], .dependency {
|
||||
fill: ${s.lineColor} !important;
|
||||
stroke: ${s.lineColor} !important;
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
[id$="-dependencyEnd"], .dependency {
|
||||
fill: ${s.lineColor} !important;
|
||||
stroke: ${s.lineColor} !important;
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
[id$="-extensionStart"], .extension {
|
||||
fill: transparent !important;
|
||||
stroke: ${s.lineColor} !important;
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
[id$="-extensionEnd"], .extension {
|
||||
fill: transparent !important;
|
||||
stroke: ${s.lineColor} !important;
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
[id$="-aggregationStart"], .aggregation {
|
||||
fill: transparent !important;
|
||||
stroke: ${s.lineColor} !important;
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
[id$="-aggregationEnd"], .aggregation {
|
||||
fill: transparent !important;
|
||||
stroke: ${s.lineColor} !important;
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
[id$="-lollipopStart"], .lollipop {
|
||||
fill: ${s.mainBkg} !important;
|
||||
stroke: ${s.lineColor} !important;
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
[id$="-lollipopEnd"], .lollipop {
|
||||
fill: ${s.mainBkg} !important;
|
||||
stroke: ${s.lineColor} !important;
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
.edgeTerminals {
|
||||
font-size: 11px;
|
||||
line-height: initial;
|
||||
}
|
||||
|
||||
.classTitleText {
|
||||
text-anchor: middle;
|
||||
font-size: 18px;
|
||||
fill: ${s.textColor};
|
||||
}
|
||||
|
||||
.edgeLabel[data-look="neo"] {
|
||||
background-color: ${s.edgeLabelBackground};
|
||||
p {
|
||||
background-color: ${s.edgeLabelBackground};
|
||||
}
|
||||
rect {
|
||||
opacity: 0.5;
|
||||
background-color: ${s.edgeLabelBackground};
|
||||
fill: ${s.edgeLabelBackground};
|
||||
}
|
||||
text-align: center;
|
||||
}
|
||||
${st()}
|
||||
`,"getStyles"),Nt=Ct,bt=f((s,i="TB")=>{if(!s.doc)return i;let a=i;for(const n of s.doc)n.stmt==="dir"&&(a=n.value);return a},"getDir"),kt=f(function(s,i){return i.db.getClasses()},"getClasses"),Et=f(async function(s,i,a,n){we.info("REF0:"),we.info("Drawing class diagram (v3)",i);const{securityLevel:r,state:c,layout:u}=F();n.db.setDiagramId(i);const d=n.db.getData(),m=it(i,r);d.type=n.type,d.layoutAlgorithm=nt(u),d.nodeSpacing=c?.nodeSpacing||50,d.rankSpacing=c?.rankSpacing||50,d.markers=["aggregation","extension","composition","dependency","lollipop"],d.diagramId=i,await rt(d,m);const g=8;Ve.insertTitle(m,"classDiagramTitleText",c?.titleTopMargin??25,n.db.getDiagramTitle()),at(m,g,"classDiagram",c?.useMaxWidth??!0)},"draw"),Lt={getClasses:kt,draw:Et,getDir:bt};export{St as C,_t as a,Lt as c,Nt as s};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as a,j as o}from"./mermaid.core.js";var g=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{g};
|
||||
@@ -0,0 +1 @@
|
||||
import{s as a,c as s,a as e,C as t}from"./chunk-TICWLB2K.js";import{_ as i}from"./mermaid.core.js";import"./chunk-5VM5RSS4.js";import"./chunk-XXDRQBXY.js";import"./chunk-POPQ4Y6H.js";import"./chunk-F27PBJKO.js";import"./index.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
||||
@@ -0,0 +1 @@
|
||||
import{s as a,c as s,a as e,C as t}from"./chunk-TICWLB2K.js";import{_ as i}from"./mermaid.core.js";import"./chunk-5VM5RSS4.js";import"./chunk-XXDRQBXY.js";import"./chunk-POPQ4Y6H.js";import"./chunk-F27PBJKO.js";import"./index.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
||||
@@ -0,0 +1 @@
|
||||
var b;(function(s){s.assertEqual=n=>{};function e(n){}s.assertIs=e;function t(n){throw new Error}s.assertNever=t,s.arrayToEnum=n=>{const i={};for(const a of n)i[a]=a;return i},s.getValidEnumValues=n=>{const i=s.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),a={};for(const o of i)a[o]=n[o];return s.objectValues(a)},s.objectValues=n=>s.objectKeys(n).map(function(i){return n[i]}),s.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const i=[];for(const a in n)Object.prototype.hasOwnProperty.call(n,a)&&i.push(a);return i},s.find=(n,i)=>{for(const a of n)if(i(a))return a},s.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function r(n,i=" | "){return n.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}s.joinValues=r,s.jsonStringifyReplacer=(n,i)=>typeof i=="bigint"?i.toString():i})(b||(b={}));var Ie;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(Ie||(Ie={}));const f=b.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),I=s=>{switch(typeof s){case"undefined":return f.undefined;case"string":return f.string;case"number":return Number.isNaN(s)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(s)?f.array:s===null?f.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?f.promise:typeof Map<"u"&&s instanceof Map?f.map:typeof Set<"u"&&s instanceof Set?f.set:typeof Date<"u"&&s instanceof Date?f.date:f.object;default:return f.unknown}},c=b.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class T extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(i){return i.message},r={_errors:[]},n=i=>{for(const a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(n);else if(a.code==="invalid_return_type")n(a.returnTypeError);else if(a.code==="invalid_arguments")n(a.argumentsError);else if(a.path.length===0)r._errors.push(t(a));else{let o=r,l=0;for(;l<a.path.length;){const d=a.path[l];l===a.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(a))):o[d]=o[d]||{_errors:[]},o=o[d],l++}}};return n(this),r}static assert(e){if(!(e instanceof T))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,b.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const i=n.path[0];t[i]=t[i]||[],t[i].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}T.create=s=>new T(s);const _e=(s,e)=>{let t;switch(s.code){case c.invalid_type:s.received===f.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,b.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${b.joinValues(s.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${b.joinValues(s.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${b.joinValues(s.options)}, received '${s.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:b.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case c.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.iLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as V,l as $,j as lt}from"./mermaid.core.js";import{c as tt}from"./cytoscape.esm.js";import{g as gt}from"./index.js";var k={exports:{}},Z={exports:{}},Q={exports:{}},ut=Q.exports,q;function ft(){return q||(q=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.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=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},nLine truncated
|
||||
@@ -0,0 +1,166 @@
|
||||
import{_ as ut}from"./index.js";var fk=Object.create,Lu=Object.defineProperty,dk=Object.getOwnPropertyDescriptor,vh=Object.getOwnPropertyNames,pk=Object.getPrototypeOf,mk=Object.prototype.hasOwnProperty,s=(t,e)=>Lu(t,"name",{value:e,configurable:!0}),hk=(t,e)=>function(){return t&&(e=(0,t[vh(t)[0]])(t=0)),e},X=(t,e)=>function(){return e||(0,t[vh(t)[0]])((e={exports:{}}).exports,e),e.exports},en=(t,e)=>{for(var r in e)Lu(t,r,{get:e[r],enumerable:!0})},Th=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of vh(e))!mk.call(t,a)&&a!==r&&Lu(t,a,{get:()=>e[a],enumerable:!(n=dk(e,a))||n.enumerable});return t},kf=(t,e,r)=>(Th(t,e,"default"),r),$h=(t,e,r)=>(r=t!=null?fk(pk(t)):{},Th(Lu(r,"default",{value:t,enumerable:!0}),t)),Rh=t=>Th(Lu({},"__esModule",{value:!0}),t),Of={};en(Of,{AnnotatedTextEdit:()=>Ar,ChangeAnnotation:()=>pn,ChangeAnnotationIdentifier:()=>et,CodeAction:()=>Zp,CodeActionContext:()=>Jp,CodeActionKind:()=>Xp,CodeActionTriggerKind:()=>Yl,CodeDescription:()=>wp,CodeLens:()=>Qp,Color:()=>Ac,ColorInformation:()=>Ap,ColorPresentation:()=>Ep,Command:()=>dn,CompletionItem:()=>Gp,CompletionItemKind:()=>kp,CompletionItemLabelDetails:()=>Mp,CompletionItemTag:()=>Lp,CompletionList:()=>Fp,CreateFile:()=>ba,DeleteFile:()=>Sa,Diagnostic:()=>Wl,DiagnosticRelatedInformation:()=>Ec,DiagnosticSeverity:()=>_p,DiagnosticTag:()=>Sp,DocumentHighlight:()=>Kp,DocumentHighlightKind:()=>Up,DocumentLink:()=>tm,DocumentSymbol:()=>Yp,DocumentUri:()=>Tp,EOL:()=>x$,FoldingRange:()=>bp,FoldingRangeKind:()=>Cp,FormattingOptions:()=>em,Hover:()=>zp,InlayHint:()=>cm,InlayHintKind:()=>_c,InlayHintLabelPart:()=>Sc,InlineCompletionContext:()=>ym,InlineCompletionItem:()=>dm,InlineCompletionList:()=>pm,InlineCompletionTriggerKind:()=>mm,InlineValueContext:()=>um,InlineValueEvaluatableExpression:()=>lm,InlineValueText:()=>sm,InlineValueVariableLookup:()=>om,InsertReplaceEdit:()=>Dp,InsertTextFormat:()=>Op,InsertTextMode:()=>xp,Location:()=>Kl,LocationLink:()=>Rp,MarkedString:()=>Hl,MarkupContent:()=>wa,MarkupKind:()=>bc,OptionalVersionedTextDocumentIdentifier:()=>ql,ParameterInformation:()=>jp,Position:()=>oe,Range:()=>te,RenameFile:()=>_a,SelectedCompletionInfo:()=>hm,SelectionRange:()=>rm,SemanticTokenModifiers:()=>am,SemanticTokenTypes:()=>nm,SemanticTokens:()=>im,SignatureInformation:()=>Bp,StringValue:()=>fm,SymbolInformation:()=>qp,SymbolKind:()=>Wp,SymbolTag:()=>Vp,TextDocument:()=>vm,TextDocumentEdit:()=>Vl,TextDocumentIdentifier:()=>Ip,TextDocumentItem:()=>Pp,TextEdit:()=>ar,URI:()=>Rc,VersionedTextDocumentIdentifier:()=>Np,WorkspaceChange:()=>D$,WorkspaceEdit:()=>Cc,WorkspaceFolder:()=>gm,WorkspaceSymbol:()=>Hp,integer:()=>$p,uinteger:()=>Ul});var Tp,Rc,$p,Ul,oe,te,Kl,Rp,Ac,Ap,Ep,Cp,bp,Ec,_p,Sp,wp,Wl,dn,ar,pn,et,Ar,Vl,ba,_a,Sa,Cc,Pl,Bd,D$,Ip,Np,ql,Pp,bc,wa,kp,Op,Lp,Dp,xp,Mp,Gp,Fp,Hl,zp,jp,Bp,Up,Kp,Wp,Vp,qp,Hp,Yp,Xp,Yl,Jp,Zp,Qp,em,tm,rm,nm,am,im,sm,om,lm,um,_c,Sc,cm,fm,dm,pm,mm,hm,ym,gm,x$,vm,av,E,Du=hk({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-languageserver-types/lib/esm/main.js"(){var t,e,r,n;(function(a){function i(o){return typeof o=="string"}s(i,"is"),a.is=i})(Tp||(Tp={})),(function(a){function i(o){return typeof o=="string"}s(i,"is"),a.is=i})(Rc||(Rc={})),(function(a){a.MIN_VALUE=-2147483648,a.MAX_VALUE=2147483647;function i(o){return typeof o=="number"&&a.MIN_VALUE<=o&&o<=a.MAX_VALUE}s(i,"is"),a.is=i})($p||($p={})),(function(a){a.MIN_VALUE=0,a.MAX_VALUE=2147483647;function i(o){return typeof o=="number"&&a.MIN_VALUE<=o&&o<=a.MAX_VALUE}s(i,"is"),a.is=i})(Ul||(Ul={})),(function(a){function i(u,l){return u===Number.MAX_VALUE&&(u=Ul.MAX_VALUE),l===Number.MAX_VALUE&&(l=Ul.MAX_VALUE),{line:u,character:l}}s(i,"create"),a.create=i;function o(u){let l=u;return E.objectLiteral(l)&&E.uinteger(l.line)&&E.uinteger(l.character)}s(o,"is"),a.is=o})(oe||(oe={})),(function(a){function i(u,l,c,f){if(E.uinteger(u)&&E.uinteger(l)&&E.uinteger(c)&&E.uinteger(f))return{start:oe.create(u,l),end:oe.create(c,f)};if(oe.is(u)&&oe.is(l))return{start:u,end:l};throw new Error(`Range#create called with invalid arguments[${u}, ${l}, ${c}, ${f}]`)}s(i,"create"),a.create=i;function o(u){let l=u;return E.objectLiteral(l)&&oe.is(l.start)&&oe.is(l.end)}s(o,"is"),a.is=o})(te||(te={})),(function(a){function i(u,l){return{uri:u,range:l}}s(i,"create"),a.create=i;function o(u){let l=u;return E.objectLiteral(l)&&te.is(l.range)&&(E.string(l.uri)||E.undefined(l.uri))}s(o,"is"),a.is=o})(Kl||(Kl={})),(function(a){function i(u,l,c,f){return{targetUri:u,targetRange:l,targetSelectionRange:c,originSelectionRange:f}}s(i,"create"),a.create=i;function o(u){let l=u;return E.objectLiteral(l)&&te.is(l.targetRange)&&E.string(l.targetUri)&&te.is(l.targetSelectionRange)&&(te.is(l.originSelectionRange)||E.undefined(l.originSelectionRange))}s(o,"is"),a.is=o})(Rp||(Rp={})),(function(a){function i(u,l,c,f){return{red:u,green:l,blue:c,alpha:f}}s(i,"create"),a.create=i;function o(u){const l=u;return E.objectLiteral(l)&&E.numberRaLine truncated
|
||||
`,`\r
|
||||
`,"\r"],(function(a){function i(c,f,d,p){return new av(c,f,d,p)}s(i,"create"),a.create=i;function o(c){let f=c;return!!(E.defined(f)&&E.string(f.uri)&&(E.undefined(f.languageId)||E.string(f.languageId))&&E.uinteger(f.lineCount)&&E.func(f.getText)&&E.func(f.positionAt)&&E.func(f.offsetAt))}s(o,"is"),a.is=o;function u(c,f){let d=c.getText(),p=l(f,(h,T)=>{let C=h.range.start.line-T.range.start.line;return C===0?h.range.start.character-T.range.start.character:C}),y=d.length;for(let h=p.length-1;h>=0;h--){let T=p[h],C=c.offsetAt(T.range.start),v=c.offsetAt(T.range.end);if(v<=y)d=d.substring(0,C)+T.newText+d.substring(v,d.length);else throw new Error("Overlapping edit");y=C}return d}s(u,"applyEdits"),a.applyEdits=u;function l(c,f){if(c.length<=1)return c;const d=c.length/2|0,p=c.slice(0,d),y=c.slice(d);l(p,f),l(y,f);let h=0,T=0,C=0;for(;h<p.length&&T<y.length;)f(p[h],y[T])<=0?c[C++]=p[h++]:c[C++]=y[T++];for(;h<p.length;)c[C++]=p[h++];for(;T<y.length;)c[C++]=y[T++];return c}s(l,"mergeSort")})(vm||(vm={})),av=(n=class{constructor(i,o,u,l){this._uri=i,this._languageId=o,this._version=u,this._content=l,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(i){if(i){let o=this.offsetAt(i.start),u=this.offsetAt(i.end);return this._content.substring(o,u)}return this._content}update(i,o){this._content=i.text,this._version=o,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let i=[],o=this._content,u=!0;for(let l=0;l<o.length;l++){u&&(i.push(l),u=!1);let c=o.charAt(l);u=c==="\r"||c===`
|
||||
`,c==="\r"&&l+1<o.length&&o.charAt(l+1)===`
|
||||
`&&l++}u&&o.length>0&&i.push(o.length),this._lineOffsets=i}return this._lineOffsets}positionAt(i){i=Math.max(Math.min(i,this._content.length),0);let o=this.getLineOffsets(),u=0,l=o.length;if(l===0)return oe.create(0,i);for(;u<l;){let f=Math.floor((u+l)/2);o[f]>i?l=f:u=f+1}let c=u-1;return oe.create(c,i-o[c])}offsetAt(i){let o=this.getLineOffsets();if(i.line>=o.length)return this._content.length;if(i.line<0)return 0;let u=o[i.line],l=i.line+1<o.length?o[i.line+1]:this._content.length;return Math.max(Math.min(u+i.character,l),u)}get lineCount(){return this.getLineOffsets().length}},s(n,"FullTextDocument"),n),(function(a){const i=Object.prototype.toString;function o(v){return typeof v<"u"}s(o,"defined"),a.defined=o;function u(v){return typeof v>"u"}s(u,"undefined"),a.undefined=u;function l(v){return v===!0||v===!1}s(l,"boolean"),a.boolean=l;function c(v){return i.call(v)==="[object String]"}s(c,"string"),a.string=c;function f(v){return i.call(v)==="[object Number]"}s(f,"number"),a.number=f;function d(v,w,b){return i.call(v)==="[object Number]"&&w<=v&&v<=b}s(d,"numberRange"),a.numberRange=d;function p(v){return i.call(v)==="[object Number]"&&-2147483648<=v&&v<=2147483647}s(p,"integer"),a.integer=p;function y(v){return i.call(v)==="[object Number]"&&0<=v&&v<=2147483647}s(y,"uinteger"),a.uinteger=y;function h(v){return i.call(v)==="[object Function]"}s(h,"func"),a.func=h;function T(v){return v!==null&&typeof v=="object"}s(T,"objectLiteral"),a.objectLiteral=T;function C(v,w){return Array.isArray(v)&&v.every(w)}s(C,"typedArray"),a.typedArray=C})(E||(E={}))}}),Wn=X({"../../node_modules/.pnpm/[email protected]/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}s(r,"RAL"),(function(n){function a(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");e=i}s(a,"install"),n.install=a})(r||(r={})),t.default=r}}),xu=X({"../../node_modules/.pnpm/[email protected]/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}s(e,"boolean"),t.boolean=e;function r(l){return typeof l=="string"||l instanceof String}s(r,"string"),t.string=r;function n(l){return typeof l=="number"||l instanceof Number}s(n,"number"),t.number=n;function a(l){return l instanceof Error}s(a,"error"),t.error=a;function i(l){return typeof l=="function"}s(i,"func"),t.func=i;function o(l){return Array.isArray(l)}s(o,"array"),t.array=o;function u(l){return o(l)&&l.every(c=>r(c))}s(u,"stringArray"),t.stringArray=u}}),nl=X({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e=Wn(),r;(function(u){const l={dispose(){}};u.None=function(){return l}})(r||(t.Event=r={}));var n=(i=class{add(l,c=null,f){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(l),this._contexts.push(c),Array.isArray(f)&&f.push({dispose:s(()=>this.remove(l,c),"dispose")})}remove(l,c=null){if(!this._callbacks)return;let f=!1;for(let d=0,p=this._callbacks.length;d<p;d++)if(this._callbacks[d]===l)if(this._contexts[d]===c){this._callbacks.splice(d,1),this._contexts.splice(d,1);return}else f=!0;if(f)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 c=[],f=this._callbacks.slice(0),d=this._contexts.slice(0);for(let p=0,y=f.length;p<y;p++)try{c.push(f[p].apply(d[p],l))}catch(h){(0,e.default)().console.error(h)}return c}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},s(i,"CallbackList"),i),a=(o=class{constructor(l){this._options=l}get event(){return this._event||(this._event=(l,c,f)=>{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(l,c);const d={dispose:s(()=>{this._callbacks&&(this._callbacks.remove(l,c),d.dispose=o._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(f)&&f.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)}},s(o,"Emitter"),o);t.Emitter=a,a._noop=function(){}}}),Lf=X({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){var l,c;Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var e=Wn(),r=xu(),n=nl(),a;(function(f){f.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Even
Line truncated
|
||||
${JSON.stringify(Object.fromEntries(h))}`));return}const C=parseInt(T);if(isNaN(C)){this.fireError(new Error(`Content-Length value must be a number. Got ${T}`));return}this.nextMessageLength=C}const y=this.buffer.tryReadBody(this.nextMessageLength);if(y===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const h=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(y):y,T=await this.options.contentTypeDecoder.decode(h,this.options);this.callback(T)}).catch(h=>{this.fireError(h)})}}catch(y){this.fireError(y)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,e.default)().timer.setTimeout((p,y)=>{this.partialMessageTimer=void 0,p===this.messageToken&&(this.firePartialMessage({messageToken:p,waitingTime:y}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},s(f,"ReadableStreamMessageReader"),f);t.ReadableStreamMessageReader=l}}),Tk=X({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(t){var d,p;Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;var e=Wn(),r=xu(),n=F$(),a=nl(),i="Content-Length: ",o=`\r
|
||||
`,u;(function(y){function h(T){let C=T;return C&&r.func(C.dispose)&&r.func(C.onClose)&&r.func(C.onError)&&r.func(C.write)}s(h,"is"),y.is=h})(u||(t.MessageWriter=u={}));var l=(d=class{constructor(){this.errorEmitter=new a.Emitter,this.closeEmitter=new a.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(h,T,C){this.errorEmitter.fire([this.asError(h),T,C])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(h){return h instanceof Error?h:new Error(`Writer received error. Reason: ${r.string(h.message)?h.message:"unknown"}`)}},s(d,"AbstractMessageWriter"),d);t.AbstractMessageWriter=l;var c;(function(y){function h(T){return T===void 0||typeof T=="string"?{charset:T??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:T.charset??"utf-8",contentEncoder:T.contentEncoder,contentTypeEncoder:T.contentTypeEncoder??(0,e.default)().applicationJson.encoder}}s(h,"fromOptions"),y.fromOptions=h})(c||(c={}));var f=(p=class extends l{constructor(h,T){super(),this.writable=h,this.options=c.fromOptions(T),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(C=>this.fireError(C)),this.writable.onClose(()=>this.fireClose())}async write(h){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(h,this.options).then(C=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(C):C).then(C=>{const v=[];return v.push(i,C.byteLength.toString(),o),v.push(o),this.doWrite(h,v,C)},C=>{throw this.fireError(C),C}))}async doWrite(h,T,C){try{return await this.writable.write(T.join(""),"ascii"),this.writable.write(C)}catch(v){return this.handleError(v,h),Promise.reject(v)}}handleError(h,T){this.errorCount++,this.fireError(h,T,this.errorCount)}end(){this.writable.end()}},s(p,"WriteableStreamMessageWriter"),p);t.WriteableStreamMessageWriter=f}}),$k=X({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0;var e=13,r=10,n=`\r
|
||||
`,a=(i=class{constructor(u="utf-8"){this._encoding=u,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(u){const l=typeof u=="string"?this.fromString(u,this._encoding):u;this._chunks.push(l),this._totalLength+=l.byteLength}tryReadHeaders(u=!1){if(this._chunks.length===0)return;let l=0,c=0,f=0,d=0;e:for(;c<this._chunks.length;){const T=this._chunks[c];for(f=0;f<T.length;){switch(T[f]){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,f++;break e;default:l=0}break;default:l=0}f++}d+=T.byteLength,c++}if(l!==4)return;const p=this._read(d+f),y=new Map,h=this.toString(p,"ascii").split(n);if(h.length<2)return y;for(let T=0;T<h.length-2;T++){const C=h[T],v=C.indexOf(":");if(v===-1)throw new Error(`Message header must separate key and value using ':'
|
||||
${C}`);const w=C.substr(0,v),b=C.substr(v+1).trim();y.set(u?w.toLowerCase():w,b)}return y}tryReadBody(u){if(!(this._totalLength<u))return this._read(u)}get numberOfBytes(){return this._totalLength}_read(u){if(u===0)return this.emptyBuffer();if(u>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===u){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=u,this.asNative(d)}if(this._chunks[0].byteLength>u){const d=this._chunks[0],p=this.asNative(d,u);return this._chunks[0]=d.slice(u),this._totalLength-=u,p}const l=this.allocNative(u);let c=0,f=0;for(;u>0;){const d=this._chunks[f];if(d.byteLength>u){const p=d.slice(0,u);l.set(p,c),c+=u,this._chunks[f]=d.slice(u),this._totalLength-=u,u-=u}else l.set(d,c),c+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,u-=d.byteLength}return l}},s(i,"AbstractMessageBuffer"),i);t.AbstractMessageBuffer=a}}),Rk=X({"../../node_modules/.pnpm/[email protected]/node_modules/vscode-jsonrpc/lib/common/connection.js"(t){var k,_;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=Wn(),r=xu(),n=M$(),a=G$(),i=nl(),o=Lf(),u;(function($){$.type=new n.NotificationType("$/cancelRequest")})(u||(u={}));var l;(function($){function I(R){return typeof R=="string"||typeof R=="number"}s(I,"is"),$.is=I})(l||(t.ProgressToken=l={}));var c;(function($){$.type=new n.NotificationType("$/progress")})(c||(c={}));var f=(k=class{constructor(){}},s(k,"ProgressType"),k);t.ProgressType=f;var d;(function($){function I(R){return r.func(R)}s(I,"is"),$.is=I})(d||(d={})),t.NullLogger=Object.freeze({error:s(()=>{},"error"),warn:s(()=>{},"warn"),info:s(()=>{},"info"),log:s(()=>{},"log")});var p;(function($){$[$.Off=0]="Off",$[$.Messages=1]="Messages",$[$.Compact=2]="Compact",$[$.Verbose=3]="Verbose"})(p||(t.Trace=p={}));var y;(function($){$.Off="off",$.Messages="messages",$.Compact="compact",$.Verbose="verbose"})(y||(t.TraceValues=y={})),(function($){function I(A){if(!r.string(A))return $.Off;switch(A=A.toLowerCase(),A){case"off":return $.Off;case"messages":return $.Messages;case"compact":return $.Compact;case"verbose":return $.Verbose;default:return $.Off}}s(I,"fromString"),$.fromString=I;function R(A){switch(A){case $.Off:return"off";case $.Messages:return"messages";case $.Compact:return"compact";case $.Verbose:return"verbose";default:return"off"}}s(R,"toString"),$.toString=R})(p||(t.Trace=p={}));var h;(function($){$.Text="text",$.JSON="json"})(h||(t.TraceFormat=h={})),(function($){function I(R){return r.string(R)?(R=R.toLowerCase(),R==="json"?$.JSON:$.Text):$.Text}s(I,"fromString"),$.fromString=I})(h||(t.TraceFormat=h={}));var T;(function($){$.type=new n.NotificationType("$/setTrace")})(T||(t.SetTraceNotification=T={}));var C;(function($){$.type=new n.NotificationType("$/logTrace")})(C||(t.LogTraceNotification=C={}));var v;(function($){$[$.Closed=1]="Closed",$[$.Disposed=2]="Disposed",$[$.AlreadyListening=3]="AlreadyListening"})(v||(t.ConnectionErrors=v={}));var w=(_=class extends Error{constructor(I,R){super(R),this.code=I,Object.setPrototypeOf(this,_.prototype)}},s(_,"ConnectionError"),_);t.ConnectionError=w;var b;(function($){function I(R){const A=R;return A&&r.func(A.cancelUndispatched)}s(I,"is"),$.is=I})(b||(t.ConnectionStrategy=b={}));var N;(function($){function I(R){const A=R;return A&&(A.kind===void 0||A.kind==="id")&&r.func(A.createCancellationTokenSource)&&(A.dispose===void 0||r.func(A.dispose))}s(I,"is"),$.is=I})(N||(t.IdCancellationReceiverStrategy=N={}));var B;(function($){function I(R){const A=R;return A&&A.kind==="request"&&r.func(A.createCancellationTokenSource)&&(A.dispose===void 0||r.func(A.dispose))}s(I,"is"),$.is=I})(B||(t.RequestCancellationReceiverStrategy=B={}));var ne;(function($){$.Message=Object.freeze({createCancellationTokenSource(R){return new o.CancellationTokenSource}});function I(R){return N.is(R)||B.is(R)}s(I,"is"),$.is=I})(ne||(t.CancellationReceiverStrategy=ne={}));var J;(function($){$.Message=Object.freeze({sendCancellation(R,A){return R.sendNotification(u.type,{id:A})},cleanup(R){}});function I(R){const A=R;return A&&r.func(A.sendCancellation)&&r.func(A.cleanup)}s(I,"is"),$.is=I})(J||(t.CancellationSenderStrategy=J={}));var he;(function($){$.Message=Object.freeze({receiver:ne.Message,sender:J.Message});function I(R){const A=R;return A&&ne.is(A.receiver)&&J.is(A.sender)}s(I,"is"),$.is=I})(he||(t.CancellationStrategy=he={}));var Ae;(function($){function I(R){const A=R;return A&&r.func(A.handleMessage)}s(I,"is"),$.is=I})(Ae||(t.MessageStrategy=Ae={}));var ye;(function($){function I(R){const A=R;ret
Line truncated
|
||||
${JSON.stringify(g.error,void 0,4)}`):S.error("Received response message without id. No further error information provided.");else{const P=g.id,D=Ee.get(P);if(wl(g,D),D!==void 0){Ee.delete(P);try{if(g.error){const F=g.error;D.reject(new n.ResponseError(F.code,F.message,F.data))}else if(g.result!==void 0)D.resolve(g.result);else throw new Error("Should never happen.")}catch(F){F.message?S.error(`Response handler '${D.method}' failed with message: ${F.message}`):S.error(`Response handler '${D.method}' failed unexpectedly.`)}}}}s(Al,"handleResponse");function El(g){if(er())return;let P,D;if(g.method===u.type.method){const F=g.params.id;Ve.delete(F),sn(g);return}else{const F=Z.get(g.method);F&&(D=F.handler,P=F.type)}if(D||q)try{if(sn(g),D)if(g.params===void 0)P!==void 0&&P.numberOfParams!==0&&P.parameterStructures!==n.ParameterStructures.byName&&S.error(`Notification ${g.method} defines ${P.numberOfParams} params but received none.`),D();else if(Array.isArray(g.params)){const F=g.params;g.method===c.type.method&&F.length===2&&l.is(F[0])?D({token:F[0],value:F[1]}):(P!==void 0&&(P.parameterStructures===n.ParameterStructures.byName&&S.error(`Notification ${g.method} defines parameters by name but received parameters by position`),P.numberOfParams!==g.params.length&&S.error(`Notification ${g.method} defines ${P.numberOfParams} params but received ${F.length} arguments`)),D(...F))}else P!==void 0&&P.parameterStructures===n.ParameterStructures.byPosition&&S.error(`Notification ${g.method} defines parameters by position but received parameters by name`),D(g.params);else q&&q(g.method,g.params)}catch(F){F.message?S.error(`Notification handler '${g.method}' failed with message: ${F.message}`):S.error(`Notification handler '${g.method}' failed unexpectedly.`)}else je.fire(g)}s(El,"handleNotification");function Cl(g){if(!g){S.error("Received empty message.");return}S.error(`Received message which is neither a response nor a notification message:
|
||||
${JSON.stringify(g,null,4)}`);const P=g;if(r.string(P.id)||r.number(P.id)){const D=P.id,F=Ee.get(D);F&&F.reject(new Error("The received response has neither a result nor an error property."))}}s(Cl,"handleInvalidMessage");function xt(g){if(g!=null)switch(ee){case p.Verbose:return JSON.stringify(g,null,4);case p.Compact:return JSON.stringify(g);default:return}}s(xt,"stringifyTrace");function bl(g){if(!(ee===p.Off||!ce))if(Qe===h.Text){let P;(ee===p.Verbose||ee===p.Compact)&&g.params&&(P=`Params: ${xt(g.params)}
|
||||
|
||||
`),ce.log(`Sending request '${g.method} - (${g.id})'.`,P)}else tr("send-request",g)}s(bl,"traceSendingRequest");function _l(g){if(!(ee===p.Off||!ce))if(Qe===h.Text){let P;(ee===p.Verbose||ee===p.Compact)&&(g.params?P=`Params: ${xt(g.params)}
|
||||
|
||||
`:P=`No parameters provided.
|
||||
|
||||
`),ce.log(`Sending notification '${g.method}'.`,P)}else tr("send-notification",g)}s(_l,"traceSendingNotification");function jr(g,P,D){if(!(ee===p.Off||!ce))if(Qe===h.Text){let F;(ee===p.Verbose||ee===p.Compact)&&(g.error&&g.error.data?F=`Error data: ${xt(g.error.data)}
|
||||
|
||||
`:g.result?F=`Result: ${xt(g.result)}
|
||||
|
||||
`:g.error===void 0&&(F=`No result returned.
|
||||
|
||||
`)),ce.log(`Sending response '${P} - (${g.id})'. Processing request took ${Date.now()-D}ms`,F)}else tr("send-response",g)}s(jr,"traceSendingResponse");function Sl(g){if(!(ee===p.Off||!ce))if(Qe===h.Text){let P;(ee===p.Verbose||ee===p.Compact)&&g.params&&(P=`Params: ${xt(g.params)}
|
||||
|
||||
`),ce.log(`Received request '${g.method} - (${g.id})'.`,P)}else tr("receive-request",g)}s(Sl,"traceReceivedRequest");function sn(g){if(!(ee===p.Off||!ce||g.method===C.type.method))if(Qe===h.Text){let P;(ee===p.Verbose||ee===p.Compact)&&(g.params?P=`Params: ${xt(g.params)}
|
||||
|
||||
`:P=`No parameters provided.
|
||||
|
||||
`),ce.log(`Received notification '${g.method}'.`,P)}else tr("receive-notification",g)}s(sn,"traceReceivedNotification");function wl(g,P){if(!(ee===p.Off||!ce))if(Qe===h.Text){let D;if((ee===p.Verbose||ee===p.Compact)&&(g.error&&g.error.data?D=`Error data: ${xt(g.error.data)}
|
||||
|
||||
`:g.result?D=`Result: ${xt(g.result)}
|
||||
|
||||
`:g.error===void 0&&(D=`No result returned.
|
||||
|
||||
`)),P){const F=g.error?` Request failed: ${g.error.message} (${g.error.code}).`:"";ce.log(`Received response '${P.method} - (${g.id})' in ${Date.now()-P.timerStart}ms.${F}`,D)}else ce.log(`Received response ${g.id} without active response promise.`,D)}else tr("receive-response",g)}s(wl,"traceReceivedResponse");function tr(g,P){if(!ce||ee===p.Off)return;const D={isLSPMessage:!0,type:g,message:P,timestamp:Date.now()};ce.log(D)}s(tr,"logLSPMessage");function Tr(){if(ma())throw new w(v.Closed,"Connection is closed.");if(er())throw new w(v.Disposed,"Connection is disposed.")}s(Tr,"throwIfClosedOrDisposed");function Il(){if(pa())throw new w(v.AlreadyListening,"Connection is already listening")}s(Il,"throwIfListening");function Nl(){if(!pa())throw new Error("Call listen() first.")}s(Nl,"throwIfNotListening");function m(g){return g===void 0?null:g}s(m,"undefinedToNull");function le(g){if(g!==null)return g}s(le,"nullToUndefined");function we(g){return g!=null&&!Array.isArray(g)&&typeof g=="object"}s(we,"isNamedParam");function H(g,P){switch(g){case n.ParameterStructures.auto:return we(P)?le(P):[m(P)];case n.ParameterStructures.byName:if(!we(P))throw new Error("Received parameters by name but param is not an object literal.");return le(P);case n.ParameterStructures.byPosition:return[m(P)];default:throw new Error(`Unknown parameter structure ${g.toString()}`)}}s(H,"computeSingleParam");function Ie(g,P){let D;const F=g.numberOfParams;switch(F){case 0:D=void 0;break;case 1:D=H(g.parameterStructures,P[0]);break;default:D=[];for(let Ce=0;Ce<P.length&&Ce<F;Ce++)D.push(m(P[Ce]));if(P.length<F)for(let Ce=P.length;Ce<F;Ce++)D.push(null);break}return D}s(Ie,"computeMessageParams");const va={sendNotification:s((g,...P)=>{Tr();let D,F;if(r.string(g)){D=g;const me=P[0];let De=0,Ge=n.ParameterStructures.auto;n.ParameterStructures.is(me)&&(De=1,Ge=me);let ie=P.length;const Ne=ie-De;switch(Ne){case 0:F=void 0;break;case 1:F=H(Ge,P[De]);break;default:if(Ge===n.ParameterStructures.byName)throw new Error(`Received ${Ne} parameters for 'by Name' notification parameter structure.`);F=P.slice(De,ie).map(fe=>m(fe));break}}else{const me=P;D=g.method,F=Ie(g,me)}const Ce={jsonrpc:z,method:D,params:F};return _l(Ce),I.write(Ce).catch(me=>{throw S.error("Sending notification failed."),me})},"sendNotification"),onNotification:s((g,P)=>{Tr();let D;return r.func(g)?q=g:P&&(r.string(g)?(D=g,Z.set(g,{type:void 0,handler:P})):(D=g.method,Z.set(g.method,{type:g,handler:P}))),{dispose:s(()=>{D!==void 0?Z.delete(D):q=void 0},"dispose")}},"onNotification"),onProgress:s((g,P,D)=>{if(ae.has(P))throw new Error(`Progress handler for token ${P} already registered`);return ae.set(P,D),{dispose:s(()=>{ae.delete(P)},"dispose")}},"onProgress"),sendProgress:s((g,P,D)=>va.sendNotification(c.type,{token:P,value:D}),"sendProgress"),onUnhandledProgress:Qt.event,sendRequest:s((g,...P)=>{Tr(),Nl();let D,F,Ce;if(r.string(g)){D=g;const ie=P[0],Ne=P[P.length-1];let fe=0,Ue=n.ParameterStructures.auto;n.ParameterStructures.is(ie)&&(fe=1,Ue=ie);let lt=P.length;o.CancellationToken.is(Ne)&&(lt=lt-1,Ce=Ne);const rr=lt-fe;switch(rr){case 0:F=void 0;break;case 1:F=H(Ue,P[fe]);break;default:if(Ue===n.ParameterStructures.byName)throw new Error(`Received ${rr} parameters for 'by Name' request parameter structure.`);F=P.slice(fe,lt).map(ck=>m(ck));break}}else{const ie=P;D=g.method,F=Ie(g,ie);const Ne=g.numberOfParams;Ce=o.CancellationToken.is(ie[Ne])?ie[Ne]:void 0}const me=L++;let De;Ce&&(De=Ce.onCancellationRequested(()=>{const ie=ve.sender.sendCancellation(va,me);return ie===void 0?(S.log(`Received no promise from cancellation strategy when cancelling id ${me}`),Promise.resolve()):ie.catch(()=>{S.log(`Sending cancellation messages for id ${me} failed`)})}));const Ge={jsonrpc:z,id:me,method:D,params:F};return bl(Ge),typeof ve.sender.enableCancellation=="function"&&ve.sender.enableCancellation(Ge),new Promise(async(ie,Ne)=>{const fe=s(rr=>{ie(rr),ve.sender.cleanup(me),De?.dispose()},"resolveWithCleanup"),Ue=s(rr=>{Ne(rr),ve.sender.cleanup(me),De?.dispose()},"rejectWithCleanup"),lt={method:D,timerStart:Date.now(),resolve:fe,reject:Ue};try{await I.write(Ge),Ee.set(me,lt)}catch(rr){throw S.error("Sending request failed."),lt.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,rr.message?rr.message:"Unknown reason")),rr}})},"sendRequest"),onRequest:s((g,P)=>{Tr();let D=null;return d.is(g)?(D=void 0,M=g):r.string(g)?(D=null,P!==void 0&&(D=g,Y.set(g,{handler:P,type:void 0}))):P!==void 0&&(D=g.method,Y.set(g.method,{type:g,handler:P})),{dispose:s(()=>{D!==null&&(D!==void 0?Y.delete(D):M=void 0)},"dispose")}},"onRequest"),hasPendingResponse:s(()=>Ee.size>0,"hasPendingResponse"),trace:s(async(g,P,D)=>{let F=!1,Ce=h.Text;D!==void 0&&(r.boolean(D)?F=D:(F=D.sendNotification||!1,Ce=D.traceFormat||h.Text)),ee=g,Qe=Ce,ee===p.Off?ce=void 0:ce=P,F&&!ma()&&!er()&&await va.sendNotification(T.type,{value:p.toString(g)})},"trace"),onError:ge.event,onClose:G.event,onUnhandledNotification:je.event,onD
Line truncated
|
||||
`),W("\r"),W(" "),W("\v"),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W(" "),W("\u2028"),W("\u2029"),W(" "),W(" "),W(" "),W("\uFEFF")],Yk=/[0-9a-fA-F]/,nc=/[0-9]/,Xk=/[1-9]/,ri,mR=(ri=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":Ia(n,"global");break;case"i":Ia(n,"ignoreCase");break;case"m":Ia(n,"multiLine");break;case"u":Ia(n,"unicode");break;case"y":Ia(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}}mn(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return pR()}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 a=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:a,atMost:a};break;case",":let i;this.isDigit()?(i=this.integerIncludingZero(),r={atLeast:a,atMost:i}):r={atLeast:a,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;mn(r);break}if(!(e===!0&&r===void 0)&&mn(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()),mn(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[W(`
|
||||
`),W("\r"),W("\u2028"),W("\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=lf;break;case"D":e=lf,r=!0;break;case"s":e=sv;break;case"S":e=sv,r=!0;break;case"w":e=uf;break;case"W":e=uf,r=!0;break}if(mn(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=W("\f");break;case"n":e=W(`
|
||||
`);break;case"r":e=W("\r");break;case"t":e=W(" ");break;case"v":e=W("\v");break}if(mn(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:W("\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:W(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:W(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,Rm(n)&&this.isRangeDash()){this.consumeChar("-");const a=this.classAtom();if(a.type,Rm(a)){if(a.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:a.value})}else wc(n.value,e),e.push(W("-")),wc(a.value,e)}else wc(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:W("\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;this.consumeChar("("),this.peekChar(0)==="?"?(this.consumeChar("?"),this.consumeChar(":"),e=!1):this.groupIdx++;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(Xk.test(e)===!1)throw Error("Expecting a positive integer");for(;nc.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(nc.test(e)===!1)throw Error("Expecting an integer");for(;nc.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:W(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 nc.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 a=0;a<e;a++){const i=this.popChar();if(Yk.test(i)===!1)throw Error("Expecting a HexDecimal digits");r+=i}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}}},s(ri,"RegExpParser"),ri),ni,Kf=(ni=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(a=>{this.visit(a)},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){}},s(ni,"BaseRegExpVisitor"),ni),hR=/\r?\n/gm,yR=new mR,ai,Jk=(ai=class extends Kf{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=il(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)}},s(ai,"TerminalRegExpVisitor"),ai),On=new Jk;function gR(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=yR.pattern(t),r=[];for(const n of e.value.value)On.reset(t),On.visit(n),r.push({start:On.startRegexp,end:On.endRegex});return r}catch{return[]}}s(gR,"getTerminalParts");function iy(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),On.reset(t),On.visit(yR.pattern(t)),On.multiline}catch{return!1}}s(iy,"isMultilineComment");var vR=`\f
|
||||
\r \v \u2028\u2029 \uFEFF`.split("");function Wf(t){const e=typeof t=="string"?new RegExp(t):t;return vR.some(r=>e.test(r))}s(Wf,"isWhitespace");function il(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}s(il,"escapeRegExp");function sy(t,e){const r=oy(t),n=e.match(r);return!!n&&n[0].length>0}s(sy,"partialMatches");function oy(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function a(){let i="",o;function u(c){i+=r.substr(n,c),n+=c}s(u,"appendRaw");function l(c){i+="(?:"+r.substr(n,c)+"|$)",n+=c}for(s(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"[":o=/\[(?:\\.|.)*?\]/g,o.lastIndex=n,o=o.exec(r)||[],l(o[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":u(1);break;case"{":o=/\{\d+,?\d*\}/g,o.lastIndex=n,o=o.exec(r),o?u(o[0].length):l(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":i+="(?:",n+=3,i+=a()+"|$)";break;case"=":i+="(?=",n+=3,i+=a()+")";break;case"!":o=n,n+=3,a(),i+=r.substr(o,n-o);break;case"<":switch(r[n+3]){case"=":case"!":o=n,n+=4,a(),i+=r.substr(o,n-o);break;default:u(r.indexOf(">",n)-n+1),i+=a()+"|$)";break}break}else u(1),i+=a()+"|$)";break;case")":return++n,i;default:l(1);break}return i}return s(a,"process"),new RegExp(a(),t.flags)}s(oy,"partialRegExp");function ly(t){return t.rules.find(e=>mt(e)&&e.entry)}s(ly,"getEntryRule");function uy(t){return t.rules.filter(e=>jt(e)&&e.hidden)}s(uy,"getHiddenRules");function Vf(t,e){const r=new Set,n=ly(t);if(!n)return new Set(t.rules);const a=[n].concat(uy(t));for(const o of a)cy(o,r,e);const i=new Set;for(const o of t.rules)(r.has(o.name)||jt(o)&&o.hidden)&&i.add(o);return i}s(Vf,"getAllReachableRules");function cy(t,e,r){e.add(t.name),Mr(t).forEach(n=>{if(Nr(n)||r&&Ff(n)){const a=n.rule.ref;a&&!e.has(a.name)&&cy(a,e,r)}})}s(cy,"ruleDfs");function TR(t){const e=new Set;return Mr(t).forEach(r=>{Yn(r)&&(mt(r.type.ref)&&e.add(r.type.ref),Gu(r.type.ref)&&mt(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}s(TR,"getAllRulesUsedForCrossReferences");function fy(t){if(t.terminal)return t.terminal;if(t.type.ref)return Xf(t.type.ref)?.terminal}s(fy,"getCrossReferenceTerminal");function dy(t){return t.hidden&&!Wf(ju(t))}s(dy,"isCommentTerminal");function py(t,e){return!t||!e?[]:Hf(t,e,t.astNode,!0)}s(py,"findNodesForProperty");function qf(t,e,r){if(!t||!e)return;const n=Hf(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]}s(qf,"findNodeForProperty");function Hf(t,e,r,n){if(!n){const a=qn(t.grammarSource,wr);if(a&&a.feature===e)return[t]}return Sr(t)&&t.astNode===r?t.content.flatMap(a=>Hf(a,e,r,!1)):[]}s(Hf,"findNodesForPropertyInternal");function $R(t,e){return t?Yf(t,e,t?.astNode):[]}s($R,"findNodesForKeyword");function my(t,e,r){if(!t)return;const n=Yf(t,e,t?.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}s(my,"findNodeForKeyword");function Yf(t,e,r){if(t.astNode!==r)return[];if(Ir(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=Jo(t).iterator();let a;const i=[];do if(a=n.next(),!a.done){const o=a.value;o.astNode===r?Ir(o.grammarSource)&&o.grammarSource.value===e&&i.push(o):n.prune()}while(!a.done);return i}s(Yf,"findNodesForKeywordInternal");function hy(t){const e=t.astNode;for(;e===t.container?.astNode;){const r=qn(t.grammarSource,wr);if(r)return r;t=t.container}}s(hy,"findAssignment");function Xf(t){let e=t;return Gu(e)&&(Yr(e.$container)?e=e.$container.$container:Hn(e.$container)?e=e.$container:tn(e.$container)),yy(t,e,new Map)}s(Xf,"findNameAssignment");function yy(t,e,r){function n(a,i){let o;return qn(a,wr)||(o=yy(i,i,r)),r.set(t,o),o}if(s(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of Mr(e)){if(wr(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(Nr(a)&&mt(a.rule.ref))return n(a,a.rule.ref);if(Gf(a)&&a.typeRef?.ref)return n(a,a.typeRef.ref)}}s(yy,"findNameAssignmentInternal");function gy(t){const e=t.$container;if(Xn(e)){const r=e.elements,n=r.indexOf(t);for(let a=n-1;a>=0;a--){const i=r[a];if(Yr(i))return i;{const o=Mr(r[a]).find(Yr);if(o)return o}}}if(xf(e))return gy(e)}s(gy,"getActionAtElement");function RR(t,e){return t==="?"||t==="*"||Xn(e)&&!!e.guardCondition}s(RR,"isOptionalCardinality");function AR(t){return t==="*"||t==="+"}s(AR,"isArrayCardinality");function ER(t){return t==="+="}s(ER,"isArrayOperator");function Fu(t){return vy(t,new Set)}s(Fu,"isDataTypeRule");function vy(t,e){if(e.has(t))return!0;e.add(t);for(const r of Mr(t))if(Nr(r)){if(!r.rule.ref||mt(r.rule.ref)&&!vy(r.rule.ref,e)||Xo(r.rule.ref))return!1}else{if(wr(r))return!1;if(Yr(r))return!1}return!!t.definition}s(vy,"isDataTypeRuleInternal");function CR(t){return cf(t.type,new Set)}s(CR,"isDat
Line truncated
|
||||
`;function Fb(t,e=!1){try{const r=Ju(t);return hf(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===Gb)e&&Uy(`${mf} 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.`),pf(`${mf}
|
||||
Failed parsing: < ${t.toString()} >
|
||||
Using the @chevrotain/regexp-to-ast library
|
||||
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}s(Fb,"getOptimizedStartCodesIndices");function hf(t,e,r){switch(t.type){case"Disjunction":for(let a=0;a<t.value.length;a++)hf(t.value[a],e,r);break;case"Alternative":const n=t.value;for(let a=0;a<n.length;a++){const i=n[a];switch(i.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"Lookbehind":case"NegativeLookbehind":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const o=i;switch(o.type){case"Character":Xl(o.value,e,r);break;case"Set":if(o.complement===!0)throw Error(Gb);V(o.value,l=>{if(typeof l=="number")Xl(l,e,r);else{const c=l;if(r===!0)for(let f=c.from;f<=c.to;f++)Xl(f,e,r);else{for(let f=c.from;f<=c.to&&f<Zl;f++)Xl(f,e,r);if(c.to>=Zl){const f=c.from>=Zl?c.from:Zl,d=c.to,p=Or(f),y=Or(d);for(let h=p;h<=y;h++)e[h]=h}}}});break;case"Group":hf(o.value,e,r);break;default:throw Error("Non Exhaustive Match")}const u=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&yf(o)===!1||o.type!=="Group"&&u===!1)break}break;default:throw Error("non exhaustive match!")}return Ke(e)}s(hf,"firstCharOptimizedIndices");function Xl(t,e,r){const n=Or(t);e[n]=n,r===!0&&zb(t,e)}s(Xl,"addOptimizedIdxToResult");function zb(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const a=Or(n.charCodeAt(0));e[a]=a}else{const a=r.toLowerCase();if(a!==r){const i=Or(a.charCodeAt(0));e[i]=i}}}s(zb,"handleIgnoreCase");function Sm(t,e){return el(t.value,r=>{if(typeof r=="number")return vt(e,r);{const n=r;return el(e,a=>n.from<=a&&a<=n.to)!==void 0}})}s(Sm,"findCode");function yf(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?se(t.value)?Yt(t.value,yf):yf(t.value):!1}s(yf,"isWholeOptional");var Ti,v1=(Ti=class extends Kf{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){vt(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Sm(e,this.targetCharCodes)===void 0&&(this.found=!0):Sm(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},s(Ti,"CharCodeFinder"),Ti);function dd(t,e){if(e instanceof RegExp){const r=Ju(e),n=new v1(t);return n.visit(r),n.found}else return el(e,r=>vt(t,r.charCodeAt(0)))!==void 0}s(dd,"canMatchCharCode");var Un="PATTERN",Jl="defaultMode",ic="modes";function jb(t,e){e=jy(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
||||
`],tracer:s((w,b)=>b(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{l_()});let n;r("Reject Lexer.NA",()=>{n=cd(t,w=>w[Un]===pt.NA)});let a=!1,i;r("Transform Patterns",()=>{a=!1,i=j(n,w=>{const b=w[Un];if(Pr(b)){const N=b.source;return N.length===1&&N!=="^"&&N!=="$"&&N!=="."&&!b.ignoreCase?N:N.length===2&&N[0]==="\\"&&!vt(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],N[1])?N[1]:wm(b)}else{if(Gr(b))return a=!0,{exec:b};if(typeof b=="object")return a=!0,b;if(typeof b=="string"){if(b.length===1)return b;{const N=b.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),B=new RegExp(N);return wm(B)}}else throw Error("non exhaustive match")}})});let o,u,l,c,f;r("misc mapping",()=>{o=j(n,w=>w.tokenTypeIdx),u=j(n,w=>{const b=w.GROUP;if(b!==pt.SKIPPED){if(Ct(b))return b;if(kr(b))return!1;throw Error("non exhaustive match")}}),l=j(n,w=>{const b=w.LONGER_ALT;if(b)return se(b)?j(b,B=>Fv(n,B)):[Fv(n,b)]}),c=j(n,w=>w.PUSH_MODE),f=j(n,w=>K(w,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const w=Hy(e.lineTerminatorCharacters);d=j(n,b=>!1),e.positionTracking!=="onlyOffset"&&(d=j(n,b=>K(b,"LINE_BREAKS")?!!b.LINE_BREAKS:qy(b,w)===!1&&dd(w,b.PATTERN)))});let p,y,h,T;r("Misc Mapping #2",()=>{p=j(n,Vy),y=j(i,s_),h=kt(n,(w,b)=>{const N=b.GROUP;return Ct(N)&&N!==pt.SKIPPED&&(w[N]=[]),w},{}),T=j(i,(w,b)=>({pattern:i[b],longerAlt:l[b],canLineTerminator:d[b],isCustom:p[b],short:y[b],group:u[b],push:c[b],pop:f[b],tokenTypeIdx:o[b],tokenType:n[b]}))});let C=!0,v=[];return e.safeMode||r("First Char Optimization",()=>{v=kt(n,(w,b,N)=>{if(typeof b.PATTERN=="string"){const B=b.PATTERN.charCodeAt(0),ne=Or(B);Pc(w,ne,T[N])}else if(se(b.START_CHARS_HINT)){let B;V(b.START_CHARS_HINT,ne=>{const J=typeof ne=="string"?ne.charCodeAt(0):ne,he=Or(J);B!==he&&(B=he,Pc(w,he,T[N]))})}else if(Pr(b.PATTERN))if(b.PATTERN.unicode)C=!1,e.ensureOptimizations&&pf(`${mf} 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 B=Fb(b.PATTERN,e.ensureOptimizations);Re(B)&&(C=!1),V(B,ne=>{Pc(w,ne,T[N])})}else e.ensureOptimizations&&pf(`${mf} 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`),C=!1;return w},[])}),{emptyGroups:h,patternIdxToConfig:T,charCodeToPatternIdxToConfig:v,hasCustom:a,canBeOptimized:C}}s(jb,"analyzeTokenTypes");function Bb(t,e){let r=[];const n=Kb(t);r=r.concat(n.errors);const a=Wb(n.valid),i=a.valid;return r=r.concat(a.errors),r=r.concat(Ub(i)),r=r.concat(Jb(i)),r=r.concat(Zb(i,e)),r=r.concat(Qb(i)),r}s(Bb,"validatePatterns");function Ub(t){let e=[];const r=Bt(t,n=>Pr(n[Un]));return e=e.concat(Vb(r)),e=e.concat(Hb(r)),e=e.concat(Yb(r)),e=e.concat(Xb(r)),e=e.concat(qb(r)),e}s(Ub,"validateRegExpPattern");function Kb(t){const e=Bt(t,a=>!K(a,Un)),r=j(e,a=>({message:"Token Type: ->"+a.name+"<- missing static 'PATTERN' property",type:Me.MISSING_PATTERN,tokenTypes:[a]})),n=ud(t,e);return{errors:r,valid:n}}s(Kb,"findMissingPatterns");function Wb(t){const e=Bt(t,a=>{const i=a[Un];return!Pr(i)&&!Gr(i)&&!K(i,"exec")&&!Ct(i)}),r=j(e,a=>({message:"Token Type: ->"+a.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Me.INVALID_PATTERN,tokenTypes:[a]})),n=ud(t,e);return{errors:r,valid:n}}s(Wb,"findInvalidPatterns");var T1=/[^\\][$]/;function Vb(t){const a=class a extends Kf{constructor(){super(...arguments),this.found=!1}visitEndAnchor(o){this.found=!0}};s(a,"EndAnchorFinder");let e=a;const r=Bt(t,i=>{const o=i.PATTERN;try{const u=Ju(o),l=new e;return l.visit(u),l.found}catch{return T1.test(o.source)}});return j(r,i=>({message:`Unexpected RegExp Anchor Error:
|
||||
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
||||
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Me.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}s(Vb,"findEndOfInputAnchor");function qb(t){const e=Bt(t,n=>n.PATTERN.test(""));return j(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Me.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}s(qb,"findEmptyMatchRegExps");var $1=/[^\\[][\^]|^\^/;function Hb(t){const a=class a extends Kf{constructor(){super(...arguments),this.found=!1}visitStartAnchor(o){this.found=!0}};s(a,"StartAnchorFinder");let e=a;const r=Bt(t,i=>{const o=i.PATTERN;try{const u=Ju(o),l=new e;return l.visit(u),l.found}catch{return $1.test(o.source)}});return j(r,i=>({message:`Unexpected RegExp Anchor Error:
|
||||
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
||||
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Me.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}s(Hb,"findStartOfInputAnchor");function Yb(t){const e=Bt(t,n=>{const a=n[Un];return a instanceof RegExp&&(a.multiline||a.global)});return j(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Me.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}s(Yb,"findUnsupportedFlags");function Xb(t){const e=[];let r=j(t,i=>kt(t,(o,u)=>(i.PATTERN.source===u.PATTERN.source&&!vt(e,u)&&u.PATTERN!==pt.NA&&(e.push(u),o.push(u)),o),[]));r=Xu(r);const n=Bt(r,i=>i.length>1);return j(n,i=>{const o=j(i,l=>l.name);return{message:`The same RegExp pattern ->${Jt(i).PATTERN}<-has been used in all of the following Token Types: ${o.join(", ")} <-`,type:Me.DUPLICATE_PATTERNS_FOUND,tokenTypes:i}})}s(Xb,"findDuplicatePatterns");function Jb(t){const e=Bt(t,n=>{if(!K(n,"GROUP"))return!1;const a=n.GROUP;return a!==pt.SKIPPED&&a!==pt.NA&&!Ct(a)});return j(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Me.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}s(Jb,"findInvalidGroupType");function Zb(t,e){const r=Bt(t,a=>a.PUSH_MODE!==void 0&&!vt(e,a.PUSH_MODE));return j(r,a=>({message:`Token Type: ->${a.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${a.PUSH_MODE}<-which does not exist`,type:Me.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[a]}))}s(Zb,"findModesThatDoNotExist");function Qb(t){const e=[],r=kt(t,(n,a,i)=>{const o=a.PATTERN;return o===pt.NA||(Ct(o)?n.push({str:o,idx:i,tokenType:a}):Pr(o)&&t_(o)&&n.push({str:o.source,idx:i,tokenType:a})),n},[]);return V(t,(n,a)=>{V(r,({str:i,idx:o,tokenType:u})=>{if(a<o&&e_(i,n.PATTERN)){const l=`Token: ->${u.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:Me.UNREACHABLE_PATTERN,tokenTypes:[n,u]})}})}),e}s(Qb,"findUnreachablePatterns");function e_(t,e){if(Pr(e)){if(r_(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(Gr(e))return e(t,0,[],{});if(K(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}s(e_,"tryToMatchStrToPattern");function t_(t){return el([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}s(t_,"noMetaChar");function r_(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(t.source)}s(r_,"usesLookAheadOrBehind");function wm(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}s(wm,"addStickyFlag");function n_(t,e,r){const n=[];return K(t,Jl)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Jl+`> property in its definition
|
||||
`,type:Me.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),K(t,ic)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+ic+`> property in its definition
|
||||
`,type:Me.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),K(t,ic)&&K(t,Jl)&&!K(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Jl}: <${t.defaultMode}>which does not exist
|
||||
`,type:Me.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),K(t,ic)&&V(t.modes,(a,i)=>{V(a,(o,u)=>{if(kr(o))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${i}> at index: <${u}>
|
||||
`,type:Me.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(K(o,"LONGER_ALT")){const l=se(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];V(l,c=>{!kr(c)&&!vt(a,c)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${c.name}> on token <${o.name}> outside of mode <${i}>
|
||||
`,type:Me.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}s(n_,"performRuntimeChecks");function a_(t,e,r){const n=[];let a=!1;const i=Xu(Ht(Ke(t.modes))),o=cd(i,l=>l[Un]===pt.NA),u=Hy(r);return e&&V(o,l=>{const c=qy(l,u);if(c!==!1){const d={message:o_(l,c),type:c.issue,tokenType:l};n.push(d)}else K(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(a=!0):dd(u,l.PATTERN)&&(a=!0)}),e&&!a&&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:Me.NO_LINE_BREAKS_FLAGS}),n}s(a_,"performWarningRuntimeChecks");function i_(t){const e={},r=Nt(t);return V(r,n=>{const a=t[n];if(se(a))e[n]=[];else throw Error("non exhaustive match")}),e}s(i_,"cloneEmptyGroups");function Vy(t){const e=t.PATTERN;if(Pr(e))return!1;if(Gr(e))return!0;if(K(e,"exec"))return!0;if(Ct(e))return!1;throw Error("non exhaustive match")}s(Vy,"isCustomPattern");function s_(t){return Ct(t)&&t.length===1?t.charCodeAt(0):!1}s(s_,"isShortPattern");var R1={test:s(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 qy(t,e){if(K(t,"LINE_BREAKS"))return!1;if(Pr(t.PATTERN)){try{dd(e,t.PATTERN)}catch(r){return{issue:Me.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(Ct(t.PATTERN))return!1;if(Vy(t))return{issue:Me.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}s(qy,"checkLineBreaksIssues");function o_(t,e){if(e.issue===Me.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===Me.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")}s(o_,"buildLineBreakIssueMessage");function Hy(t){return j(t,r=>Ct(r)?r.charCodeAt(0):r)}s(Hy,"getCharCodes");function Pc(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}s(Pc,"addToMapOfArrays");var Zl=256,kc=[];function Or(t){return t<Zl?t:kc[t]}s(Or,"charCodeToOptimizedIndex");function l_(){if(Re(kc)){kc=new Array(65536);for(let t=0;t<65536;t++)kc[t]=t>255?255+~~(t/255):t}}s(l_,"initCharCodeToOptimizedIndexMap");function ul(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}s(ul,"tokenStructuredMatcher");function _u(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}s(_u,"tokenStructuredMatcherNoCategories");var jv=1,u_={};function cl(t){const e=c_(t);f_(e),p_(e),d_(e),V(e,r=>{r.isParent=r.categoryMatches.length>0})}s(cl,"augmentTokenTypes");function c_(t){let e=it(t),r=t,n=!0;for(;n;){r=Xu(Ht(j(r,i=>i.CATEGORIES)));const a=ud(r,e);e=e.concat(a),Re(a)?n=!1:r=a}return e}s(c_,"expandCategories");function f_(t){V(t,e=>{Xy(e)||(u_[jv]=e,e.tokenTypeIdx=jv++),Im(e)&&!se(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Im(e)||(e.CATEGORIES=[]),m_(e)||(e.categoryMatches=[]),h_(e)||(e.categoryMatchesMap={})})}s(f_,"assignTokenDefaultProps");function d_(t){V(t,e=>{e.categoryMatches=[],V(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(u_[n].tokenTypeIdx)})})}s(d_,"assignCategoriesTokensProp");function p_(t){V(t,e=>{Yy([],e)})}s(p_,"assignCategoriesMapProp");function Yy(t,e){V(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),V(e.CATEGORIES,r=>{const n=t.concat(e);vt(n,r)||Yy(n,r)})}s(Yy,"singleAssignCategoriesToksMap");function Xy(t){return K(t,"tokenTypeIdx")}s(Xy,"hasShortKeyProperty");function Im(t){return K(t,"CATEGORIES")}s(Im,"hasCategoriesProperty");function m_(t){return K(t,"categoryMatches")}s(m_,"hasExtendingTokensTypesProperty");function h_(t){return K(t,"categoryMatchesMap")}s(h_,"hasExtendingTokensTypesMapProperty");function y_(t){return K(t,"tokenTypeIdx")}s(y_,"isTokenType");var Nm={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,a,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}},Me;(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"})(Me||(Me={}));var Ql={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
||||
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Nm,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Ql);var $i,pt=($i=class{constructor(e,r=Ql){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=(a,i)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const o=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${o}--> <${a}>`);const{time:u,value:l}=Ky(i),c=u>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&c(`${o}<-- <${a}> time: ${u}ms`),this.traceInitIndent--,l}else return i()},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=Pt({},Ql,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 a,i=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Ql.lineTerminatorsPattern)this.config.lineTerminatorsPattern=R1;else if(this.config.lineTerminatorCharacters===Ql.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),se(e)?a={modes:{defaultMode:it(e)},defaultMode:Jl}:(i=!1,a=it(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(n_(a,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(a_(a,this.trackStartLines,this.config.lineTerminatorCharacters))})),a.modes=a.modes?a.modes:{},V(a.modes,(u,l)=>{a.modes[l]=cd(u,c=>kr(c))});const o=Nt(a.modes);if(V(a.modes,(u,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(Bb(u,o))}),Re(this.lexerDefinitionErrors)){cl(u);let c;this.TRACE_INIT("analyzeTokenTypes",()=>{c=jb(u,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=c.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=c.charCodeToPatternIdxToConfig,this.emptyGroups=Pt({},this.emptyGroups,c.emptyGroups),this.hasCustom=c.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=c.canBeOptimized}})}),this.defaultMode=a.defaultMode,!Re(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=j(this.lexerDefinitionErrors,c=>c.message).join(`-----------------------
|
||||
`);throw new Error(`Errors detected in definition of Lexer:
|
||||
`+l)}V(this.lexerDefinitionWarning,u=>{Uy(u.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(i&&(this.handleModes=He),this.trackStartLines===!1&&(this.computeNewColumn=Ku),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=He),/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 u=kt(this.canModeBeOptimized,(l,c,f)=>(c===!1&&l.push(f),l),[]);if(r.ensureOptimizations&&!Re(u))throw Error(`Lexer Modes: < ${u.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",()=>{Mb()}),this.TRACE_INIT("toFastProperties",()=>{Wy(this)})})}tokenize(e,r=this.defaultMode){if(!Re(this.lexerDefinitionErrors)){const a=j(this.lexerDefinitionErrors,i=>i.message).join(`-----------------------
|
||||
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
||||
`+a)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,a,i,o,u,l,c,f,d,p,y,h,T,C,v;const w=e,b=w.length;let N=0,B=0;const ne=this.hasCustom?0:Math.floor(e.length/10),J=new Array(ne),he=[];let Ae=this.trackStartLines?1:void 0,ye=this.trackStartLines?1:void 0;const ue=i_(this.emptyGroups),ot=this.trackStartLines,k=this.config.lineTerminatorsPattern;let _=0,$=[],I=[];const R=[],A=[];Object.freeze(A);let S=!1;const L=s(M=>{if(R.length===1&&M.tokenType.PUSH_MODE===void 0){const Y=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(M);he.push({offset:M.startOffset,line:M.startLine,column:M.startColumn,length:M.image.length,message:Y})}else{R.pop();const Y=Bn(R);$=this.patternIdxToConfig[Y],I=this.charCodeToPatternIdxToConfig[Y],_=$.length;const q=this.canModeBeOptimized[Y]&&this.config.safeMode===!1;I&&q?S=!0:S=!1}},"pop_mode");function x(M){R.push(M),I=this.charCodeToPatternIdxToConfig[M],$=this.patternIdxToConfig[M],_=$.length,_=$.length;const Y=this.canModeBeOptimized[M]&&this.config.safeMode===!1;I&&Y?S=!0:S=!1}s(x,"push_mode"),x.call(this,r);let O;const z=this.config.recoveryEnabled;for(;N<b;){l=null,d=-1;const M=w.charCodeAt(N);let Y;if(S){const Z=Or(M),ae=I[Z];Y=ae!==void 0?ae:A}else Y=$;const q=Y.length;for(n=0;n<q;n++){O=Y[n];const Z=O.pattern;c=null;const ae=O.short;if(ae!==!1?M===ae&&(d=1,l=Z):O.isCustom===!0?(v=Z.exec(w,N,J,ue),v!==null?(l=v[0],d=l.length,v.payload!==void 0&&(c=v.payload)):l=null):(Z.lastIndex=N,d=this.matchLength(Z,e,N)),d!==-1){if(u=O.longerAlt,u!==void 0){l=e.substring(N,N+d);const Oe=u.length;for(i=0;i<Oe;i++){const pe=$[u[i]],Ee=pe.pattern;if(f=null,pe.isCustom===!0?(v=Ee.exec(w,N,J,ue),v!==null?(o=v[0],v.payload!==void 0&&(f=v.payload)):o=null):(Ee.lastIndex=N,o=this.match(Ee,e,N)),o&&o.length>l.length){l=o,d=o.length,c=f,O=pe;break}}}break}}if(d!==-1){if(p=O.group,p!==void 0&&(l=l!==null?l:e.substring(N,N+d),y=O.tokenTypeIdx,h=this.createTokenInstance(l,N,y,O.tokenType,Ae,ye,d),this.handlePayload(h,c),p===!1?B=this.addToken(J,B,h):ue[p].push(h)),ot===!0&&O.canLineTerminator===!0){let Z=0,ae,Oe;k.lastIndex=0;do l=l!==null?l:e.substring(N,N+d),ae=k.test(l),ae===!0&&(Oe=k.lastIndex-1,Z++);while(ae===!0);Z!==0?(Ae=Ae+Z,ye=d-Oe,this.updateTokenEndLineColumnLocation(h,p,Oe,Z,Ae,ye,d)):ye=this.computeNewColumn(ye,d)}else ye=this.computeNewColumn(ye,d);N=N+d,this.handleModes(O,L,x,h)}else{const Z=N,ae=Ae,Oe=ye;let pe=z===!1;for(;pe===!1&&N<b;)for(N++,a=0;a<_;a++){const Ee=$[a],Ve=Ee.pattern,Le=Ee.short;if(Le!==!1?w.charCodeAt(N)===Le&&(pe=!0):Ee.isCustom===!0?pe=Ve.exec(w,N,J,ue)!==null:(Ve.lastIndex=N,pe=Ve.exec(e)!==null),pe===!0)break}if(T=N-Z,ye=this.computeNewColumn(ye,T),C=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(w,Z,T,ae,Oe,Bn(R)),he.push({offset:Z,line:ae,column:Oe,length:T,message:C}),z===!1)break}}return this.hasCustom||(J.length=B),{tokens:J,groups:ue,errors:he}}handleModes(e,r,n,a){if(e.pop===!0){const i=e.push;r(a),i!==void 0&&n.call(this,i)}else e.push!==void 0&&n.call(this,e.push)}updateTokenEndLineColumnLocation(e,r,n,a,i,o,u){let l,c;r!==void 0&&(l=n===u-1,c=l?-1:0,a===1&&l===!0||(e.endLine=i+c,e.endColumn=o-1+-c))}computeNewColumn(e,r){return e+r}createOffsetOnlyToken(e,r,n,a){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:a}}createStartOnlyToken(e,r,n,a,i,o){return{image:e,startOffset:r,startLine:i,startColumn:o,tokenTypeIdx:n,tokenType:a}}createFullToken(e,r,n,a,i,o,u){return{image:e,startOffset:r,endOffset:r+u-1,startLine:i,endLine:i,startColumn:o,endColumn:o+u-1,tokenTypeIdx:n,tokenType:a}}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}},s($i,"Lexer"),$i);pt.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.";pt.NA=/NOT_APPLICABLE/;function Mn(t){return Jy(t)?t.LABEL:t.name}s(Mn,"tokenLabel");function Jy(t){return Ct(t.LABEL)&&t.LABEL!==""}s(Jy,"hasTokenLabel");var A1="parent",Bv="categories",Uv="label",Kv="group",Wv="push_mode",Vv="pop_mode",qv="longer_alt",Hv="line_breaks",Yv="start_chars_hint";function Xa(t){return g_(t)}s(Xa,"createToken");function g_(t){const e=t.pattern,r={};if(r.name=t.name,kr(e)||(r.PATTERN=e),K(t,A1))throw`The parent property is no longer supported.
|
||||
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return K(t,Bv)&&(r.CATEGORIES=t[Bv]),cl([r]),K(t,Uv)&&(r.LABEL=t[Uv]),K(t,Kv)&&(r.GROUP=t[Kv]),K(t,Vv)&&(r.POP_MODE=t[Vv]),K(t,Wv)&&(r.PUSH_MODE=t[Wv]),K(t,qv)&&(r.LONGER_ALT=t[qv]),K(t,Hv)&&(r.LINE_BREAKS=t[Hv]),K(t,Yv)&&(r.START_CHARS_HINT=t[Yv]),r}s(g_,"createTokenInternal");var Jr=Xa({name:"EOF",pattern:pt.NA});cl([Jr]);function Zu(t,e,r,n,a,i,o,u){return{image:e,startOffset:r,endOffset:n,startLine:a,endLine:i,startColumn:o,endColumn:u,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}s(Zu,"createTokenInstance");function Zy(t,e){return ul(t,e)}s(Zy,"tokenMatcher");var qa={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${Jy(t)?`--> ${Mn(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:a}){const i="Expecting: ",u=`
|
||||
but found: '`+Jt(e).image+"'";if(n)return i+n+u;{const l=kt(t,(p,y)=>p.concat(y),[]),c=j(l,p=>`[${j(p,y=>Mn(y)).join(", ")}]`),d=`one of these possible Token sequences:
|
||||
${j(c,(p,y)=>` ${y+1}. ${p}`).join(`
|
||||
`)}`;return i+d+u}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const a="Expecting: ",o=`
|
||||
but found: '`+Jt(e).image+"'";if(r)return a+r+o;{const l=`expecting at least one iteration which starts with one of these possible Token sequences::
|
||||
<${j(t,c=>`[${j(c,f=>Mn(f)).join(",")}]`).join(" ,")}>`;return a+l+o}}};Object.freeze(qa);var E1={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
|
||||
inside top level rule: ->`+t.name+"<-"}},Ln={buildDuplicateFoundError(t,e){function r(f){return f instanceof Se?f.terminalType.name:f instanceof ht?f.nonTerminalName:""}s(r,"getExtraProductionArgument");const n=t.name,a=Jt(e),i=a.idx,o=Kt(a),u=r(a),l=i>0;let c=`->${o}${l?i:""}<- ${u?`with argument: ->${u}<-`:""}
|
||||
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 c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,`
|
||||
`),c},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=j(t.prefixPath,a=>Mn(a)).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 a=j(t.prefixPath,i=>Mn(i)).join(", ");n+=`<${a}> 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=Kt(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=j(t.leftRecursionPath,i=>i.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 sl?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function v_(t,e){const r=new C1(t,e);return r.resolveRefs(),r.errors}s(v_,"resolveGrammar");var Ri,C1=(Ri=class extends ol{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){V(Ke(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:yt.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},s(Ri,"GastRefResolverVisitor"),Ri),Ai,b1=(Ai=class extends fd{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=it(this.path.ruleStack).reverse(),this.occurrenceStack=it(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 a=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,a)}}updateExpectedNext(){Re(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},s(Ai,"AbstractNextPossibleTokensWalker"),Ai),Ei,_1=(Ei=class extends b1{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 a=r.concat(n),i=new bt({definition:a});this.possibleTokTypes=ll(i),this.found=!0}}},s(Ei,"NextAfterTokenWalker"),Ei),Ci,pd=(Ci=class extends fd{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}},s(Ci,"AbstractNextTerminalAfterProductionWalker"),Ci),bi,S1=(bi=class extends pd{walkMany(e,r,n){if(e.idx===this.occurrence){const a=Jt(r.concat(n));this.result.isEndOfRule=a===void 0,a instanceof Se&&(this.result.token=a.terminalType,this.result.occurrence=a.idx)}else super.walkMany(e,r,n)}},s(bi,"NextTerminalAfterManyWalker"),bi),_i,Xv=(_i=class extends pd{walkManySep(e,r,n){if(e.idx===this.occurrence){const a=Jt(r.concat(n));this.result.isEndOfRule=a===void 0,a instanceof Se&&(this.result.token=a.terminalType,this.result.occurrence=a.idx)}else super.walkManySep(e,r,n)}},s(_i,"NextTerminalAfterManySepWalker"),_i),Si,w1=(Si=class extends pd{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const a=Jt(r.concat(n));this.result.isEndOfRule=a===void 0,a instanceof Se&&(this.result.token=a.terminalType,this.result.occurrence=a.idx)}else super.walkAtLeastOne(e,r,n)}},s(Si,"NextTerminalAfterAtLeastOneWalker"),Si),wi,Jv=(wi=class extends pd{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const a=Jt(r.concat(n));this.result.isEndOfRule=a===void 0,a instanceof Se&&(this.result.token=a.terminalType,this.result.occurrence=a.idx)}else super.walkAtLeastOneSep(e,r,n)}},s(wi,"NextTerminalAfterAtLeastOneSepWalker"),wi);function gf(t,e,r=[]){r=it(r);let n=[],a=0;function i(u){return u.concat(nt(t,a+1))}s(i,"remainingPathWith");function o(u){const l=gf(i(u),e,r);return n.concat(l)}for(s(o,"getAlternativesForProd");r.length<e&&a<t.length;){const u=t[a];if(u instanceof bt)return o(u.definition);if(u instanceof ht)return o(u.definition);if(u instanceof at)n=o(u.definition);else if(u instanceof Ot){const l=u.definition.concat([new xe({definition:u.definition})]);return o(l)}else if(u instanceof Lt){const l=[new bt({definition:u.definition}),new xe({definition:[new Se({terminalType:u.separator})].concat(u.definition)})];return o(l)}else if(u instanceof _t){const l=u.definition.concat([new xe({definition:[new Se({terminalType:u.separator})].concat(u.definition)})]);n=o(l)}else if(u instanceof xe){const l=u.definition.concat([new xe({definition:u.definition})]);n=o(l)}else{if(u instanceof St)return V(u.definition,l=>{Re(l.definition)===!1&&(n=o(l.definition))}),n;if(u instanceof Se)r.push(u.terminalType);else throw Error("non exhaustive match")}a++}return n.push({p
Line truncated
|
||||
${i.join(`
|
||||
|
||||
`).replace(/\n/g,`
|
||||
`)}`)}},"validateVisitor")};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}s(rS,"createBaseSemanticVisitorConstructor");function nS(t,e,r){const n=s(function(){},"derivedConstructor");sg(n,t+"BaseSemanticsWithDefaults");const a=Object.create(r.prototype);return V(e,i=>{a[i]=tS}),n.prototype=a,n.prototype.constructor=n,n}s(nS,"createBaseVisitorConstructorWithDefaults");var Gm;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Gm||(Gm={}));function aS(t,e){return iS(t,e)}s(aS,"validateVisitor");function iS(t,e){const r=Bt(e,a=>Gr(t[a])===!1),n=j(r,a=>({msg:`Missing visitor method: <${a}> on ${t.constructor.name} CST Visitor.`,type:Gm.MISSING_METHOD,methodName:a}));return Xu(n)}s(iS,"validateMissingCstMethods");var Ki,j1=(Ki=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=K(e,"nodeLocationTracking")?e.nodeLocationTracking:Lr.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=He,this.cstFinallyStateUpdate=He,this.cstPostTerminal=He,this.cstPostNonTerminal=He,this.cstPostRule=He;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Mm,this.setNodeLocationFromNode=Mm,this.cstPostRule=He,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=He,this.setNodeLocationFromNode=He,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=xm,this.setNodeLocationFromNode=xm,this.cstPostRule=He,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=He,this.setNodeLocationFromNode=He,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=He,this.setNodeLocationFromNode=He,this.cstPostRule=He,this.setInitialNodeLocation=He;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];Q_(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];eS(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(kr(this.baseCstVisitorConstructor)){const e=rS(this.className,Nt(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(kr(this.baseCstVisitorWithDefaultsConstructor)){const e=nS(this.className,Nt(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]}},s(Ki,"TreeBuilder"),Ki),Wi,B1=(Wi=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)):Tf}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?Tf: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()}},sLine truncated
|
||||
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
||||
For Further details.`);if(se(e)){if(Re(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(se(e))this.tokensMap=kt(e,(i,o)=>(i[o.name]=o,i),{});else if(K(e,"modes")&&Yt(Ht(Ke(e.modes)),y_)){const i=Ht(Ke(e.modes)),o=By(i);this.tokensMap=kt(o,(u,l)=>(u[l.name]=l,u),{})}else if(zt(e))this.tokensMap=it(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=Jr;const n=K(e,"modes")?Ht(Ke(e.modes)):Ke(e),a=Yt(n,i=>Re(i.categoryMatches));this.tokenMatcher=a?_u:ul,cl(Ke(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 a=K(n,"resyncEnabled")?n.resyncEnabled:$f.resyncEnabled,i=K(n,"recoveryValueFunc")?n.recoveryValueFunc:$f.recoveryValueFunc,o=this.ruleShortNameIdx<<M1+nn;this.ruleShortNameIdx++,this.shortRuleNameToFull[o]=e,this.fullRuleNameToShort[e]=o;let u;return this.outputCst===!0?u=s(function(...f){try{this.ruleInvocationStateUpdate(o,e,this.subruleIdx),r.apply(this,f);const d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,a,i)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTry"):u=s(function(...f){try{return this.ruleInvocationStateUpdate(o,e,this.subruleIdx),r.apply(this,f)}catch(d){return this.invokeRuleCatch(d,a,i)}finally{this.ruleFinallyStateUpdate()}},"invokeRuleWithTryCst"),Object.assign(u,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){const a=this.RULE_STACK.length===1,i=r&&!this.isBackTracking()&&this.recoveryEnabled;if(Su(e)){const o=e;if(i){const u=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(u))if(o.resyncedTokens=this.reSyncTo(u),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,o.partialCstResult=l}throw o}}else{if(a)return this.moveToTerminatedState(),n(e);throw o}}else throw e}optionInternal(e,r){const n=this.getKeyForAutomaticLookahead(J_,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let a=this.getLaFuncFromCache(n),i;if(typeof e!="function"){i=e.DEF;const o=e.GATE;if(o!==void 0){const u=a;a=s(()=>o.call(this)&&u.call(this),"lookAheadFunc")}}else i=e;if(a.call(this)===!0)return i.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(Lm,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let a=this.getLaFuncFromCache(n),i;if(typeof r!="function"){i=r.DEF;const o=r.GATE;if(o!==void 0){const u=a;a=s(()=>o.call(this)&&u.call(this),"lookAheadFunc")}}else i=r;if(a.call(this)===!0){let o=this.doSingleRepetition(i);for(;a.call(this)===!0&&o===!0;)o=this.doSingleRepetition(i)}else throw this.raiseEarlyExitException(e,Pe.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],a,Lm,e,w1)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(Lc,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const a=r.DEF,i=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){a.call(this);const u=s(()=>this.tokenMatcher(this.LA(1),i),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),i)===!0;)this.CONSUME(i),a.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,u,a,Jv],u,Lc,e,Jv)}else throw this.raiseEarlyExitException(e,Pe.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(Om,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let a=this.getLaFuncFromCache(n),i;if(typeof r!="function"){i=r.DEF;const u=r.GATE;if(u!==void 0){const l=a;a=s(()=>u.call(this)&&l.call(this),"lookaheadFunction")}}else i=r;let o=!0;for(;a.call(this)===!0&&o===!0;)o=this.doSingleRepetition(i);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],a,Om,e,S1,o)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(Dm,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const a=r.DEF,i=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){a.call(this);const u=s(()=>this.tokenMatcher(this.LA(1),i),"separatorLookAheadFunc");for(;this.tokenMatcher(this.LA(1),i)===!0;)this.CONSUME(i),a.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,u,a,Xv],u,Dm,e,Xv)}}repetitionSepSecondInternal(e,r,n,a,i){for(;n();)this.CONSUME(r),a.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,a,i],n,Lc,e,i)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(X_,r),a=se(e)?e:e.DEF,o=this.getLaFuncFromCache(n).call(this,a);if(o!==void 0)return a[o].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 O1(r,e))}}subruleInternal(e,r,n){let a;try{const i=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,a=e.apply(this,i),this.cstPostNonTerminal(a,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),a}catch(i){throw this.subruleInternalError(i,n,e.ruleName)}}subruleInternalError(e,r,n){throw Su(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstRe
Line truncated
|
||||
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(oS);var q1={name:`This CSTNode indicates the Parser is in Recording Phase
|
||||
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Xi,H1=(Xi=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,a){return this.consumeInternalRecord(n,e,a)},this[`SUBRULE${r}`]=function(n,a){return this.subruleInternalRecord(n,e,a)},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 Tf}topLevelRuleRecord(e,r){try{const n=new sl({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 Na.call(this,at,e,r)}atLeastOneInternalRecord(e,r){Na.call(this,Ot,r,e)}atLeastOneSepFirstInternalRecord(e,r){Na.call(this,Lt,r,e,Zv)}manyInternalRecord(e,r){Na.call(this,xe,r,e)}manySepFirstInternalRecord(e,r){Na.call(this,_t,r,e,Zv)}orInternalRecord(e,r){return lS.call(this,e,r)}subruleInternalRecord(e,r,n){if(wu(r),!e||K(e,"ruleName")===!1){const u=new Error(`<SUBRULE${Fm(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
|
||||
inside top level rule: <${this.recordingProdStack[0].name}>`);throw u.KNOWN_RECORDER_ERROR=!0,u}const a=Bn(this.recordingProdStack),i=e.ruleName,o=new ht({idx:r,nonTerminalName:i,label:n?.LABEL,referencedRule:void 0});return a.definition.push(o),this.outputCst?q1:yd}consumeInternalRecord(e,r,n){if(wu(r),!Xy(e)){const o=new Error(`<CONSUME${Fm(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
|
||||
inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const a=Bn(this.recordingProdStack),i=new Se({idx:r,terminalType:e,label:n?.LABEL});return a.definition.push(i),oS}},s(Xi,"GastRecorder"),Xi);function Na(t,e,r,n=!1){wu(r);const a=Bn(this.recordingProdStack),i=Gr(e)?e:e.DEF,o=new t({definition:[],idx:r});return n&&(o.separator=e.SEP),K(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),i.call(this),a.definition.push(o),this.recordingProdStack.pop(),yd}s(Na,"recordProd");function lS(t,e){wu(e);const r=Bn(this.recordingProdStack),n=se(t)===!1,a=n===!1?t:t.DEF,i=new St({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});K(t,"MAX_LOOKAHEAD")&&(i.maxLookahead=t.MAX_LOOKAHEAD);const o=Eb(a,u=>Gr(u.GATE));return i.hasPredicates=o,r.definition.push(i),V(a,u=>{const l=new bt({definition:[]});i.definition.push(l),K(u,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=u.IGNORE_AMBIGUITIES:K(u,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),u.ALT.call(this),this.recordingProdStack.pop()}),yd}s(lS,"recordOrProd");function Fm(t){return t===0?"":`${t}`}s(Fm,"getIdxSuffix");function wu(t){if(t<0||t>Qv){const e=new Error(`Invalid DSL Method idx value: <${t}>
|
||||
Idx value must be a none negative value smaller than ${Qv+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}s(wu,"assertMethodIdxIsValid");var Ji,Y1=(Ji=class{initPerformanceTracer(e){if(K(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=Lr.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:a,value:i}=Ky(r),o=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&o(`${n}<-- <${e}> time: ${a}ms`),this.traceInitIndent--,i}else return r()}},s(Ji,"PerformanceTracer"),Ji);function uS(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(a=>{if(a==="constructor")return;const i=Object.getOwnPropertyDescriptor(n,a);i&&(i.get||i.set)?Object.defineProperty(t.prototype,a,i):t.prototype[a]=r.prototype[a]})})}s(uS,"applyMixins");var Tf=Zu(Jr,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Tf);var Lr=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:qa,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),$f=Object.freeze({recoveryValueFunc:s(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),yt;(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"})(yt||(yt={}));function zm(t=void 0){return function(){return t}}s(zm,"EMPTY_ALT");var Fn,og=(Fn=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",()=>{Wy(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),V(this.definedRulesNames,a=>{const o=this[a].originalGrammarAction;let u;this.TRACE_INIT(`${a} Rule`,()=>{u=this.topLevelRuleRecord(a,o)}),this.gastProductionsCache[a]=u})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=z_({rules:Ke(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Re(n)&&this.skipValidations===!1){const a=j_({rules:Ke(this.gastProductionsCache),tokenTypes:Ke(this.tokensMap),errMsgProvider:Ln,grammarName:r}),i=S_({lookaheadStrategy:this.lookaheadStrategy,rules:Ke(this.gastProductionsCache),tokenTypes:Ke(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(a,i)}}),Re(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const a=Db(Ke(this.gastProductionsCache));this.resyncFollows=a}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var a,i;(i=(a=this.lookaheadStrategy).initialize)===null||i===void 0||i.call(a,{rules:Ke(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Ke(this.gastProductionsCache))})),!Fn.DEFER_DEFINITION_ERRORS_HANDLING&&!Re(this.definitionErrors))throw e=j(this.definitionErrors,a=>a.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),K(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=K(r,"skipValidations")?r.skipValidations:Lr.skipValidations}},s(Fn,"Parser"),Fn);og.DEFER_DEFINITION_ERRORS_HANDLING=!1;uS(og,[x1,G1,j1,B1,K1,U1,W1,V1,H1,Y1]);var Zi,X1=(Zi=class extends og{constructor(e,r=Lr){const n=it(r);n.outputCst=!1,super(e,n)}},s(Zi,"EmbeddedActionsParser"),Zi);function cS(t,e){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a}s(cS,"arrayMap");var fS=cS;function dS(){this.__data__=[],this.size=0}s(dS,"listCacheClear");var J1=dS;function pS(t,e){return t===e||t!==t&&e!==e}s(pS,"eq");var mS=pS;function hS(t,e){for(var r=t.length;r--;)if(mS(t[r][0],e))return r;return-1}s(hS,"assocIndexOf");var gd=hS,Z1=Array.prototype,Q1=Z1.splice;function yS(t){var e=this.__data__,r=gd(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Q1.call(e,r,1),--this.size,!0}s(yS,"listCacheDelete");var eG=yS;function gS(t){var e=this.__data__,r=gd(e,t);return r<0?void 0:e[r][1]}s(gS,"listCacheGet");var tG=gS;function vS(t){return gd(this.__data__,t)>-1}s(vS,"listCacheHas");var rG=vS;function TS(t,e){var r=this.__data__,n=gd(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}s(TS,"listCacheSet");var nG=TS;function ia(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])}}s(ia,"ListCache");ia.prototype.clear=J1;ia.prototype.delete=eG;ia.prototype.get=tG;ia.prototype.has=rG;ia.prototype.set=nG;var vd=ia;function $S(){this.__data__=new vd,this.size=0}s($S,"stackClear");var aG=$S;function RS(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}s(RS,"stackDelete");var iG=RS;function AS(t){return this.__data__.get(t)}s(AS,"stackGet");var sG=AS;function ES(t){return this.__data__.has(t)}s(ES,"stackHas");var oG=ES,lG=typeof global=="object"&&global&&global.Object===Object&&global,CS=lG,uG=typeof self=="object"&&self&&self.Object===Object&&self,cG=CS||uG||Function("return this")(),Fr=cG,fG=Fr.Symbol,pr=fG,bS=Object.prototype,dG=bS.hasOwnProperty,pG=bS.toString,Ol=pr?pr.toStringTag:void 0;function _S(t){var e=dG.call(t,Ol),r=t[Ol];try{t[Ol]=void 0;var n=!0}catch{}var a=pG.call(t);return n&&(e?t[Ol]=r:delete t[Ol]),a}s(_S,"getRawTag");var mG=_S,hG=Object.prototype,yG=hG.toString;function SS(t){return yG.call(t)}s(SS,"objectToString");var gG=SS,vG="[object Null]",TG="[object Undefined]",eT=pr?pr.toStringTag:void 0;function wS(t){return t==null?t===void 0?TG:vG:eT&&eT in Object(t)?mG(t):gG(t)}s(wS,"baseGetTag");var fl=wS;function IS(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}s(IS,"isObject");var lg=IS,$G="[object AsyncFunction]",RG="[object Function]",AG="[object GeneratorFunction]",EG="[object Proxy]";function NS(t){if(!lg(t))return!1;var e=fl(t);return e==RG||e==AG||e==$G||e==EG}s(NS,"isFunction");var PS=NS,CG=Fr["__core-js_shared__"],qd=CG,tT=(function(){var t=/[^.]+$/.exec(qd&&qd.keys&&qd.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function kS(t){return!!tT&&tT in t}s(kS,"isMasked");var bG=kS,_G=Function.prototype,SG=_G.toString;function OS(t){if(t!=null){try{return SG.call(t)}catch{}try{return t+""}catch{}}return""}s(OS,"toSource");var sa=OS,wG=/[\\^$.*+?()[\]{}|]/g,IG=/^\[object .+?Constructor\]$/,NG=Function.prototype,PG=Object.prototype,kG=NG.toString,OG=PG.hasOwnProperty,LG=RegExp("^"+kG.call(OG).replace(wG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function LS(t){if(!lg(t)||bG(t))return!1;var e=PS(t)?LG:IG;return e.test(sa(t))}s(LS,"baseIsNative");var DG=LS;function DS(t,e){return t?.[e]}s(DS,"getValue");var xG=DS;function xS(t,e){var r=xG(t,e);return DG(r)?r:void 0}s(xS,"getNative");var dl=xS,MG=dl(Fr,"Map"),Iu=MG,GG=dl(Object,"create"),Nu=GG;function MS(){this.__data__=Nu?Nu(null):{},this.size=0}s(MS,"hashClear");var FG=MS;function GS(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}s(GS,"hashDelete");var zG=GS,jG="__lodash_hash_undefined__",BG=Object.prototype,UG=BG.hasOwnProperty;function FS(t){var e=this.__data__;if(Nu){var r=e[t];return r===jG?void 0:r}return UG.call(e,t)?e[t]:void 0}s(FS,"hashGet");var KG=FS,WG=Object.prototype,VG=WG.hasOwnProperty;function zS(t){var e=this.__data__;return Nu?e[t]!==void 0:VG.call(e,t)}s(zS,"hashHas");var qG=zS,HG="__lodash_hash_undefined__";function jS(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Nu&&e===void 0?HG:e,this}s(jS,"hashSet");var YG=jS;function oa(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])}}s(oa,"Hash");oa.prototype.clear=FG;oa.prototype.delete=zG;oa.prototype.get=KG;oa.prototype.has=qG;oa.prototype.set=YG;var rT=oa;function BS(){this.size=0,this.__data__={hash:new rT,map:new(Iu||vd),string:new rT}}s(BS,"mapCacheClear");var XG=BS;function US(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}s(US,"isKeyable");var JG=US;function KS(t,e){var r=t.__data__;return JG(e)?r[typeof e=="string"?"string":"hash"]:r.map}s(KS,"getMapDat
Line truncated
|
||||
<${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}s(uN,"buildAmbiguityError");function cN(t){if(t instanceof ht)return"SUBRULE";if(t instanceof at)return"OPTION";if(t instanceof St)return"OR";if(t instanceof Ot)return"AT_LEAST_ONE";if(t instanceof Lt)return"AT_LEAST_ONE_SEP";if(t instanceof _t)return"MANY_SEP";if(t instanceof xe)return"MANY";if(t instanceof Se)return"CONSUME";throw Error("non exhaustive match")}s(cN,"getProductionDslName");function fN(t,e,r){const n=Gj(e.configs.elements,i=>i.state.transitions),a=Jj(n.filter(i=>i instanceof vg).map(i=>i.tokenType),i=>i.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:a,tokenPath:t}}s(fN,"buildAdaptivePredictError");function dN(t,e){return t.edges[e.tokenTypeIdx]}s(dN,"getExistingTargetState");function pN(t,e,r){const n=new Wm,a=[];for(const o of t.elements){if(r.is(o.alt)===!1)continue;if(o.state.type===tc){a.push(o);continue}const u=o.state.transitions.length;for(let l=0;l<u;l++){const c=o.state.transitions[l],f=mN(c,e);f!==void 0&&n.add({state:f,alt:o.alt,stack:o.stack})}}let i;if(a.length===0&&n.size===1&&(i=n),i===void 0){i=new Wm;for(const o of n.elements)ku(o,i)}if(a.length>0&&!vN(i))for(const o of a)i.add(o);return i}s(pN,"computeReachSet");function mN(t,e){if(t instanceof vg&&Zy(e,t.tokenType))return t.target}s(mN,"getReachableTarget");function hN(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}s(hN,"getUniqueAlt");function bg(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}s(bg,"newDFAState");function qm(t,e,r,n){return n=_g(t,n),e.edges[r.tokenTypeIdx]=n,n}s(qm,"addDFAEdge");function _g(t,e){if(e===Af)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}s(_g,"addDFAState");function yN(t){const e=new Wm,r=t.transitions.length;for(let n=0;n<r;n++){const i={state:t.transitions[n].target,alt:n,stack:[]};ku(i,e)}return e}s(yN,"computeStartState");function ku(t,e){const r=t.state;if(r.type===tc){if(t.stack.length>0){const a=[...t.stack],o={state:a.pop(),alt:t.alt,stack:a};ku(o,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let a=0;a<n;a++){const i=r.transitions[a],o=gN(t,i);o!==void 0&&ku(o,e)}}s(ku,"closure");function gN(t,e){if(e instanceof TI)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Tg){const r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}s(gN,"getEpsilonTarget");function vN(t){for(const e of t.elements)if(e.state.type===tc)return!0;return!1}s(vN,"hasConfigInRuleStopState");function TN(t){for(const e of t.elements)if(e.state.type!==tc)return!1;return!0}s(TN,"allConfigsInRuleStopStates");function $N(t){if(TN(t))return!0;const e=RN(t.elements);return AN(e)&&!EN(e)}s($N,"hasConflictTerminatingPrediction");function RN(t){const e=new Map;for(const r of t){const n=Eg(r,!1);let a=e.get(n);a===void 0&&(a={},e.set(n,a)),a[r.alt]=!0}return e}s(RN,"getConflictingAltSets");function AN(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}s(AN,"hasConflictingAltSet");function EN(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}s(EN,"hasStateAssociatedWithOneAlt");Du();var ss,CN=(ss=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new wg(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new Nd;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new Ef(e.startOffset,e.image.length,Tu(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 i of e){const o=new Ef(i.startOffset,i.image.length,Tu(i),i.tokenType,!0);o.root=this.rootNode,r.push(o)}let n=this.current,a=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const i=n.container.content.indexOf(n);if(i>0){n.container.content.splice(i,0,...r),a=!0;break}n=n.container}a||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();n?.content.length===0&&this.removeNode(n)}},s(ss,"CstNodeBuilder"),ss),os,Sg=(os=class{get hidden(){return!1}get astNode(){const e=typeof this._astNode?.$type=="string"?this._astNode:this.container?.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)}},s(os,"AbstractCstNode"),os),ls,Ef=(ls=class extends Sg{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get
Line truncated
|
||||
`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return c}}s(r,"convertEscapeCharacter");function n(c){return c.charAt(0)==="^"?c.substring(1):c}s(n,"convertID"),t.convertID=n;function a(c){return parseInt(c)}s(a,"convertInt"),t.convertInt=a;function i(c){return BigInt(c)}s(i,"convertBigint"),t.convertBigint=i;function o(c){return new Date(c)}s(o,"convertDate"),t.convertDate=o;function u(c){return Number(c)}s(u,"convertNumber"),t.convertNumber=u;function l(c){return c.toLowerCase()==="true"}s(l,"convertBoolean"),t.convertBoolean=l})(or||(or={}));var $e={};kf($e,$h(Lf()));function Ld(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}s(Ld,"delayNextTick");var Fc=0,zN=10;function Dd(){return Fc=performance.now(),new $e.CancellationTokenSource}s(Dd,"startCancelableOperation");function Mg(t){zN=t}s(Mg,"setInterruptionPeriod");var cr=Symbol("OperationCancelled");function fa(t){return t===cr}s(fa,"isOperationCancelled");async function Ye(t){if(t===$e.CancellationToken.None)return;const e=performance.now();if(e-Fc>=zN&&(Fc=e,await Ld(),Fc=performance.now()),t.isCancellationRequested)throw cr}s(Ye,"interruptAndCheck");var $s,Dr=($s=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},s($s,"Deferred"),$s),Hr,_T=(Hr=class{constructor(e,r,n,a){this._uri=e,this._languageId=r,this._version=n,this._content=a,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(Hr.isIncremental(n)){const a=Fg(n.range),i=this.offsetAt(a.start),o=this.offsetAt(a.end);this._content=this._content.substring(0,i)+n.text+this._content.substring(o,this._content.length);const u=Math.max(a.start.line,0),l=Math.max(a.end.line,0);let c=this._lineOffsets;const f=Hm(n.text,!1,i);if(l-u===f.length)for(let p=0,y=f.length;p<y;p++)c[p+u+1]=f[p];else f.length<1e4?c.splice(u+1,l-u,...f):this._lineOffsets=c=c.slice(0,u+1).concat(f,c.slice(l+1));const d=n.text.length-(o-i);if(d!==0)for(let p=u+1+f.length,y=c.length;p<y;p++)c[p]=c[p]+d}else if(Hr.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=Hm(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const r=this.getLineOffsets();let n=0,a=r.length;if(a===0)return{line:0,character:e};for(;n<a;){const o=Math.floor((n+a)/2);r[o]>e?a=o:n=o+1}const i=n-1;return e=this.ensureBeforeEOL(e,r[i]),{line:i,character:e-r[i]}}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 a=e.line+1<r.length?r[e.line+1]:this._content.length,i=Math.min(n+e.character,a);return this.ensureBeforeEOL(i,n)}ensureBeforeEOL(e,r){for(;e>r&&Gg(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}},s(Hr,"FullTextDocument"),Hr),_f;(function(t){function e(a,i,o,u){return new _T(a,i,o,u)}s(e,"create"),t.create=e;function r(a,i,o){if(a instanceof _T)return a.update(i,o),a;throw new Error("TextDocument.update: document must be created by TextDocument.create")}s(r,"update"),t.update=r;function n(a,i){const o=a.getText(),u=Sf(i.map(jN),(f,d)=>{const p=f.range.start.line-d.range.start.line;return p===0?f.range.start.character-d.range.start.character:p});let l=0;const c=[];for(const f of u){const d=a.offsetAt(f.range.start);if(d<l)throw new Error("Overlapping edit");d>l&&c.push(o.substring(l,d)),f.newText.length&&c.push(f.newText),l=a.offsetAt(f.range.end)}return c.push(o.substr(l)),c.join("")}s(n,"applyEdits"),t.applyEdits=n})(_f||(_f={}));function Sf(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),a=t.slice(r);Sf(n,e),Sf(a,e);let i=0,o=0,u=0;for(;i<n.length&&o<a.length;)e(n[i],a[o])<=0?t[u++]=n[i++]:t[u++]=a[o++];for(;i<n.length;)t[u++]=n[i++];for(;o<a.length;)t[u++]=a[o++];return t}s(Sf,"mergeSort");function Hm(t,e,r=0){const n=e?[r]:[];for(let a=0;a<t.length;a++){const i=t.charCodeAt(a);Gg(i)&&(i===13&&a+1<t.length&&t.charCodeAt(a+1)===10&&a++,n.push(r+a+1))}return n}s(Hm,"computeLineOffsets");function Gg(t){return t===13||t===10}s(Gg,"isEOL");function Fg(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}s(Fg,"getWellformedRange");function jN(t){const e=Fg(t.range);return e!==t.range?{newText:t.newText,range:e}:t}s(jN,"getWellfo
Line truncated
|
||||
${r}`),this.inline?`{${e}}`:e}toMarkdown(e){return e?.renderTag?.(this)??this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const i=vP(this.name,r,e??{});if(typeof i=="string")return i}let n="";e?.tag==="italic"||e?.tag===void 0?n="*":e?.tag==="bold"?n="**":e?.tag==="bold-italic"&&(n="***");let a=`${n}@${this.name}${n}`;return this.content.inlines.length===1?a=`${a} — ${r}`:this.content.inlines.length>1&&(a=`${a}
|
||||
${r}`),this.inline?`{${a}}`:a}},s(Qs,"JSDocTagImpl"),Qs);function vP(t,e,r){if(t==="linkplain"||t==="linkcode"||t==="link"){const n=e.indexOf(" ");let a=e;if(n>0){const o=Pf(e,n);a=e.substring(o),e=e.substring(0,n)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(a=`\`${a}\``),r.renderLink?.(e,a)??TP(e,a)}}s(vP,"renderInlineTag");function TP(t,e){try{return It.parse(t,!0),`[${e}](${t})`}catch{return t}}s(TP,"renderLinkDefault");var eo,Jm=(eo=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],a=this.inlines[r+1];e+=n.toString(),a&&a.range.start.line>n.range.start.line&&(e+=`
|
||||
`)}return e}toMarkdown(e){let r="";for(let n=0;n<this.inlines.length;n++){const a=this.inlines[n],i=this.inlines[n+1];r+=a.toMarkdown(e),i&&i.range.start.line>a.range.start.line&&(r+=`
|
||||
`)}return r}},s(eo,"JSDocTextImpl"),eo),to,$P=(to=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},s(to,"JSDocLineImpl"),to);function Zm(t){return t.endsWith(`
|
||||
`)?`
|
||||
`:`
|
||||
|
||||
`}s(Zm,"fillNewlines");var ro,RP=(ro=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&Xg(r))return Yg(r).toMarkdown({renderLink:s((a,i)=>this.documentationLinkRenderer(e,a,i),"renderLink"),renderTag:s(a=>this.documentationTagRenderer(e,a),"renderTag")})}documentationLinkRenderer(e,r,n){const a=this.findNameInLocalSymbols(e,r)??this.findNameInGlobalScope(e,r);if(a&&a.nameSegment){const i=a.nameSegment.range.start.line+1,o=a.nameSegment.range.start.character+1,u=a.documentUri.with({fragment:`L${i},${o}`});return`[${n}](${u.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const a=Vt(e).localSymbols;if(!a)return;let i=e;do{const u=a.getStream(i).find(l=>l.name===r);if(u)return u;i=i.$container}while(i)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(a=>a.name===r)}},s(ro,"JSDocDocumentationProvider"),ro),no,AP=(no=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return Kg(e)?e.$comment:Zh(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}},s(no,"DefaultCommentProvider"),no),ao,EP=(ao=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},s(ao,"DefaultAsyncParser"),ao),io,gB=(io=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),a=new Dr;let i;const o=r.onCancellationRequested(()=>{i=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(u=>{const l=this.hydrator.hydrate(u);a.resolve(l)}).catch(u=>{a.reject(u)}).finally(()=>{o.dispose(),clearTimeout(i)}),a.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 Dr;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(cr)}),this.queue.push(r),r.promise}},s(io,"AbstractThreadedAsyncParser"),io),so,vB=(so=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,a){this.onReadyEmitter=new Gd.Emitter,this.deferred=new Dr,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=a,r(i=>{const o=i;this.deferred.resolve(o),this.unlock()}),n(i=>{this.deferred.reject(i),this.unlock()})}terminate(){this.deferred.reject(cr),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 Dr,this.sendMessage(e),this.deferred.promise}},s(so,"ParserWorker"),so),oo,CP=(oo=class{constructor(){this.previousTokenSource=new $e.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=Dd();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=$e.CancellationToken.None){const a=new Dr,i={action:r,deferred:a,cancellationToken:n};return e.push(i),this.performNextOperation(),a.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:a})=>{try{const i=await Promise.resolve().then(()=>r(a));n.resolve(i)}catch(i){fa(i)?n.resolve(void 0):n.reject(i)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},s(oo,"DefaultWorkspaceLock"),oo),lo,bP=(lo=class{constructor(e){this.grammarElementIdMap=new wf,this.tokenTypeIdMap=new wf,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 a of qt(e))r.set(a,{});if(e.$cstNode)for(const a of Jo(e.$cstNode))n.set(a,{});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.dehydrateCstN
Line truncated
|
||||
`.includes(e[r-1])}matchWhitespace(e,r,n,a){this.whitespaceRegExp.lastIndex=r;const i=this.whitespaceRegExp.exec(e);return{currIndentLevel:i?.[0].length??0,prevIndentLevel:this.indentationStack.at(-1),match:i}}createIndentationTokenInstance(e,r,n,a){const i=this.getLineNumber(r,a);return Zu(e,n,a,a+n.length,i,i,1,n.length)}getLineNumber(e,r){return e.substring(0,r).split(/\r\n|\r|\n/).length}indentMatcher(e,r,n,a){if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:i,prevIndentLevel:o,match:u}=this.matchWhitespace(e,r,n,a);return i<=o?null:(this.indentationStack.push(i),u)}dedentMatcher(e,r,n,a){if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:i,prevIndentLevel:o,match:u}=this.matchWhitespace(e,r,n,a);if(i>=o)return null;const l=this.indentationStack.lastIndexOf(i);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${i} at offset: ${r}. Current indentation stack: ${this.indentationStack}`,offset:r,length:u?.[0]?.length??0,line:this.getLineNumber(e,r),column:1}),null;const c=this.indentationStack.length-l-1,f=e.substring(0,r).match(/[\r\n]+$/)?.[0].length??1;for(let d=0;d<c;d++){const p=this.createIndentationTokenInstance(this.dedentTokenType,e,"",r-(f-1));n.push(p),this.indentationStack.pop()}return null}buildTerminalToken(e){const r=super.buildTerminalToken(e),{indentTokenName:n,dedentTokenName:a,whitespaceTokenName:i}=this.options;return r.name===n?this.indentTokenType:r.name===a?this.dedentTokenType:r.name===i?Xa({name:i,pattern:this.whitespaceRegExp,group:pt.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}},s(uo,"IndentationAwareTokenBuilder"),uo),co,TB=(co=class extends Hg{constructor(e){if(super(e),e.parser.TokenBuilder instanceof SP)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=qg){const n=super.tokenize(e),a=n.report;r?.mode==="full"&&n.tokens.push(...a.remainingDedents),a.remainingDedents=[];const{indentTokenType:i,dedentTokenType:o}=this.indentationTokenBuilder,u=i.tokenTypeIdx,l=o.tokenTypeIdx,c=[],f=n.tokens.length-1;for(let d=0;d<f;d++){const p=n.tokens[d],y=n.tokens[d+1];if(p.tokenTypeIdx===u&&y.tokenTypeIdx===l){d++;continue}c.push(p)}return f>=0&&c.push(n.tokens[f]),n.tokens=c,n}},s(co,"IndentationAwareLexer"),co),nv={};en(nv,{AstUtils:()=>_h,BiMap:()=>wf,Cancellation:()=>$e,ContextCache:()=>Md,CstUtils:()=>Eh,DONE_RESULT:()=>ct,Deferred:()=>Dr,Disposable:()=>Gn,DisposableCache:()=>xd,DocumentCache:()=>XN,EMPTY_STREAM:()=>Vo,ErrorWithLocation:()=>Uf,GrammarUtils:()=>ry,MultiMap:()=>xr,OperationCancelled:()=>cr,Reduction:()=>vu,RegExpUtils:()=>ay,SimpleCache:()=>Bg,StreamImpl:()=>ur,TreeStreamImpl:()=>qo,URI:()=>It,UriTrie:()=>zg,UriUtils:()=>dt,WorkspaceCache:()=>Ug,assertCondition:()=>ny,assertUnreachable:()=>tn,delayNextTick:()=>Ld,interruptAndCheck:()=>Ye,isOperationCancelled:()=>fa,loadGrammarFromJson:()=>Ze,setInterruptionPeriod:()=>Mg,startCancelableOperation:()=>Dd,stream:()=>de});kf(nv,Gd);var fo,wP=(fo=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[]}},s(fo,"EmptyFileSystemProvider"),fo),st={fileSystemProvider:s(()=>new wP,"fileSystemProvider")},$B={Grammar:s(()=>{},"Grammar"),LanguageMetaData:s(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},RB={AstReflection:s(()=>new qh,"AstReflection")};function IP(){const t=re(Je(st),RB),e=re(Xe({shared:t}),$B);return t.ServiceRegistry.register(e),e}s(IP,"createMinimalGrammarServices");function Ze(t){const e=IP(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,It.parse(`memory:/${r.name??"grammar"}.langium`)),r}s(Ze,"loadGrammarFromJson");kf(z$,nv);var po,AB=(po=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new xr}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 NP(n=>this.records.add(e,this.dumpLine truncated
|
||||
`)}}},s(yo,"AbstractMermaidValueConverter"),yo),go,pl=(go=class extends vr{runCustomConverter(e,r,n){}},s(go,"CommonValueConverter"),go),vo,$t=(vo=class extends Od{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,r,n){const a=super.buildKeywordTokens(e,r,n);return a.forEach(i=>{this.keywords.has(i.name)&&i.PATTERN!==void 0&&(i.PATTERN=new RegExp(i.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),a}},s(vo,"AbstractMermaidTokenBuilder"),vo),To;To=class extends $t{},s(To,"CommonTokenBuilder");var $o,zU=($o=class extends $t{constructor(){super(["radar-beta"])}},s($o,"RadarTokenBuilder"),$o),kP={parser:{TokenBuilder:s(()=>new zU,"TokenBuilder"),ValueConverter:s(()=>new pl,"ValueConverter")}};function OP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),wU,kP);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}s(OP,"createRadarServices");var Ro,jU=(Ro=class extends $t{constructor(){super(["railroad-beta"])}},s(Ro,"RailroadTokenBuilder"),Ro),w$=s(t=>{const e=t.slice(1,-1);let r="";for(let n=0;n<e.length;n++){const a=e[n];if(a==="\\"&&n+1<e.length){n++;const i=e[n];switch(i){case"n":r+=`
|
||||
`;break;case"r":r+="\r";break;case"t":r+=" ";break;default:r+=i}continue}r+=a}return r},"decodeEscapedString"),Ao,BU=(Ao=class extends vr{runConverter(e,r,n){const a=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof a=="string"){const i=a.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return w$(i)}return a}runCustomConverter(e,r,n){if(e.name==="RR_STRING")return w$(r)}},s(Ao,"RailroadValueConverter"),Ao),LP={parser:{TokenBuilder:s(()=>new jU,"TokenBuilder"),ValueConverter:s(()=>new BU,"ValueConverter")}};function DP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),PU,LP);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}s(DP,"createRailroadServices");var Eo,UU=(Eo=class extends $t{constructor(){super(["railroad-ebnf-beta"])}},s(Eo,"RailroadEbnfTokenBuilder"),Eo),I$=s(t=>{const e=t.slice(1,-1);let r="";for(let n=0;n<e.length;n++){const a=e[n];if(a==="\\"&&n+1<e.length){n++;const i=e[n];switch(i){case"n":r+=`
|
||||
`;break;case"r":r+="\r";break;case"t":r+=" ";break;default:r+=i}continue}r+=a}return r},"decodeEscapedString"),Co,KU=(Co=class extends vr{runConverter(e,r,n){const a=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof a=="string"){const i=a.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return I$(i)}return a}runCustomConverter(e,r,n){if(e.name==="EBNF_STRING")return I$(r);if(e.name==="EBNF_SPECIAL_SEQUENCE")return r.slice(1,-1).trim()}},s(Co,"RailroadEbnfValueConverter"),Co),xP={parser:{TokenBuilder:s(()=>new UU,"TokenBuilder"),ValueConverter:s(()=>new KU,"ValueConverter")}};function MP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),NU,xP);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}s(MP,"createRailroadEbnfServices");var bo,WU=(bo=class extends $t{constructor(){super(["railroad-abnf-beta"])}},s(bo,"RailroadAbnfTokenBuilder"),bo),_o,VU=(_o=class extends vr{runConverter(e,r,n){const a=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof a=="string"){const i=a.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1)}return a}runCustomConverter(e,r,n){if(e.name==="ABNF_STRING")return r.slice(1,-1)}},s(_o,"RailroadAbnfValueConverter"),_o),GP={parser:{TokenBuilder:s(()=>new WU,"TokenBuilder"),ValueConverter:s(()=>new VU,"ValueConverter")}};function FP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),IU,GP);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}s(FP,"createRailroadAbnfServices");var So,qU=(So=class extends $t{constructor(){super(["railroad-peg-beta"])}},s(So,"RailroadPegTokenBuilder"),So),N$=s(t=>{const e=t.slice(1,-1);let r="";for(let n=0;n<e.length;n++){const a=e[n];if(a==="\\"&&n+1<e.length){n++;const i=e[n];switch(i){case"n":r+=`
|
||||
`;break;case"r":r+="\r";break;case"t":r+=" ";break;default:r+=i}continue}r+=a}return r},"decodeEscapedString"),wo,HU=(wo=class extends vr{runConverter(e,r,n){const a=super.runConverter(e,r,n);if(e.name==="TITLE"&&typeof a=="string"){const i=a.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return N$(i)}return a}runCustomConverter(e,r,n){if(e.name==="PEG_STRING")return N$(r)}},s(wo,"RailroadPegValueConverter"),wo),zP={parser:{TokenBuilder:s(()=>new qU,"TokenBuilder"),ValueConverter:s(()=>new HU,"ValueConverter")}};function jP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),kU,zP);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}s(jP,"createRailroadPegServices");var Io,YU=(Io=class extends $t{constructor(){super(["treemap"])}},s(Io,"TreemapTokenBuilder"),Io),XU=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,No,JU=(No=class extends vr{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 a=XU.exec(r);if(a)return{$type:"ClassDefStatement",className:a[1],styleText:a[2]||void 0}}}},s(No,"TreemapValueConverter"),No);function BP(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}s(BP,"registerValidationChecks");var Po,ZU=(Po=class{checkSingleRoot(e,r){let n;for(const a of e.TreemapRows)a.item&&(n===void 0&&a.indent===void 0?n=0:a.indent===void 0?r("error","Multiple root nodes are not allowed in a treemap.",{node:a,property:"item"}):n!==void 0&&n>=parseInt(a.indent,10)&&r("error","Multiple root nodes are not allowed in a treemap.",{node:a,property:"item"}))}},s(Po,"TreemapValidator"),Po),UP={parser:{TokenBuilder:s(()=>new YU,"TokenBuilder"),ValueConverter:s(()=>new JU,"ValueConverter")},validation:{TreemapValidator:s(()=>new ZU,"TreemapValidator")}};function KP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),OU,UP);return e.ServiceRegistry.register(r),BP(r),{shared:e,Treemap:r}}s(KP,"createTreemapServices");var ko,QU=(ko=class extends vr{runCustomConverter(e,r,n){if(e.name.toUpperCase()==="LINK_LABEL")return r.substring(1).trim()}},s(ko,"WardleyValueConverter"),ko),WP={parser:{ValueConverter:s(()=>new QU,"ValueConverter")}};function VP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),DU,WP);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}s(VP,"createWardleyServices");var Oo,eK=(Oo=class extends $t{constructor(){super(["cynefin-beta"])}},s(Oo,"CynefinTokenBuilder"),Oo),qP={parser:{TokenBuilder:s(()=>new eK,"TokenBuilder"),ValueConverter:s(()=>new pl,"ValueConverter")}};function HP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),AU,qP);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}s(HP,"createCynefinServices");var Lo,tK=(Lo=class extends $t{constructor(){super(["gitGraph"])}},s(Lo,"GitGraphTokenBuilder"),Lo),YP={parser:{TokenBuilder:s(()=>new tK,"TokenBuilder"),ValueConverter:s(()=>new pl,"ValueConverter")}};function XP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),CU,YP);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}s(XP,"createGitGraphServices");var Do,rK=(Do=class extends $t{constructor(){super(["info","showInfo"])}},s(Do,"InfoTokenBuilder"),Do),JP={parser:{TokenBuilder:s(()=>new rK,"TokenBuilder"),ValueConverter:s(()=>new pl,"ValueConverter")}};function ZP(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),bU,JP);return e.ServiceRegistry.register(r),{shared:e,Info:r}}s(ZP,"createInfoServices");var xo,nK=(xo=class extends $t{constructor(){super(["packet"])}},s(xo,"PacketTokenBuilder"),xo),QP={parser:{TokenBuilder:s(()=>new nK,"TokenBuilder"),ValueConverter:s(()=>new pl,"ValueConverter")}};function ek(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),_U,QP);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}s(ek,"createPacketServices");var Mo,aK=(Mo=class extends $t{constructor(){super(["pie","showData"])}},s(Mo,"PieTokenBuilder"),Mo),Go,iK=(Go=class extends vr{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},s(Go,"PieValueConverter"),Go),tk={parser:{TokenBuilder:s(()=>new aK,"TokenBuilder"),ValueConverter:s(()=>new iK,"ValueConverter")}};function rk(t=st){const e=re(Je(t),Tt),r=re(Xe({shared:e}),SU,tk);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}s(rk,"createPieServices");var Fo,sK=(Fo=class extends vr{runCustomConverter(e,r,n){if(e.name==="INDENTATION")return 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 a=r.trim();return a.substring(5,a.length-1)}if(e.name==="DESC_ANNOTATION")return r.trim().substring(2).trim()}},s(Fo,"TreeViewValueConverter"),Fo),zo,oK=(zo=class extends
Line truncated
|
||||
`),n=e.parserErrors.map(a=>{const i=a.token.startLine!==void 0&&!isNaN(a.token.startLine)?a.token.startLine:"?",o=a.token.startColumn!==void 0&&!isNaN(a.token.startColumn)?a.token.startColumn:"?";return`Parse error on line ${i}, column ${o}: ${a.message}`}).join(`
|
||||
`);super(`Parsing failed: ${r} ${n}`),this.result=e}},s(Wo,"MermaidParseError"),Wo);const hK=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:JP,createInfoServices:ZP},Symbol.toStringTag,{value:"Module"})),yK=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:QP,createPacketServices:ek},Symbol.toStringTag,{value:"Module"})),gK=Object.freeze(Object.defineProperty({__proto__:null,PieModule:tk,createPieServices:rk},Symbol.toStringTag,{value:"Module"})),vK=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:nk,createTreeViewServices:ak},Symbol.toStringTag,{value:"Module"})),TK=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:ik,createArchitectureServices:sk},Symbol.toStringTag,{value:"Module"})),$K=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:YP,createGitGraphServices:XP},Symbol.toStringTag,{value:"Module"})),RK=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:lk,createEventModelingServices:uk},Symbol.toStringTag,{value:"Module"})),AK=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:kP,createRadarServices:OP},Symbol.toStringTag,{value:"Module"})),EK=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:LP,createRailroadServices:DP},Symbol.toStringTag,{value:"Module"})),CK=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:xP,createRailroadEbnfServices:MP},Symbol.toStringTag,{value:"Module"})),bK=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:GP,createRailroadAbnfServices:FP},Symbol.toStringTag,{value:"Module"})),_K=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:zP,createRailroadPegServices:jP},Symbol.toStringTag,{value:"Module"})),SK=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:UP,createTreemapServices:KP},Symbol.toStringTag,{value:"Module"})),wK=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:WP,createWardleyServices:VP},Symbol.toStringTag,{value:"Module"})),IK=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:qP,createCynefinServices:HP},Symbol.toStringTag,{value:"Module"}));export{mK as M,MP as a,FP as b,DP as c,jP as d,NB as i,pK as p};
|
||||
@@ -0,0 +1,62 @@
|
||||
import{p as xt}from"./chunk-JWPE2WC7.js";import{s as gt,g as $t,o as bt,n as wt,a as Ct,b as vt,_ as s,l as O,D as Dt,d as kt,p as At,A as U,y as Q,B as Tt,E as ot}from"./mermaid.core.js";import{p as Bt}from"./cynefin-OW5HDTMX.js";import"./index.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.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"),Nt=s(()=>U({...Tt.cynefin,...Q().cynefin}),"getConfig"),Pt=s(()=>{At(),H=rt()},"clear"),Y={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,Y),Y.setDomains(t.domains),Y.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),It(e)},"parse")};function V(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}s(V,"seededRandom");function st(t){let e=0;for(let n=0;n<t.length;n++){const a=t.charCodeAt(n);e=(e<<5)-e+a,e|=0}return e}s(st,"hashString");function it(t,e){return typeof t=="number"&&Number.isFinite(t)&&t!==0?t:st(e)}s(it,"resolveSeed");function ct(t,e,n,a){const c=t/2,m=a??t*.015,v=7,W=e/v,d=[];for(let o=0;o<=v;o++){const p=V(n+o*17)*m*2-m;d.push({x:c+p,y:o*W})}let D=`M${d[0].x},${d[0].y}`;for(let o=0;o<d.length-1;o++){const p=d[o],i=d[o+1],f=(p.y+i.y)/2,b=o%2===0?1:-1,h=m*1.5*b*V(n+o*31+7),R=p.x+h,_=f,E=i.x-h;D+=` C${R},${_} ${E},${f} ${i.x},${i.y}`}return D}s(ct,"generateFoldPath");function lt(t,e,n,a){const c=e/2,m=a??e*.015,v=7,W=t/v,d=[];for(let o=0;o<=v;o++){const p=V(n+o*23)*m*2-m;d.push({x:o*W,y:c+p})}let D=`M${d[0].x},${d[0].y}`;for(let o=0;o<d.length-1;o++){const p=d[o],i=d[o+1],f=(p.x+i.x)/2,b=o%2===0?1:-1,h=m*1.5*b*V(n+o*37+11),R=f,_=p.y+h,E=f,z=i.y-h;D+=` C${R},${_} ${E},${z} ${i.x},${i.y}`}return D}s(lt,"generateHorizontalBoundary");function dt(t,e){const n=t/2,a=e*.5,c=e,m=t*.03;return[`M${n},${a}`,`C${n+m},${a+(c-a)*.2}`,`${n-m*1.5},${a+(c-a)*.55}`,`${n+m*.5},${a+(c-a)*.75}`,`C${n-m},${a+(c-a)*.85}`,`${n+m*.3},${a+(c-a)*.95}`,`${n},${c}`].join(" ")}s(dt,"generateCliffPath");function ft(t,e,n,a){return[`M${t-n},${e}`,`A${n},${a} 0 1,1 ${t+n},${e}`,`A${n},${a} 0 1,1 ${t-n},${e}`,"Z"].join(" ")}s(ft,"generateConfusionPath");var at={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"}},Rt=s((t,e)=>{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Et=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,E=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,E,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${E}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const A=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Z=it(o.seed,e),mt=A.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=A.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=A.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x"Line truncated
|
||||
.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"),Gt=Ht,qt={parser:Wt,db:Y,renderer:Ft,styles:Gt};export{qt as diagram};
|
||||
@@ -0,0 +1,321 @@
|
||||
function Ds(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,a=Array(e);t<e;t++)a[t]=r[t];return a}function tc(r){if(Array.isArray(r))return r}function ac(r){if(Array.isArray(r))return Ds(r)}function ct(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function nc(r,e){for(var t=0;t<e.length;t++){var a=e[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,Jl(a.key),a)}}function dt(r,e,t){return e&&nc(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function Cr(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=Ks(r))||e){t&&(r=t);var a=0,n=function(){};return{s:n,n:function(){return a>=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function(u){throw u},f:n}}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 i,s=!0,o=!1;return{s:function(){t=t.call(r)},n:function(){var u=t.next();return s=u.done,u},e:function(u){o=!0,i=u},f:function(){try{s||t.return==null||t.return()}finally{if(o)throw i}}}}function Ql(r,e,t){return(e=Jl(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ic(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function sc(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var a,n,i,s,o=[],u=!0,l=!1;try{if(i=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;u=!1}else for(;!(u=(a=i.call(t)).done)&&(o.push(a.value),o.length!==e);u=!0);}catch(v){l=!0,n=v}finally{try{if(!u&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(l)throw n}}return o}}function oc(){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 uc(){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 Xe(r,e){return tc(r)||sc(r,e)||Ks(r,e)||oc()}function yn(r){return ac(r)||ic(r)||Ks(r)||uc()}function lc(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var a=t.call(r,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function Jl(r){var e=lc(r,"string");return typeof e=="symbol"?e:e+""}function je(r){"@babel/helpers - typeof";return je=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},je(r)}function Ks(r,e){if(r){if(typeof r=="string")return Ds(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ds(r,e):void 0}}var Qe=typeof window>"u"?null:window,Co=Qe?Qe.navigator:null;Qe&&Qe.document;var vc=je(""),jl=je({}),fc=je(function(){}),cc=typeof HTMLElement>"u"?"undefined":je(HTMLElement),La=function(e){return e&&e.instanceString&&He(e.instanceString)?e.instanceString():null},he=function(e){return e!=null&&je(e)==vc},He=function(e){return e!=null&&je(e)===fc},Fe=function(e){return!Tr(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Me=function(e){return e!=null&&je(e)===jl&&!Fe(e)&&e.constructor===Object},dc=function(e){return e!=null&&je(e)===jl},ae=function(e){return e!=null&&je(e)===je(1)&&!isNaN(e)},ev=function(e){return ae(e)&&Math.floor(e)===e},mn=function(e){if(cc!=="undefined")return e!=null&&e instanceof HTMLElement},Tr=function(e){return Ia(e)||rv(e)},Ia=function(e){return La(e)==="collection"&&e._private.single},rv=function(e){return La(e)==="collection"&&!e._private.single},Xs=function(e){return La(e)==="core"},tv=function(e){return La(e)==="stylesheet"},hc=function(e){return La(e)==="event"},st=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},gc=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},pc=function(e){return Me(e)&&ae(e.x1)&&ae(e.x2)&&ae(e.y1)&&ae(e.y2)},yc=function(e){return dc(e)&&He(e.then)},mc=function(){return Co&&Co.userAgent.match(/msie|trident|edge/i)},Yt=function(e,t){t||(t=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;s<arguments.length;s++)i.push(arguments[s]);return i.join("$")});var a=function(){var i=this,s=arguments,o,u=t.apply(i,s),l=a.cache;return(o=l[u])||(o=l[u]=e.apply(i,s)),o};return a.cache={},a},Ys=Yt(function(r){return r.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Rn=Yt(function(r){return r.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),av=Yt(function(r,e){return r+e[0].toUpperCase()+e.substring(1)},function(r,e){return r+"$"+e}),To=function(e){return st(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},rt=function(e,t){return e.slice(-1*t.length)===t},Je="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",bc="rgb[a]?\\(("+Je+"[%]?)\\s*,\\s*("+Je+"[%]?)\\s*,\\s*("+Je+"[%]?)(?:\\s*,\\s*("+Je+"))?\\)",wc="rgb[a]?\\((?:"+Je+"[%]?)\\s*,\\s*(?:"+Je+"[%]?)\\s*,\\s*(?:"+Je+"[%]?)(?:\\s*,\\s*(?:"+Je+"))?\\)",xc="hsl[a]?\\(("+Je+")\\s*,\\s*("+Je+"[%])\\s*,\\s*("+Je+"[%])(?:\\s*,\\s*("+Je+"))?\\)",Ec="hsl[a]?\\((?:"+Je+")\\s*,\\s*(?:"+Je+"[%])\\s*,\\s*(?:"+Je+"[%])(?:\\s*,\\s*(?:"+Je+"))?\\)",Cc="\\#[0-9a-fA-F]{3}",Tc="\\#[0-9a-fA-F]{6}",nv=function(e,t){return e<t?-1:e>t?1:0},Sc=function(e,t){return-1*nv(e,t)},me=Object.assign!=null?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t<e.length;t++){var a=e[t];if(a!=null)for(var n=Object.keys(a),i=0;i<n.length;i++){var s=n[i];r[s]=a[s]}}return r},kc=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var t=e.length===4,a,n,i,s=16;return t?(a=parseInt(e[1]+e[1],s),n=parseInt(e[2]+e[2],s),i=parseInt(e[3]+e[3],s)):(a=parseInt(e[1]+e[2],s),n=parseInt(e[3]+e[4],s),i=parseInt(e[5]+e[6],s)),[a,n,i]}},Dc=function(e){var t,a,n,i,s,o,u,l;function v(d,y,g){return g<0&&(g+=1),g>1&&(g-=1),g<1/6?d+(y-d)*6*g:g<1/2?y:g<2/3?d+(y-d)*(2/3-g)*6:d}var f=new RegExp("^"+xc+"$").exec(e);if(f){if(a=parseInt(f[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(f[2]),n<0||n>100||(n=n/100,i=parseFloat(f[3]),i<0||i>100)||(i=i/100,s=f[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(n===0)o=u=l=Math.round(i*255);else{var c=i<.5?i*(1+n):i+n-i*n,h=2*i-c;o=Math.round(255*v(h,c,a+1/3)),u=Math.round(255*v(h,c,a)),l=Math.round(255*v(h,c,a-1/3))}t=[o,u,l,s]}return t},Bc=function(e){var t,a=new RegExp("^"+bc+"$").exec(e);if(a){t=[];for(var n=[],i=1;i<=3;i++){var s=a[i];if(s[s.length-1]==="%"&&(n[i]=!0),s=parseFloat(s),n[i]&&(s=s/100*255),s<0||s>255)return;t.push(Math.floor(s))}var o=n[1]||n[2]||n[3],u=n[1]&&n[2]&&n[3];if(o&&!u)return;var l=a[4];if(l!==void 0){if(l=parseFloat(l),l<0||l>1)re
Line truncated
|
||||
`),f=r.pstyle("text-max-width").pfValue,c=r.pstyle("text-overflow-wrap").value,h=c==="anywhere",d=[],y=/[\s\u200b]+|$/g,g=0;g<v.length;g++){var p=v[g],m=this.calculateLabelDimensions(r,p),b=m.width;if(h){var w=p.split("").join(l);p=w}if(b>f){var E=p.matchAll(y),C="",x=0,T=Cr(E),k;try{for(T.s();!(k=T.n()).done;){var B=k.value,D=B[0],P=p.substring(x,B.index);x=B.index+D.length;var A=C.length===0?P:C+P+D,R=this.calculateLabelDimensions(r,A),L=R.width;L<=f?C+=P+D:(C&&d.push(C),C=P+D)}}catch(q){T.e(q)}finally{T.f()}C.match(/^[\s\u200b]+$/)||d.push(C)}else d.push(p)}s("labelWrapCachedLines",d),n=s("labelWrapCachedText",d.join(`
|
||||
`)),s("labelWrapKey",u)}else if(o==="ellipsis"){var I=r.pstyle("text-max-width").pfValue,M="",N="…",F=!1;if(this.calculateLabelDimensions(r,n).width<I)return n;for(var _=0;_<n.length;_++){var z=this.calculateLabelDimensions(r,M+n[_]+N).width;if(z>I)break;M+=n[_],_===n.length-1&&(F=!0)}return F||(M+=N),M}return n};Hr.getLabelJustification=function(r){var e=r.pstyle("text-justification").strValue,t=r.pstyle("text-halign").strValue;return e==="auto"?r.isNode()?Ug(t):"center":e};Hr.calculateLabelDimensions=function(r,e){var t=this,a=t.cy.window(),n=a.document,i=0,s=r.pstyle("font-style").strValue,o=r.pstyle("font-size").pfValue,u=r.pstyle("font-family").strValue,l=r.pstyle("font-weight").strValue,v=r.pstyle("text-metrics").strValue||"font",f=this.labelCalcCanvas,c=this.labelCalcCanvasContext;if(!f){f=this.labelCalcCanvas=n.createElement("canvas"),c=this.labelCalcCanvasContext=f.getContext("2d");var h=f.style;h.position="absolute",h.left="-9999px",h.top="-9999px",h.zIndex="-1",h.visibility="hidden",h.pointerEvents="none"}c.font="".concat(s," ").concat(l," ").concat(o,"px ").concat(u);for(var d=0,y=0,g=e.split(`
|
||||
`),p=g.length,m=0,b=0,w=0;w<p;w++){var E=g[w],C=c.measureText(E),x=Math.ceil(C.width),T=o;v==="glyph"&&(w===0&&(b=C.actualBoundingBoxAscent),w===p-1&&(m=C.actualBoundingBoxDescent)),d=Math.max(x,d),y+=T}return v==="glyph"&&(y-=o-b-m),d+=i,y+=i,{width:d,height:y,labelActualAscent:b,labelActualDescent:m}};Hr.calculateLabelAngle=function(r,e){var t=r._private,a=t.rscratch,n=r.isEdge(),i=e?e+"-":"",s=r.pstyle(i+"text-rotation"),o=s.strValue;return o==="none"?0:n&&o==="autorotate"?a.labelAutoAngle:o==="autorotate"?0:s.pfValue};Hr.calculateLabelAngles=function(r){var e=this,t=r.isEdge(),a=r._private,n=a.rscratch;n.labelAngle=e.calculateLabelAngle(r),t&&(n.sourceLabelAngle=e.calculateLabelAngle(r,"source"),n.targetLabelAngle=e.calculateLabelAngle(r,"target"))};var xf={},Ml=28,Ll=!1;xf.getNodeShape=function(r){var e=this,t=r.pstyle("shape").value;if(t==="cutrectangle"&&(r.width()<Ml||r.height()<Ml))return Ll||(Ne("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Ll=!0),"rectangle";if(r.isParent())return t==="rectangle"||t==="roundrectangle"||t==="round-rectangle"||t==="cutrectangle"||t==="cut-rectangle"||t==="barrel"?t:"rectangle";if(t==="polygon"){var a=r.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(a).name}return t};var Kn={};Kn.registerCalculationListeners=function(){var r=this.cy,e=r.collection(),t=this,a=function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var u=0;u<s.length;u++){var l=s[u],v=l._private,f=v.rstyle;f.clean=!1,f.cleanConnected=!1}};t.binder(r).on("bounds.* dirty.*",function(s){var o=s.target;a(o)}).on("style.* background.*",function(s){var o=s.target;a(o,!1)});var n=function(s){if(s){var o=t.onUpdateEleCalcsFns;e.cleanStyle();for(var u=0;u<e.length;u++){var l=e[u],v=l._private.rstyle;l.isNode()&&!v.cleanConnected&&(a(l.connectedEdges()),v.cleanConnected=!0)}if(o)for(var f=0;f<o.length;f++){var c=o[f];c(s,e)}t.recalculateRenderedStyle(e),e=r.collection()}};t.flushRenderedStyleQueue=function(){n(!0)},t.beforeRender(n,t.beforeRenderPriorities.eleCalcs)};Kn.onUpdateEleCalcs=function(r){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(r)};Kn.recalculateRenderedStyle=function(r,e){var t=function(w){return w._private.rstyle.cleanConnected};if(r.length!==0){var a=[],n=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<r.length;i++){var s=r[i],o=s._private,u=o.rstyle;s.isEdge()&&(!t(s.source())||!t(s.target()))&&(u.clean=!1),s.isEdge()&&s.isBundledBezier()&&s.parallelEdges().some(function(b){return!b._private.rstyle.clean&&b.isBundledBezier()})&&(u.clean=!1),!(e&&u.clean||s.removed())&&s.pstyle("display").value!=="none"&&(o.group==="nodes"?n.push(s):a.push(s),u.clean=!0)}for(var l=0;l<n.length;l++){var v=n[l],f=v._private,c=f.rstyle,h=v.position();this.recalculateNodeLabelProjection(v),c.nodeX=h.x,c.nodeY=h.y,c.nodeW=v.pstyle("width").pfValue,c.nodeH=v.pstyle("height").pfValue}this.recalculateEdgeProjections(a);for(var d=0;d<a.length;d++){var y=a[d],g=y._private,p=g.rstyle,m=g.rscratch;p.srcX=m.arrowStartX,p.srcY=m.arrowStartY,p.tgtX=m.arrowEndX,p.tgtY=m.arrowEndY,p.midX=m.midX,p.midY=m.midY,p.labelAngle=m.labelAngle,p.sourceLabelAngle=m.sourceLabelAngle,p.targetLabelAngle=m.targetLabelAngle}}}};var Xn={};Xn.updateCachedGrabbedEles=function(){var r=this.cachedZSortedEles;if(r){r.drag=[],r.nondrag=[];for(var e=[],t=0;t<r.length;t++){var a=r[t],n=a._private.rscratch;a.grabbed()&&!a.isParent()?e.push(a):n.inDragLayer?r.drag.push(a):r.nondrag.push(a)}for(var t=0;t<e.length;t++){var a=e[t];r.drag.push(a)}}};Xn.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};Xn.getCachedZSortedEles=function(r){if(r||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(rf),e.interactive=e.filter(function(t){return t.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var Ef={};[At,Dn,hr,Ga,po,Hr,xf,Kn,Xn].forEach(function(r){me(Ef,r)});var Cf={};Cf.getCachedImage=function(r,e,t){var a=this,n=a.imageCache=a.imageCache||{},i=n[r];if(i)return i.image.complete||i.image.addEventListener("load",t),i.image;i=n[r]=n[r]||{};var s=i.image=new Image;s.addEventListener("load",t),s.addEventListener("error",function(){s.error=!0});var o="data:",u=r.substring(0,o.length).toLowerCase()===o;return u||(e=e==="null"?null:e,s.crossOrigin=e),s.src=r,s};var Tf=function(e,t){var a=e[0];!a||a._private.grabbed===t||(a._private.grabbed=t,e.updateStyle(!1))},sy=function(e){Tf(e,!0)},oy=function(e){Tf(e,!1)},ia={};ia.registerBinding=function(r,e,t,a){var n=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(r)){for(var i=[],s=0;s<r.length;s++){var o=r[s];if(o!==void 0){var u=this.binder(o);i.push(u.on.apply(u,n))}}return i}var u=this.binder(r);return u.on.apply(u,n)};ia.binder=function(r){var e=this,t=e.cy.window(),a=r===t||r===t.document||r===t.document.body||gc(r);if(e.supportsPassiveEvents==null){var n=!1;try{va
Line truncated
|
||||
float circleSD(vec2 p, float r) {
|
||||
return distance(vec2(0), p) - r; // signed distance
|
||||
}
|
||||
`,dm=`
|
||||
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);
|
||||
}
|
||||
`,hm=`
|
||||
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;
|
||||
}
|
||||
`,gm=`
|
||||
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;
|
||||
}
|
||||
`,Ea={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},Pn={IGNORE:1,USE_BB:2},Es=0,Ul=1,Kl=2,Cs=3,Vt=4,nn=5,ga=6,pa=7,pm=(function(){function r(e,t,a){ct(this,r),this.r=e,this.gl=t,this.maxInstances=a.webglBatchSize,this.atlasSize=a.webglTexSize,this.bgColor=a.bgColor,this.debug=a.webglDebug,this.batchDebugInfo=[],a.enableWrapping=!0,a.createTextureCanvas=Xy,this.atlasManager=new vm(e,a),this.batchManager=new fm(a),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Ea.SCREEN),this.pickingProgram=this._createShaderProgram(Ea.PICKING),this.vao=this._createVAO()}return dt(r,[{key:"addAtlasCollection",value:function(t,a){this.atlasManager.addAtlasCollection(t,a)}},{key:"addTextureAtlasRenderType",value:function(t,a){this.atlasManager.addRenderType(t,a)}},{key:"addSimpleShapeRenderType",value:function(t,a){this.simpleShapeOptions.set(t,a)}},{key:"invalidate",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=a.type,i=this.atlasManager;return n?i.invalidate(t,{filterType:function(o){return o===n},forceRedraw:!0}):i.invalidate(t)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(t){var a=this.gl,n=`#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(Es,`) {
|
||||
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(Vt," || aVertType == ").concat(pa,`
|
||||
|| aVertType == `).concat(nn," || aVertType == ").concat(ga,`) { // 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(Ul,`) {
|
||||
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(Kl,`) {
|
||||
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(Cs,` && 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;
|
||||
}
|
||||
`),i=this.batchManager.getIndexArray(),s=`#version 300 es
|
||||
precision highp float;
|
||||
|
||||
// declare texture unit for each texture atlas in the batch
|
||||
`.concat(i.map(function(l){return"uniform sampler2D uTexture".concat(l,";")}).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(cm,`
|
||||
`).concat(dm,`
|
||||
`).concat(hm,`
|
||||
`).concat(gm,`
|
||||
|
||||
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(Es,`) {
|
||||
// look up the texel from the texture unit
|
||||
`).concat(i.map(function(l){return"if(vAtlasId == ".concat(l,") outColor = texture(uTexture").concat(l,", vTexCoord);")}).join(`
|
||||
else `),`
|
||||
}
|
||||
else if(vVertType == `).concat(Cs,`) {
|
||||
// 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(Vt,` && 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(Vt," || vVertType == ").concat(pa,`
|
||||
|| vVertType == `).concat(nn," || vVertType == ").concat(ga,`) { // 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(Vt,`) {
|
||||
d = rectangleSD(p, b);
|
||||
} else if(vVertType == `).concat(pa,` && w == h) {
|
||||
d = circleSD(p, b.x); // faster than ellipse
|
||||
} else if(vVertType == `).concat(pa,`) {
|
||||
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(t.picking?`if(outColor.a == 0.0) discard;
|
||||
else outColor = vIndex;`:"",`
|
||||
}
|
||||
`),o=Ky(a,n,s);o.aPosition=a.getAttribLocation(o,"aPosition"),o.aIndex=a.getAttribLocation(o,"aIndex"),o.aVertType=a.getAttribLocation(o,"aVertType"),o.aTransform=a.getAttribLocation(o,"aTransform"),o.aAtlasId=a.getAttribLocation(o,"aAtlasId"),o.aTex=a.getAttribLocation(o,"aTex"),o.aPointAPointB=a.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=a.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=a.getAttribLocation(o,"aLineWidth"),o.aColor=a.getAttribLocation(o,"aColor"),o.aCornerRadius=a.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=a.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=a.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=a.getUniformLocation(o,"uAtlasSize"),o.uBGColor=a.getUniformLocation(o,"uBGColor"),o.uZoom=a.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var u=0;u<this.batchManager.getMaxAtlasesPerBatch();u++)o.uTextures.push(a.getUniformLocation(o,"uTexture".concat(u)));return o}},{key:"_createVAO",value:function(){var t=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=t.length/2;var a=this.maxInstances,n=this.gl,i=this.program,s=n.createVertexArray();return n.bindVertexArray(s),tm(n,"vec2",i.aPosition,t),this.transformBuffer=am(n,a,i.aTransform),this.indexBuffer=Fr(n,a,"vec4",i.aIndex),this.vertTypeBuffer=Fr(n,a,"int",i.aVertType),this.atlasIdBuffer=Fr(n,a,"int",i.aAtlasId),this.texBuffer=Fr(n,a,"vec4",i.aTex),this.pointAPointBBuffer=Fr(n,a,"vec4",i.aPointAPointB),this.pointCPointDBuffer=Fr(n,a,"vec4",i.aPointCPointD),this.lineWidthBuffer=Fr(n,a,"vec2",i.aLineWidth),this.colorBuffer=Fr(n,a,"vec4",i.aColor),this.cornerRadiusBuffer=Fr(n,a,"vec4",i.aCornerRadius),this.borderColorBuffer=Fr(n,a,"vec4",i.aBorderColor),n.bindVertexArray(null),s}},{key:"buffers",get:function(){var t=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(a){return rt(a,"Buffer")}).map(function(a){return t[a]})),this._buffers}},{key:"startFrame",value:function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ea.SCREEN;this.panZoomMatrix=t,this.renderTarget=a,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(t,a){return t.visible()?a&&a.isVisible?a.isVisible(t):!0:!1}},{key:"drawTexture",value:function(t,a,n){var i=this.atlasManager,s=this.batchManager,o=i.getRenderTypeOpts(n);if(this._isVisible(t,o)&&!(t.isEdge()&&!this._isValidEdge(t))){if(this.renderTarget.picking&&o.getTexPickingMode){var u=o.getTexPickingMode(t);if(u===Pn.IGNORE)return;if(u==Pn.USE_BB){this.drawPickingRectangle(t,a,n);return}}var l=i.getAtlasInfo(t,n),v=Cr(l),f;try{for(v.s();!(f=v.n()).done;){var c=f.value,h=c.atlas,d=c.tex1,y=c.tex2;s.canAddToCurrentBatch(h)||this.endBatch();for(var g=s.getAtlasIndexForBatch(h),p=0,m=[[d,!0],[y,!1]];p<m.length;p++){var b=Xe(m[p],2),w=b[0],E=b[1];if(w.w!=0){var C=this.instanceCount;this.vertTypeBuffer.getView(C)[0]=Es;var x=this.indexBuffer.getView(C);Ft(a,x);var T=this.atlasIdBuffer.getView(C);T[0]=g;var k=this.texBuffer.getView(C);k[0]=w.x,k[1]=w.y,k[2]=w.w,k[3]=w.h;var B=this.transformBuffer.getMatrixView(C);this.setTransformMatrix(t,B,o,c,E),this.instanceCount++,E||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(D){v.e(D)}finally{v.f()}}}},{key:"setTransformMatrix",value:function(t,a,n,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=0;if(n.shapeProps&&n.shapeProps.padding&&(o=t.pstyle(n.shapeProps.padding).pfValue),i){var u=i.bb,l=i.tex1,v=i.tex2,f=l.w/(l.w+v.w);s||(f=1-f);var c=this._getAdjustedBB(u,o,s,f);this._applyTransformMatrix(a,c,n,t)}else{var h=n.getBoundingBox(t),d=this._getAdjustedBB(h,o,!0,1);this._applyTransformMatrix(a,d,n,t)}}},{key:"_applyTransformMatrix",value:function(t,a,n,i){var s,o;Wl(t);var u=n.getRotation?n.getRotation(i):0;if(u!==0){var l=n.getRotationPoint(i),v=l.x,f=l.y;pn(t,t,[v,f]),$l(t,t,u);var c=n.getRotationOffset(i);s=c.x+(a.xOffset||0),o=c.y+(a.yOffset||0)}else s=a.x1,o=a.y1;pn(t,t,[s,o]),Hs(t,t,[a.w,a.h])}},{key:"_getAdjustedBB",value:function(t,a,n,i){var s=t.x1,o=t.y1,u=t.w,l=t.h,v=t.yOffset;a&&(s-=a,o-=a,u+=2*a,l+=2*a);var f=0,c=u*i;return n&&i<1?u=c:!n&&i<1&&(f=u-c,s+=f,u=c),{x1:s,y1:o,w:u,h:l,xOffset:f,yOffset:v}}},{key:"drawPickingRectangle",value:function(t,a,n){var i=this.atlasManager.getRenderTypeOpts(n),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=Vt;var o=this.indexBuffer.getView(s);Ft(a,o);var u=this.colorBuffer.getView(s);bt([0,0,0],1,u);var l=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(t,l,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(t,a,n){var i=this.simpleShapeOptions.get(n);if(this._isVisible(t,i)){var s=i.shapeProps,o=this._getVertTypeForShape(t,s.shape);if(o===void 0||i.isSimple&&!i.isSimple(t,this.renderTarget)){this.drawTexture(t,
Line truncated
|
||||
@@ -0,0 +1,4 @@
|
||||
import{_ as m,ao as x,c as k,Q as O,l as p,ap as A,aq as Y,ar as b,as as _,at as z,au as H,av as D,aw as J,ax as T,ay as X,ah as R,af as F,az as q,aA as W}from"./mermaid.core.js";import{l as j}from"./layout.js";import"./index.js";var C=m((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),P=m((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";default:return"top"}},"getDefaultSelfLoopSide"),Q=m(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram"||t==="er"||t==="classDiagram","shouldMergeSelfLoopSegments"),U=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],K=m((t,e,r,d,a)=>{const f=[],h=new Set;if(r.forEach(({start:i,end:o})=>{i!==d&&h.add(i),o!==d&&h.add(o)}),h.forEach(i=>{const o=t.node(i);typeof o?.x=="number"&&typeof o?.y=="number"&&f.push(o)}),f.length===0&&r.forEach(({edge:i})=>{(i.points??[]).forEach(o=>{typeof o?.x=="number"&&typeof o?.y=="number"&&f.push(o)})}),f.length===0)return P(a);const c=f.reduce((i,o)=>({x:i.x+o.x/f.length,y:i.y+o.y/f.length}),{x:0,y:0}),l=c.x-e.x,s=c.y-e.y;return Math.abs(l)>Math.abs(s)?l>0?"right":"left":Math.abs(s)>0?s>0?"bottom":"top":P(a)},"getSelfLoopSide"),V=m((t,e="top",r=0,d=0)=>{const a=t.x,f=t.y-r,h=t.width/2,c=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),s=C(Math.max(d,t.width*.35),36,l),i=C(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const o=f+c;return[{x:a-s/2,y:o},{x:a-s/2,y:o+i},{x:a+s/2,y:o+i},{x:a+s/2,y:o}]}case"right":{const o=a+h;return[{x:o,y:f-s/2},{x:o+i,y:f-s/2},{x:o+i,y:f+s/2},{x:o,y:f+s/2}]}case"left":{const o=a-h;return[{x:o,y:f-s/2},{x:o-i,y:f-s/2},{x:o-i,y:f+s/2},{x:o,y:f+s/2}]}default:{const o=f-c;return[{x:a-s/2,y:o},{x:a-s/2,y:o-i},{x:a+s/2,y:o-i},{x:a+s/2,y:o}]}}},"getSelfLoopPoints"),Z=m((t,e,r="top",d=0,a={})=>{const h=t.x,c=t.y-d,l=a.width??0,s=a.height??0;switch(r){case"bottom":return{x:h,y:Math.max(...e.map(i=>i.y))+s/2+4};case"right":return{x:Math.max(...e.map(i=>i.x))+l/2+4,y:c};case"left":return{x:Math.min(...e.map(i=>i.x))-l/2-4,y:c};default:return{x:h,y:Math.min(...e.map(i=>i.y))-s/2-4}}},"getSelfLoopLabelPosition"),B=m((t,e=0,{mergeSelfLoops:r=!0}={})=>{const d=new Map,a=[],f=t.graph()?.rankdir;return t.edges().forEach(h=>{const c=t.edge(h);if(r&&c.selfLoop){const l=c.selfLoop.id;d.has(l)||d.set(l,[]),d.get(l).push({edge:c,start:h.v,end:h.w})}else a.push({edge:c,start:h.v,end:h.w})}),d.forEach(h=>{if(h.length!==3){h.forEach(u=>a.push(u));return}h.sort((u,E)=>u.edge.selfLoop.order-E.edge.selfLoop.order);const[c,l,s]=h,i=c.edge.originalEdge??l.edge.originalEdge??s.edge.originalEdge??l.edge,o=t.node(i.start);if(!o){h.forEach(u=>a.push(u));return}const n={width:l.edge.width,height:l.edge.height},L=K(t,o,h,i.start,f),w=V(o,L,e,n.width??0),y=Z(o,w,L,e,n),g={...l.edge,...i,id:i.id,points:w,start:i.start,end:i.end,x:y.x,y:y.y,width:n.width,height:n.height,labelStyle:l.edge.labelStyle,fromCluster:c.edge.fromCluster??l.edge.fromCluster??s.edge.fromCluster,toCluster:c.edge.toCluster??l.edge.toCluster??s.edge.toCluster};delete g.selfLoop,delete g.originalEdge,a.push({edge:g,start:g.start,end:g.end})}),a},"getEdgesToRender"),I=m(async({element:t,graph:e,diagramType:r,id:d,parentCluster:a,siteConfig:f})=>{const h=e.graph().rankdir;p.trace("Dir in recursive render - dir:",h);const{clusters:c,edgePaths:l,edgeLabels:s,nodes:i,rootGroups:o}=_(t,{edgePathsClass:"edgePaths"});e.nodes()?p.info("Recursive render XXX",e.nodes()):p.info("No nodes found for",e),e.edges().length>0&&p.info("Recursive edges",e.edge(e.edges()[0]));const n=Q(r);await Promise.all(e.nodes().map(async function(y){const g=e.node(y);if(a!==void 0){const u=JSON.parse(JSON.stringify(a.clusterData));p.trace(`Setting data for parent cluster XXX
|
||||
Node.id = `,y,`
|
||||
data=`,u.height,`
|
||||
Parent cluster`,a.height),e.setNode(a.id,u),e.parent(y)||(p.trace("Setting parent",y,a.id),e.setParent(y,a.id,u))}if(p.info("(Insert) Node XXX"+y+": "+JSON.stringify(e.node(y))),g?.clusterNode){p.info("Cluster identified XBX",y,g.width,e.node(y));const{ranksep:u,nodesep:E}=e.graph();g.graph.setGraph({...g.graph.graph(),ranksep:u+25,nodesep:E});const S=await oe({element:i,graph:g.graph,diagramType:r,id:d,parentCluster:e.node(y),siteConfig:f}),N=S.elem;z(g,N),g.diff=S.diff||0,p.info("New compound node after recursive render XAX",y,"width",g.width,"height",g.height),H(N,g)}else e.children(y).length>0?(p.trace("Cluster - the non recursive path XBX",y,g.id,g,g.width,"Graph:",e),p.trace(D(g.id,e)),b.set(g.id,{id:D(g.id,e),node:g})):(p.trace("Node - the non recursive path XAX",y,i,e.node(y),h),await J(i,e.node(y),{config:f,dir:h}))})),await m(async()=>{const y=e.edges().map(async function(g){const u=e.edge(g.v,g.w,g.name);if(p.info("Edge "+g.v+" -> "+g.w+": "+JSON.stringify(g)),p.info("Edge "+g.v+" -> "+g.w+": ",g," ",JSON.stringify(e.edge(g))),p.info("Fix",b,"ids:",g.v,g.w,"Translating: ",b.get(g.v),b.get(g.w)),n&&u.selfLoop){if(u.selfLoop.order!==1)return;const E={...u.originalEdge,...u,id:u.selfLoop.id,startLabelLeft:u.originalEdge?.startLabelLeft??u.startLabelLeft,startLabelRight:u.originalEdge?.startLabelRight??u.startLabelRight,endLabelLeft:u.originalEdge?.endLabelLeft??u.endLabelLeft,endLabelRight:u.originalEdge?.endLabelRight??u.endLabelRight};await X(s,E),u.width=E.width,u.height=E.height,u.labelStyle=E.labelStyle;return}await X(s,u)});await Promise.all(y)},"processEdges")();const{subGraphTitleTotalMargin:w}=T(f);return{elem:o,graph:e,groups:{clusters:c,edgePaths:l,edgeLabels:s,nodes:i,rootGroups:o},diagramType:r,id:d,mergeSelfLoops:n,subGraphTitleTotalMargin:w}},"measureDagreGraph"),M=m(t=>{p.info("############################################# XXX"),p.info("### Layout ### XXX"),p.info("############################################# XXX"),j(t)},"runDagreGraphLayout"),$=m((t,e,r)=>{const d=t.node(e);if(!d)return;const a={...d};return d?.clusterNode?a.y=(d.y??0)+r:t.children(e).length>0?a.height=(d.height??0)+r:a.y=(d.y??0)+r/2,a},"normalizeDagreNode"),v=m((t,e)=>{U.forEach(r=>{e[r]!==void 0&&(t[r]=e[r])})},"applyDagreNodeLayout"),ee=m((t,e,r,d)=>({...t,start:t.start??e,end:t.end??r,points:(t.points??[]).map(a=>({...a,y:typeof a.y=="number"?a.y+d:a.y}))}),"normalizeDagreEdge"),te=m((t,e)=>{const{graph:r,mergeSelfLoops:d,subGraphTitleTotalMargin:a=0}=e,f=new Map(t.nodes.map(c=>[c.id,c]));x(r).forEach(c=>{const l=$(r,c,a);if(!l)return;v(r.node(c),l);const s=f.get(c);s&&v(s,l)});const h=a/2;return t.edges=B(r,h,{mergeSelfLoops:d}).map(({edge:c,start:l,end:s})=>ee(c,l,s,h)),t},"applyDagreLayoutResult"),re=m(async({elem:t,graph:e,groups:{clusters:r,edgePaths:d},diagramType:a,id:f,mergeSelfLoops:h,subGraphTitleTotalMargin:c})=>{let l=0;await Promise.all(x(e).map(async function(o){const n=e.node(o);if(p.info("Position XBX => "+o+": ("+n.x,","+n.y,") width: ",n.width," height: ",n.height),n?.clusterNode)n.y+=c,p.info("A tainted cluster node XBX1",o,n.id,n.width,n.height,n.x,n.y,e.parent(o)),b.get(n.id).node=n,R(n);else if(e.children(o).length>0){p.info("A pure cluster node XBX1",o,n.id,n.x,n.y,n.width,n.height,e.parent(o)),n.height+=c,e.node(n.parentId);const L=n?.padding/2||0,w=n?.labelBBox?.height||0,y=w-L||0;p.debug("OffsetY",y,"labelHeight",w,"halfPadding",L),await F(r,n),b.get(n.id).node=n}else{const L=e.node(n.parentId);n.y+=c/2,p.info("A regular node XBX1 - using the padding",n.id,"parent",n.parentId,n.width,n.height,n.x,n.y,"offsetY",n.offsetY,"parent",L,L?.offsetY,n),R(n)}}));const s=c/2;return B(e,s,{mergeSelfLoops:h}).forEach(function({edge:o,start:n,end:L}){p.info("Edge "+n+" -> "+L+": "+JSON.stringify(o),o),o.points.forEach(u=>u.y+=s);const w=e.node(n),y=e.node(L),g=q(d,o,b,a,w,y,f);W(o,g)}),e.nodes().forEach(function(o){const n=e.node(o);p.info(o,n.type,n.diff),n.isGroup&&(l=n.diff)}),p.warn("Returning from recursive render XAX",t,l),{elem:t,diff:l}},"paintDagreLayoutCore"),oe=m(async t=>{const e=await I(t);return M(e.graph),await re(e)},"renderDagreSubgraph"),G=m(t=>{const e=new O({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:t.config?.nodeSpacing||t.nodeSpacing||t.config?.flowchart?.nodeSpacing,ranksep:t.config?.rankSpacing||t.rankSpacing||t.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return t.nodes.forEach(r=>{e.setNode(r.id,{...r}),r.parentId&&e.setParent(r.id,r.parentId)}),p.debug("Edges:",t.edges),t.edges.forEach(r=>{if(r.start===r.end){const d=r.start,a=d+"---"+d+"---1",f=d+"---"+d+"---2",h=e.node(d);e.setNode(a,{domId:a,id:a,parentId:h.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),e.setParent(a,h.parentId),e.setNode(f,{domId:f,id:f,parentId:h.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),e.setParent(f,h.pa
Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
function J(n){return Math.abs(n=Math.round(n))>=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function j(n,t){if(!isFinite(n)||n===0)return null;var e=(n=t?n.toExponential(t-1):n.toExponential()).indexOf("e"),i=n.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+n.slice(e+1)]}function K(n){return n=j(Math.abs(n)),n?n[1]:NaN}function Q(n,t){return function(e,i){for(var o=e.length,a=[],c=0,h=n[0],M=0;o>0&&h>0&&(M+h+1>i&&(h=Math.max(1,i-M)),a.push(e.substring(o-=h,o+h)),!((M+=h+1)>i));)h=n[c=(c+1)%n.length];return a.reverse().join(t)}}function V(n){return function(t){return t.replace(/[0-9]/g,function(e){return n[+e]})}}var W=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $(n){if(!(t=W.exec(n)))throw new Error("invalid format: "+n);var t;return new L({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}$.prototype=L.prototype;function L(n){this.fill=n.fill===void 0?" ":n.fill+"",this.align=n.align===void 0?">":n.align+"",this.sign=n.sign===void 0?"-":n.sign+"",this.symbol=n.symbol===void 0?"":n.symbol+"",this.zero=!!n.zero,this.width=n.width===void 0?void 0:+n.width,this.comma=!!n.comma,this.precision=n.precision===void 0?void 0:+n.precision,this.trim=!!n.trim,this.type=n.type===void 0?"":n.type+""}L.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 _(n){n:for(var t=n.length,e=1,i=-1,o;e<t;++e)switch(n[e]){case".":i=o=e;break;case"0":i===0&&(i=e),o=e;break;default:if(!+n[e])break n;i>0&&(i=0);break}return i>0?n.slice(0,i)+n.slice(o+1):n}var N;function v(n,t){var e=j(n,t);if(!e)return N=void 0,n.toPrecision(t);var i=e[0],o=e[1],a=o-(N=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,c=i.length;return a===c?i:a>c?i+new Array(a-c+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+j(n,Math.max(0,t+a-1))[0]}function X(n,t){var e=j(n,t);if(!e)return n+"";var i=e[0],o=e[1];return o<0?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}const O={"%":(n,t)=>(n*100).toFixed(t),b:n=>Math.round(n).toString(2),c:n=>n+"",d:J,e:(n,t)=>n.toExponential(t),f:(n,t)=>n.toFixed(t),g:(n,t)=>n.toPrecision(t),o:n=>Math.round(n).toString(8),p:(n,t)=>X(n*100,t),r:X,s:v,X:n=>Math.round(n).toString(16).toUpperCase(),x:n=>Math.round(n).toString(16)};function R(n){return n}var U=Array.prototype.map,Y=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function nn(n){var t=n.grouping===void 0||n.thousands===void 0?R:Q(U.call(n.grouping,Number),n.thousands+""),e=n.currency===void 0?"":n.currency[0]+"",i=n.currency===void 0?"":n.currency[1]+"",o=n.decimal===void 0?".":n.decimal+"",a=n.numerals===void 0?R:V(U.call(n.numerals,String)),c=n.percent===void 0?"%":n.percent+"",h=n.minus===void 0?"−":n.minus+"",M=n.nan===void 0?"NaN":n.nan+"";function T(f,g){f=$(f);var b=f.fill,p=f.align,m=f.sign,w=f.symbol,S=f.zero,E=f.width,F=f.comma,y=f.precision,C=f.trim,d=f.type;d==="n"?(F=!0,d="g"):O[d]||(y===void 0&&(y=12),C=!0,d="g"),(S||b==="0"&&p==="=")&&(S=!0,b="0",p="=");var q=(g&&g.prefix!==void 0?g.prefix:"")+(w==="$"?e:w==="#"&&/[boxX]/.test(d)?"0"+d.toLowerCase():""),B=(w==="$"?i:/[%p]/.test(d)?c:"")+(g&&g.suffix!==void 0?g.suffix:""),D=O[d],H=/[defgprs%]/.test(d);y=y===void 0?6:/[gprs]/.test(d)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function G(r){var l=q,u=B,x,I,k;if(d==="c")u=D(r)+u,r="";else{r=+r;var P=r<0||1/r<0;if(r=isNaN(r)?M:D(Math.abs(r),y),C&&(r=_(r)),P&&+r==0&&m!=="+"&&(P=!1),l=(P?m==="("?m:h:m==="-"||m==="("?"":m)+l,u=(d==="s"&&!isNaN(r)&&N!==void 0?Y[8+N/3]:"")+u+(P&&m==="("?")":""),H){for(x=-1,I=r.length;++x<I;)if(k=r.charCodeAt(x),48>k||k>57){u=(k===46?o+r.slice(x+1):r.slice(x))+u,r=r.slice(0,x);break}}}F&&!S&&(r=t(r,1/0));var z=l.length+r.length+u.length,s=z<E?new Array(E-z+1).join(b):"";switch(F&&S&&(r=t(s+r,s.length?E-u.length:1/0),s=""),p){case"<":r=l+r+u+s;break;case"=":r=l+s+r+u;break;case"^":r=s.slice(0,z=s.length>>1)+l+r+u+s.slice(z);break;default:r=s+l+r+u;break}return a(r)}return G.toString=function(){return f+""},G}function Z(f,g){var b=Math.max(-8,Math.min(8,Math.floor(K(g)/3)))*3,p=Math.pow(10,-b),m=T((f=$(f),f.type="f",f),{suffix:Y[8+b/3]});return function(w){return m(p*w)}}return{format:T,formatPrefix:Z}}var A,tn,rn;en({thousands:",",grouping:[3],currency:["$",""]});function en(n){return A=nn(n),tn=A.format,rn=A.formatPrefix,A}export{rn as a,tn as b,K as e,$ as f};
|
||||
@@ -0,0 +1,30 @@
|
||||
import{I as X}from"./chunk-2Q5K7J3B.js";import{p as z}from"./chunk-JWPE2WC7.js";import{n as O,b as G,s as Y,o as P,g as F,a as Z,_ as g,A as N,l as A,D as q,d as U,y as E,p as j,i as J,ak as K,B as Q,al as ee}from"./mermaid.core.js";import{p as te}from"./cynefin-OW5HDTMX.js";import"./index.js";var D=/[─━│┃└┗├┣]/,L=/[└┗├┣]/,ne=/[─━]/,k=/^[\s│┃]+$/,T=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,V=/^\s*%%/,re=" ";function _(n){return n.some(t=>D.test(t))}g(_,"isBoxDrawingFormat");function M(n){for(const t of n){const e=L.exec(t);if(e?.index&&e.index>0)return e.index}return 4}g(M,"inferSegmentWidth");function S(n,t){return n.replace(/\bline\s+(\d+)\b/gi,(e,r)=>{const s=parseInt(r,10),i=t.get(s);return i?`line ${i}`:e})}g(S,"remapErrorLines");function R(n){const t=n.split(`
|
||||
`),e=new Map;let r=-1;for(const[p,c]of t.entries())if(c.trim()==="treeView-beta"){r=p;break}if(r===-1)return{text:n,lineMap:e};const s=[];for(let p=r+1;p<t.length;p++){const c=t[p];c.trim()===""||V.test(c)||T.test(c)||k.test(c)||s.push(c.replace(/\t/g," "))}if(!_(s))return{text:n,lineMap:e};const i=M(s),o=[];let a=0;for(let p=0;p<=r;p++)o.push(t[p]),a++,e.set(a,p+1);for(let p=r+1;p<t.length;p++){const c=t[p],d=c.trim(),h=p+1;if(d===""){o.push(c),a++,e.set(a,h);continue}if(V.test(c)){o.push(c),a++,e.set(a,h);continue}if(T.test(c)){o.push(c),a++,e.set(a,h);continue}if(k.test(c))continue;const l=c.replace(/\t/g," "),w=L.exec(l);if(w?.index!==void 0){const f=w.index,m=Math.round(f/i)+1;let u=f+1;for(;u<l.length&&ne.test(l[u]);)u++;for(;u<l.length&&l[u]===" ";)u++;const v=l.slice(u).trimEnd();if(!v)throw new Error(`Line ${h}: Empty node — expected a filename or directory name after the box-drawing prefix`);const W=re.repeat(m);o.push(W+v),a++,e.set(a,h)}else{if(/^[\s─━│┃└┗├┣]+$/.test(l))continue;if(D.test(l))o.push(c),a++,e.set(a,h);else{if(/^\s+/.test(l))throw new Error(`Line ${h}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);o.push(c),a++,e.set(a,h)}}}return{text:o.join(`
|
||||
`),lineMap:e}}g(R,"preprocessBoxDrawing");var x=new X(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),ie=g(()=>{x.reset(),j()},"clear"),oe=g(()=>x.records.stack[0],"getRoot"),se=g(()=>x.records.cnt,"getCount"),ae=Q.treeView,ce=g(()=>N(ae,E().treeView),"getConfig"),le=g((n,t,e,r,s,i)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const o={id:x.records.cnt++,level:n,name:t,nodeType:e,icon:s,cssClass:r,description:i,children:[]};x.records.stack[x.records.stack.length-1].children.push(o),x.records.stack.push(o)},"addNode"),de={clear:ie,addNode:le,getRoot:oe,getCount:se,getConfig:ce,getAccTitle:Z,getAccDescription:F,getDiagramTitle:P,setAccDescription:Y,setAccTitle:G,setDiagramTitle:O},I=de,he=g(n=>{z(n,I);for(const t of n.nodes){const e=typeof t.indent=="number"?t.indent:0;let r=t.name;const s=r.endsWith("/");s&&(r=r.slice(0,-1));const i=s?"directory":"file",o=t.classAnnotation||void 0,a=t.iconAnnotation,p=a!==void 0?a||"none":void 0,c=t.descAnnotation||void 0,d=c?J(c,E()):void 0;I.addNode(e,r,i,o,p,d)}},"populate"),pe={parse:g(async n=>{const{text:t,lineMap:e}=R(n);try{const r=await te("treeView",t);A.debug(r),he(r)}catch(r){throw e.size>0&&r instanceof Error&&(r.message=S(r.message,e)),r}},"parse")},b={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 H(n,t){const e=t?.filenameIcons?.[n];if(e)return e;const r=n.lastIndexOf(".");if(r>0){const s=n.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[s]??i?.[s.slice(1)]}}g(H,"detectIcon");function C(n,t){return n.includes(":")?n:n in b.icons||!t?`${b.prefix}:${n}`:`${t}:${n}`}g(C,"qualifyIcon");function B(n,t){if(n.icon!=="none"){if(n.icon)return C(n.icon,t.defaultIconPack);if(t.showIcons){if(n.nodeType==="file"){const e=H(n.name,t);if(e==="none")return;if(e)return C(e,t.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}g(B,"getNodeIcon");ee([{name:b.prefix,icons:b}]);var y=14,ge=4,fe=16,ue=g(async(n,t)=>{const e=[],r=g(i=>{const o=B(i,t);o&&e.push({icon:o,node:i}),i.children.forEach(r)},"collect");r(n);const s=await Promise.all(e.map(async({icon:i,node:o})=>({id:o.id,svg:await K(i,{height:y,width:y})})));return new Map(s.map(({id:i,svg:o})=>[i,o]))},"resolveNodeIcons"),we=g((n,t,e,r,s,i)=>{const o=r.append("g");let a="treeView-node-label";e.nodeType==="directory"&&(a+=" treeView-node-dir"),e.cssClass&&(a+=` ${e.cssClass}`);const p=y+ge,c=B(e,s),d=c!==void 0;c&&o.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${n+s.paddingX}, ${t+s.paddingY})`).html(i.get(e.id)??"");const h=o.append("text").text(e.name).attr("dominant-baseline","middle").attr("class",a),{height:l,width:w}=h.node().getBBox(),f=l+s.paddingY*2,m=n+s.paddingX+(d?p:0);h.attr("x",m),h.attr("y",t+f/2);const u=m+w,v=w+s.paddingX*2+(d?p:0);return e.BBox={x:n,y:t,width:v,height:f},e.cssClass?.split(/\s+/).includes("highlight")&&o.insert("rect",":first-child").attr("x",n).attr("y",t+1).attr("width",0).attr("height",f-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:e,nodeGroup:o,labelRightEdge:u,centerY:t+f/2}},"positionLabel"),$=g((n,t,e,r,s,i)=>n.append("line").attr("x1",t).attr("y1",e).attr("x2",r).attr("y2",s).attr("stroke-width",i).attr("class","treeView-node-line"),"positionLine"),me=g((n,t,e,r)=>{let s=0,i=0;const o=[],a=g((d,h,l,w)=>{const f=w*(l.rowIndent+l.paddingX),m=we(f,s,h,d,l,r);o.push(m);const{height:u,width:v}=h.BBox;$(d,f-l.rowIndent,s+u/2,f,s+u/2,l.lineThickness),i=Math.max(i,f+v),s+=u},"drawNode"),p=g((d,h=0)=>{a(n,d,e,h),d.children.forEach(m=>{p(m,h+1)});const{x:l,y:w,height:f}=d.BBox;if(d.children.length){const{y:m,height:u}=d.children[d.children.length-1].BBox;$(n,l+e.paddingX,w+f,l+e.paddingX,m+u/2+e.lineThickness/2,e.lineThickness)}},"processNode");p(t);const c=o.filter(d=>d.node.description);if(c.length>0){const h=Math.max(...o.map(l=>l.labelRightEdge))+fe;for(const l of c){const f=l.nodeGroup.append("text").text(l.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",h).attr("y",l.centerY).node().getBBox();i=Math.max(i,h+f.width+e.paddingX)}}for(const d of o)if(d.node.cssClass?.split(/\s+/).includes("highlight")){const h=d.nodeGroup.select(".treeView-highlight-bg");if(!h.empty()){const l=i-d.node.BBox.x+8;h.attr("width",l),i=Math.max(i,d.node.BBox.x+l+2)}}return{totalHeight:s,totalWidth:i}},"drawTree"),xe=g(async(n,t,e,r)=>{A.debug(`Rendering treeView diagram
|
||||
`+n);const s=r.db,i=s.getRoot(),o=s.getConfig(),a=q(t),p=a.append("g");p.attr("class","tree-view");const c=await ue(i,o),{totalHeight:d,totalWidth:h}=me(p,i,o,c);a.attr("viewBox",`-${o.lineThickness/2} 0 ${h} ${d}`),U(a,d,h,o.useMaxWidth)},"draw"),ve={draw:xe},be=ve,Ie={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Ce=g(({treeView:n})=>{const{labelFontSize:t,labelColor:e,lineColor:r,iconColor:s,descriptionColor:i,highlightBg:o,highlightStroke:a}=N(Ie,n);return`
|
||||
.treeView-node-label {
|
||||
font-size: ${t};
|
||||
fill: ${e};
|
||||
white-space: pre;
|
||||
}
|
||||
.treeView-node-dir {
|
||||
font-weight: bold;
|
||||
}
|
||||
.treeView-node-line {
|
||||
stroke: ${r};
|
||||
}
|
||||
.treeView-node-icon {
|
||||
color: ${s};
|
||||
}
|
||||
.treeView-node-description {
|
||||
font-size: ${t};
|
||||
fill: ${i};
|
||||
font-style: italic;
|
||||
white-space: pre;
|
||||
}
|
||||
.treeView-highlight-bg {
|
||||
fill: ${o};
|
||||
stroke: ${a};
|
||||
stroke-width: 1;
|
||||
}
|
||||
`},"styles"),ye=Ce,Ne={db:I,renderer:be,parser:pe,styles:ye};export{Ne as diagram};
|
||||
@@ -0,0 +1,41 @@
|
||||
import{p as I}from"./chunk-JWPE2WC7.js";import{s as _,g as E,o as D,n as F,a as P,b as z,_ as c,D as G,p as B,A as w,y as C,B as W,l as b,E as V,d as H}from"./mermaid.core.js";import{p as j}from"./cynefin-OW5HDTMX.js";import"./index.js";var x={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},y=32,A={axes:[],curves:[],options:x},m=structuredClone(A),U=W.radar,X=c(()=>w({...U,...C().radar}),"getConfig"),M=c(()=>m.axes,"getAxes"),K=c(()=>m.curves,"getCurves"),N=c(()=>m.options,"getOptions"),Y=c(a=>{m.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=c(a=>{m.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});m.options={showLegend:t.showLegend?.value??x.showLegend,ticks:t.ticks?.value??x.ticks,max:t.max?.value??x.max,min:t.min?.value??x.min,graticule:t.graticule?.value??x.graticule},m.options.ticks>y&&(b.warn(`Radar diagram ticks (${m.options.ticks}) exceeds maximum allowed (${y}). Using ${y} instead.`),m.options.ticks=y)},"setOptions"),Q=c(()=>{B(),m=structuredClone(A)},"clear"),$={getAxes:M,getCurves:K,getOptions:N,setAxes:Y,setCurves:Z,setOptions:J,getConfig:X,clear:Q,setAccTitle:z,getAccTitle:P,setDiagramTitle:F,getDiagramTitle:D,getAccDescription:E,setAccDescription:_},tt=c(a=>{I(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),et={parse:c(async a=>{const t=await j("radar",a);b.debug(t),tt(t)},"parse")},at=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=G(t),u=rt(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;st(u,i,v,n.ticks,n.graticule),nt(u,i,v,o),L(u,i,l,h,g,n.graticule,o),k(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),rt=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return H(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),st=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i<r;i++){const l=e*(i+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(s==="polygon"){const i=t.length;for(let l=0;l<r;l++){const n=e*(l+1)/r,o=t.map((d,p)=>{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),nt=c((a,t,e,r)=>{const s=t.length;for(let i=0;i<s;i++){const l=t[i].label,n=2*i*Math.PI/s-Math.PI/2,o=Math.cos(n),d=Math.sin(n);a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*o).attr("y2",e*r.axisScaleFactor*d).attr("class","radarAxisLine");const p=o>.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function L(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=T(g,r,s,o),O=f*Math.cos(v),R=f*Math.sin(v);return{x:O,y:R}});i==="circle"?a.append("path").attr("d",S(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(L,"drawCurves");function T(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(T,"relativeRadius");function S(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s<e;s++){const i=a[(s-1+e)%e],l=a[s],n=a[(s+1)%e],o=a[(s+2)%e],d={x:l.x+(n.x-i.x)*t,y:l.y+(n.y-i.y)*t},p={x:n.x-(o.x-l.x)*t,y:n.y-(o.y-l.y)*t};r+=` C${d.x},${d.y} ${p.x},${p.y} ${n.x},${n.y}`}return`${r} Z`}c(S,"closedRoundCurve");function k(a,t,e,r){if(!e)return;const s=(r.width/2+r.marginRight)*3/4,i=-(r.height/2+r.marginTop)*3/4,l=20;t.forEach((n,o)=>{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(k,"drawLegend");var ot={draw:at},it=c((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const s=a[`cScale${r}`];e+=`
|
||||
.radarCurve-${r} {
|
||||
color: ${s};
|
||||
fill: ${s};
|
||||
fill-opacity: ${t.curveOpacity};
|
||||
stroke: ${s};
|
||||
stroke-width: ${t.curveStrokeWidth};
|
||||
}
|
||||
.radarLegendBox-${r} {
|
||||
fill: ${s};
|
||||
fill-opacity: ${t.curveOpacity};
|
||||
stroke: ${s};
|
||||
}
|
||||
`}return e},"genIndexStyles"),lt=c(a=>{const t=V(),e=C(),r=w(t,e.themeVariables),s=w(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),ct=c(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=lt(a);return`
|
||||
.radarTitle {
|
||||
font-size: ${t.fontSize};
|
||||
color: ${t.titleColor};
|
||||
dominant-baseline: hanging;
|
||||
text-anchor: middle;
|
||||
}
|
||||
.radarAxisLine {
|
||||
stroke: ${e.axisColor};
|
||||
stroke-width: ${e.axisStrokeWidth};
|
||||
}
|
||||
.radarAxisLabel {
|
||||
font-size: ${e.axisLabelFontSize}px;
|
||||
color: ${e.axisColor};
|
||||
}
|
||||
.radarGraticule {
|
||||
fill: ${e.graticuleColor};
|
||||
fill-opacity: ${e.graticuleOpacity};
|
||||
stroke: ${e.graticuleColor};
|
||||
stroke-width: ${e.graticuleStrokeWidth};
|
||||
}
|
||||
.radarLegendText {
|
||||
text-anchor: start;
|
||||
font-size: ${e.legendFontSize}px;
|
||||
dominant-baseline: hanging;
|
||||
}
|
||||
${it(t,e)}
|
||||
`},"styles"),mt={parser:et,db:$,renderer:ot,styles:ct};export{mt as diagram};
|
||||
@@ -0,0 +1,3 @@
|
||||
import{p as re}from"./chunk-JWPE2WC7.js";import{o as oe,n as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as T,j as ue,z as xe,p as fe,A as ge,y as M,B as he,i as y,w as P,am as pe}from"./mermaid.core.js";import{p as be,i as ve}from"./cynefin-OW5HDTMX.js";import"./index.js";var $="position frame",D="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:$,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={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 E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&a<t}).map(i=>Number.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"};let c=`<b>${P(a,t.textMaxWidth,d)}</b>`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{
|
||||
`)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," "),r+="<br/>")}const m=r!==void 0;m&&(c+=`<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${r}</code>`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(G,"calculateTextProps");function V(e,n){const t=n,i=L(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:D,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(V,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function j(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(j,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function Y(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,d,r),m=c+l.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p<f.length;p++){const w=f[p],R=f[p-1];w.y=R.y+R.height+s.swimlaneGap}return h}o(Y,"evolveFramePositioned");function z(e,n){return e===0&&n.sourceFrames.length===0}o(z,"isFirstFrame");function K(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}o(K,"hasSourceFrame");function k(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(k,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function J(e,n){const t=n;if(ve(t.frame)||z(t.index,t.frame))return[];const i=k(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=k(e.boxes,t.sourceFrame):a=q(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:N,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(J,"decidePositionRelation");function Q(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Q,"evolveRelationPositioned");var Me={[$]:V,[S]:J},Be={[D]:Y,[N]:Q};function Z(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Z,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Z(e,n);return ee(e,t)}o(v,"dispatch");var F={getConfig:ke,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:le,setAccDescription:de,setDiagramTitle:se,getDiagramTitle:oe,setAst:I,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),F.setAst(n),re(n,F)},"parse")},Ae=T(),Re=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.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(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimeLine truncated
|
||||
`,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=T(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.append("defs").append("marker").attr("id",x).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",u),xe(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),$e={draw:Te},De=o(e=>"","getStyles"),Ne=De,He={parser:Ee,db:F,renderer:$e,styles:Ne};export{He as diagram};
|
||||
@@ -0,0 +1,24 @@
|
||||
import{p as ge}from"./chunk-JWPE2WC7.js";import{_ as w,E as ye,y as ae,A as ee,D as Se,d as ve,l as te,bd as B,j as U,b as xe,a as be,n as we,o as Ce,g as Te,s as Le,B as $e,be as Ae,p as Fe}from"./mermaid.core.js";import{s as Ne}from"./chunk-POPQ4Y6H.js";import{p as Me}from"./cynefin-OW5HDTMX.js";import{b as O}from"./defaultLocale.js";import{o as Q}from"./ordinal.js";import"./index.js";import"./init.js";function _e(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function ke(){return this.eachAfter(_e)}function ze(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function Ve(t,a){for(var l=this,n=[l],r,i,h=-1;l=n.pop();)if(t.call(a,l,++h,this),r=l.children)for(i=r.length-1;i>=0;--i)n.push(r[i]);return this}function De(t,a){for(var l=this,n=[l],r=[],i,h,d,g=-1;l=n.pop();)if(r.push(l),i=l.children)for(h=0,d=i.length;h<d;++h)n.push(i[h]);for(;l=r.pop();)t.call(a,l,++g,this);return this}function Pe(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function Be(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,r=n&&n.length;--r>=0;)l+=n[r].value;a.value=l})}function Ee(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function Re(t){for(var a=this,l=We(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var r=n.length;t!==l;)n.splice(r,0,t),t=t.parent;return n}function We(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),r=null;for(t=l.pop(),a=n.pop();t===a;)r=t,t=l.pop(),a=n.pop();return r}function He(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Ie(){return Array.from(this)}function Oe(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function Ge(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*qe(){var t=this,a,l=[t],n,r,i;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(r=0,i=n.length;r<i;++r)l.push(n[r]);while(l.length)}function ne(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Ye)):a===void 0&&(a=je);for(var l=new Z(t),n,r=[l],i,h,d,g;n=r.pop();)if((h=a(n.data))&&(g=(h=Array.from(h)).length))for(n.children=h,d=g-1;d>=0;--d)r.push(i=h[d]=new Z(h[d])),i.parent=n,i.depth=n.depth+1;return l.eachBefore(Ze)}function Xe(){return ne(this).eachBefore(Ue)}function je(t){return t.children}function Ye(t){return Array.isArray(t)?t[1]:null}function Ue(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ze(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function Z(t){this.data=t,this.depth=this.height=0,this.parent=null}Z.prototype=ne.prototype={constructor:Z,count:ke,each:ze,eachAfter:De,eachBefore:Ve,find:Pe,sum:Be,sort:Ee,path:Re,ancestors:He,descendants:Ie,leaves:Oe,links:Ge,copy:Xe,[Symbol.iterator]:qe};function Je(t){if(typeof t!="function")throw new Error;return t}function G(){return 0}function q(t){return function(){return t}}function Ke(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 Qe(t,a,l,n,r){for(var i=t.children,h,d=-1,g=i.length,c=t.value&&(n-a)/t.value;++d<g;)h=i[d],h.y0=l,h.y1=r,h.x0=a,h.x1=a+=h.value*c}function et(t,a,l,n,r){for(var i=t.children,h,d=-1,g=i.length,c=t.value&&(r-l)/t.value;++d<g;)h=i[d],h.x0=a,h.x1=n,h.y0=l,h.y1=l+=h.value*c}var tt=(1+Math.sqrt(5))/2;function at(t,a,l,n,r,i){for(var h=[],d=a.children,g,c,p=0,b=0,s=d.length,x,S,v=a.value,u,y,N,$,V,W,M;p<s;){x=r-l,S=i-n;do u=d[b++].value;while(!u&&b<s);for(y=N=u,W=Math.max(S/x,x/S)/(v*t),M=u*u*W,V=Math.max(N/M,M/y);b<s;++b){if(u+=c=d[b].value,c<y&&(y=c),c>N&&(N=c),M=u*u*W,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x<S,children:d.slice(p,b)}),g.dice?Qe(g,l,n,r,v?n+=S*u/v:i):et(g,l,n,v?l+=x*u/v:r,i),v-=u,p=b}return h}const nt=(function t(a){function l(n,r,i,h,d){at(a,n,r,i,h,d)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(tt);function lt(){var t=nt,a=!1,l=1,n=1,r=[0],i=G,h=G,d=G,g=G,c=G;function p(s){return s.x0=s.y0=0,s.x1=l,s.y1=n,s.eachBefore(b),r=[0],a&&s.eachBefore(Ke),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,u=s.x1-x,y=s.y1-x;u<S&&(S=u=(S+u)/2),y<v&&(v=y=(v+y)/2),s.x0=S,s.y0=v,s.x1=u,s.y1=y,s.children&&(x=r[s.depth+1]=i(s)/2,S+=c(s)-x,v+=h(s)-x,u-=d(s)-x,y-=g(s)-x,u<S&&(S=u=(S+u)/2),y<v&&(v=y=(v+y)/2),t(s,S,v,u,y))}return p.round=function(s){return arguments.length?(a=!!s,p):a},p.size=function(s){return arguments.length?(l=+s[0],n=+s[1],p):[l,n]},p.tile=function(s){return arguments.length?(t=Je(s),p):t},p.padding=function(s){return arguments.length?p.paddingInner(s).paddingOuter(s):p.paddingInner()},p.paddingInner=function(s){return arguments.length?(i=typeof s=="function"?s:q(+s),p):i},p.paddingOuter=function(s){return arguments.length?p.paddingTop(s).paddingRight(s).paddingBottom(s).paddingLeft(s):p.paddingTop()},p.paddingTop=function(s){return arguments.length?(h=typeof s=="function"?s:q(+s),p):h},p.paddingRight=function(s){return arguments.length?(d=typeof s=="function"?s:q(+s),p)Line truncated
|
||||
.treemapNode.section {
|
||||
stroke: ${r.sectionStrokeColor};
|
||||
stroke-width: ${r.sectionStrokeWidth};
|
||||
fill: ${r.sectionFillColor};
|
||||
}
|
||||
.treemapNode.leaf {
|
||||
stroke: ${r.leafStrokeColor};
|
||||
stroke-width: ${r.leafStrokeWidth};
|
||||
fill: ${r.leafFillColor};
|
||||
}
|
||||
.treemapLabel {
|
||||
fill: ${h};
|
||||
font-size: ${r.labelFontSize};
|
||||
}
|
||||
.treemapValue {
|
||||
fill: ${d};
|
||||
font-size: ${r.valueFontSize};
|
||||
}
|
||||
.treemapTitle {
|
||||
fill: ${i};
|
||||
font-size: ${r.titleFontSize};
|
||||
}
|
||||
`},"getStyles"),ut=pt,Ct={parser:he,get db(){return new oe},renderer:ht,styles:ut};export{Ct as diagram};
|
||||
@@ -0,0 +1,24 @@
|
||||
import{p as $}from"./chunk-JWPE2WC7.js";import{_ as b,A as m,D as C,d as S,l as w,b as D,a as T,n as P,o as z,g as A,s as E,y as F,B as W,p as _}from"./mermaid.core.js";import{p as N}from"./cynefin-OW5HDTMX.js";import"./index.js";var L=W.packet,u,v=(u=class{constructor(){this.packet=[],this.setAccTitle=D,this.getAccTitle=T,this.setDiagramTitle=P,this.getDiagramTitle=z,this.getAccDescription=A,this.setAccDescription=E}getConfig(){const t=m({...L,...F().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){_(),this.packet=[]}},b(u,"PacketDB"),u),M=1e4,Y=b((e,t)=>{$(e,t);let r=-1,s=[],n=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:i,bits:d,label:c}of e.blocks){if(a!==void 0&&i!==void 0&&i<a)throw new Error(`Packet block ${a} - ${i} is invalid. End must be greater than start.`);if(a??=r+1,a!==r+1)throw new Error(`Packet block ${a} - ${i??a} is not contiguous. It should start from ${r+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(i??=a+(d??1)-1,d??=i-a+1,r=i,w.debug(`Packet block ${a} - ${r} with label ${c}`);s.length<=l+1&&t.getPacket().length<M;){const[p,o]=I({start:a,end:i,bits:d,label:c},n,l);if(s.push(p),p.end+1===n*l&&(t.pushWord(s),s=[],n++),!o)break;({start:a,end:i,bits:d,label:c}=o)}}t.pushWord(s)},"populate"),I=b((e,t,r)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*r)return[e,void 0];const s=t*r-1,n=t*r;return[{start:e.start,end:s,label:e.label,bits:s-e.start},{start:n,end:e.end,label:e.label,bits:e.end-n}]},"getNextFittingBlock"),x={parser:{yy:void 0},parse:b(async e=>{const t=await N("packet",e),r=x.parser?.yy;if(!(r instanceof v))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.");w.debug(t),Y(t,r)},"parse")},O=b((e,t,r,s)=>{const n=s.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),o=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(o?0:a),k=d*c+2,f=C(t);f.attr("viewBox",`0 0 ${k} ${g}`),S(f,g,k,l.useMaxWidth);for(const[y,B]of p.entries())j(f,B,y,l);f.append("text").text(o).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),j=b((e,t,r,{rowHeight:s,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=e.append("g"),p=r*(s+l)+l;for(const o of t){const h=o.start%i*a+1,g=(o.end-o.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(o.label),!d)continue;const k=o.end===o.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(o.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(o.end)}},"drawWord"),G={draw:O},H={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},K=b(({packet:e}={})=>{const t=m(H,e);return`
|
||||
.packetByte {
|
||||
font-size: ${t.byteFontSize};
|
||||
}
|
||||
.packetByte.start {
|
||||
fill: ${t.startByteColor};
|
||||
}
|
||||
.packetByte.end {
|
||||
fill: ${t.endByteColor};
|
||||
}
|
||||
.packetLabel {
|
||||
fill: ${t.labelColor};
|
||||
font-size: ${t.labelFontSize};
|
||||
}
|
||||
.packetTitle {
|
||||
fill: ${t.titleColor};
|
||||
font-size: ${t.titleFontSize};
|
||||
}
|
||||
.packetBlock {
|
||||
stroke: ${t.blockStrokeColor};
|
||||
stroke-width: ${t.blockStrokeWidth};
|
||||
fill: ${t.blockFillColor};
|
||||
}
|
||||
`},"styles"),J={parser:x,get db(){return new v},renderer:G,styles:K};export{J as diagram};
|
||||
@@ -0,0 +1 @@
|
||||
import{g as l,r as m,d as n}from"./chunk-SVP7TREG.js";import{p}from"./chunk-JWPE2WC7.js";import{_ as t,l as o}from"./mermaid.core.js";import{M as u,a as f}from"./cynefin-OW5HDTMX.js";import"./index.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},R={parser:g,db:n,renderer:m,styles:l};export{R as diagram};
|
||||
@@ -0,0 +1,99 @@
|
||||
import{g as Ut}from"./chunk-XXDRQBXY.js";import{s as Kt}from"./chunk-POPQ4Y6H.js";import{_ as f,b as Zt,a as jt,s as qt,g as Wt,n as Ht,o as Qt,c as tt,l as F,k as Xt,p as Jt,q as $t,r as te,t as ee,u as se,v as ie,j as re,x as ne}from"./mermaid.core.js";import{c as ae}from"./channel.js";import"./index.js";var Ot=(function(){var s=f(function(G,a,l,d){for(l=l||{},d=G.length;d--;l[G[d]]=a);return l},"o"),n=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],o=[2,2],c=[1,7],r=[1,9],h=[1,10],y=[1,11],b=[1,12],k=[1,30],R=[1,23],p=[1,24],g=[1,25],C=[1,26],v=[1,27],O=[1,19],x=[1,28],A=[1,29],N=[1,20],D=[1,18],L=[1,21],w=[1,22],xt=[2,6],u=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],pt=[1,36],ft=[1,37],bt=[1,38],gt=[1,39],yt=[1,40],Z=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],V=[1,46],M=[1,47],j=[1,57],q=[43,51,53,54,55,74,75],W=[1,70],H=[1,68],B=[1,65],Q=[1,69],X=[1,71],et=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],st=[1,78],it=[1,77],rt=[1,76],Nt=[69,70,71,72,73],Ct=[1,91],At=[6,9,45,50],z=[6,9,12,44,45,50,51,52],nt=[1,101],at=[1,100],ot=[1,99],J=[18,61],It=[1,110],Rt=[1,109],vt=[20,43,51,53,54,55],_t=[18,61,64,66],kt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",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",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:f(function(a,l,d,i,_,t,$){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:this.$=t[e-1].concat(t[e]);break;case 4:this.$=t[e];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[e-4]),i.addEntity(t[e-2]),i.addRelationship(t[e-4],t[e],t[e-2],t[e-3]),this.$=[t[e-4],t[e-2]];break;case 8:i.addEntity(t[e-8]),i.addEntity(t[e-4]),i.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),i.setClass([t[e-8]],t[e-6]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-8],t[e-4]];break;case 9:i.addEntity(t[e-6]),i.addEntity(t[e-2]),i.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),i.setClass([t[e-6]],t[e-4]),this.$=[t[e-6],t[e-2]];break;case 10:i.addEntity(t[e-6]),i.addEntity(t[e-4]),i.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-6],t[e-4]];break;case 11:i.addEntity(t[e-3]),i.addAttributes(t[e-3],t[e-1]),this.$=[t[e-3]];break;case 12:i.addEntity(t[e-5]),i.addAttributes(t[e-5],t[e-1]),i.setClass([t[e-5]],t[e-3]),this.$=[t[e-5]];break;case 13:i.addEntity(t[e-2]),this.$=[t[e-2]];break;case 14:i.addEntity(t[e-4]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-4]];break;case 15:i.addEntity(t[e]),this.$=[t[e]];break;case 16:i.addEntity(t[e-2]),i.setClass([t[e-2]],t[e]),this.$=[t[e-2]];break;case 17:i.addEntity(t[e-6],t[e-4]),i.addAttributes(t[e-6],t[e-1]),this.$=[t[e-6]];break;case 18:i.addEntity(t[e-8],t[e-6]),i.addAttribuLine truncated
|
||||
`+m.showPosition()+`
|
||||
Expecting `+ut.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Tt="Parse error on line "+(lt+1)+": Unexpected "+(E==Lt?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Tt,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:Et,expected:ut})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+E);switch(T[0]){case 1:d.push(E),_.push(m.yytext),t.push(m.yylloc),d.push(T[1]),E=null,Dt=m.yyleng,e=m.yytext,lt=m.yylineno,Et=m.yylloc;break;case 2:if(I=this.productions_[T[1]][1],U.$=_[_.length-I],U._$={first_line:t[t.length-(I||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(I||1)].first_column,last_column:t[t.length-1].last_column},Pt&&(U._$.range=[t[t.length-(I||1)].range[0],t[t.length-1].range[1]]),St=this.performAction.apply(U,[e,Dt,lt,Y.yy,T[1],_,t].concat(Yt)),typeof St<"u")return St;I&&(d=d.slice(0,-1*I*2),_=_.slice(0,-1*I),t=t.slice(0,-1*I)),d.push(this.productions_[T[1]][0]),_.push(U.$),t.push(U._$),Vt=$[d[d.length-2]][d[d.length-1]],d.push(Vt);break;case 3:return!0}}return!0},"parse")},Gt=(function(){var G={EOF:1,parseError:f(function(l,d){if(this.yy.parser)this.yy.parser.parseError(l,d);else throw new Error(l)},"parseError"),setInput:f(function(a,l){return this.yy=l||this.yy||{},this._input=a,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:f(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var l=a.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:f(function(a){var l=a.length,d=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var i=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),d.length-1&&(this.yylineno-=d.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:d?(d.length===i.length?this.yylloc.first_column:0)+i[i.length-d.length].length-d[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(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:f(function(a){this.unput(this.match.slice(a))},"less"),pastInput:f(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var a=this.pastInput(),l=new Array(a.length+1).join("-");return a+this.upcomingInput()+`
|
||||
`+l+"^"},"showPosition"),test_match:f(function(a,l){var d,i,_;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))),i=a[0].match(/(?:\r\n?|\n).*/g),i&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,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(a[0].length),this.matched+=a[0],d=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),d)return d;if(this._backtrack){for(var t in _)this[t]=_[t];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,l,d,i;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),t=0;t<_.length;t++)if(d=this._input.match(this.rules[_[t]]),d&&(!l||d[0].length>l[0].length)){if(l=d,i=t,this.options.backtrack_lexer){if(a=this.test_match(d,_[t]),a!==!1)return a;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(a=this.test_match(l,_[i]),a!==!1?a:!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:f(function(){var l=this.next();return l||this.lex()},"lex"),begin:f(function(l){this.conditionStack.push(l)},"begin"),popState:f(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(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:f(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:f(function(l){this.begin(l)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:f(function(l,d,i,_){switch(i){case 0:return this.begin("acc_title"),23;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),25;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 37;case 8:return 38;case 9:return 39;case 10:return 40;case 11:break;case 12:return 9;case 13:return 53;case 14:return 76;case 15:return 4;case 16:return this.begin("block"),16;case 17:return 52;case 18:return 52;case 19:return 45;case 20:return 14;case 21:return 12;case 22:break;case 23:return 65;case 24:return 61;case 25:return 61;case 26:this.begin("block_bq");break;case 27:return 61;case 28:this.popState();break;case 29:return 66;case 30:break;case 31:return this.popState(),18;case 32:return d.yytext[0];case 33:return 19;case 34:return 20;case 35:return this.begin("style"),47;case 36:return this.popState(),9;case 37:break;case 38:return 12;case 39:return 45;case 40:return 52;case 41:return this.begin("style"),41;case 42:return 46;case 43:return 34;case 44:return 33;case 45:return 69;case 46:return 71;case 47:return 71;case 48:return 71;case 49:return 69;case 50:return 69;case 51:return 70;case 52:return 70;case 53:return 70;case 54:return 70;case 55:return 70;case 56:return 71;case 57:return 70;case 58:return 71;case 59:return 72;case 60:return 72;case 61:return 54;case 62:return 72;case 63:return 72;case 64:return 72;case 65:return 55;case 66:return 51;case 67:return 72;case 68:return 69;case 69:return 70;case 70:return 71;case 71:return 73;case 72:return 74;case 73:return 75;case 74:return 75;case 75:return 74;case 76:return 74;case 77:return 74;case 78:return 44;case 79:return 50;case 80:return 43;case 81:return d.yytext[0];case 82: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,/^(?:[ \t\r]+)/i,/^(?:[\n]+)/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,/^(?:subgraph\b)/i,/^(?:end\b\s*)/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:[36,37,38,39,40,78,79],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:[27,28],inclusive:!1},block:{rules:[22,23,24,25,26,29,30,31,32],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,33,34,35,41,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,77,80,81,82],inclusive:!0}}};return G})();kt.lexer=Gt;function ct(){this.yy={}}return f(ct,"Parser"),ct.prototype=kt,kt.Parser=ct,new ct})();Ot.parser=Ot;var oe=Ot,K,ce=(K=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.subgraphDepth=0,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0Line truncated
|
||||
|
||||
[data-look="${o}"][data-color-id="color-${b}"].node path {
|
||||
stroke: ${r[b]};
|
||||
${h?`fill: ${c[b]};`:""}
|
||||
}
|
||||
|
||||
[data-look="${o}"][data-color-id="color-${b}"].node rect {
|
||||
stroke: ${r[b]};
|
||||
${h?`fill: ${c[b]};`:""}
|
||||
}
|
||||
`;return y},"genColor"),ue=f(s=>{const{look:n,theme:o,erEdgeLabelBackground:c,strokeWidth:r}=s;return`
|
||||
${he(s)}
|
||||
.entityBox {
|
||||
fill: ${s.mainBkg};
|
||||
stroke: ${s.nodeBorder};
|
||||
}
|
||||
|
||||
.relationshipLabelBox {
|
||||
fill: ${s.tertiaryColor};
|
||||
opacity: 0.7;
|
||||
background-color: ${s.tertiaryColor};
|
||||
rect {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
.labelBkg {
|
||||
background-color: ${dt.has(o)&&c?c:Mt(s.tertiaryColor,.5)};
|
||||
}
|
||||
|
||||
.edgeLabel {
|
||||
background-color: ${dt.has(o)&&c?c:s.edgeLabelBackground};
|
||||
}
|
||||
.edgeLabel .label rect {
|
||||
fill: ${dt.has(o)&&c?c:s.edgeLabelBackground};
|
||||
}
|
||||
.edgeLabel .label text {
|
||||
fill: ${s.textColor};
|
||||
}
|
||||
|
||||
.edgeLabel .label {
|
||||
fill: ${s.nodeBorder};
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-family: ${s.fontFamily};
|
||||
color: ${s.nodeTextColor||s.textColor};
|
||||
}
|
||||
|
||||
.edge-pattern-dashed {
|
||||
stroke-dasharray: 8,8;
|
||||
}
|
||||
|
||||
.node rect,
|
||||
.node circle,
|
||||
.node ellipse,
|
||||
.node polygon
|
||||
{
|
||||
fill: ${s.mainBkg};
|
||||
stroke: ${s.nodeBorder};
|
||||
stroke-width: ${n==="neo"?r:"1px"};
|
||||
}
|
||||
|
||||
.relationshipLine {
|
||||
stroke: ${s.lineColor};
|
||||
stroke-width: ${n==="neo"?r:"1px"};
|
||||
fill: none;
|
||||
}
|
||||
|
||||
.marker {
|
||||
fill: none !important;
|
||||
stroke: ${s.lineColor} !important;
|
||||
stroke-width: 1;
|
||||
}
|
||||
[data-look=neo].labelBkg {
|
||||
background-color: ${Mt(s.tertiaryColor,.5)};
|
||||
}
|
||||
|
||||
.cluster rect {
|
||||
fill: ${s.clusterBkg??s.mainBkg};
|
||||
stroke: ${s.clusterBorder??s.nodeBorder};
|
||||
stroke-width: 1px;
|
||||
}
|
||||
|
||||
.cluster text {
|
||||
fill: ${s.titleColor??s.textColor};
|
||||
}
|
||||
|
||||
.cluster-label text {
|
||||
fill: ${s.titleColor??s.textColor};
|
||||
}
|
||||
`},"getStyles"),de=ue,_e={parser:oe,get db(){return new ce},renderer:Bt,styles:de};export{_e as diagram};
|
||||
@@ -0,0 +1,168 @@
|
||||
import{g as Xt}from"./chunk-5VM5RSS4.js";import{g as Qt}from"./chunk-XXDRQBXY.js";import{s as Jt}from"./chunk-POPQ4Y6H.js";import{_ as k,b4 as Zt,F as Mt,l as $,c as ke,u as $t,v as e1,x as rt,b as t1,s as s1,n as i1,a as r1,g as a1,o as n1,k as u1,H as o1,J as l1,ca as c1,q as st,j as it,O as h1,p as d1,b7 as p1,r as f1}from"./mermaid.core.js";import{f as g1}from"./chunk-F27PBJKO.js";import{c as b1}from"./channel.js";var A1="flowchart-",Pe,k1=(Pe=class{constructor(){this.vertexCounter=0,this.config=ke(),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=t1,this.setAccDescription=s1,this.setDiagramTitle=i1,this.getAccTitle=r1,this.getAccDescription=a1,this.getDiagramTitle=n1,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(i){return u1.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}setDiagramId(i){this.diagramId=i}lookUpDomId(i){for(const r of this.vertices.values())if(r.id===i)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${i}`:i}addVertex(i,r,a,n,c,g,l={},m){if(!i||i.trim().length===0)return;let p;if(m!==void 0){let u;m.includes(`
|
||||
`)?u=m+`
|
||||
`:u=`{
|
||||
`+m+`
|
||||
}`,p=o1(u,{schema:l1})}const F=this.subGraphLookup.get(i);if(F&&p){F.metadata={...F.metadata,...p};return}const _=this.edges.find(u=>u.id===i);if(_){const u=p;u?.animate!==void 0&&(_.animate=u.animate),u?.animation!==void 0&&(_.animation=u.animation),u?.curve!==void 0&&(_.interpolate=u.curve);return}let L,A=this.vertices.get(i);if(A===void 0&&(r===void 0&&a===void 0&&n!==void 0&&n!==null&&$.warn(`Style applied to unknown node "${i}". This may indicate a typo. The node will be created automatically.`),A={id:i,labelType:"text",domId:A1+i+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(i,A)),this.vertexCounter++,r!==void 0?(this.config=ke(),L=this.sanitizeText(r.text.trim()),A.labelType=r.type,L.startsWith('"')&&L.endsWith('"')&&(L=L.substring(1,L.length-1)),A.text=L):A.text===void 0&&(A.text=i),a!==void 0&&(A.type=a),n?.forEach(u=>{A.styles.push(u)}),c?.forEach(u=>{A.classes.push(u)}),g!==void 0&&(A.dir=g),A.props===void 0?A.props=l:l!==void 0&&Object.assign(A.props,l),p!==void 0){if(p.shape){if(p.shape!==p.shape.toLowerCase()||p.shape.includes("_"))throw new Error(`No such shape: ${p.shape}. Shape names should be lowercase.`);if(!c1(p.shape))throw new Error(`No such shape: ${p.shape}.`);A.type=p?.shape}p?.label&&(A.text=p?.label,A.labelType=this.sanitizeNodeLabelType(p?.labelType)),p?.icon&&(A.icon=p?.icon,!p.label?.trim()&&A.text===i&&(A.text="")),p?.form&&(A.form=p?.form),p?.pos&&(A.pos=p?.pos),p?.img&&(A.img=p?.img,!p.label?.trim()&&A.text===i&&(A.text="")),p?.constraint&&(A.constraint=p.constraint),p.w&&(A.assetWidth=Number(p.w)),p.h&&(A.assetHeight=Number(p.h))}}addSingleLink(i,r,a,n){const l={start:i,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};$.info("abc78 Got edge...",l);const m=a.text;if(m!==void 0&&(l.text=this.sanitizeText(m.text.trim()),l.text.startsWith('"')&&l.text.endsWith('"')&&(l.text=l.text.substring(1,l.text.length-1)),l.labelType=this.sanitizeNodeLabelType(m.type)),a!==void 0&&(l.type=a.type,l.stroke=a.stroke,l.length=a.length>10?10:a.length),n&&!this.edges.some(p=>p.id===n))l.id=n,l.isUserDefinedId=!0;else{const p=this.edges.filter(F=>F.start===l.start&&F.end===l.end);p.length===0?l.id=st(l.start,l.end,{counter:0,prefix:"L"}):l.id=st(l.start,l.end,{counter:p.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))$.info("Pushing edge..."),this.edges.push(l);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(i){return i!==null&&typeof i=="object"&&"id"in i&&typeof i.id=="string"}addLink(i,r,a){const n=this.isLinkData(a)?a.id.replace("@",""):void 0;$.info("addLink",i,r,n);for(const c of i)for(const g of r){const l=c===i[i.length-1],m=g===r[0];l&&m?this.addSingleLink(c,g,a,n):this.addSingleLink(c,g,a,void 0)}}updateLinkInterpolate(i,r){i.forEach(a=>{a==="default"?this.edges.defaultInterpolate=r:this.edges[a].interpolate=r})}updateLink(i,r){i.forEach(a=>{if(typeof a=="number"&&a>=this.edges.length)throw new Error(`The index ${a} 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.)`);a==="default"?this.edges.defaultStyle=r:(this.edges[a].style=r,(this.edges[a]?.style?.length??0)>0&&!this.edges[a]?.style?.some(n=>n?.startsWith("fill"))&&this.edges[a]?.style?.push("fill:none"))})}addClass(i,r){const a=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");i.split(",").forEach(n=>{let c=this.classes.get(n);c===void 0&&(c={id:n,styles:[],textStyles:[]},this.classes.set(n,c)),a?.forEach(g=>{if(/color/.exec(g)){const l=g.replace("fill","bgFill");c.textStyles.push(l)}c.styles.push(g)})})}setDirection(i){this.direction=i.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(i,r){for(const a of i.split(",")){const n=this.vertices.get(a);n&&n.classes.push(r);const c=this.edges.find(l=>l.id===a);c&&c.classes.push(r);const g=this.subGraphLookup.get(a);g&&g.classes.push(r)}}setTooltip(i,r){if(r!==void 0){r=this.sanitizeText(r);for(const a of i.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(a):a,r)}}setClickFun(i,r,a){if(ke().securityLevel!=="loose"||r===void 0)return;let n=[];if(typeof a=="string"){n=a.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let g=0;g<n.length;g++){let l=n[g].trim();l.startsWith('"')&&l.endsWith('"')&&(l=l.substr(1,l.length-2)),n[g]=l}}n.length===0&&n.push(i);const c=this.vertices.get(i);c&&(c.haveCallback=!0,this.funs.push(()=>{const g=this.lookUpDomId(i),l=document.querySelector(`[id="${g}"]`);l!==null&&l.addEventListener("click",()=>{rt.runFunc(r,...n)},!1)}))}setLink(i,r,a){i.split(",").forEach(n=>{const c=this.vertices.get(n);c!==void 0&&(c.link=rt.formatUrl(r,this.config),c.linkTarget=a)}),this.setClass(i,"clickable")}getTooltip(i){return this.tooltips.get(i)}setClickEvent(i,r,a){i.split(",").forEach(n=>{this.setClickFun(n,r,a)}),this.setClass(i,"clickable")}bindFunctions(i){this.funs.forEach(r=>{r(i)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(i){const r=g1();it(i).select("svg").selectAll("g.node").on("mouseover",c=>{const g=it(c.currentTarget),l=g.attr("title");if(l===null)return;const m=c.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(g.attr("title")).style("left",window.scrollX+m.left+(m.right-m.left)/2+"px").style("top",window.scrollY+m.bottom+"px"),r.html(h1.sanitize(l)),g.classed("hover",!0)}).on("mouseout",c=>{r.transition().duration(500).style("opacity",0),it(c.currentTarget).classed("hover",!1)})}clear(i="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=i,this.config=ke(),d1()}setGen(i){this.version=i||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(i,r,a){let n=i.text.trim(),c=a.text;i===a&&/\s/.exec(a.text)&&(n=void 0);const l=k(L=>{const A={boolean:{},number:{},string:{}},u=[];let h;return{nodeList:L.filter(function(B){const J=typeof B;return B.stmt&&B.stmt==="dir"?(h=B.value,!1):B.trim()===""?!1:J in A?A[J].hasOwnProperty(B)?!1:A[J][B]=!0:u.includes(B)?!1:u.push(B)}),dir:h}},"uniq")(r.flat()),m=l.nodeList;let p=l.dir;const F=ke().flowchart??{};if(p=p??(F.inheritDir?this.getDirection()??ke().direction??void 0:void 0),this.version==="gen-1")for(let L=0;L<m.length;L++)m[L]=this.lookUpDomId(m[L]);n=n??"subGraph"+this.subCount,c=c||"",c=this.sanitizeText(c),this.subCount=this.subCount+1;const _={id:n,nodes:m,title:c.trim(),classes:[],dir:p,labelType:this.sanitizeNodeLabelType(a?.type)};return $.info("Adding",_.id,_.nodes,_.dir),_.nodes=this.makeUniq(_,this.subGraphs).nodes,this.subGraphs.push(_),this.subGraphLookup.set(n,_),n}getPosForId(i){for(const[r,a]of this.subGraphs.entries())if(a.id===i)return r;return-1}indexNodes2(i,r){const a=this.subGraphs[r].nodes;if(this.secCount=this.secCount+1,this.secCount>2e3)return{result:!1,count:0};
Line truncated
|
||||
`+z.showPosition()+`
|
||||
Expecting `+Xe.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":tt="Parse error on line "+(I+1)+": Unexpected "+(Y==Gt?"end of input":"'"+(this.terminals_[Y]||Y)+"'"),this.parseError(tt,{text:z.match,token:this.terminals_[Y]||Y,line:z.yylineno,loc:$e,expected:Xe})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+De+", token: "+Y);switch(Z[0]){case 1:b.push(Y),x.push(z.yytext),e.push(z.yylloc),b.push(Z[1]),Y=null,Nt=z.yyleng,t=z.yytext,I=z.yylineno,$e=z.yylloc;break;case 2:if(de=this.productions_[Z[1]][1],Ge.$=x[x.length-de],Ge._$={first_line:e[e.length-(de||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(de||1)].first_column,last_column:e[e.length-1].last_column},Yt&&(Ge._$.range=[e[e.length-(de||1)].range[0],e[e.length-1].range[1]]),et=this.performAction.apply(Ge,[t,Nt,I,Ce.yy,Z[1],x,e].concat(Ht)),typeof et<"u")return et;de&&(b=b.slice(0,-1*de*2),x=x.slice(0,-1*de),e=e.slice(0,-1*de)),b.push(this.productions_[Z[1]][0]),x.push(Ge.$),e.push(Ge._$),Ot=Oe[b[b.length-2]][b[b.length-1]],b.push(Ot);break;case 3:return!0}}return!0},"parse")},jt=(function(){var Ae={EOF:1,parseError:k(function(f,b){if(this.yy.parser)this.yy.parser.parseError(f,b);else throw new Error(f)},"parseError"),setInput:k(function(d,f){return this.yy=f||this.yy||{},this._input=d,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:k(function(){var d=this._input[0];this.yytext+=d,this.yyleng++,this.offset++,this.match+=d,this.matched+=d;var f=d.match(/(?:\r\n?|\n).*/g);return f?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),d},"input"),unput:k(function(d){var f=d.length,b=d.split(/(?:\r\n?|\n)/g);this._input=d+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-f),this.offset-=f;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),b.length-1&&(this.yylineno-=b.length-1);var x=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===o.length?this.yylloc.first_column:0)+o[o.length-b.length].length-b[0].length:this.yylloc.first_column-f},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-f]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(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:k(function(d){this.unput(this.match.slice(d))},"less"),pastInput:k(function(){var d=this.matched.substr(0,this.matched.length-this.match.length);return(d.length>20?"...":"")+d.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var d=this.match;return d.length<20&&(d+=this._input.substr(0,20-d.length)),(d.substr(0,20)+(d.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var d=this.pastInput(),f=new Array(d.length+1).join("-");return d+this.upcomingInput()+`
|
||||
`+f+"^"},"showPosition"),test_match:k(function(d,f){var b,o,x;if(this.options.backtrack_lexer&&(x={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&&(x.yylloc.range=this.yylloc.range.slice(0))),o=d[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+d[0].length},this.yytext+=d[0],this.match+=d[0],this.matches=d,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(d[0].length),this.matched+=d[0],b=this.performAction.call(this,this.yy,this,f,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),b)return b;if(this._backtrack){for(var e in x)this[e]=x[e];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var d,f,b,o;this._more||(this.yytext="",this.match="");for(var x=this._currentRules(),e=0;e<x.length;e++)if(b=this._input.match(this.rules[x[e]]),b&&(!f||b[0].length>f[0].length)){if(f=b,o=e,this.options.backtrack_lexer){if(d=this.test_match(b,x[e]),d!==!1)return d;if(this._backtrack){f=!1;continue}else return!1}else if(!this.options.flex)break}return f?(d=this.test_match(f,x[o]),d!==!1?d:!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:k(function(){var f=this.next();return f||this.lex()},"lex"),begin:k(function(f){this.conditionStack.push(f)},"begin"),popState:k(function(){var f=this.conditionStack.length-1;return f>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(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:k(function(f){return f=this.conditionStack.length-1-Math.abs(f||0),f>=0?this.conditionStack[f]:"INITIAL"},"topState"),pushState:k(function(f){this.begin(f)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:k(function(f,b,o,x){switch(o){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"),b.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const e=/\n\s*/g;return b.yytext=b.yytext.replace(e,"<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 f.lex.firstGraph()&&this.begin("dir"),12;case 36:return f.lex.firstGraph()&&this.begin("dir"),12;case 37:return f.lex.firstGraph()&&this.begin("dir"),12;case 38:return f.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)/,/^(?:linkStylLine truncated
|
||||
`);return Ut.parse(i)};var T1=zt,S1=k((s,i)=>{const r=b1,a=r(s,"r"),n=r(s,"g"),c=r(s,"b");return f1(a,n,c,i)},"fade"),E1=k(s=>`.label {
|
||||
font-family: ${s.fontFamily};
|
||||
color: ${s.nodeTextColor||s.textColor};
|
||||
}
|
||||
.cluster-label text {
|
||||
fill: ${s.titleColor};
|
||||
}
|
||||
.cluster-label span {
|
||||
color: ${s.titleColor};
|
||||
}
|
||||
.cluster-label span p {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.label text,span {
|
||||
fill: ${s.nodeTextColor||s.textColor};
|
||||
color: ${s.nodeTextColor||s.textColor};
|
||||
}
|
||||
|
||||
.node rect,
|
||||
.node circle,
|
||||
.node ellipse,
|
||||
.node polygon,
|
||||
.node path {
|
||||
fill: ${s.mainBkg};
|
||||
stroke: ${s.nodeBorder};
|
||||
stroke-width: ${s.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: ${s.lineColor} !important;
|
||||
stroke-width: 0;
|
||||
stroke: ${s.lineColor};
|
||||
}
|
||||
|
||||
.arrowheadPath {
|
||||
fill: ${s.arrowheadColor};
|
||||
}
|
||||
|
||||
.edgePaths .path {
|
||||
stroke: ${s.lineColor};
|
||||
stroke-width: ${s.strokeWidth??2}px;
|
||||
}
|
||||
|
||||
.flowchart-link {
|
||||
stroke: ${s.lineColor};
|
||||
fill: none;
|
||||
}
|
||||
|
||||
.edgeLabel {
|
||||
background-color: ${s.edgeLabelBackground};
|
||||
p {
|
||||
background-color: ${s.edgeLabelBackground};
|
||||
}
|
||||
rect {
|
||||
opacity: 0.5;
|
||||
background-color: ${s.edgeLabelBackground};
|
||||
fill: ${s.edgeLabelBackground};
|
||||
}
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* For html labels only */
|
||||
.labelBkg {
|
||||
background-color: ${S1(s.edgeLabelBackground,.5)};
|
||||
// background-color:
|
||||
}
|
||||
|
||||
.cluster rect {
|
||||
fill: ${s.clusterBkg};
|
||||
stroke: ${s.clusterBorder};
|
||||
stroke-width: 1px;
|
||||
}
|
||||
|
||||
.cluster text {
|
||||
fill: ${s.titleColor};
|
||||
}
|
||||
|
||||
.cluster span {
|
||||
color: ${s.titleColor};
|
||||
}
|
||||
/* .cluster div {
|
||||
color: ${s.titleColor};
|
||||
} */
|
||||
|
||||
/* Collapsed subgraph node (@{ view: collapsed }) */
|
||||
.node .collapsed-indicator {
|
||||
fill: ${s.clusterBorder};
|
||||
stroke: none;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.node .collapsed-separator {
|
||||
stroke: ${s.clusterBorder};
|
||||
stroke-width: 0.75px;
|
||||
}
|
||||
|
||||
div.mermaidTooltip {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
max-width: 200px;
|
||||
padding: 2px;
|
||||
font-family: ${s.fontFamily};
|
||||
font-size: 12px;
|
||||
background: ${s.tertiaryColor};
|
||||
border: 1px solid ${s.border2};
|
||||
border-radius: 2px;
|
||||
pointer-events: none;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.flowchartTitleText {
|
||||
text-anchor: middle;
|
||||
font-size: 18px;
|
||||
fill: ${s.textColor};
|
||||
}
|
||||
|
||||
rect.text {
|
||||
fill: none;
|
||||
stroke-width: 0;
|
||||
}
|
||||
|
||||
.icon-shape, .image-shape {
|
||||
background-color: ${s.edgeLabelBackground};
|
||||
p {
|
||||
background-color: ${s.edgeLabelBackground};
|
||||
padding: 2px;
|
||||
}
|
||||
.label rect {
|
||||
opacity: 0.5;
|
||||
background-color: ${s.edgeLabelBackground};
|
||||
fill: ${s.edgeLabelBackground};
|
||||
}
|
||||
text-align: center;
|
||||
}
|
||||
${Xt()}
|
||||
`,"getStyles"),y1=E1,Wt=k(({defaultLayout:s,styles:i=y1}={})=>({parser:T1,get db(){return new k1},renderer:D1,styles:i,init:k(r=>{r.flowchart||(r.flowchart={});const a=Zt().layout??s??r.layout;a&&Mt({layout:a}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,Mt({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),x1=Wt();const I1=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:Wt,diagram:x1},Symbol.toStringTag,{value:"Module"}));export{Wt as c,I1 as f,y1 as s};
|
||||
@@ -0,0 +1,292 @@
|
||||
import{bf as on,bg as On,bh as cn,bi as un,bj as ln,bk as ue,bl as Hn,g as Nn,s as Pn,o as Vn,n as Rn,a as zn,b as qn,_ as d,c as Yt,j as Zt,d as Bn,bm as it,l as Tt,k as Zn,G as Xn,p as Gn,x as jn}from"./mermaid.core.js";import{g as oe}from"./index.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear.js";import{i as er}from"./init.js";import"./defaultLocale.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*hr;return new ht(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}fuLine truncated
|
||||
`+H.showPosition()+`
|
||||
Expecting `+Bt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":ce="Parse error on line "+(K+1)+": Unexpected "+(A==O?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(ce,{text:H.match,token:this.terminals_[A]||A,line:H.yylineno,loc:N,expected:Bt})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+A);switch(Z[0]){case 1:b.push(A),I.push(H.yytext),o.push(H.yylloc),b.push(Z[1]),A=null,l=H.yyleng,u=H.yytext,K=H.yylineno,N=H.yylloc;break;case 2:if(ut=this.productions_[Z[1]][1],at.$=I[I.length-ut],at._$={first_line:o[o.length-(ut||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ut||1)].first_column,last_column:o[o.length-1].last_column},V&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),st=this.performAction.apply(at,[u,l,K,J.yy,Z[1],I,o].concat(j)),typeof st<"u")return st;ut&&(b=b.slice(0,-1*ut*2),I=I.slice(0,-1*ut),o=o.slice(0,-1*ut)),b.push(this.productions_[Z[1]][0]),I.push(at.$),o.push(at._$),He=W[b[b.length-2]][b[b.length-1]],b.push(He);break;case 3:return!0}}return!0},"parse")},C=(function(){var D={EOF:1,parseError:d(function(g,b){if(this.yy.parser)this.yy.parser.parseError(g,b);else throw new Error(g)},"parseError"),setInput:d(function(c,g){return this.yy=g||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:d(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var g=c.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),c},"input"),unput:d(function(c){var g=c.length,b=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;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),b.length-1&&(this.yylineno-=b.length-1);var I=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===m.length?this.yylloc.first_column:0)+m[m.length-b.length].length-b[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(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:d(function(c){this.unput(this.match.slice(c))},"less"),pastInput:d(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:d(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:d(function(){var c=this.pastInput(),g=new Array(c.length+1).join("-");return c+this.upcomingInput()+`
|
||||
`+g+"^"},"showPosition"),test_match:d(function(c,g){var b,m,I;if(this.options.backtrack_lexer&&(I={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&&(I.yylloc.range=this.yylloc.range.slice(0))),m=c[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+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],b=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),b)return b;if(this._backtrack){for(var o in I)this[o]=I[o];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,g,b,m;this._more||(this.yytext="",this.match="");for(var I=this._currentRules(),o=0;o<I.length;o++)if(b=this._input.match(this.rules[I[o]]),b&&(!g||b[0].length>g[0].length)){if(g=b,m=o,this.options.backtrack_lexer){if(c=this.test_match(b,I[o]),c!==!1)return c;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(c=this.test_match(g,I[m]),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:d(function(){var g=this.next();return g||this.lex()},"lex"),begin:d(function(g){this.conditionStack.push(g)},"begin"),popState:d(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(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:d(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:d(function(g){this.begin(g)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(g,b,m,I){switch(m){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})();x.lexer=C;function M(){this.yy={}}return d(M,"Parser"),M.prototype=x,x.Parser=M,new M})();we.parser=we;var Qi=we;it.extend(Oi);it.extend(Vi);it.extend(Bi);var rn={friday:5,saturday:6},lt="",Ye="",Fe=void 0,Ue="",Lt=[],At=[],Ee=new Map,Ie=[],se=[],Wt="",Le="",Yn=["active","done","crit","milestone","vert"],Ae=[],_t="",qt=!1,We=!1,$e="sunday",ae="saturday",De=0,Ji=d(function(){Ie=[],se=[],Wt="",Ae=[],te=0,Ce=void 0,ee=void 0,et=[],lt="",Ye="",Le="",Fe=void 0,Ue="",Lt=[],At=[],qt=!1,We=!1,De=0,Ee=new Map,_t="",Gn(),$e="sunday",ae="saturday"},"clear"),Ki=d(function(t){_t=t},"setDiagramId"),ts=d(function(t){Ye=t},"setAxisFormat"),es=d(function(){return Ye},"getAxisFormat"),ns=d(function(t){Fe=t},"setTickInterval"),rs=d(function(){return Fe},"getTickInterval"),is=d(function(t){Ue=t},"setTodayMarker"),ss=d(function(){return Ue},"getTodayMarker"),as=d(function(t){lt=t},"setDateFormat"),os=d(function(){qt=!0},"enableInclusiveEndDates"),cs=d(function(){return qt},"endDatesAreInclusive"),us=d(function(){We=!0},"enableTopAxis"),ls=d(function(){return We},"topAxisEnabled"),fs=d(function(t){Le=t},"setDisplayMode"),ds=d(function(){return Le},"getDisplayMode"),hs=d(function(){return lt},"getDateFormat"),Fn=d((t,e)=
Line truncated
|
||||
.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"),Ns=Hs,Bs={parser:Qi,db:Ls,renderer:Os,styles:Ns};export{Bs as diagram};
|
||||
@@ -0,0 +1,106 @@
|
||||
import{I as le}from"./chunk-2Q5K7J3B.js";import{p as he}from"./chunk-JWPE2WC7.js";import{o as $e,n as fe,s as ge,g as ue,a as ye,b as xe,_ as h,y as J,l as w,j as me,c as q,x as pe,z as be,p as we,k as B,A as ke,B as ve,C as Ce}from"./mermaid.core.js";import{p as Ee}from"./cynefin-OW5HDTMX.js";import"./index.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))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 ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.braLine truncated
|
||||
${s-i/2-L/2},${x+R}
|
||||
${s-i/2-L/2},${x-R}
|
||||
${t.posWithOffset-i/2-L},${x-c-R}
|
||||
${t.posWithOffset+i/2+L},${x-c-R}
|
||||
${t.posWithOffset+i/2+L},${x+c+R}
|
||||
${t.posWithOffset-i/2-L},${x+c+R}`),f.attr("cy",x).attr("cx",s-i/2+L/2).attr("r",1.5).attr("class","tag-hole"),y==="TB"||y==="BT"){const u=s+$;g.attr("class","tag-label-bkg").attr("points",`
|
||||
${t.x},${u+2}
|
||||
${t.x},${u-2}
|
||||
${t.x+O},${u-c-2}
|
||||
${t.x+O+i+4},${u-c-2}
|
||||
${t.x+O+i+4},${u+c+2}
|
||||
${t.x+O},${u+c+2}`).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),f.attr("cx",t.x+L/2).attr("cy",u).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),l.attr("x",t.x+5).attr("y",u+3).attr("transform","translate(14,14) rotate(45, "+t.x+","+s+")")}}}},"drawCommitTags"),cr=h(e=>{switch(e.customType??e.type){case m.NORMAL:return"commit-normal";case m.REVERSE:return"commit-reverse";case m.HIGHLIGHT:return"commit-highlight";case m.MERGE:return"commit-merge";case m.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),ir=h((e,r,t,s)=>{const o={x:0,y:0};if(e.parents.length>0){const i=ce(e.parents);if(i){const n=s.get(i)??o;return r==="TB"?n.y+_:r==="BT"?(s.get(e.id)??o).y-_:n.x+_}}else return r==="TB"?F:r==="BT"?(s.get(e.id)??o).y-_:0;return 0},"calculatePosition"),dr=h((e,r,t)=>{const s=y==="BT"&&t?r:r+O,o=C.get(e.branch)?.pos,i=y==="TB"||y==="BT"?C.get(e.branch)?.pos:s;if(i===void 0||o===void 0)throw new Error(`Position were undefined for commit ${e.id}`);const n=j.has(q().theme??""),a=y==="TB"||y==="BT"?s:o+(n?X/2+1:-2);return{x:i,y:a,posWithOffset:s}},"getCommitPosition"),re=h((e,r,t,s)=>{const o=e.append("g").attr("class","commit-bullets"),i=e.append("g").attr("class","commit-labels");let n=y==="TB"||y==="BT"?F:0;const a=[...r.keys()],l=s.parallelCommits??!1,f=h(($,c)=>{const x=r.get($)?.seq,u=r.get(c)?.seq;return x!==void 0&&u!==void 0?x-u:0},"sortKeys");let g=a.sort(f);y==="BT"&&(l&&Ze(g,r,n),g=g.reverse()),g.forEach($=>{const c=r.get($);if(!c)throw new Error(`Commit not found for key ${$}`);l&&(n=ir(c,y,n,E));const x=dr(c,n,l);if(t){const u=cr(c),p=c.customType??c.type,b=C.get(c.branch)?.index??0;nr(o,c,x,u,b,p),sr(i,c,x,n,s),or(i,c,x,n)}y==="TB"||y==="BT"?E.set(c.id,{x:x.x,y:x.posWithOffset}):E.set(c.id,{x:x.posWithOffset,y:x.y}),n=y==="BT"&&l?n+_:n+_+O,n>I&&(I=n)})},"drawCommits"),lr=h((e,r,t,s,o)=>{const n=(y==="TB"||y==="BT"?t.x<s.x:t.y<s.y)?r.branch:e.branch,a=h(f=>f.branch===n,"isOnBranchToGetCurve"),l=h(f=>f.seq>e.seq&&f.seq<r.seq,"isBetweenCommits");return[...o.values()].some(f=>l(f)&&a(f))},"shouldRerouteArrow"),W=h((e,r,t=0)=>{const s=e+Math.abs(e-r)/2;if(t>5)return s;if(z.every(n=>Math.abs(n-s)>=10))return z.push(s),s;const i=Math.abs(e-r);return W(e,r-i/5,t+1)},"findLane"),hr=h((e,r,t,s)=>{const{theme:o}=q(),i=Z.has(o??""),n=E.get(r.id),a=E.get(t.id);if(n===void 0||a===void 0)throw new Error(`Commit positions not found for commits ${r.id} and ${t.id}`);const l=lr(r,t,n,a,s);let f="",g="",$=0,c=0,x=C.get(t.branch)?.index;t.type===m.MERGE&&r.id!==t.parents[0]&&(x=C.get(r.branch)?.index);let u;if(l){f="A 10 10, 0, 0, 0,",g="A 10 10, 0, 0, 1,",$=10,c=10;const p=n.y<a.y?W(n.y,a.y):W(a.y,n.y),b=n.x<a.x?W(n.x,a.x):W(a.x,n.x);y==="TB"?n.x<a.x?u=`M ${n.x} ${n.y} L ${b-$} ${n.y} ${g} ${b} ${n.y+c} L ${b} ${a.y-$} ${f} ${b+c} ${a.y} L ${a.x} ${a.y}`:(x=C.get(r.branch)?.index,u=`M ${n.x} ${n.y} L ${b+$} ${n.y} ${f} ${b} ${n.y+c} L ${b} ${a.y-$} ${g} ${b-c} ${a.y} L ${a.x} ${a.y}`):y==="BT"?n.x<a.x?u=`M ${n.x} ${n.y} L ${b-$} ${n.y} ${f} ${b} ${n.y-c} L ${b} ${a.y+$} ${g} ${b+c} ${a.y} L ${a.x} ${a.y}`:(x=C.get(r.branch)?.index,u=`M ${n.x} ${n.y} L ${b+$} ${n.y} ${g} ${b} ${n.y-c} L ${b} ${a.y+$} ${f} ${b-c} ${a.y} L ${a.x} ${a.y}`):n.y<a.y?u=`M ${n.x} ${n.y} L ${n.x} ${p-$} ${f} ${n.x+c} ${p} L ${a.x-$} ${p} ${g} ${a.x} ${p+c} L ${a.x} ${a.y}`:(x=C.get(r.branch)?.index,u=`M ${n.x} ${n.y} L ${n.x} ${p+$} ${g} ${n.x+c} ${p} L ${a.x-$} ${p} ${f} ${a.x} ${p-c} L ${a.x} ${a.y}`)}else f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,y==="TB"?(n.x<a.x&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y-$} ${f} ${n.x+c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${g} ${a.x} ${n.y+c} L ${a.x} ${a.y}`),n.x>a.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y-$} ${g} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${f} ${a.x} ${n.y+c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):y==="BT"?(n.x<a.x&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${g} ${n.x+c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${f} ${a.x} ${n.y-c} L ${a.x} ${a.y}`),n.x>a.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${f} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${g} ${a.x} ${n.y-c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):(n.y<a.y&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${g} ${a.x} ${n.y+c} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${n.x} ${a.y-$} ${f} ${n.x+c} ${a.y} L ${a.x} ${a.y}`),n.y>a.y&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${f} ${a.x} ${n.y-c} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${g} ${n.x+c} ${a.y} L ${a.x} ${a.y}`),n.y=
Line truncated
|
||||
`,"id:",r,t);const o=s.db;if(!o.getConfig){w.error("getConfig method is not available on db");return}const i=o.getConfig(),n=i.rotateCommitLabel??!1;P=o.getCommits();const a=o.getBranchesAsObjArray();y=o.getDirection();const l=me(`[id="${r}"]`),{look:f,theme:g,themeVariables:$}=q(),{useGradient:c,gradientStart:x,gradientStop:u,filterColor:p}=$;if(c){const k=l.append("defs").append("linearGradient").attr("id",r+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");k.append("stop").attr("offset","0%").attr("stop-color",x).attr("stop-opacity",1),k.append("stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}f==="neo"&&j.has(g??"")&&l.append("defs").append("filter").attr("id",r+"-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",p);let b=0;a.forEach((k,U)=>{const D=oe(k.name),T=l.append("g"),K=T.insert("g").attr("class","branchLabel"),M=K.insert("g").attr("class","label branch-label");M.node()?.appendChild(D);const v=D.getBBox();b=gr(k.name,b,U,v,n),M.remove(),K.remove(),T.remove()}),re(l,P,!1,i),i.showBranches&&fr(l,a,i,r),$r(l,P),re(l,P,!0,i),pe.insertTitle(l,"gitTitleText",i.titleTopMargin??0,o.getDiagramTitle()),be(void 0,l,i.diagramPadding,i.useMaxWidth)},"draw"),yr={draw:ur},ie=8,de=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),xr=new Set(["redux-color","redux-dark-color"]),mr=new Set(["neo","neo-dark"]),pr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),br=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),wr=h(e=>{const{svgId:r}=e;let t="";if(e.useGradient&&r)for(let s=0;s<e.THEME_COLOR_LIMIT;s++)t+=`
|
||||
.label${s} { fill: ${e.mainBkg}; stroke: url(${r}-gradient); stroke-width: ${e.strokeWidth};}
|
||||
`;return t},"genGitGraphGradient"),kr=h(e=>{const r=J(),{theme:t,themeVariables:s}=r,{borderColorArray:o}=s,i=de.has(t);if(mr.has(t)){let n="";for(let a=0;a<e.THEME_COLOR_LIMIT;a++)if(a===0)n+=`
|
||||
.branch-label${a} { fill: ${e.nodeBorder};}
|
||||
.commit${a} { stroke: ${e.nodeBorder}; }
|
||||
.commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
|
||||
.arrow${a} { stroke: ${e.nodeBorder}; }
|
||||
.commit-bullets { fill: ${e.nodeBorder}; }
|
||||
.commit-cherry-pick${a} { stroke: ${e.nodeBorder}; }
|
||||
${wr(e)}`;else{const l=a%ie;n+=`
|
||||
.branch-label${a} { fill: ${e["gitBranchLabel"+l]}; }
|
||||
.commit${a} { stroke: ${e["git"+l]}; fill: ${e["git"+l]}; }
|
||||
.commit-highlight${a} { stroke: ${e["gitInv"+l]}; fill: ${e["gitInv"+l]}; }
|
||||
.arrow${a} { stroke: ${e["git"+l]}; }
|
||||
`}return n}else if(xr.has(t)){let n="";for(let a=0;a<e.THEME_COLOR_LIMIT;a++)if(a===0)n+=`
|
||||
.branch-label${a} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:""} }
|
||||
.commit${a} { stroke: ${e.nodeBorder}; }
|
||||
.commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.mainBkg}; }
|
||||
.label${a} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i?`font-weight:${e.noteFontWeight}`:""} }
|
||||
.arrow${a} { stroke: ${e.nodeBorder}; }
|
||||
.commit-bullets { fill: ${e.nodeBorder}; }
|
||||
`;else{const l=a%o.length;n+=`
|
||||
.branch-label${a} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:""} }
|
||||
.commit${a} { stroke: ${o[l]}; fill: ${o[l]}; }
|
||||
.commit-highlight${a} { stroke: ${o[l]}; fill: ${o[l]}; }
|
||||
.label${a} { fill: ${pr.has(t)?e.mainBkg:o[l]}; stroke: ${o[l]}; stroke-width: ${e.strokeWidth}; }
|
||||
.arrow${a} { stroke: ${o[l]}; }
|
||||
`}return n}else{let n="";for(let a=0;a<e.THEME_COLOR_LIMIT;a++)n+=`
|
||||
.branch-label${a} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:""} }
|
||||
.commit${a} { stroke: ${e.nodeBorder}; }
|
||||
.commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
|
||||
.label${a} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i?`font-weight:${e.noteFontWeight}`:""}}
|
||||
.arrow${a} { stroke: ${e.nodeBorder}; }
|
||||
.commit-bullets { fill: ${e.nodeBorder}; }
|
||||
.commit-cherry-pick${a} { stroke: ${e.nodeBorder}; }
|
||||
`;return n}},"genColor"),vr=h(e=>`${Array.from({length:e.THEME_COLOR_LIMIT},(r,t)=>t).map(r=>{const t=r%ie;return`
|
||||
.branch-label${r} { fill: ${e["gitBranchLabel"+t]}; }
|
||||
.commit${r} { stroke: ${e["git"+t]}; fill: ${e["git"+t]}; }
|
||||
.commit-highlight${r} { stroke: ${e["gitInv"+t]}; fill: ${e["gitInv"+t]}; }
|
||||
.label${r} { fill: ${e["git"+t]}; }
|
||||
.arrow${r} { stroke: ${e["git"+t]}; }
|
||||
`}).join(`
|
||||
`)}`,"normalTheme"),Cr=h(e=>{const r=J(),{theme:t}=r,s=br.has(t);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);
|
||||
}
|
||||
|
||||
${s?kr(e):vr(e)}
|
||||
|
||||
.branch {
|
||||
stroke-width: ${e.strokeWidth};
|
||||
stroke: ${e.commitLineColor??e.lineColor};
|
||||
stroke-dasharray: ${s?"4 2":"2"};
|
||||
}
|
||||
.commit-label { font-size: ${e.commitLabelFontSize}; fill: ${s?e.nodeBorder:e.commitLabelColor}; ${s?`font-weight:${e.noteFontWeight};`:""}}
|
||||
.commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${s?"transparent":e.commitLabelBackground}; opacity: ${s?"":.5}; }
|
||||
.tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};}
|
||||
.tag-label-bkg { fill: ${s?e.mainBkg:e.tagLabelBackground}; stroke: ${s?e.nodeBorder:e.tagLabelBorder}; ${s?`filter:${e.dropShadow}`:""} }
|
||||
.tag-hole { fill: ${e.textColor}; }
|
||||
|
||||
.commit-merge {
|
||||
stroke: ${s?e.mainBkg:e.primaryColor};
|
||||
fill: ${s?e.mainBkg:e.primaryColor};
|
||||
}
|
||||
.commit-reverse {
|
||||
stroke: ${s?e.mainBkg:e.primaryColor};
|
||||
fill: ${s?e.mainBkg:e.primaryColor};
|
||||
stroke-width: ${s?e.strokeWidth:3};
|
||||
}
|
||||
.commit-highlight-outer {
|
||||
}
|
||||
.commit-highlight-inner {
|
||||
stroke: ${s?e.mainBkg:e.primaryColor};
|
||||
fill: ${s?e.mainBkg:e.primaryColor};
|
||||
}
|
||||
|
||||
.arrow {
|
||||
/* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */
|
||||
stroke-width: ${de.has(t)?e.strokeWidth:8};
|
||||
stroke-linecap: round;
|
||||
fill: none
|
||||
}
|
||||
.gitTitleText {
|
||||
text-anchor: middle;
|
||||
font-size: 18px;
|
||||
fill: ${e.textColor};
|
||||
}
|
||||
`},"getStyles"),Er=Cr,Ir={parser:Ve,db:se,renderer:yr,styles:Er};export{Ir as diagram};
|
||||
@@ -0,0 +1 @@
|
||||
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-orange-50:oklch(98% .016 73.684);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-400:oklch(75% .183 55.934);--color-orange-600:oklch(64.6% .222 41.116);--color-orange-800:oklch(47% .157 37.304);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-200:oklch(94.5% .129 101.54);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-yellow-800:oklch(47.6% .114 61.907);--color-green-50:oklch(98.2% .018 155.826);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-emerald-400:oklch(76.5% .177 163.223);--color-cyan-400:oklch(78.9% .154 211.53);--color-blue-50:oklch(97% .014 254.604);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-blue-900:oklch(37.9% .146 265.522);--color-violet-500:oklch(60.6% .25 292.717);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-pink-400:oklch(71.8% .202 349.761);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--breakpoint-2xl:96rem;--contLine truncated
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index3.js","assets/common-types.js","assets/index2.js"])))=>i.map(i=>d[i]);
|
||||
function jL(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const o in a)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(a,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>a[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const u of s.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function wc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jf={exports:{}},bs={};var AA;function UL(){if(AA)return bs;AA=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,o,s){var u=null;if(s!==void 0&&(u=""+s),o.key!==void 0&&(u=""+o.key),"key"in o){s={};for(var c in o)c!=="key"&&(s[c]=o[c])}else s=o;return o=s.ref,{$$typeof:e,type:a,key:u,ref:o!==void 0?o:null,props:s}}return bs.Fragment=t,bs.jsx=n,bs.jsxs=n,bs}var kA;function FL(){return kA||(kA=1,jf.exports=UL()),jf.exports}var p=FL(),Uf={exports:{}},Re={};var _A;function BL(){if(_A)return Re;_A=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),E=Symbol.iterator;function S(M){return M===null||typeof M!="object"?null:(M=E&&M[E]||M["@@iterator"],typeof M=="function"?M:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,T={};function A(M,j,C){this.props=M,this.context=j,this.refs=T,this.updater=C||x}A.prototype.isReactComponent={},A.prototype.setState=function(M,j){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,j,"setState")},A.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function _(){}_.prototype=A.prototype;function N(M,j,C){this.props=M,this.context=j,this.refs=T,this.updater=C||x}var L=N.prototype=new _;L.constructor=N,w(L,A.prototype),L.isPureReactComponent=!0;var U=Array.isArray;function D(){}var P={H:null,A:null,T:null,S:null},$=Object.prototype.hasOwnProperty;function Y(M,j,C){var J=C.ref;return{$$typeof:e,type:M,key:j,ref:J!==void 0?J:null,props:C}}function B(M,j){return Y(M.type,j,M.props)}function V(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function X(M){var j={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(C){return j[C]})}var ne=/\/+/g;function ie(M,j){return typeof M=="object"&&M!==null&&M.key!=null?X(""+M.key):j.toString(36)}function ee(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(D,D):(M.status="pending",M.then(function(j){M.status==="pending"&&(M.status="fulfilled",M.value=j)},function(j){M.status==="pending"&&(M.status="rejected",M.reason=j)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function F(M,j,C,J,Q){var re=typeof M;(re==="undefined"||re==="boolean")&&(M=null);var oe=!1;if(M===null)oe=!0;else switch(re){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(M.$$typeof){case e:case t:oe=!0;break;case h:return oe=M._init,F(oe(M._payload),j,C,J,Q)}}if(oe)return Q=Q(M),oe=J===""?"."+ie(M,0):J,U(Q)?(C="",oe!=null&&(C=oe.replace(ne,"$&/")+"/"),F(Q,j,C,"",function(ve){return ve})):Q!=null&&(V(Q)&&(Q=B(Q,C+(Q.key==null||M&&M.key===Q.key?"":(""+Q.key).replace(ne,"$&/")+"/")+oe)),j.push(Q)),1;oe=0;var he=J===""?".":J+":";if(U(M))for(var pe=0;pe<M.length;pe++)J=M[pe],re=he+ie(J,pe),oe+=F(J,j,C,re,Q);else if(pe=S(M),typeof pe=="function")for(M=pe.call(M),pe=0;!(J=M.next()).done;)J=J.value,re=he+ie(J,pe++),oe+=F(J,j,C,re,Q);else if(re==="object"){if(typeof M.then=="function")return F(ee(M),j,C,J,Q);throw j=String(M),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return oe}functLine truncated
|
||||
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||||
`+je+r+qe}var Ie=!1;function kt(r,i){if(!r||Ie)return"";Ie=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(ae){var Z=ae}Reflect.construct(r,[],de)}else{try{de.call()}catch(ae){Z=ae}r.call(de.prototype)}}else{try{throw Error()}catch(ae){Z=ae}(de=r())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ae){if(ae&&Z&&typeof ae.stack=="string")return[ae.stack,Z.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=d.DetermineComponentFrameRoot(),k=y[0],R=y[1];if(k&&R){var z=k.split(`
|
||||
`),K=R.split(`
|
||||
`);for(b=d=0;d<z.length&&!z[d].includes("DetermineComponentFrameRoot");)d++;for(;b<K.length&&!K[b].includes("DetermineComponentFrameRoot");)b++;if(d===z.length||b===K.length)for(d=z.length-1,b=K.length-1;1<=d&&0<=b&&z[d]!==K[b];)b--;for(;1<=d&&0<=b;d--,b--)if(z[d]!==K[b]){if(d!==1||b!==1)do if(d--,b--,0>b||z[d]!==K[b]){var le=`
|
||||
`+z[d].replace(" at new "," at ");return r.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",r.displayName)),le}while(1<=d&&0<=b);break}}}finally{Ie=!1,Error.prepareStackTrace=l}return(l=r?r.displayName||r.name:"")?Qe(l):""}function cn(r,i){switch(r.tag){case 26:case 27:case 5:return Qe(r.type);case 16:return Qe("Lazy");case 13:return r.child!==i&&i!==null?Qe("Suspense Fallback"):Qe("Suspense");case 19:return Qe("SuspenseList");case 0:case 15:return kt(r.type,!1);case 11:return kt(r.type.render,!1);case 1:return kt(r.type,!0);case 31:return Qe("Activity");default:return""}}function ml(r){try{var i="",l=null;do i+=cn(r,l),l=r,r=r.return;while(r);return i}catch(d){return`
|
||||
Error generating stack: `+d.message+`
|
||||
`+d.stack}}var ai=Object.prototype.hasOwnProperty,ii=e.unstable_scheduleCallback,Ao=e.unstable_cancelCallback,Ed=e.unstable_shouldYield,Sd=e.unstable_requestPaint,Vt=e.unstable_now,xd=e.unstable_getCurrentPriorityLevel,ue=e.unstable_ImmediatePriority,me=e.unstable_UserBlockingPriority,Ne=e.unstable_NormalPriority,Ue=e.unstable_LowPriority,Xe=e.unstable_IdlePriority,dn=e.log,dr=e.unstable_setDisableYieldValue,qt=null,wt=null;function Jt(r){if(typeof dn=="function"&&dr(r),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(qt,r)}catch{}}var at=Math.clz32?Math.clz32:x1,Mr=Math.log,Bn=Math.LN2;function x1(r){return r>>>=0,r===0?32:31-(Mr(r)/Bn|0)|0}var hl=256,bl=262144,yl=4194304;function Ta(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function vl(r,i,l){var d=r.pendingLanes;if(d===0)return 0;var b=0,y=r.suspendedLanes,k=r.pingedLanes;r=r.warmLanes;var R=d&134217727;return R!==0?(d=R&~y,d!==0?b=Ta(d):(k&=R,k!==0?b=Ta(k):l||(l=R&~r,l!==0&&(b=Ta(l))))):(R=d&~y,R!==0?b=Ta(R):k!==0?b=Ta(k):l||(l=d&~r,l!==0&&(b=Ta(l)))),b===0?0:i!==0&&i!==b&&(i&y)===0&&(y=b&-b,l=i&-i,y>=l||y===32&&(l&4194048)!==0)?i:b}function ko(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function w1(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function CS(){var r=yl;return yl<<=1,(yl&62914560)===0&&(yl=4194304),r}function wd(r){for(var i=[],l=0;31>l;l++)i.push(r);return i}function _o(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function T1(r,i,l,d,b,y){var k=r.pendingLanes;r.pendingLanes=l,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=l,r.entangledLanes&=l,r.errorRecoveryDisabledLanes&=l,r.shellSuspendCounter=0;var R=r.entanglements,z=r.expirationTimes,K=r.hiddenUpdates;for(l=k&~l;0<l;){var le=31-at(l),de=1<<le;R[le]=0,z[le]=-1;var Z=K[le];if(Z!==null)for(K[le]=null,le=0;le<Z.length;le++){var ae=Z[le];ae!==null&&(ae.lane&=-536870913)}l&=~de}d!==0&&RS(r,d,0),y!==0&&b===0&&r.tag!==0&&(r.suspendedLanes|=y&~(k&~i))}function RS(r,i,l){r.pendingLanes|=i,r.suspendedLanes&=~i;var d=31-at(i);r.entangledLanes|=i,r.entanglements[d]=r.entanglements[d]|1073741824|l&261930}function IS(r,i){var l=r.entangledLanes|=i;for(r=r.entanglements;l;){var d=31-at(l),b=1<<d;b&i|r[d]&i&&(r[d]|=i),l&=~b}}function OS(r,i){var l=i&-i;return l=(l&42)!==0?1:Td(l),(l&(r.suspendedLanes|i))!==0?0:l}function Td(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Ad(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function DS(){var r=q.p;return r!==0?r:(r=window.event,r===void 0?32:yA(r.type))}function LS(r,i){var l=q.p;try{return q.p=r,i()}finally{q.p=l}}var jr=Math.random().toString(36).slice(2),Ot="__reactFiber$"+jr,en="__reactProps$"+jr,oi="__reactContainer$"+jr,kd="__reactEvents$"+jr,A1="__reactListeners$"+jr,k1="__reactHandles$"+jr,MS="__reactResources$"+jr,No="__reactMarker$"+jr;function _d(r){delete r[Ot],delete r[en],delete r[kd],delete r[A1],delete r[k1]}function si(r){var i=r[Ot];if(i)return i;for(var l=r.parentNode;l;){if(i=l[oi]||l[Ot]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(r=nA(r);r!==null;){if(l=r[Ot])return l;r=nA(r)}return i}r=l,l=r.parentNode}return null}function li(r){if(r=r[Ot]||r[oi]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function Co(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function ui(r){var i=r[MS];return i||(i=r[MS]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function _t(r){r[No]=!0}var jS=new Set,US={};function Aa(r,i){ci(r,i),ci(r+"Capture",i)}function ci(r,i){for(US[r]=i,r=0;r<i.length;r++)jS.add(i[r])}var _1=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u20
Line truncated
|
||||
`).replace(aL,"")}function qT(r,i){return i=VT(i),VT(r)===i}function nt(r,i,l,d,b,y){switch(l){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||pi(r,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&pi(r,""+d);break;case"className":Sl(r,"class",d);break;case"tabIndex":Sl(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":Sl(r,l,d);break;case"style":qS(r,d,y);break;case"data":if(i!=="object"){Sl(r,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||l!=="href")){r.removeAttribute(l);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(l);break}d=wl(""+d),r.setAttribute(l,d);break;case"action":case"formAction":if(typeof d=="function"){r.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(l==="formAction"?(i!=="input"&&nt(r,i,"name",b.name,b,null),nt(r,i,"formEncType",b.formEncType,b,null),nt(r,i,"formMethod",b.formMethod,b,null),nt(r,i,"formTarget",b.formTarget,b,null)):(nt(r,i,"encType",b.encType,b,null),nt(r,i,"method",b.method,b,null),nt(r,i,"target",b.target,b,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(l);break}d=wl(""+d),r.setAttribute(l,d);break;case"onClick":d!=null&&(r.onclick=fr);break;case"onScroll":d!=null&&Be("scroll",r);break;case"onScrollEnd":d!=null&&Be("scrollend",r);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(l=d.__html,l!=null){if(b.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"multiple":r.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":r.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){r.removeAttribute("xlink:href");break}l=wl(""+d),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(l,""+d):r.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(l,""):r.removeAttribute(l);break;case"capture":case"download":d===!0?r.setAttribute(l,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(l,d):r.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?r.setAttribute(l,d):r.removeAttribute(l);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?r.removeAttribute(l):r.setAttribute(l,d);break;case"popover":Be("beforetoggle",r),Be("toggle",r),El(r,"popover",d);break;case"xlinkActuate":pr(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":pr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":pr(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":pr(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":pr(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":pr(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":pr(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":pr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":pr(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":El(r,"is",d);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=O1.get(l)||l,El(r,l,d))}}function yf(r,i,l,d,b,y){switch(l){case"style":qS(r,d,y);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(l=d.__html,l!=null){if(b.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"children":typeof d=="string"?pi(r,d):(typeof d=="number"||typeof d=="bigint")&&pi(r,""+d);break;case"onScroll":d!=null&&Be("scroll",r);break;case"onScrollEnd":d!=null&&Be("scrollend",r);break;case"onClick":d!=null&&(r.onclick=fr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"inne
Line truncated
|
||||
.`.concat(HU,` {
|
||||
overflow: hidden `).concat(a,`;
|
||||
padding-right: `).concat(c,"px ").concat(a,`;
|
||||
}
|
||||
body[`).concat(to,`] {
|
||||
overflow: hidden `).concat(a,`;
|
||||
overscroll-behavior: contain;
|
||||
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
|
||||
padding-left: `.concat(o,`px;
|
||||
padding-top: `).concat(s,`px;
|
||||
padding-right: `).concat(u,`px;
|
||||
margin-left:0;
|
||||
margin-top:0;
|
||||
margin-right: `).concat(c,"px ").concat(a,`;
|
||||
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(a,";")].filter(Boolean).join(""),`
|
||||
}
|
||||
|
||||
.`).concat(Qu,` {
|
||||
right: `).concat(c,"px ").concat(a,`;
|
||||
}
|
||||
|
||||
.`).concat(Ju,` {
|
||||
margin-right: `).concat(c,"px ").concat(a,`;
|
||||
}
|
||||
|
||||
.`).concat(Qu," .").concat(Qu,` {
|
||||
right: 0 `).concat(a,`;
|
||||
}
|
||||
|
||||
.`).concat(Ju," .").concat(Ju,` {
|
||||
margin-right: 0 `).concat(a,`;
|
||||
}
|
||||
|
||||
body[`).concat(to,`] {
|
||||
`).concat(VU,": ").concat(c,`px;
|
||||
}
|
||||
`)},fk=function(){var e=parseInt(document.body.getAttribute(to)||"0",10);return isFinite(e)?e:0},cF=function(){v.useEffect(function(){return document.body.setAttribute(to,(fk()+1).toString()),function(){var e=fk()-1;e<=0?document.body.removeAttribute(to):document.body.setAttribute(to,e.toString())}},[])},dF=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,o=a===void 0?"margin":a;cF();var s=v.useMemo(function(){return sF(o)},[o]);return v.createElement(lF,{styles:uF(s,!t,o,n?"":"!important")})},Dg=!1;if(typeof window<"u")try{var Fu=Object.defineProperty({},"passive",{get:function(){return Dg=!0,!0}});window.addEventListener("test",Fu,Fu),window.removeEventListener("test",Fu,Fu)}catch{Dg=!1}var Vi=Dg?{passive:!1}:!1,pF=function(e){return e.tagName==="TEXTAREA"},eC=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!pF(e)&&n[t]==="visible")},fF=function(e){return eC(e,"overflowY")},gF=function(e){return eC(e,"overflowX")},gk=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var o=tC(e,a);if(o){var s=nC(e,a),u=s[1],c=s[2];if(u>c)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},mF=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},hF=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},tC=function(e,t){return e==="v"?fF(t):gF(t)},nC=function(e,t){return e==="v"?mF(t):hF(t)},bF=function(e,t){return e==="h"&&t==="rtl"?-1:1},yF=function(e,t,n,a,o){var s=bF(e,window.getComputedStyle(t).direction),u=s*a,c=n.target,f=t.contains(c),g=!1,h=u>0,m=0,E=0;do{if(!c)break;var S=nC(e,c),x=S[0],w=S[1],T=S[2],A=w-T-s*x;(x||A)&&tC(e,c)&&(m+=A,E+=x);var _=c.parentNode;c=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(h&&Math.abs(m)<1||!h&&Math.abs(E)<1)&&(g=!0),g},Bu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},mk=function(e){return[e.deltaX,e.deltaY]},hk=function(e){return e&&"current"in e?e.current:e},vF=function(e,t){return e[0]===t[0]&&e[1]===t[1]},EF=function(e){return`
|
||||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||||
`)},SF=0,qi=[];function xF(e){var t=v.useRef([]),n=v.useRef([0,0]),a=v.useRef(),o=v.useState(SF++)[0],s=v.useState(JN)[0],u=v.useRef(e);v.useEffect(function(){u.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=GU([e.lockRef.current],(e.shards||[]).map(hk),!0).filter(Boolean);return w.forEach(function(T){return T.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(T){return T.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=v.useCallback(function(w,T){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!u.current.allowPinchZoom;var A=Bu(w),_=n.current,N="deltaX"in w?w.deltaX:_[0]-A[0],L="deltaY"in w?w.deltaY:_[1]-A[1],U,D=w.target,P=Math.abs(N)>Math.abs(L)?"h":"v";if("touches"in w&&P==="h"&&D.type==="range")return!1;var $=window.getSelection(),Y=$&&$.anchorNode,B=Y?Y===D||Y.contains(D):!1;if(B)return!1;var V=gk(P,D);if(!V)return!0;if(V?U=P:(U=P==="v"?"h":"v",V=gk(P,D)),!V)return!1;if(!a.current&&"changedTouches"in w&&(N||L)&&(a.current=U),!U)return!0;var X=a.current||U;return yF(X,T,w,X==="h"?N:L)},[]),f=v.useCallback(function(w){var T=w;if(!(!qi.length||qi[qi.length-1]!==s)){var A="deltaY"in T?mk(T):Bu(T),_=t.current.filter(function(U){return U.name===T.type&&(U.target===T.target||T.target===U.shadowParent)&&vF(U.delta,A)})[0];if(_&&_.should){T.cancelable&&T.preventDefault();return}if(!_){var N=(u.current.shards||[]).map(hk).filter(Boolean).filter(function(U){return U.contains(T.target)}),L=N.length>0?c(T,N[0]):!u.current.noIsolation;L&&T.cancelable&&T.preventDefault()}}},[]),g=v.useCallback(function(w,T,A,_){var N={name:w,delta:T,target:A,should:_,shadowParent:wF(A)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(L){return L!==N})},1)},[]),h=v.useCallback(function(w){n.current=Bu(w),a.current=void 0},[]),m=v.useCallback(function(w){g(w.type,mk(w),w.target,c(w,e.lockRef.current))},[]),E=v.useCallback(function(w){g(w.type,Bu(w),w.target,c(w,e.lockRef.current))},[]);v.useEffect(function(){return qi.push(s),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:E}),document.addEventListener("wheel",f,Vi),document.addEventListener("touchmove",f,Vi),document.addEventListener("touchstart",h,Vi),function(){qi=qi.filter(function(w){return w!==s}),document.removeEventListener("wheel",f,Vi),document.removeEventListener("touchmove",f,Vi),document.removeEventListener("touchstart",h,Vi)}},[]);var S=e.removeScrollBar,x=e.inert;return v.createElement(v.Fragment,null,x?v.createElement(s,{styles:EF(o)}):null,S?v.createElement(dF,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function wF(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const TF=QU(QN,xF);var Js=v.forwardRef(function(e,t){return v.createElement(jc,ar({},e,{ref:t,sideCar:TF}))});Js.classNames=jc.classNames;var Lg=["Enter"," "],AF=["ArrowDown","PageUp","Home"],rC=["ArrowUp","PageDown","End"],kF=[...AF,...rC],_F={ltr:[...Lg,"ArrowRight"],rtl:[...Lg,"ArrowLeft"]},NF={ltr:["ArrowLeft"],rtl:["ArrowRight"]},el="Menu",[js,CF,RF]=Ys(el),[ei,aC]=It(el,[RF,va,fo]),Uc=va(),iC=fo(),[IF,ti]=ei(el),[OF,tl]=ei(el),oC=e=>{const{__scopeMenu:t,open:n=!1,children:a,dir:o,onOpenChange:s,modal:u=!0}=e,c=Uc(t),[f,g]=v.useState(null),h=v.useRef(!1),m=Rt(s),E=ya(o);return v.useEffect(()=>{const S=()=>{h.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>h.current=!1;return document.addEventListener("keydown",S,{capture:!0}),()=>{document.removeEventListener("keydown",S,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),p.jsx(Oc,{...c,children:p.jsx(IF,{scope:t,open:n,onOpenChange:m,content:f,onContentChange:g,children:p.jsx(OF,{scope:t,onClose:v.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:h,dir:E,modal:u,children:a})})})};oC.displayName=el;var DF="MenuAnchor",_m=v.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,o=Uc(n);return p.jsx(Zs,{...o,...a,ref:t})});_m.displayName=DF;var Nm="MenuPortal",[LF,sC]=ei(Nm,{forceMount:void 0}),lC=e=>{const{__scopeMenu:t,forceMount:n,children:a,container:o}=e,s=ti(Nm,t);return p.jsx(LF,{scope:t,forceMount:n,children:p.jsx(xt,{present:n||s.open,children:p.jsx(po,{asChild:!0,container:o,children:a})})})};lC.displayName=Nm;var Un="MenuContent",[MF,Cm]=ei(Un),uC=v.forwardRef((e,t)=>{const n=sC(Un,e.__scopeMenu),{forceMount:a=n.forceMount,...o}=e,s=ti(Un,e.__scopeMenu),u=tl(Un,e.__scopeMenu);return p.jsx(js.Provider,{scope:e.__scopeMenu,children:p.jsx(xt,{present:a||s.open,children:p.jsx(js.Slot,{scope:e.__scopeMenu,children:u.modal?p.jsx(jF,{...o,ref:t}):p.jsx(UF,{...o,ref:t})})})})}),jF=v.forwardRef((e,t)=>{const n=ti(Un,e.__scopeMenu),a=v.useRef(n
Line truncated
|
||||
|
||||
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||||
|
||||
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},xP="DialogDescriptionWarning",wP=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${uR(xP).contentName}}.`;return v.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Pm=KC,TP=ZC,zm=JC,$m=eR,Gm=tR,cR=rR,AP=iR,dR=sR;function kP({...e}){return p.jsx(Pm,{"data-slot":"sheet",...e})}function _P({...e}){return p.jsx(zm,{"data-slot":"sheet-portal",...e})}function NP({className:e,...t}){return p.jsx($m,{"data-slot":"sheet-overlay",className:be("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function CP({className:e,children:t,side:n="right",showCloseButton:a=!0,...o}){return p.jsxs(_P,{children:[p.jsx(NP,{}),p.jsxs(Gm,{"data-slot":"sheet-content",className:be("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...o,children:[t,a&&p.jsxs(dR,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[p.jsx(J_,{className:"size-4"}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function RP({className:e,...t}){return p.jsx("div",{"data-slot":"sheet-header",className:be("flex flex-col gap-1.5 p-4",e),...t})}function IP({className:e,...t}){return p.jsx(cR,{"data-slot":"sheet-title",className:be("text-foreground font-semibold",e),...t})}function Pt(e){return(e||"/").replace(/\/+$/,"")||"/"}function OP(e){if(!e||e.startsWith("#"))return e;try{const t=new URL(e,window.location.origin);return t.origin!==window.location.origin?e:Pt(t.pathname)+t.search+t.hash}catch{return e}}function DP(e){if(!e||e.startsWith("#"))return!1;if(e.startsWith("/docs"))return!0;try{const t=new URL(e,window.location.origin);return t.origin===window.location.origin&&t.pathname.startsWith("/docs")}catch{return!1}}function LP(e){const t=Pt(e);return t==="/"?"/docs/index.md":`${t}.md`}function pR({nav:e,activeItem:t,onItemClick:n}){const a=(o,s=0)=>{const u=(o.path||o.title)===t;if(o.children&&o.children.length>0)return p.jsxs("div",{className:"mb-4",children:[p.jsx("div",{className:"flex items-center gap-1 px-3 py-1.5 text-[11px] font-semibold text-muted-foreground/80 uppercase tracking-wider",children:o.title}),p.jsx("div",{className:"space-y-0.5 mt-1",children:o.children.map(g=>a(g,s+1))})]},o.title+(o.path||""));const f=Pt(o.path||"/");return p.jsxs("a",{href:f,"data-nav-path":o.path||"",onClick:g=>{g.preventDefault(),n(o)},className:`group flex items-center gap-1.5 w-full text-left px-3 py-1.5 text-[13px] rounded-md transition-colors ${u?"text-primary font-medium bg-primary/10":"text-muted-foreground hover:text-foreground hover:bg-muted/40"}`,style:{paddingLeft:`${12+s*10}px`},children:[s>0&&p.jsx(kc,{className:`h-3 w-3 shrink-0 opacity-0 group-hover:opacity-40 ${u?"opacity-60 text-primary":""}`}),p.jsx("span",{className:"truncate",children:o.title})]},o.title+(o.path||""))};return p.jsx("nav",{className:"space-y-0.5 pb-6",children:e.items?.map(o=>a(o))})}function Pu({nav:e,activeItem:t,onItemClick:n}){return p.jsx("aside",{className:"docs-sidebar w-[17rem] min-w-[17rem] shrink-0 hidden md:block border-r border-border/40",children:p.jsx(YC,{className:"h-[calc(100vh-3.5rem)] sticky top-14",children:p.jsx("div",{className:"py-5 px-2",children:p.jsx(pR,{nav:e,activeItem:t,onItemClick:n})})})})}function MP({open:e,onOpenChange:t,nav:n,activeItem:a,onItemClick:o,title:s="Navigation"}){return p.jsx(kP,{open:e,onOpenChange:t,children:p.jsxs(CP,{side:"left",className:"w-72 p-0",children:[p.jsx(RP,{className:"border-b px-4 py-3",children:p.jsx(IP,{children:s})}),p.jsx(YC,{className:"h-[calc(100vh-4rem)] px-2 py-4",children:p.jsx(pR,{nav:n,activeItem:a,onItemClick:u=>{o(u),t(!1)}})})]})})}function vk(e){const t=[],n=String(e||"");let a=n.indexOf(","),o=0,s=!1;for(;!s;){a===-1&&(a=n.length,s=!0);const u=n.slice(o,a).trim();(u||!s)&&t.pus
Line truncated
|
||||
`,g="/",h="*",m="",E="comment",S="declaration";function x(T,A){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];A=A||{};var _=1,N=1;function L(ie){var ee=ie.match(t);ee&&(_+=ee.length);var F=ie.lastIndexOf(f);N=~F?ie.length-F:N+ie.length}function U(){var ie={line:_,column:N};return function(ee){return ee.position=new D(ie),Y(),ee}}function D(ie){this.start=ie,this.end={line:_,column:N},this.source=A.source}D.prototype.content=T;function P(ie){var ee=new Error(A.source+":"+_+":"+N+": "+ie);if(ee.reason=ie,ee.filename=A.source,ee.line=_,ee.column=N,ee.source=T,!A.silent)throw ee}function $(ie){var ee=ie.exec(T);if(ee){var F=ee[0];return L(F),T=T.slice(F.length),ee}}function Y(){$(n)}function B(ie){var ee;for(ie=ie||[];ee=V();)ee!==!1&&ie.push(ee);return ie}function V(){var ie=U();if(!(g!=T.charAt(0)||h!=T.charAt(1))){for(var ee=2;m!=T.charAt(ee)&&(h!=T.charAt(ee)||g!=T.charAt(ee+1));)++ee;if(ee+=2,m===T.charAt(ee-1))return P("End of comment missing");var F=T.slice(2,ee-2);return N+=2,L(F),T=T.slice(ee),N+=2,ie({type:E,comment:F})}}function X(){var ie=U(),ee=$(a);if(ee){if(V(),!$(o))return P("property missing ':'");var F=$(s),q=ie({type:S,property:w(ee[0].replace(e,m)),value:F?w(F[0].replace(e,m)):m});return $(u),q}}function ne(){var ie=[];B(ie);for(var ee;ee=X();)ee!==!1&&(ie.push(ee),B(ie));return ie}return Y(),ne()}function w(T){return T?T.replace(c,m):m}return ng=x,ng}var kk;function QP(){if(kk)return Yi;kk=1;var e=Yi&&Yi.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.default=n;const t=e(ZP());function n(a,o){let s=null;if(!a||typeof a!="string")return s;const u=(0,t.default)(a),c=typeof o=="function";return u.forEach(f=>{if(f.type!=="declaration")return;const{property:g,value:h}=f;c?o(g,h,f):h&&(s=s||{},s[g]=h)}),s}return Yi}var Es={},_k;function JP(){if(_k)return Es;_k=1,Object.defineProperty(Es,"__esModule",{value:!0}),Es.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(g){return!g||n.test(g)||e.test(g)},u=function(g,h){return h.toUpperCase()},c=function(g,h){return"".concat(h,"-")},f=function(g,h){return h===void 0&&(h={}),s(g)?g:(g=g.toLowerCase(),h.reactCompat?g=g.replace(o,c):g=g.replace(a,c),g.replace(t,u))};return Es.camelCase=f,Es}var Ss,Nk;function ez(){if(Nk)return Ss;Nk=1;var e=Ss&&Ss.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(QP()),n=JP();function a(o,s){var u={};return!o||typeof o!="string"||(0,t.default)(o,function(c,f){c&&f&&(u[(0,n.camelCase)(c,s)]=f)}),u}return a.default=a,Ss=a,Ss}var tz=ez();const nz=wc(tz),xR=wR("end"),Vm=wR("start");function wR(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function rz(e){const t=Vm(e),n=xR(e);if(t&&n)return{start:t,end:n}}function Rs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ck(e.position):"start"in e||"end"in e?Ck(e):"line"in e||"column"in e?Ug(e):""}function Ug(e){return Rk(e&&e.line)+":"+Rk(e&&e.column)}function Ck(e){return Ug(e&&e.start)+"-"+Ug(e&&e.end)}function Rk(e){return e&&typeof e=="number"?e:1}class $t extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let o="",s={},u=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?o=t:!s.cause&&t&&(u=!0,o=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof a=="string"){const f=a.indexOf(":");f===-1?s.ruleId=a:(s.source=a.slice(0,f),s.ruleId=a.slice(f+1))}if(!s.place&&s.ancestors&&s.ancestors){const f=s.ancestors[s.ancestors.length-1];f&&(s.place=f.position)}const c=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=c?c.line:void 0,this.name=Rs(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=u&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}$t.prototype.file="";$t.prototype.name="";$t.prototype.reason="";$t.prototype.message="";$t.prototype.stack="";$t.prototype.column=void 0;$t.prototype.line=void 0;$t.prototype.ancestors=void 0;$t.prototype.cause=void 0;$t.prototype.fatal=void 0;$t.prototype.place=void 0;$t.prototype.ruleId=void 0;$t.prototype.source=void 0;const qm={}.hasOwnProperty,az=new Map,iz=/[A-Z]/g,oz=new Set(["table","tbody","thead","tfoot","tr"]),sz=new Set(["td","th"]),TR="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function lz(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options
Line truncated
|
||||
`;break}case-3:{u=`\r
|
||||
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&o)continue;u=" ";break}default:u=String.fromCharCode(s)}o=s===-2,a.push(u)}return a.join("")}function h3(e){const a={constructs:CR([p3,...(e||{}).extensions||[]]),content:o(Iz),defined:[],document:o(Dz),flow:o(Z$),lazy:{},string:o(e3),text:o(t3)};return a;function o(s){return u;function u(c){return f3(a,s,c)}}}function b3(e){for(;!LR(e););return e}const Pk=/[\0\t\n\r]/g;function y3(){let e=1,t="",n=!0,a;return o;function o(s,u,c){const f=[];let g,h,m,E,S;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(u||void 0).decode(s)),m=0,t="",n&&(s.charCodeAt(0)===65279&&m++,n=void 0);m<s.length;){if(Pk.lastIndex=m,g=Pk.exec(s),E=g&&g.index!==void 0?g.index:s.length,S=s.charCodeAt(E),!g){t=s.slice(m);break}if(S===10&&m===E&&a)f.push(-3),a=void 0;else switch(a&&(f.push(-5),a=void 0),m<E&&(f.push(s.slice(m,E)),e+=E-m),S){case 0:{f.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,f.push(-2);e++<h;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:a=!0,e=1}m=E+1}return c&&(a&&f.push(-5),t&&f.push(t),f.push(null)),f}}const v3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function E3(e){return e.replace(v3,S3)}function S3(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),s=o===120||o===88;return RR(n.slice(s?2:1),s?16:10)}return zs(n)||e}const PR={}.hasOwnProperty;function x3(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),w3(n)(b3(h3(n).document().write(y3()(e,t,!0))))}function w3(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(ai),autolinkProtocol:Y,autolinkEmail:Y,atxHeading:s(Ie),blockQuote:s(ve),characterEscape:Y,characterReference:Y,codeFenced:s(Ce),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:s(Ce,u),codeText:s(je,u),codeTextData:Y,data:Y,codeFlowValue:Y,definition:s(qe),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:s(Qe),hardBreakEscape:s(kt),hardBreakTrailing:s(kt),htmlFlow:s(cn,u),htmlFlowData:Y,htmlText:s(cn,u),htmlTextData:Y,image:s(ml),label:u,link:s(ai),listItem:s(Ao),listItemValue:E,listOrdered:s(ii,m),listUnordered:s(ii),paragraph:s(Ed),reference:C,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:s(Ie),strong:s(Sd),thematicBreak:s(xd)},exit:{atxHeading:f(),atxHeadingSequence:U,autolink:f(),autolinkEmail:pe,autolinkProtocol:he,blockQuote:f(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:Q,characterReferenceMarkerNumeric:Q,characterReferenceValue:re,characterReference:oe,codeFenced:f(T),codeFencedFence:w,codeFencedFenceInfo:S,codeFencedFenceMeta:x,codeFlowValue:B,codeIndented:f(A),codeText:f(ee),codeTextData:B,data:B,definition:f(),definitionDestinationString:L,definitionLabelString:_,definitionTitleString:N,emphasis:f(),hardBreakEscape:f(X),hardBreakTrailing:f(X),htmlFlow:f(ne),htmlFlowData:B,htmlText:f(ie),htmlTextData:B,image:f(q),label:se,labelText:te,lineEnding:V,link:f(F),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:J,resourceDestinationString:I,resourceTitleString:M,resource:j,setextHeading:f($),setextHeadingLineSequence:P,setextHeadingText:D,strong:f(),thematicBreak:f()}};zR(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(ue){let me={type:"root",children:[]};const Ne={stack:[me],tokenStack:[],config:t,enter:c,exit:g,buffer:u,resume:h,data:n},Ue=[];let Xe=-1;for(;++Xe<ue.length;)if(ue[Xe][1].type==="listOrdered"||ue[Xe][1].type==="listUnordered")if(ue[Xe][0]==="enter")Ue.push(Xe);else{const dn=Ue.pop();Xe=o(ue,dn,Xe)}for(Xe=-1;++Xe<ue.length;){const dn=t[ue[Xe][0]];PR.call(dn,ue[Xe][1].type)&&dn[ue[Xe][1].type].call(Object.assign({sliceSerialize:ue[Xe][2].sliceSerialize},Ne),ue[Xe][1])}if(Ne.tokenStack.length>0){const dn=Ne.tokenStack[Ne.tokenStack.length-1];(dn[1]||zk).call(Ne,void 0,dn[0])}for(me.position={start:la(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:la(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<t.transforms.length;)me=t.transforms[Xe](me)||me;return me}function o(ue,me,Ne){let Ue=me-1,Xe=-1,dn=!1,dr,qt,wt,Jt;for(;++Ue<=Ne;){const at=ue[Ue];switch(at[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{at[0]==="enter"?Xe++:Xe--,Jt=void 0;break}case"lineEndingBlank":{at[0]==="enter"&&(dr&&!Jt&&!Xe&&!wt&&(wt=Ue),Jt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Jt=void 0}if(!Xe&&at[0]==="enter"&&at[1].type==="listItemPrefix"||Xe===-1&&at[0]==="exit"&&(at[1].type==="listUnordered"||at[1].type==="listOrdered")){if(dr){let Mr=Ue;for(qt=void 0;Mr--;){const Bn=ue[Mr];if(Bn[1].type==="lineEnding"||Bn[1].type==="lineEndingBlank"){if(Bn[0]==="exit")continue;qt&&(ue[qt][1].type="lineEndingBlank",dn=!0),Bn[1].type="lineEnding",qt=Mr}else if(!(Bn[1].type==="linePrefix"||Bn[1].type==="blockQuotePrefix"||Bn[1].type==="blockQuotePrefixWhitespaLine truncated
|
||||
`}]}function N3(e,t){const n=t.value?t.value+`
|
||||
`:"",a={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(a.className=["language-"+o[0]]);let s={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function C3(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function R3(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function I3(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),o=mo(a.toLowerCase()),s=e.footnoteOrder.indexOf(a);let u,c=e.footnoteCounts.get(a);c===void 0?(c=0,e.footnoteOrder.push(a),u=e.footnoteOrder.length):u=s+1,c+=1,e.footnoteCounts.set(a,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,f);const g={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,g),e.applyData(t,g)}function O3(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function D3(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function $R(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const o=e.all(t),s=o[0];s&&s.type==="text"?s.value="["+s.value:o.unshift({type:"text",value:"["});const u=o[o.length-1];return u&&u.type==="text"?u.value+=a:o.push({type:"text",value:a}),o}function L3(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return $R(e,t);const o={src:mo(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(o.title=a.title);const s={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,s),e.applyData(t,s)}function M3(e,t){const n={src:mo(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function j3(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function U3(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return $R(e,t);const o={href:mo(a.url||"")};a.title!==null&&a.title!==void 0&&(o.title=a.title);const s={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function F3(e,t){const n={href:mo(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function B3(e,t,n){const a=e.all(t),o=n?P3(n):GR(t),s={},u=[];if(typeof t.checked=="boolean"){const h=a[0];let m;h&&h.type==="element"&&h.tagName==="p"?m=h:(m={type:"element",tagName:"p",properties:{},children:[]},a.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let c=-1;for(;++c<a.length;){const h=a[c];(o||c!==0||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
|
||||
`}),h.type==="element"&&h.tagName==="p"&&!o?u.push(...h.children):u.push(h)}const f=a[a.length-1];f&&(o||f.type!=="element"||f.tagName!=="p")&&u.push({type:"text",value:`
|
||||
`});const g={type:"element",tagName:"li",properties:s,children:u};return e.patch(t,g),e.applyData(t,g)}function P3(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=GR(n[a])}return t}function GR(e){const t=e.spread;return t??e.children.length>1}function z3(e,t){const n={},a=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<a.length;){const u=a[o];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,s),e.applyData(t,s)}function $3(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function G3(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function H3(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function V3(e,t){const n=e.all(t),a=n.shift(),o=[];if(a){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],u),o.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=Vm(t.children[1]),f=xR(t.children[t.children.length-1]);c&&f&&(u.position={start:c,end:f}),o.push(u)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,s),e.applyData(t,s)}function q3(e,t,n){const a=n?n.children:void 0,s=(a?a.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,c=u?u.length:t.children.length;let f=-1;const g=[];for(;++f<c;){const m=t.children[f],E={},S=u?u[f]:void 0;S&&(E.align=S);let x={type:"element",tagName:s,properties:E,children:[]};m&&(x.children=e.all(m),e.patch(m,x),x=e.applyData(m,x)),g.push(x)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(g,!0)};return e.patch(t,h),e.applyData(t,h)}function Y3(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const $k=9,Gk=32;function W3(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),o=0;const s=[];for(;a;)s.push(Hk(t.slice(o,a.index),o>0,!0),a[0]),o=a.index+a[0].length,a=n.exec(t);return s.push(Hk(t.slice(o),o>0,!1)),s.join("")}function Hk(e,t,n){let a=0,o=e.length;if(t){let s=e.codePointAt(a);for(;s===$k||s===Gk;)a++,s=e.codePointAt(a)}if(n){let s=e.codePointAt(o-1);for(;s===$k||s===Gk;)o--,s=e.codePointAt(o-1)}return o>a?e.slice(a,o):""}function K3(e,t){const n={type:"text",value:W3(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function X3(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Z3={blockquote:k3,break:_3,code:N3,delete:C3,emphasis:R3,footnoteReference:I3,heading:O3,html:D3,imageReference:L3,image:M3,inlineCode:j3,linkReference:U3,link:F3,listItem:B3,list:z3,paragraph:$3,root:G3,strong:H3,table:V3,tableCell:Y3,tableRow:q3,text:K3,thematicBreak:X3,toml:zu,yaml:zu,definition:zu,footnoteDefinition:zu};function zu(){}const HR=-1,qc=0,Os=1,hc=2,Zm=3,Qm=4,Jm=5,eh=6,VR=7,qR=8,Vk=typeof self=="object"?self:globalThis,Q3=(e,t)=>{const n=(o,s)=>(e.set(s,o),o),a=o=>{if(e.has(o))return e.get(o);const[s,u]=t[o];switch(s){case qc:case HR:return n(u,o);case Os:{const c=n([],o);for(const f of u)c.push(a(f));return c}case hc:{const c=n({},o);for(const[f,g]of u)c[a(f)]=a(g);return c}case Zm:return n(new Date(u),o);case Qm:{const{source:c,flags:f}=u;return n(new RegExp(c,f),o)}case Jm:{const c=n(new Map,o);for(const[f,g]of u)c.set(a(f),a(g));return c}case eh:{const c=n(new Set,o);for(const f of u)c.add(a(f));return c}case VR:{const{name:c,message:f}=u;return n(new Vk[c](f),o)}case qR:return n(BigInt(u),o);case"BigInt":return n(Object(BigInt(u)),o);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:c}=new Uint8Array(u);return n(new DataView(c),u)}}return n(new Vk[s](u),o)};return a},qk=e=>Q3(new Map,e)(0),Wi="",{toString:J3}={},{keys:e4}=Object,ws=e=>{const t=typeof e;if(t!=="object"||!e)return[qc,t];const n=J3.call(e).slice(8,-1);switch(n){case"Array":return[Os,Wi];case"Object":return[hc,Wi];case"Date":return[Zm,Wi];case"RegExp":return[Qm,Wi];case"Map":return[Jm,Wi];case"Set":return[eh,Wi];case"DataView":return[Os,n]}return n.includes("Array")?[Os,n]:n.includes("Error")?[VR,n]:[hc,n]},$u=([e,t])=>e===qc&&(t==="function"||t==="symbol"),t4=(e,t,n,a)=>{const o=(u,c)=>{const f=a.push(u)-1;return n.set(c,f),f},s=u=>{if(n.has(u))return n.get(u);let[c,f]=ws(u);switch(c){case qc:{let h=u;switch(f){case"bigint":c=qR,h=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);h=null;break;case"undefined":return o([HR],u)}return o([c,h],u)}case Os:{if(f){let E=u;return f==="DataView"?E=new Uint8Array(u.buffer):f==="ArrayBuffer"&&(E=new Uint8Array(
Line truncated
|
||||
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
||||
`}]}}const Yc=(function(e){if(e==null)return l4;if(typeof e=="function")return Wc(e);if(typeof e=="object")return Array.isArray(e)?i4(e):o4(e);if(typeof e=="string")return s4(e);throw new Error("Expected function, string, or object as test")});function i4(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Yc(e[n]);return Wc(a);function a(...o){let s=-1;for(;++s<t.length;)if(t[s].apply(this,o))return!0;return!1}}function o4(e){const t=e;return Wc(n);function n(a){const o=a;let s;for(s in e)if(o[s]!==t[s])return!1;return!0}}function s4(e){return Wc(t);function t(n){return n&&n.type===e}}function Wc(e){return t;function t(n,a,o){return!!(u4(n)&&e.call(this,n,typeof a=="number"?a:void 0,o||void 0))}}function l4(){return!0}function u4(e){return e!==null&&typeof e=="object"&&"type"in e}const YR=[],c4=!0,Pg=!1,d4="skip";function WR(e,t,n,a){let o;typeof t=="function"&&typeof n!="function"?(a=n,n=t):o=t;const s=Yc(o),u=a?-1:1;c(e,void 0,[])();function c(f,g,h){const m=f&&typeof f=="object"?f:{};if(typeof m.type=="string"){const S=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(E,"name",{value:"node ("+(f.type+(S?"<"+S+">":""))+")"})}return E;function E(){let S=YR,x,w,T;if((!t||s(f,g,h[h.length-1]||void 0))&&(S=p4(n(f,h)),S[0]===Pg))return S;if("children"in f&&f.children){const A=f;if(A.children&&S[0]!==d4)for(w=(a?A.children.length:-1)+u,T=h.concat(A);w>-1&&w<A.children.length;){const _=A.children[w];if(x=c(_,w,T)(),x[0]===Pg)return x;w=typeof x[1]=="number"?x[1]:w+u}}return S}}}function p4(e){return Array.isArray(e)?e:typeof e=="number"?[c4,e]:e==null?YR:[e]}function th(e,t,n,a){let o,s,u;typeof t=="function"&&typeof n!="function"?(s=void 0,u=t,o=n):(s=t,u=n,o=a),WR(e,s,c,o);function c(f,g){const h=g[g.length-1],m=h?h.children.indexOf(f):void 0;return u(f,m,h)}}const zg={}.hasOwnProperty,f4={};function g4(e,t){const n=t||f4,a=new Map,o=new Map,s=new Map,u={...Z3,...n.handlers},c={all:g,applyData:h4,definitionById:a,footnoteById:o,footnoteCounts:s,footnoteOrder:[],handlers:u,one:f,options:n,patch:m4,wrap:y4};return th(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const m=h.type==="definition"?a:o,E=String(h.identifier).toUpperCase();m.has(E)||m.set(E,h)}}),c;function f(h,m){const E=h.type,S=c.handlers[E];if(zg.call(c.handlers,E)&&S)return S(c,h,m);if(c.options.passThrough&&c.options.passThrough.includes(E)){if("children"in h){const{children:w,...T}=h,A=bc(T);return A.children=c.all(h),A}return bc(h)}return(c.options.unknownHandler||b4)(c,h,m)}function g(h){const m=[];if("children"in h){const E=h.children;let S=-1;for(;++S<E.length;){const x=c.one(E[S],h);if(x){if(S&&E[S-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=Wk(x.value)),!Array.isArray(x)&&x.type==="element")){const w=x.children[0];w&&w.type==="text"&&(w.value=Wk(w.value))}Array.isArray(x)?m.push(...x):m.push(x)}}}return m}}function m4(e,t){e.position&&(t.position=rz(e))}function h4(e,t){let n=t;if(e&&e.data){const a=e.data.hName,o=e.data.hChildren,s=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const u="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:u}}n.type==="element"&&s&&Object.assign(n.properties,bc(s)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function b4(e,t){const n=t.data||{},a="value"in t&&!(zg.call(n,"hProperties")||zg.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function y4(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
|
||||
`});++a<e.length;)a&&n.push({type:"text",value:`
|
||||
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
||||
`}),n}function Wk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Kk(e,t){const n=g4(e,t),a=n.one(e,void 0),o=a4(n),s=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return o&&s.children.push({type:"text",value:`
|
||||
`},o),s}function v4(e,t){return e&&"run"in e?async function(n,a){const o=Kk(n,{file:a,...t});await e.run(o,a)}:function(n,a){return Kk(n,{file:a,...e||t})}}function Xk(e){if(e)throw e}var og,Zk;function E4(){if(Zk)return og;Zk=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(g){return typeof Array.isArray=="function"?Array.isArray(g):t.call(g)==="[object Array]"},s=function(g){if(!g||t.call(g)!=="[object Object]")return!1;var h=e.call(g,"constructor"),m=g.constructor&&g.constructor.prototype&&e.call(g.constructor.prototype,"isPrototypeOf");if(g.constructor&&!h&&!m)return!1;var E;for(E in g);return typeof E>"u"||e.call(g,E)},u=function(g,h){n&&h.name==="__proto__"?n(g,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):g[h.name]=h.newValue},c=function(g,h){if(h==="__proto__")if(e.call(g,h)){if(a)return a(g,h).value}else return;return g[h]};return og=function f(){var g,h,m,E,S,x,w=arguments[0],T=1,A=arguments.length,_=!1;for(typeof w=="boolean"&&(_=w,w=arguments[1]||{},T=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});T<A;++T)if(g=arguments[T],g!=null)for(h in g)m=c(w,h),E=c(g,h),w!==E&&(_&&E&&(s(E)||(S=o(E)))?(S?(S=!1,x=m&&o(m)?m:[]):x=m&&s(m)?m:{},u(w,{name:h,newValue:f(_,x,E)})):typeof E<"u"&&u(w,{name:h,newValue:E}));return w},og}var S4=E4();const sg=wc(S4);function $g(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function x4(){const e=[],t={run:n,use:a};return t;function n(...o){let s=-1;const u=o.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);c(null,...o);function c(f,...g){const h=e[++s];let m=-1;if(f){u(f);return}for(;++m<o.length;)(g[m]===null||g[m]===void 0)&&(g[m]=o[m]);o=g,h?w4(h,c)(...g):u(null,...g)}}function a(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function w4(e,t){let n;return a;function a(...u){const c=e.length>u.length;let f;c&&u.push(o);try{f=e.apply(this,u)}catch(g){const h=g;if(c&&n)throw h;return o(h)}c||(f&&f.then&&typeof f.then=="function"?f.then(s,o):f instanceof Error?o(f):s(f))}function o(u,...c){n||(n=!0,t(u,...c))}function s(u){o(null,u)}}const rr={basename:T4,dirname:A4,extname:k4,join:_4,sep:"/"};function T4(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');al(e);let n=0,a=-1,o=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else a<0&&(s=!0,a=o+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let u=-1,c=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else u<0&&(s=!0,u=o+1),c>-1&&(e.codePointAt(o)===t.codePointAt(c--)?c<0&&(a=o):(c=-1,a=u));return n===a?a=u:a<0&&(a=e.length),e.slice(n,a)}function A4(e){if(al(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function k4(e){al(e);let t=e.length,n=-1,a=0,o=-1,s=0,u;for(;t--;){const c=e.codePointAt(t);if(c===47){if(u){a=t+1;break}continue}n<0&&(u=!0,n=t+1),c===46?o<0?o=t:s!==1&&(s=1):o>-1&&(s=-1)}return o<0||n<0||s===0||s===1&&o===n-1&&o===a+1?"":e.slice(o,n)}function _4(...e){let t=-1,n;for(;++t<e.length;)al(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":N4(n)}function N4(e){al(e);const t=e.codePointAt(0)===47;let n=C4(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function C4(e,t){let n="",a=0,o=-1,s=0,u=-1,c,f;for(;++u<=e.length;){if(u<e.length)c=e.codePointAt(u);else{if(c===47)break;c=47}if(c===47){if(!(o===u-1||s===1))if(o!==u-1&&s===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",a=0):(n=n.slice(0,f),a=n.length-1-n.lastIndexOf("/")),o=u,s=0;continue}}else if(n.length>0){n="",a=0,o=u,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(o+1,u):n=e.slice(o+1,u),a=u-o-1;o=u,s=0}else c===46&&s>-1?s++:s=-1}return n}function al(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const R4={cwd:I4};function I4(){return"/"}function Gg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function O4(e){if(typeof e=="string")e=new URL(e);else if(!Gg(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return D4(e)}function D4(e){if(e.hostname!==""){consLine truncated
|
||||
`:" ")+s.indentLines(s.containerFlow(a,c.current()),t?JR:xG))),g(),f}}function xG(e,t,n){return t===0?e:JR(e,t,n)}function JR(e,t,n){return(n?"":" ")+e}const wG=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];e0.peek=NG;function TG(){return{canContainEols:["delete"],enter:{strikethrough:kG},exit:{strikethrough:_G}}}function AG(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:wG}],handlers:{delete:e0}}}function kG(e){this.enter({type:"delete",children:[]},e)}function _G(e){this.exit(e)}function e0(e,t,n,a){const o=n.createTracker(a),s=n.enter("strikethrough");let u=o.move("~~");return u+=n.containerPhrasing(e,{...o.current(),before:u,after:"~"}),u+=o.move("~~"),s(),u}function NG(){return"~"}function CG(e){return e.length}function RG(e,t){const n=t||{},a=(n.align||[]).concat(),o=n.stringLength||CG,s=[],u=[],c=[],f=[];let g=0,h=-1;for(;++h<e.length;){const w=[],T=[];let A=-1;for(e[h].length>g&&(g=e[h].length);++A<e[h].length;){const _=IG(e[h][A]);if(n.alignDelimiters!==!1){const N=o(_);T[A]=N,(f[A]===void 0||N>f[A])&&(f[A]=N)}w.push(_)}u[h]=w,c[h]=T}let m=-1;if(typeof a=="object"&&"length"in a)for(;++m<g;)s[m]=a_(a[m]);else{const w=a_(a);for(;++m<g;)s[m]=w}m=-1;const E=[],S=[];for(;++m<g;){const w=s[m];let T="",A="";w===99?(T=":",A=":"):w===108?T=":":w===114&&(A=":");let _=n.alignDelimiters===!1?1:Math.max(1,f[m]-T.length-A.length);const N=T+"-".repeat(_)+A;n.alignDelimiters!==!1&&(_=T.length+_+A.length,_>f[m]&&(f[m]=_),S[m]=_),E[m]=N}u.splice(1,0,E),c.splice(1,0,S),h=-1;const x=[];for(;++h<u.length;){const w=u[h],T=c[h];m=-1;const A=[];for(;++m<g;){const _=w[m]||"";let N="",L="";if(n.alignDelimiters!==!1){const U=f[m]-(T[m]||0),D=s[m];D===114?N=" ".repeat(U):D===99?U%2?(N=" ".repeat(U/2+.5),L=" ".repeat(U/2-.5)):(N=" ".repeat(U/2),L=N):L=" ".repeat(U)}n.delimiterStart!==!1&&!m&&A.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&_==="")&&(n.delimiterStart!==!1||m)&&A.push(" "),n.alignDelimiters!==!1&&A.push(N),A.push(_),n.alignDelimiters!==!1&&A.push(L),n.padding!==!1&&A.push(" "),(n.delimiterEnd!==!1||m!==g-1)&&A.push("|")}x.push(n.delimiterEnd===!1?A.join("").replace(/ +$/,""):A.join(""))}return x.join(`
|
||||
`)}function IG(e){return e==null?"":String(e)}function a_(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function OG(e,t,n,a){const o=n.enter("blockquote"),s=n.createTracker(a);s.move("> "),s.shift(2);const u=n.indentLines(n.containerFlow(e,s.current()),DG);return o(),u}function DG(e,t,n){return">"+(n?"":" ")+e}function LG(e,t){return i_(e,t.inConstruct,!0)&&!i_(e,t.notInConstruct,!1)}function i_(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function o_(e,t,n,a){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
|
||||
`&&LG(n.stack,n.unsafe[o]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
||||
`}function MG(e,t){const n=String(e);let a=n.indexOf(t),o=a,s=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===o?++s>u&&(u=s):s=1,o=a+t.length,a=n.indexOf(t,o);return u}function jG(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function UG(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function FG(e,t,n,a){const o=UG(n),s=e.value||"",u=o==="`"?"GraveAccent":"Tilde";if(jG(e,n)){const m=n.enter("codeIndented"),E=n.indentLines(s,BG);return m(),E}const c=n.createTracker(a),f=o.repeat(Math.max(MG(s,o)+1,3)),g=n.enter("codeFenced");let h=c.move(f);if(e.lang){const m=n.enter(`codeFencedLang${u}`);h+=c.move(n.safe(e.lang,{before:h,after:" ",encode:["`"],...c.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${u}`);h+=c.move(" "),h+=c.move(n.safe(e.meta,{before:h,after:`
|
||||
`,encode:["`"],...c.current()})),m()}return h+=c.move(`
|
||||
`),s&&(h+=c.move(s+`
|
||||
`)),h+=c.move(f),g(),h}function BG(e,t,n){return(n?"":" ")+e}function rh(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function PG(e,t,n,a){const o=rh(n),s=o==='"'?"Quote":"Apostrophe",u=n.enter("definition");let c=n.enter("label");const f=n.createTracker(a);let g=f.move("[");return g+=f.move(n.safe(n.associationId(e),{before:g,after:"]",...f.current()})),g+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),g+=f.move("<"),g+=f.move(n.safe(e.url,{before:g,after:">",...f.current()})),g+=f.move(">")):(c=n.enter("destinationRaw"),g+=f.move(n.safe(e.url,{before:g,after:e.title?" ":`
|
||||
`,...f.current()}))),c(),e.title&&(c=n.enter(`title${s}`),g+=f.move(" "+o),g+=f.move(n.safe(e.title,{before:g,after:o,...f.current()})),g+=f.move(o),c()),u(),g}function zG(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function $s(e){return"&#x"+e.toString(16).toUpperCase()+";"}function yc(e,t,n){const a=io(e),o=io(t);return a===void 0?o===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}t0.peek=$G;function t0(e,t,n,a){const o=zG(n),s=n.enter("emphasis"),u=n.createTracker(a),c=u.move(o);let f=u.move(n.containerPhrasing(e,{after:o,before:c,...u.current()}));const g=f.charCodeAt(0),h=yc(a.before.charCodeAt(a.before.length-1),g,o);h.inside&&(f=$s(g)+f.slice(1));const m=f.charCodeAt(f.length-1),E=yc(a.after.charCodeAt(0),m,o);E.inside&&(f=f.slice(0,-1)+$s(m));const S=u.move(o);return s(),n.attentionEncodeSurroundingInfo={after:E.outside,before:h.outside},c+f+S}function $G(e,t,n){return n.options.emphasis||"*"}function GG(e,t){let n=!1;return th(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Pg}),!!((!e.depth||e.depth<3)&&Km(e)&&(t.options.setext||n))}function HG(e,t,n,a){const o=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(a);if(GG(e,n)){const h=n.enter("headingSetext"),m=n.enter("phrasing"),E=n.containerPhrasing(e,{...s.current(),before:`
|
||||
`,after:`
|
||||
`});return m(),h(),E+`
|
||||
`+(o===1?"=":"-").repeat(E.length-(Math.max(E.lastIndexOf("\r"),E.lastIndexOf(`
|
||||
`))+1))}const u="#".repeat(o),c=n.enter("headingAtx"),f=n.enter("phrasing");s.move(u+" ");let g=n.containerPhrasing(e,{before:"# ",after:`
|
||||
`,...s.current()});return/^[\t ]/.test(g)&&(g=$s(g.charCodeAt(0))+g.slice(1)),g=g?u+" "+g:u,n.options.closeAtx&&(g+=" "+u),f(),c(),g}n0.peek=VG;function n0(e){return e.value||""}function VG(){return"<"}r0.peek=qG;function r0(e,t,n,a){const o=rh(n),s=o==='"'?"Quote":"Apostrophe",u=n.enter("image");let c=n.enter("label");const f=n.createTracker(a);let g=f.move("![");return g+=f.move(n.safe(e.alt,{before:g,after:"]",...f.current()})),g+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),g+=f.move("<"),g+=f.move(n.safe(e.url,{before:g,after:">",...f.current()})),g+=f.move(">")):(c=n.enter("destinationRaw"),g+=f.move(n.safe(e.url,{before:g,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=n.enter(`title${s}`),g+=f.move(" "+o),g+=f.move(n.safe(e.title,{before:g,after:o,...f.current()})),g+=f.move(o),c()),g+=f.move(")"),u(),g}function qG(){return"!"}a0.peek=YG;function a0(e,t,n,a){const o=e.referenceType,s=n.enter("imageReference");let u=n.enter("label");const c=n.createTracker(a);let f=c.move("![");const g=n.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(g+"]["),u();const h=n.stack;n.stack=[],u=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return u(),n.stack=h,s(),o==="full"||!g||g!==m?f+=c.move(m+"]"):o==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function YG(){return"!"}i0.peek=WG;function i0(e,t,n){let a=e.value||"",o="`",s=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(a);)o+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++s<n.unsafe.length;){const u=n.unsafe[s],c=n.compilePattern(u);let f;if(u.atBreak)for(;f=c.exec(a);){let g=f.index;a.charCodeAt(g)===10&&a.charCodeAt(g-1)===13&&g--,a=a.slice(0,g)+" "+a.slice(f.index+1)}}return o+a+o}function WG(){return"`"}function o0(e,t){const n=Km(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}s0.peek=KG;function s0(e,t,n,a){const o=rh(n),s=o==='"'?"Quote":"Apostrophe",u=n.createTracker(a);let c,f;if(o0(e,n)){const h=n.stack;n.stack=[],c=n.enter("autolink");let m=u.move("<");return m+=u.move(n.containerPhrasing(e,{before:m,after:">",...u.current()})),m+=u.move(">"),c(),n.stack=h,m}c=n.enter("link"),f=n.enter("label");let g=u.move("[");return g+=u.move(n.containerPhrasing(e,{before:g,after:"](",...u.current()})),g+=u.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),g+=u.move("<"),g+=u.move(n.safe(e.url,{before:g,after:">",...u.current()})),g+=u.move(">")):(f=n.enter("destinationRaw"),g+=u.move(n.safe(e.url,{before:g,after:e.title?" ":")",...u.current()}))),f(),e.title&&(f=n.enter(`title${s}`),g+=u.move(" "+o),g+=u.move(n.safe(e.title,{before:g,after:o,...u.current()})),g+=u.move(o),f()),g+=u.move(")"),c(),g}function KG(e,t,n){return o0(e,n)?"<":"["}l0.peek=XG;function l0(e,t,n,a){const o=e.referenceType,s=n.enter("linkReference");let u=n.enter("label");const c=n.createTracker(a);let f=c.move("[");const g=n.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(g+"]["),u();const h=n.stack;n.stack=[],u=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return u(),n.stack=h,s(),o==="full"||!g||g!==m?f+=c.move(m+"]"):o==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function XG(){return"["}function ah(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function ZG(e){const t=ah(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function QG(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function u0(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function JG(e,t,n,a){const o=n.enter("list"),s=n.bulletCurrent;let u=e.ordered?QG(n):ah(n);const c=e.ordered?u==="."?")":".":ZG(n);let f=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),u0(n)===u&&h){let m=-1;for(;++m<e.chilLine truncated
|
||||
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:E,table:u,tableCell:f,tableRow:c}};function u(S,x,w,T){return g(h(S,w,T),S.align)}function c(S,x,w,T){const A=m(S,w,T),_=g([A]);return _.slice(0,_.indexOf(`
|
||||
`))}function f(S,x,w,T){const A=w.enter("tableCell"),_=w.enter("phrasing"),N=w.containerPhrasing(S,{...T,before:s,after:s});return _(),A(),N}function g(S,x){return RG(S,{align:x,alignDelimiters:a,padding:n,stringLength:o})}function h(S,x,w){const T=S.children;let A=-1;const _=[],N=x.enter("table");for(;++A<T.length;)_[A]=m(T[A],x,w);return N(),_}function m(S,x,w){const T=S.children;let A=-1;const _=[],N=x.enter("tableRow");for(;++A<T.length;)_[A]=f(T[A],S,x,w);return N(),_}function E(S,x,w){let T=d0.inlineCode(S,x,w);return w.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function bH(){return{exit:{taskListCheckValueChecked:l_,taskListCheckValueUnchecked:l_,paragraph:vH}}}function yH(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:EH}}}function l_(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function vH(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const o=t.children;let s=-1,u;for(;++s<o.length;){const c=o[s];if(c.type==="paragraph"){u=c;break}}u===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function EH(e,t,n,a){const o=e.children[0],s=typeof e.checked=="boolean"&&o&&o.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",c=n.createTracker(a);s&&c.move(u);let f=d0.listItem(e,t,n,{...a,...c.current()});return s&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,g)),f;function g(h){return h+u}}function SH(){return[J4(),EG(),TG(),cH(),bH()]}function xH(e){return{extensions:[eG(),SG(e),AG(),hH(e),yH()]}}const wH={tokenize:CH,partial:!0},p0={tokenize:RH,partial:!0},f0={tokenize:IH,partial:!0},g0={tokenize:OH,partial:!0},TH={tokenize:DH,partial:!0},m0={name:"wwwAutolink",tokenize:_H,previous:b0},h0={name:"protocolAutolink",tokenize:NH,previous:y0},Lr={name:"emailAutolink",tokenize:kH,previous:v0},ur={};function AH(){return{text:ur}}let Ha=48;for(;Ha<123;)ur[Ha]=Lr,Ha++,Ha===58?Ha=65:Ha===91&&(Ha=97);ur[43]=Lr;ur[45]=Lr;ur[46]=Lr;ur[95]=Lr;ur[72]=[Lr,h0];ur[104]=[Lr,h0];ur[87]=[Lr,m0];ur[119]=[Lr,m0];function kH(e,t,n){const a=this;let o,s;return u;function u(m){return!Hg(m)||!v0.call(a,a.previous)||ih(a.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(m))}function c(m){return Hg(m)?(e.consume(m),c):m===64?(e.consume(m),f):n(m)}function f(m){return m===46?e.check(TH,h,g)(m):m===45||m===95||zt(m)?(s=!0,e.consume(m),f):h(m)}function g(m){return e.consume(m),o=!0,f}function h(m){return s&&o&&Kt(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function _H(e,t,n){const a=this;return o;function o(u){return u!==87&&u!==119||!b0.call(a,a.previous)||ih(a.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(wH,e.attempt(p0,e.attempt(f0,s),n),n)(u))}function s(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function NH(e,t,n){const a=this;let o="",s=!1;return u;function u(m){return(m===72||m===104)&&y0.call(a,a.previous)&&!ih(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(m),e.consume(m),c):n(m)}function c(m){if(Kt(m)&&o.length<5)return o+=String.fromCodePoint(m),e.consume(m),c;if(m===58){const E=o.toLowerCase();if(E==="http"||E==="https")return e.consume(m),f}return n(m)}function f(m){return m===47?(e.consume(m),s?g:(s=!0,f)):n(m)}function g(m){return m===null||mc(m)||ot(m)||Ka(m)||Hc(m)?n(m):e.attempt(p0,e.attempt(f0,h),n)(m)}function h(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function CH(e,t,n){let a=0;return o;function o(u){return(u===87||u===119)&&a<3?(a++,e.consume(u),o):u===46&&a===3?(e.consume(u),s):n(u)}function s(u){return u===null?n(u):t(u)}}function RH(e,t,n){let a,o,s;return u;function u(g){return g===46||g===95?e.check(g0,f,c)(g):g===null||ot(g)||Ka(g)||g!==45&&Hc(g)?f(g):(s=!0,e.consume(g),u)}function c(g){return g===95?a=!0:(o=a,a=void 0),e.consume(g),u}function f(g){return o||a||!s?n(g):t(g)}}function IH(e,t){let n=0,a=0;return o;function o(u){return u===40?(n++,e.consume(u),o):u===41&&a<n?s(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(g0,t,s)(u):u===null||ot(u)||Ka(u)?t(u):(e.consume(u),o)}function s(u){return u===41&&a++,e.consume(u),o}}function OH(e,t,n){return a;function a(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),a):c===38?(e.consume(c),s):c===93?(e.consume(c),o):c===60||c===null||ot(c)||Ka(c)?t(c):n(c)}function o(c){return c===null||c===40||c===91||ot(c)||Ka(c)?t(c):a(c)}function s(c){return Kt(c)?u(c):n(c)}function u(c){re
Line truncated
|
||||
`),n=[];let a=0;for(;a<t.length;){const o=t[a].match(/^===\s+"([^"]+)"\s*$/);if(!o){n.push(t[a]),a++;continue}const s=o[1];for(a++;a<t.length&&t[a].trim()==="";)a++;const u=[];for(;a<t.length&&!(/^===\s+"[^"]+"\s*$/.test(t[a])||t[a].trim()===""&&a+1<t.length&&/^===\s+"[^"]+"\s*$/.test(t[a+1]));){if(t[a].startsWith(" ")||t[a].trimStart().startsWith("```")){u.push(t[a].replace(/^ /,"")),a++;continue}if(u.length>0&&t[a].trim()===""){u.push(""),a++;continue}break}n.push(`### ${p5}${s}`),n.push(""),n.push(...u),n.push("")}return n.join(`
|
||||
`)}function h5(e){let t=g5(e);return t=f5(t),t=m5(t),t}const b5="modulepreload",y5=function(e){return"/"+e},d_={},Vg=function(t,n,a){let o=Promise.resolve();if(n&&n.length>0){let f=function(g){return Promise.all(g.map(h=>Promise.resolve(h).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),c=u?.nonce||u?.getAttribute("nonce");o=f(n.map(g=>{if(g=y5(g),g in d_)return;d_[g]=!0;const h=g.endsWith(".css"),m=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${m}`))return;const E=document.createElement("link");if(E.rel=h?"stylesheet":b5,h||(E.as="script"),E.crossOrigin="",E.href=g,c&&E.setAttribute("nonce",c),document.head.appendChild(E),h)return new Promise((S,x)=>{E.addEventListener("load",S),E.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${g}`)))})}))}function s(u){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=u,window.dispatchEvent(c),!c.defaultPrevented)throw u}return o.then(u=>{for(const c of u||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})},v5={theme:"base",themeVariables:{background:"transparent",mainBkg:"#0d9488",primaryColor:"#0d9488",primaryBorderColor:"#14b8a6",primaryTextColor:"#ffffff",secondaryColor:"#6366f1",secondaryBorderColor:"#818cf8",secondaryTextColor:"#ffffff",tertiaryColor:"#e11d48",tertiaryBorderColor:"#fb7185",tertiaryTextColor:"#ffffff",textColor:"#f1f5f9",labelTextColor:"#f1f5f9",lineColor:"#94a3b8",arrowheadColor:"#cbd5e1",nodeBorder:"#14b8a6",clusterBkg:"rgba(13, 148, 136, 0.08)",clusterBorder:"rgba(20, 184, 166, 0.4)",defaultLinkColor:"#94a3b8",edgeLabelBackground:"rgba(15, 23, 42, 0.85)",nodeTextColor:"#ffffff",actorBkg:"#0d9488",actorBorder:"#14b8a6",actorTextColor:"#ffffff",actorLineColor:"#64748b",signalColor:"#cbd5e1",signalTextColor:"#f1f5f9",activationBorderColor:"#14b8a6",activationBkgColor:"rgba(13, 148, 136, 0.2)",sequenceNumberColor:"#ffffff",noteBkgColor:"rgba(99, 102, 241, 0.2)",noteBorderColor:"#818cf8",noteTextColor:"#f1f5f9",titleColor:"#f8fafc",fontFamily:'"Inter", system-ui, -apple-system, sans-serif',fontSize:"16px"}},E5={theme:"base",themeVariables:{background:"transparent",mainBkg:"#0d9488",primaryColor:"#0d9488",primaryBorderColor:"#0f766e",primaryTextColor:"#ffffff",secondaryColor:"#6366f1",secondaryBorderColor:"#4f46e5",secondaryTextColor:"#ffffff",tertiaryColor:"#e11d48",tertiaryBorderColor:"#be123c",tertiaryTextColor:"#ffffff",textColor:"#1e293b",labelTextColor:"#334155",lineColor:"#94a3b8",arrowheadColor:"#64748b",nodeBorder:"#0f766e",clusterBkg:"rgba(13, 148, 136, 0.06)",clusterBorder:"rgba(15, 118, 110, 0.3)",defaultLinkColor:"#94a3b8",edgeLabelBackground:"rgba(255, 255, 255, 0.9)",nodeTextColor:"#ffffff",actorBkg:"#0d9488",actorBorder:"#0f766e",actorTextColor:"#ffffff",actorLineColor:"#cbd5e1",signalColor:"#64748b",signalTextColor:"#1e293b",noteBkgColor:"rgba(99, 102, 241, 0.1)",noteBorderColor:"#6366f1",noteTextColor:"#1e293b",titleColor:"#0f172a",fontFamily:'"Inter", system-ui, -apple-system, sans-serif',fontSize:"16px"}};function S5(){return document.documentElement.classList.contains("dark")}function x5(e){return{startOnLoad:!1,securityLevel:"strict",...e?v5:E5,flowchart:{useMaxWidth:!0,htmlLabels:!0,curve:"basis"},sequence:{useMaxWidth:!0,wrap:!0},er:{useMaxWidth:!0},gantt:{useMaxWidth:!0}}}function w5(e,t){const n=Math.max(Math.floor(t),320);return e.replace(/<svg([^>]*)>/,(a,o)=>`<svg${o.replace(/\swidth="[^"]*"/g,"").replace(/\sheight="[^"]*"/g,"").replace(/\sstyle="[^"]*"/g,"")} width="${n}" style="width:100%;max-width:100%;height:auto;display:block;">`)}let p_=0;function T5(e){return p_+=1,`mermaid-${e.replace(/:/g,"")}-${p_}`}function yg({chart:e}){const t=v.useId(),n=v.useRef(null),a=v.useRef(null),o=v.useRef(void 0),[s,u]=v.useState("loading"),[c,f]=v.useState(""),[g,h]=v.useState("");return v.useEffect(()=>{const m=n.current;if(!m)return;let E=!1;const S=async()=>{u("loading"),f(""),h("");const T=(await Vg(async()=>{const{default:L}=await import("./mermaid.core.js").then(U=>U.cb);return{default:L}},[])).default;T.initialize(x5(S5()));const A=getComputedStyle(m),_=parseFloat(A.paddingLeft)+parseFloat(A.paddingRight),N=m.clientWidth-_;try{const{svg:L,bindFunctions:U}=await T.render(T5(t),e);if(E)return;o.current=U,h(w5(L,N)),u("ready")}catch(L){if(E)return;u("error"),f(L instanceof Error?L.message:"Failed to render diagram")}};S();const x=new ResizeObserver(()=>{S()});x.observe(m);const w=new MutationObserver(()=>{S()});return w.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>{E=!0,x.disconnect(),w.disconnect()}},[e,t]),v.useEffect(()=>{s!=="ready"||!a.current||o.current?.(a.current)},[s,g]),s==="error"?p.jsx("pre",{className:"mermaid-diagram mermaid-error text-destructive text-sm my-4 p-4 rounded-lg border border-destructive/30 bg-destructive/5 overflow-x-auto",children:c}):p.jsxs("div",{ref:n,className:`mermaiLine truncated
|
||||
`)===-1?p.jsx("code",{className:"bg-primary/10 text-primary px-1.5 py-0.5 rounded text-sm font-mono",children:A}):p.jsx("code",{className:`block font-mono text-foreground ${T??""}`,children:A}),pre:({children:T})=>{if(v.isValidElement(T)&&T.type===yg)return T;const A=S(T);return A?p.jsx(yg,{chart:A}):p.jsx("pre",{className:"bg-muted text-foreground border border-border p-4 rounded-lg text-sm overflow-auto my-4 font-mono whitespace-pre",children:T})},table:({children:T})=>p.jsx("div",{className:"overflow-auto my-4",children:p.jsx("table",{className:"w-full border-collapse text-sm",children:T})}),thead:({children:T})=>p.jsx("thead",{className:"bg-muted/50",children:T}),tr:({children:T})=>p.jsx("tr",{className:"border-b",children:T}),th:({children:T})=>p.jsx("th",{className:"px-4 py-2 text-left font-medium",children:T}),td:({children:T})=>p.jsx("td",{className:"px-4 py-2 text-foreground",children:T}),hr:()=>p.jsx("hr",{className:"my-6 border-border"}),strong:({children:T})=>p.jsx("strong",{className:"font-semibold text-foreground",children:T}),em:({children:T})=>p.jsx("em",{children:T})},w=u===Pt(a)&&o.length>0;return n?p.jsx("main",{id:"main-content",className:"docs-main flex-1 min-w-0",children:p.jsxs("div",{className:"docs-main-inner mx-auto w-full max-w-[720px] px-6 py-8 lg:px-8",children:[p.jsx(B5,{selectedItem:n}),f&&p.jsx("div",{className:"text-muted-foreground animate-pulse",children:"Loading content..."}),w&&p.jsx("article",{ref:h,className:"prose prose-neutral dark:prose-invert max-w-none prose-pre:bg-muted prose-pre:text-foreground prose-code:text-foreground",children:p.jsx(XR,{remarkPlugins:[E0],components:x,children:o})},a),!f&&!w&&u===Pt(a)&&p.jsx("div",{className:"bg-muted/50 border rounded-lg p-6",children:p.jsxs("p",{className:"text-muted-foreground",children:["Content for ",p.jsx("strong",{className:"text-primary",children:n.title})," would be displayed here."]})})]})}):p.jsx("main",{id:"main-content",className:"docs-main flex-1 min-w-0",children:p.jsxs("div",{className:"docs-main-inner mx-auto w-full max-w-[720px] px-6 py-8 lg:px-8",children:[p.jsx("h1",{className:"text-4xl font-bold tracking-tight mb-4",children:e.site?.title||"Documentation"}),p.jsx("p",{className:"text-muted-foreground text-lg mb-8",children:e.site?.description||"Welcome to the documentation."}),p.jsx(Ns,{className:"my-8"}),p.jsx("h2",{className:"text-2xl font-semibold mb-4 text-primary",children:"Theme Configuration"}),p.jsxs("div",{className:"bg-muted/50 border rounded-lg p-4 mb-6",children:[p.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:p.jsx("strong",{children:"Current theme from YAML:"})}),p.jsx("pre",{className:"bg-muted text-foreground border border-border p-3 rounded-lg text-sm overflow-auto",children:`site:
|
||||
theme:
|
||||
preset: "${m?.preset||"zinc"}"
|
||||
radius: "${m?.radius||"md"}"
|
||||
darkMode: ${m?.darkMode!==!1}`})]}),p.jsx("h3",{className:"text-lg font-medium mb-3",children:"Available Presets"}),p.jsx("div",{className:"flex flex-wrap gap-2 mb-6",children:Object.keys(KL).map(T=>p.jsx("span",{className:`px-3 py-1 rounded-full text-sm ${T===(m?.preset||"zinc")?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:T},T))}),p.jsxs("p",{className:"text-muted-foreground mb-4",children:[p.jsx("strong",{children:"Click any item in the sidebar"})," to navigate."]}),p.jsx("h2",{className:"text-2xl font-semibold mt-8 mb-4",children:"Routes"}),p.jsxs("p",{className:"text-muted-foreground mb-4",children:[p.jsx("span",{className:"font-medium text-primary",children:t.routes?.length||0})," routes configured."]}),p.jsx("pre",{className:"bg-muted text-foreground border border-border p-4 rounded-lg text-sm overflow-auto",children:JSON.stringify(t.routes?.slice(0,3),null,2)})]})})}function Vu({config:e,templateKey:t="docs"}){const n=e.templates?.[t]?.slots?.footer,a=n?.ref,s=(a?e.components?.[a]:e.components?.footer)?.props||n?.props;return p.jsx("footer",{className:"border-t border-border/50 py-8 px-6 bg-muted/20",children:p.jsxs("div",{className:"max-w-screen-2xl mx-auto flex flex-col sm:flex-row justify-between items-center gap-4 text-sm text-muted-foreground",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-5 h-5 rounded bg-gradient-to-br from-primary/60 to-primary flex items-center justify-center",children:p.jsx("span",{className:"text-primary-foreground text-[8px] font-bold",children:"AI"})}),p.jsx("span",{children:s?.text||`© ${new Date().getFullYear()} PraisonAIUI`})]}),p.jsx("nav",{className:"flex items-center gap-6",children:s?.links?.map(u=>p.jsx("a",{href:u.href,className:"hover:text-foreground transition-colors",children:u.label},u.href))})]})})}const P5=()=>({taskLists:[],collapsed:!1}),Vn=new Map,qg=100,z5=1440*60*1e3;function $5(){const e=Date.now(),t=Array.from(Vn.entries());for(const[n,a]of t)e-a.lastAccessed>z5&&Vn.delete(n);if(Vn.size>qg){const n=Array.from(Vn.entries()).sort(([,o],[,s])=>o.lastAccessed-s.lastAccessed),a=Vn.size-qg;for(let o=0;o<a;o++)Vn.delete(n[o][0])}}function Yg(e){if(!Vn.has(e))Vn.size>=qg&&$5(),Vn.set(e,{state:P5(),listeners:new Set,lastAccessed:Date.now()});else{const t=Vn.get(e);t.lastAccessed=Date.now()}return Vn.get(e)}function sh(e,t){const n=Yg(e),a=t(n.state);n.state=a,n.listeners.forEach(o=>o())}function G5(e,t){sh(e,n=>{const a=n.taskLists.filter(s=>s.id!==t.task_list_id),o={id:t.task_list_id,name:t.name,tasks:t.tasks,stats:T0(t.tasks),sequence:t.sequence,created_at:t.timestamp,updated_at:t.timestamp};return{...n,taskLists:[...a,o],collapsed:n.taskLists.length===0?t.tasks.length<=1:n.collapsed}})}function H5(e,t){sh(e,n=>{const a=n.taskLists.map(o=>o.id===t.task_list_id?{...o,tasks:t.tasks,stats:T0(t.tasks),sequence:t.sequence,updated_at:t.timestamp}:o);return{...n,taskLists:a}})}function T0(e){return e.reduce((t,n)=>(t.total+=1,t[n.status.toLowerCase()]+=1,t),{total:0,ready:0,running:0,done:0,failed:0})}function V5(e,t){sh(e,n=>({...n,collapsed:t}))}function q5(e){const[,t]=v.useState({});return v.useEffect(()=>{const n=Yg(e),a=()=>t({});return n.listeners.add(a),()=>{n.listeners.delete(a)}},[e]),Yg(e).state}function Y5(e,t){return t.type==="task_list.init"?(G5(e,t),!0):t.type==="task_list.update"?(H5(e,t),!0):!1}const A0=()=>({isStreaming:!1,currentResponse:"",toolCalls:[],thinkingSteps:[],pendingElements:[]}),qa=new Map;function Kc(e){return qa.has(e)||qa.set(e,{state:A0(),listeners:new Set,abortController:null,toolCallMap:new Map}),qa.get(e)}function qu(e){return e?Kc(e).state:A0()}function W5(e,t){const n=Kc(e);return n.listeners.add(t),()=>n.listeners.delete(t)}function Dn(e,t){const n=Kc(e);n.state={...n.state,...t},n.listeners.forEach(a=>a())}async function K5(e){const t=qa.get(e);if(t){t.abortController?.abort(),t.abortController=null,Dn(e,{isStreaming:!1});try{await fetch("/cancel",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:e})})}catch{}}}function X5(e,t,n,a){const o=Kc(e);if(o.state.isStreaming)return;Dn(e,{isStreaming:!0,currentResponse:"",toolCalls:[],thinkingSteps:[],pendingElements:[]}),o.toolCallMap=new Map;const s=new AbortController;o.abortController=s,Z5(e,t,n,s,a)}async function Z5(e,t,n,a,o){try{const s=await fetch("/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t,session_id:e,agent:n}),signal:a.signal});if(!s.ok)throw new Error(`HTTP ${s.status}`);const u=s.body?.getReader();if(!u)throw new Error("No response body");const c=new TextDecoder;let f="";for(;;){const{done:g,value:h}=await u.read();if(g)break;f+=c.decode(h,{stream:!0});const m=f.split(`
|
||||
`);f=m.pop()||"";for(const E of m)if(E.startsWith("data: "))try{const S=JSON.parse(E.slice(6));Q5(e,S,o)}catch{}}}catch(s){if(s.name!=="AbortError"){const u=qa.get(e);u&&Dn(e,{thinkingSteps:[...u.state.thinkingSteps,`Error: ${s.message}`]})}}finally{const s=qa.get(e);s&&(s.abortController=null),Dn(e,{isStreaming:!1}),o?.onEnd?.()}}function Q5(e,t,n){const a=qa.get(e);if(!a)return;const o=a.toolCallMap;switch(t.type){case"session":t.session_id&&typeof t.session_id=="string"&&n?.onSessionId?.(t.session_id);break;case"token":case"run_content":case"team_run_content":{const u=t.token??t.content??"";u&&Dn(e,{currentResponse:a.state.currentResponse+u});break}case"message":case"run_completed":case"team_run_completed":{const u=t.content;u&&Dn(e,{currentResponse:u});break}case"thinking":case"reasoning_step":case"team_reasoning_step":{const u=t.step;u&&Dn(e,{thinkingSteps:[...a.state.thinkingSteps,u]});break}case"reasoning_started":case"team_reasoning_started":Dn(e,{thinkingSteps:[...a.state.thinkingSteps,"Starting reasoning..."]});break;case"tool_call":case"tool_call_started":case"team_tool_call_started":{const u={name:t.name,description:t.description,icon:t.icon,step_number:t.step_number,status:"running",tool_call_id:t.tool_call_id,args:t.args};u.tool_call_id&&o.set(u.tool_call_id,u);const c=g_(a.state.toolCalls,u);Dn(e,{toolCalls:c});break}case"tool_call_completed":case"team_tool_call_completed":{const u=t.extra_data,c=t.a2ui??u?.a2ui,f=t.elements??u?.elements,g={name:t.name,description:t.description,icon:t.icon,step_number:t.step_number,status:"done",tool_call_id:t.tool_call_id,args:t.args,formatted_result:t.formatted_result,result:t.result,surface_id:t.surface_id??u?.surface_id,a2ui:c?.length?{messages:c,surface_id:t.surface_id??u?.surface_id}:void 0,elements:f};g.tool_call_id&&o.set(g.tool_call_id,g);const h=g_(a.state.toolCalls,g),m=f?.length?[...a.state.pendingElements,...f]:a.state.pendingElements;Dn(e,{toolCalls:h,pendingElements:m});break}case"message_element":{const u=t.extra_data,c=t.element??u?.element;c&&Dn(e,{pendingElements:[...a.state.pendingElements,c]});break}case"error":case"run_error":case"team_run_error":{const u=t.error;u&&Dn(e,{thinkingSteps:[...a.state.thinkingSteps,`Error: ${u}`]});break}case"approval_required":case"approval_pending":case"run_paused":{const u=t.extra_data;if(u?.type==="approval_required"){const c=u;window.dispatchEvent(new CustomEvent("aiui:approval-required",{detail:c}))}break}case"end":case"done":case"run_cancelled":case"team_run_cancelled":break;default:Y5(e,t);break}}function g_(e,t){if(t.tool_call_id){const n=e.findIndex(a=>a.tool_call_id===t.tool_call_id);if(n>=0){const a=[...e];return a[n]={...a[n],...t},a}}return[...e,t]}function k0(e={}){const{externalSessionId:t}=e,[n,a]=v.useState(()=>qu(t));v.useEffect(()=>{if(!t){a(qu(null));return}return a(qu(t)),W5(t,()=>{a(qu(t))})},[t]);const o=v.useCallback((u,c)=>{const f=t??`new-${Date.now()}`;X5(f,u,c,{onSessionId:g=>{e.onSessionId?.(g)},onEnd:e.onEnd})},[t,e.onSessionId,e.onEnd]),s=v.useCallback(()=>{t&&K5(t)},[t]);return{isStreaming:n.isStreaming,currentResponse:n.currentResponse,toolCalls:n.toolCalls,thinkingSteps:n.thinkingSteps,pendingElements:n.pendingElements,sendMessage:o,cancel:s}}function J5(e,t){if(e==null)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;n[a]=e[a]}return n}function e6(e,t){if(e==null)return{};var n,a,o=J5(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)n=s[a],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Wg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function t6(e){if(Array.isArray(e))return Wg(e)}function n6(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function r6(e,t){if(e){if(typeof e=="string")return Wg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wg(e,t):void 0}}function a6(){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 Kg(e){return t6(e)||n6(e)||r6(e)||a6()}function Gs(e){"@babel/helpers - typeof";return Gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gs(e)}function i6(e,t){if(Gs(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(Gs(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function o6(e){var t=i6(e,"string");return Gs(t)=="symbol"?t:t+""}function _0(e,t,n){return(t=o6(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xg(){return Xg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Xg.apply(null,arguments)}function m_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,a)}return n}function Ji(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m_(Object(n),!0).forEach(function(a){_0(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m_(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function s6(e){var t=e.length;if(t===0||t===1)return e;if(t===2)return[e[0],e[1],"".concat(e[0],".").concat(e[1]),"".concat(e[1],".").concat(e[0])];if(t===3)return[e[0],e[1],e[2],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0])];if(t>=4)return[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[
Line truncated
|
||||
`))})}function h6(e){var t=e.codeString,n=e.codeStyle,a=e.containerStyle,o=a===void 0?{float:"left",paddingRight:"10px"}:a,s=e.numberStyle,u=s===void 0?{}:s,c=e.startingLineNumber;return Ze.createElement("code",{style:Object.assign({},n,o)},m6({lines:t.replace(/\n$/,"").split(`
|
||||
`),style:u,startingLineNumber:c}))}function b6(e){return"".concat(e.toString().length,".25em")}function C0(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function R0(e,t,n){var a={display:"inline-block",minWidth:b6(n),paddingRight:"1em",textAlign:"right",userSelect:"none"},o=typeof e=="function"?e(t):e,s=pa(pa({},a),o);return s}function tc(e){var t=e.children,n=e.lineNumber,a=e.lineNumberStyle,o=e.largestLineNumber,s=e.showInlineLineNumbers,u=e.lineProps,c=u===void 0?{}:u,f=e.className,g=f===void 0?[]:f,h=e.showLineNumbers,m=e.wrapLongLines,E=e.wrapLines,S=E===void 0?!1:E,x=S?pa({},typeof c=="function"?c(n):c):{};if(x.className=x.className?[].concat(Kg(x.className.trim().split(/\s+/)),Kg(g)):g,n&&s){var w=R0(a,n,o);t.unshift(C0(n,w))}return m&h&&(x.style=pa({display:"flex"},x.style)),{type:"element",tagName:"span",properties:x,children:t}}function I0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];e.length===void 0&&(e=[e]);for(var a=0;a<e.length;a++){var o=e[a];if(o.type==="text")n.push(tc({children:[o],className:Kg(new Set(t))}));else if(o.children){var s,u=t.concat(((s=o.properties)===null||s===void 0?void 0:s.className)||[]);I0(o.children,u).forEach(function(c){return n.push(c)})}}return n}function y6(e,t,n,a,o,s,u,c,f){var g,h=I0(e.value),m=[],E=-1,S=0;function x(U,D){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return tc({children:U,lineNumber:D,lineNumberStyle:c,largestLineNumber:u,showInlineLineNumbers:o,lineProps:n,className:P,showLineNumbers:a,wrapLongLines:f,wrapLines:t})}function w(U,D){if(a&&D&&o){var P=R0(c,D,u);U.unshift(C0(D,P))}return U}function T(U,D){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return t||P.length>0?x(U,D,P):w(U,D)}for(var A=function(){var D=h[S],P=D.children[0].value,$=g6(P);if($){var Y=P.split(`
|
||||
`);Y.forEach(function(B,V){var X=a&&m.length+s,ne={type:"text",value:"".concat(B,`
|
||||
`)};if(V===0){var ie=h.slice(E+1,S).concat(tc({children:[ne],className:D.properties.className})),ee=T(ie,X);m.push(ee)}else if(V===Y.length-1){var F=h[S+1]&&h[S+1].children&&h[S+1].children[0],q={type:"text",value:"".concat(B)};if(F){var te=tc({children:[q],className:D.properties.className});h.splice(S+1,0,te)}else{var se=[q],I=T(se,X,D.properties.className);m.push(I)}}else{var M=[ne],j=T(M,X,D.properties.className);m.push(j)}}),E=S}S++};S<h.length;)A();if(E!==h.length-1){var _=h.slice(E+1,h.length);if(_&&_.length){var N=a&&m.length+s,L=T(_,N);m.push(L)}}return t?m:(g=[]).concat.apply(g,m)}function v6(e){var t=e.rows,n=e.stylesheet,a=e.useInlineStyles;return t.map(function(o,s){return N0({node:o,stylesheet:n,useInlineStyles:a,key:"code-segment-".concat(s)})})}function O0(e){return e&&typeof e.highlightAuto<"u"}function E6(e){var t=e.astGenerator,n=e.language,a=e.code,o=e.defaultCodeValue;if(O0(t)){var s=d6(t,n);return n==="text"?{value:o,language:"text"}:s?t.highlight(n,a):t.highlightAuto(a)}try{return n&&n!=="text"?{value:t.highlight(a,n)}:{value:o}}catch{return{value:o}}}function S6(e,t){return function(a){var o,s,u=a.language,c=a.children,f=a.style,g=f===void 0?t:f,h=a.customStyle,m=h===void 0?{}:h,E=a.codeTagProps,S=E===void 0?{className:u?"language-".concat(u):void 0,style:pa(pa({},g['code[class*="language-"]']),g['code[class*="language-'.concat(u,'"]')])}:E,x=a.useInlineStyles,w=x===void 0?!0:x,T=a.showLineNumbers,A=T===void 0?!1:T,_=a.showInlineLineNumbers,N=_===void 0?!0:_,L=a.startingLineNumber,U=L===void 0?1:L,D=a.lineNumberContainerStyle,P=a.lineNumberStyle,$=P===void 0?{}:P,Y=a.wrapLines,B=a.wrapLongLines,V=B===void 0?!1:B,X=a.lineProps,ne=X===void 0?{}:X,ie=a.renderer,ee=a.PreTag,F=ee===void 0?"pre":ee,q=a.CodeTag,te=q===void 0?"code":q,se=a.code,I=se===void 0?(Array.isArray(c)?c[0]:c)||"":se,M=a.astGenerator,j=e6(a,p6);M=M||e;var C=A?Ze.createElement(h6,{containerStyle:D,codeStyle:S.style||{},numberStyle:$,startingLineNumber:U,codeString:I}):null,J=g.hljs||g['pre[class*="language-"]']||{backgroundColor:"#fff"},Q=O0(M)?"hljs":"prismjs",re=w?Object.assign({},j,{style:Object.assign({},J,m)}):Object.assign({},j,{className:j.className?"".concat(Q," ").concat(j.className):Q,style:Object.assign({},m)});if(V?S.style=pa({whiteSpace:"pre-wrap"},S.style):S.style=pa({whiteSpace:"pre"},S.style),!M)return Ze.createElement(F,re,C,Ze.createElement(te,S,I));(Y===void 0&&ie||V)&&(Y=!0),ie=ie||v6;var oe=[{type:"text",value:I}],he=E6({astGenerator:M,language:u,code:I,defaultCodeValue:oe});he.language===null&&(he.value=oe);var pe=(o=(s=I.match(/\n/g))===null||s===void 0?void 0:s.length)!==null&&o!==void 0?o:0,ve=U+pe,Ce=y6(he,Y,ne,A,N,U,ve,$,V);return Ze.createElement(F,re,Ze.createElement(te,S,!N&&C,ie({rows:Ce,stylesheet:g,useInlineStyles:w})))}}const x6=["abap","abnf","actionscript","ada","agda","al","antlr4","apacheconf","apex","apl","applescript","aql","arduino","arff","armasm","arturo","asciidoc","asm6502","asmatmel","aspnet","autohotkey","autoit","avisynth","avro-idl","awk","bash","basic","batch","bbcode","bbj","bicep","birb","bison","bnf","bqn","brainfuck","brightscript","bro","bsl","c","cfscript","chaiscript","cil","cilkc","cilkcpp","clike","clojure","cmake","cobol","coffeescript","concurnas","cooklang","coq","cpp","crystal","csharp","cshtml","csp","css-extras","css","csv","cue","cypher","d","dart","dataweave","dax","dhall","diff","django","dns-zone-file","docker","dot","ebnf","editorconfig","eiffel","ejs","elixir","elm","erb","erlang","etlua","excel-formula","factor","false","firestore-security-rules","flow","fortran","fsharp","ftl","gap","gcode","gdscript","gedcom","gettext","gherkin","git","glsl","gml","gn","go-module","go","gradle","graphql","groovy","haml","handlebars","haskell","haxe","hcl","hlsl","hoon","hpkp","hsts","http","ichigojam","icon","icu-message-format","idris","iecst","ignore","inform7","ini","io","j","java","javadoc","javadoclike","javascript","javastacktrace","jexl","jolie","jq","js-extras","js-templates","jsdoc","json","json5","jsonp","jsstacktrace","jsx","julia","keepalived","keyman","kotlin","kumir","kusto","latex","latte","less","lilypond","linker-script","liquid","lisp","livescript","llvm","log","lolcode","lua","magma","makefile","markdown","markup-templating","markup","mata","matlab","maxscript","mel","mermaid","metafont","mizar","mongodb","monkey","moonscript","n1ql","n4js","nand2tetris-hdl","naniscript","nasm","neon","nevod","nginx","nim","nix","nsis","objectivec","ocaml","odin","opencl","openqasm","oz","parigp","parser","pascal","pascaligo","pcaxis","peoplecode","perl","php-extras","php","phpdoc","plant-uml","plsql","powerquery","powershell","processing","prolog","promql","properties","protobuf","psl","pug","puppet","pure","purebasic","purescript","python","q","qml","qore","qsharp","r","racket","reason","regex","rego","renpy","rescript","rest","rip","roboconf","robotframework","ruby","rust","sas","sass","scala","scheme","scss","shell-session","smali","smalltalk","smarty","sml
Line truncated
|
||||
?|
|
||||
|(?![\\s\\S])))+`,"m"),alias:s,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(a)[0]}}}}),Object.defineProperty(t.languages.diff,"PREFIXES",{value:n})})(e)}Ht.displayName="markup-templating";Ht.aliases=[];function Ht(e){e.register(Ft),(function(t){function n(a,o){return"___"+a.toUpperCase()+o+"___"}Object.defineProperties(t.languages["markup-templating"]={},{buildPlaceholders:{value:function(a,o,s,u){if(a.language===o){var c=a.tokenStack=[];a.code=a.code.replace(s,function(f){if(typeof u=="function"&&!u(f))return f;for(var g=c.length,h;a.code.indexOf(h=n(o,g))!==-1;)++g;return c[g]=f,h}),a.grammar=t.languages.markup}}},tokenizePlaceholders:{value:function(a,o){if(a.language!==o||!a.tokenStack)return;a.grammar=t.languages[o];var s=0,u=Object.keys(a.tokenStack);function c(f){for(var g=0;g<f.length&&!(s>=u.length);g++){var h=f[g];if(typeof h=="string"||h.content&&typeof h.content=="string"){var m=u[s],E=a.tokenStack[m],S=typeof h=="string"?h:h.content,x=n(o,m),w=S.indexOf(x);if(w>-1){++s;var T=S.substring(0,w),A=new t.Token(o,t.tokenize(E,a.grammar),"language-"+o,E),_=S.substring(w+x.length),N=[];T&&N.push.apply(N,c([T])),N.push(A),_&&N.push.apply(N,c([_])),typeof h=="string"?f.splice.apply(f,[g,1].concat(N)):h.content=N}}else h.content&&c(h.content)}return f}c(a.tokens)}}})})(e)}bb.displayName="django";bb.aliases=["jinja2"];function bb(e){e.register(Ht),(function(t){t.languages.django={comment:/^\{#[\s\S]*?#\}$/,tag:{pattern:/(^\{%[+-]?\s*)\w+/,lookbehind:!0,alias:"keyword"},delimiter:{pattern:/^\{[{%][+-]?|[+-]?[}%]\}$/,alias:"punctuation"},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},filter:{pattern:/(\|)\w+/,lookbehind:!0,alias:"function"},test:{pattern:/(\bis\s+(?:not\s+)?)(?!not\b)\w+/,lookbehind:!0,alias:"function"},function:/\b[a-z_]\w+(?=\s*\()/i,keyword:/\b(?:and|as|by|else|for|if|import|in|is|loop|not|or|recursive|with|without)\b/,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,number:/\b\d+(?:\.\d+)?\b/,boolean:/[Ff]alse|[Nn]one|[Tt]rue/,variable:/\b\w+\b/,punctuation:/[{}[\](),.:;]/};var n=/\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}|\{#[\s\S]*?#\}/g,a=t.languages["markup-templating"];t.hooks.add("before-tokenize",function(o){a.buildPlaceholders(o,"django",n)}),t.hooks.add("after-tokenize",function(o){a.tokenizePlaceholders(o,"django")}),t.languages.jinja2=t.languages.django,t.hooks.add("before-tokenize",function(o){a.buildPlaceholders(o,"jinja2",n)}),t.hooks.add("after-tokenize",function(o){a.tokenizePlaceholders(o,"jinja2")})})(e)}yb.displayName="dns-zone-file";yb.aliases=["dns-zone"];function yb(e){e.languages["dns-zone-file"]={comment:/;.*/,string:{pattern:/"(?:\\.|[^"\\\r\n])*"/,greedy:!0},variable:[{pattern:/(^\$ORIGIN[ \t]+)\S+/m,lookbehind:!0},{pattern:/(^|\s)@(?=\s|$)/,lookbehind:!0}],keyword:/^\$(?:INCLUDE|ORIGIN|TTL)(?=\s|$)/m,class:{pattern:/(^|\s)(?:CH|CS|HS|IN)(?=\s|$)/,lookbehind:!0,alias:"keyword"},type:{pattern:/(^|\s)(?:A|A6|AAAA|AFSDB|APL|ATMA|CAA|CDNSKEY|CDS|CERT|CNAME|DHCID|DLV|DNAME|DNSKEY|DS|EID|GID|GPOS|HINFO|HIP|IPSECKEY|ISDN|KEY|KX|LOC|MAILA|MAILB|MB|MD|MF|MG|MINFO|MR|MX|NAPTR|NB|NBSTAT|NIMLOC|NINFO|NS|NSAP|NSAP-PTR|NSEC|NSEC3|NSEC3PARAM|NULL|NXT|OPENPGPKEY|PTR|PX|RKEY|RP|RRSIG|RT|SIG|SINK|SMIMEA|SOA|SPF|SRV|SSHFP|TA|TKEY|TLSA|TSIG|TXT|UID|UINFO|UNSPEC|URI|WKS|X25)(?=\s|$)/,lookbehind:!0,alias:"keyword"},punctuation:/[()]/},e.languages["dns-zone"]=e.languages["dns-zone-file"]}vb.displayName="docker";vb.aliases=["dockerfile"];function vb(e){(function(t){var n=/\\[\r\n](?:\s|\\[\r\n]|#.*(?!.))*(?![\s#]|\\[\r\n])/.source,a=/(?:[ \t]+(?![ \t])(?:<SP_BS>)?|<SP_BS>)/.source.replace(/<SP_BS>/g,function(){return n}),o=/"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"|'(?:[^'\\\r\n]|\\(?:\r\n|[\s\S]))*'/.source,s=/--[\w-]+=(?:<STR>|(?!["'])(?:[^\s\\]|\\.)+)/.source.replace(/<STR>/g,function(){return o}),u={pattern:RegExp(o),greedy:!0},c={pattern:/(^[ \t]*)#.*/m,lookbehind:!0,greedy:!0};function f(g,h){return g=g.replace(/<OPT>/g,function(){return s}).replace(/<SP>/g,function(){return a}),RegExp(g,h)}t.languages.docker={instruction:{pattern:/(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,lookbehind:!0,greedy:!0,inside:{options:{pattern:f(/(^(?:ONBUILD<SP>)?\w+<SP>)<OPT>(?:<SP><OPT>)*/.source,"i"),lookbehind:!0,greedy:!0,inside:{property:{pattern:/(^|\s)--[\w-]+/,lookbehind:!0},string:[u,{pattern:/(=)(?!["'])(?:[^\s\\]|\\.)+/,lookbehind:!0}],operator:/\\$/m,punctuation:/=/}},keyword:[{pattern:f(/(^(?:ONBUILD<SP>)?HEALTHCHECK<SP>(?:<OPT><SP>)*)(?:CMD|NONE)\b/.source,"i"),lookbehind:!0,greedy:!0},{pattern:f(/(^(?:ONBUILD<SP>)?FROM<SP>(?:<OPT><SP>)*(?!--)[^ \t\\]+<SP>)AS/.source,"i"),lookbehind:!0,greedy:!0},{pattern:f(/(^ONBUILD<SP>)\w+/.source,"i"),lookbehind:!0,greedy:!0},{pattern:/^\w+/,greedy:!0}],comment:c,string:u,variable:/\$(?:\w+|\{[^{}"'\\]*\})/,oper
Line truncated
|
||||
]))(?:`+(/[^\s\\]/.source+'|[ ]+(?:(?![ "])|'+a+")|"+/\\[\r\n]+(?:[#;].*[\r\n]+)*(?![#;])/.source)+")*"),lookbehind:!0,greedy:!0,alias:"attr-value",inside:{comment:n,quoted:{pattern:RegExp(/(^|\s)/.source+a),lookbehind:!0,greedy:!0},punctuation:/\\$/m,boolean:{pattern:/^(?:false|no|off|on|true|yes)$/,greedy:!0}}},punctuation:/=/}})(e)}cl.displayName="t4-templating";cl.aliases=[];function cl(e){(function(t){function n(o,s,u){return{pattern:RegExp("<#"+o+"[\\s\\S]*?#>"),alias:"block",inside:{delimiter:{pattern:RegExp("^<#"+o+"|#>$"),alias:"important"},content:{pattern:/[\s\S]+/,inside:s,alias:u}}}}function a(o){var s=t.languages[o],u="language-"+o;return{block:{pattern:/<#[\s\S]+?#>/,inside:{directive:n("@",{"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/,inside:{punctuation:/^=|^["']|["']$/}},keyword:/\b\w+(?=\s)/,"attr-name":/\b\w+/}),expression:n("=",s,u),"class-feature":n("\\+",s,u),standard:n("",s,u)}}}}t.languages["t4-templating"]=Object.defineProperty({},"createT4",{value:a})})(e)}OE.displayName="t4-cs";OE.aliases=["t4"];function OE(e){e.register(bo),e.register(cl),e.languages.t4=e.languages["t4-cs"]=e.languages["t4-templating"].createT4("csharp")}ad.displayName="vbnet";ad.aliases=[];function ad(e){e.register(Qc),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}DE.displayName="t4-vb";DE.aliases=[];function DE(e){e.register(cl),e.register(ad),e.languages["t4-vb"]=e.languages["t4-templating"].createT4("vbnet")}LE.displayName="tap";LE.aliases=[];function LE(e){e.register(Zc),e.languages.tap={fail:/not ok[^#{\n\r]*/,pass:/ok[^#{\n\r]*/,pragma:/pragma [+-][a-z]+/,bailout:/bail out!.*/i,version:/TAP version \d+/i,plan:/\b\d+\.\.\d+(?: +#.*)?/,subtest:{pattern:/# Subtest(?:: .*)?/,greedy:!0},punctuation:/[{}]/,directive:/#.*/,yamlish:{pattern:/(^[ \t]*)---[\s\S]*?[\r\n][ \t]*\.\.\.$/m,lookbehind:!0,inside:e.languages.yaml,alias:"language-yaml"}}}ME.displayName="tcl";ME.aliases=[];function ME(e){e.languages.tcl={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:{pattern:/"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"/,greedy:!0},variable:[{pattern:/(\$)(?:::)?(?:[a-zA-Z0-9]+::)*\w+/,lookbehind:!0},{pattern:/(\$)\{[^}]+\}/,lookbehind:!0},{pattern:/(^[\t ]*set[ \t]+)(?:::)?(?:[a-zA-Z0-9]+::)*\w+/m,lookbehind:!0}],function:{pattern:/(^[\t ]*proc[ \t]+)\S+/m,lookbehind:!0},builtin:[{pattern:/(^[\t ]*)(?:break|class|continue|error|eval|exit|for|foreach|if|proc|return|switch|while)\b/m,lookbehind:!0},/\b(?:else|elseif)\b/],scope:{pattern:/(^[\t ]*)(?:global|upvar|variable)\b/m,lookbehind:!0,alias:"constant"},keyword:{pattern:/(^[\t ]*|\[)(?:Safe_Base|Tcl|after|append|apply|array|auto_(?:execok|import|load|mkindex|qualify|reset)|automkindex_old|bgerror|binary|catch|cd|chan|clock|close|concat|dde|dict|encoding|eof|exec|expr|fblocked|fconfigure|fcopy|file(?:event|name)?|flush|gets|glob|history|http|incr|info|interp|join|lappend|lassign|lindex|linsert|list|llength|load|lrange|lrepeat|lreplace|lreverse|lsearch|lset|lsort|math(?:func|op)|memory|msgcat|namespace|open|package|parray|pid|pkg_mkIndex|platform|puts|pwd|re_syntax|read|refchan|regexp|registry|regsub|rename|scan|seek|set|socket|source|split|string|subst|tcl(?:_endOfWord|_findLibrary|startOf(?:Next|Previous)Word|test|vars|wordBreak(?:After|Before))|tell|time|tm|trace|unknown|unload|unset|update|uplevel|vwait
Line truncated
|
||||
- a positive number
|
||||
- less than the value passed to \`max\` (or ${yS} if no \`max\` prop is set)
|
||||
- \`null\` or \`undefined\` if the progress is indeterminate.
|
||||
|
||||
Defaulting to \`null\`.`}var iq=vI,oq=SI;function sq({className:e,value:t,...n}){return p.jsx(iq,{"data-slot":"progress",className:be("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...n,children:p.jsx(oq,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})})}function dl(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var ud="Switch",[lq]=It(ud),[uq,cq]=lq(ud),wI=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:a,checked:o,defaultChecked:s,required:u,disabled:c,value:f="on",onCheckedChange:g,form:h,...m}=e,[E,S]=v.useState(null),x=ke(t,N=>S(N)),w=v.useRef(!1),T=E?h||!!E.closest("form"):!0,[A,_]=Zt({prop:o,defaultProp:s??!1,onChange:g,caller:ud});return p.jsxs(uq,{scope:n,checked:A,disabled:c,children:[p.jsx(ye.button,{type:"button",role:"switch","aria-checked":A,"aria-required":u,"data-state":_I(A),"data-disabled":c?"":void 0,disabled:c,value:f,...m,ref:x,onClick:ge(e.onClick,N=>{_(L=>!L),T&&(w.current=N.isPropagationStopped(),w.current||N.stopPropagation())})}),T&&p.jsx(kI,{control:E,bubbles:!w.current,name:a,value:f,checked:A,required:u,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});wI.displayName=ud;var TI="SwitchThumb",AI=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...a}=e,o=cq(TI,n);return p.jsx(ye.span,{"data-state":_I(o.checked),"data-disabled":o.disabled?"":void 0,...a,ref:t})});AI.displayName=TI;var dq="SwitchBubbleInput",kI=v.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:a=!0,...o},s)=>{const u=v.useRef(null),c=ke(u,s),f=dl(n),g=Xs(t);return v.useEffect(()=>{const h=u.current;if(!h)return;const m=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(m,"checked").set;if(f!==n&&S){const x=new Event("click",{bubbles:a});S.call(h,n),h.dispatchEvent(x)}},[f,n,a]),p.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:c,style:{...o.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});kI.displayName=dq;function _I(e){return e?"checked":"unchecked"}var pq=wI,fq=AI;function gq({className:e,size:t="default",...n}){return p.jsx(pq,{"data-slot":"switch","data-size":t,className:be("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...n,children:p.jsx(fq,{"data-slot":"switch-thumb",className:be("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}var cd="Checkbox",[mq]=It(cd),[hq,vS]=mq(cd);function bq(e){const{__scopeCheckbox:t,checked:n,children:a,defaultChecked:o,disabled:s,form:u,name:c,onCheckedChange:f,required:g,value:h="on",internal_do_not_use_render:m}=e,[E,S]=Zt({prop:n,defaultProp:o??!1,onChange:f,caller:cd}),[x,w]=v.useState(null),[T,A]=v.useState(null),_=v.useRef(!1),N=x?!!u||!!x.closest("form"):!0,L={checked:E,disabled:s,setChecked:S,control:x,setControl:w,name:c,form:u,value:h,hasConsumerStoppedPropagationRef:_,required:g,defaultChecked:fa(o)?!1:o,isFormControl:N,bubbleInput:T,setBubbleInput:A};return p.jsx(hq,{scope:t,...L,children:yq(m)?m(L):a})}var NI="CheckboxTrigger",CI=v.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...a},o)=>{const{control:s,value:u,disabled:c,checked:f,required:g,setControl:h,setChecked:m,hasConsumerStoppedPropagationRef:E,isFormControl:S,bubbleInput:x}=vS(NI,e),w=ke(o,h),T=v.useRef(f);return v.useEffect(()=>{const A=s?.form;if(A){const _=()=>m(T.current);return A.addEventListener("reset",_),()=>A.removeEventListener("reset",_)}},[s,m]),p.jsx(ye.button,{type:"button",role:"checkbox","aria-checked":fa(f)?"mixed":f,"aria-required":g,"data-state":MI(f),"data-disabled":c?"":void 0,disabled:c,value:u,...a,ref:w,onKeyDown:ge(t,A=>{A.key==="Enter"&&A.preventDefault()}),onClick:ge(n,A=>{m(_=>fa(_)?!0:!_),x&&S&&(E.current=A.isPropagationStopped(),E.current||A.stopPropagation())})})});CI.displayName=NI;var RI=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:a,checked:o,defaultChecked:s,required:u,disabled:c,value:f,onCheckedChange:g,form:h,...m}=e;return p.jsx(bq,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:c,required:u,onCheckedChange:g,name:a,form:h,value:f,internal_do_not_use_render:({isFormControl:E})=>p.jsxs(p.Fragment,{children:[p.jsx(CI,{...m,ref:t,__scopeChecLine truncated
|
||||
`);for(;t.length&&!t[0].trim();)t.shift();for(;t.length&&!t[t.length-1].trim();)t.pop();if(!t.length)return"";const n=Math.min(...t.filter(a=>a.trim().length>0).map(a=>a.match(/^ */)?.[0].length??0));return n===0?t.join(`
|
||||
`):t.map(a=>a.slice(n)).join(`
|
||||
`)}function TY({language:e,children:t}){const[n,a]=v.useState(!1),o=v.useCallback(async()=>{await navigator.clipboard.writeText(t),a(!0),setTimeout(()=>a(!1),2e3)},[t]);return p.jsxs("div",{className:"relative group/code my-3 rounded-lg overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 py-1.5 bg-[#1e1e2e] text-xs text-gray-400",children:[p.jsx("span",{children:e||"code"}),p.jsx("button",{onClick:o,className:"flex items-center gap-1 hover:text-white transition-colors",children:n?"✓ Copied":"Copy"})]}),p.jsx(F0,{style:K6,language:e||"text",PreTag:"div",customStyle:{margin:0,borderRadius:0,fontSize:"13px"},children:t})]})}function AY(e){const t=e.split(`
|
||||
`);let n=!1,a=!1,o="",s=0;for(let u=0;u<t.length;u++){const c=t[u];if(/^[ \t]*```/.test(c)){n=!n;continue}if(n)continue;const f=c.match(/^([ \t]*)(\d+)\.[ \t]/);if(f){const g=f[1];!a||g!==o?(a=!0,o=g,s=1):s++,t[u]=c.replace(/^([ \t]*)\d+\./,`${g}${s}.`)}else c.trim()===""&&a||a&&/^[ \t]+\S/.test(c)||a&&(a=!1,s=0)}return t.join(`
|
||||
`)}function u1({content:e}){const t=AY(e);return p.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none prose-p:leading-relaxed prose-pre:p-0 prose-pre:bg-transparent",children:p.jsx(XR,{remarkPlugins:[E0],components:{ul({children:n,ordered:a,start:o}){if(a){const s=o!=null?Number(o):1;return p.jsx("ol",{start:s,style:{listStyleType:"decimal",paddingLeft:"1.5rem",margin:"0.5rem 0"},children:n})}return p.jsx("ul",{style:{listStyleType:"disc",paddingLeft:"1.5rem",margin:"0.5rem 0"},children:n})},li({children:n}){return p.jsx("li",{style:{display:"list-item",marginBottom:"0.25rem"},children:n})},code({className:n,children:a,...o}){const s=/language-(\w+)/.exec(n||""),u=wY(String(a));return!s&&!u.includes(`
|
||||
`)?p.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted text-sm font-mono",...o,children:a}):p.jsx(TY,{language:s?.[1],children:u})},a({href:n,children:a}){return p.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:a})},table({children:n}){return p.jsx("div",{className:"overflow-x-auto my-3",children:p.jsx("table",{className:"min-w-full text-sm",children:n})})}},children:t})})}function kY({message:e,sessionId:t}){return e.role==="user"?p.jsx("div",{className:"flex justify-end",children:p.jsxs("div",{className:"flex gap-3 max-w-[80%]",children:[p.jsx("div",{className:"rounded-2xl px-4 py-2.5 bg-primary text-primary-foreground",children:p.jsx("p",{className:"text-sm whitespace-pre-wrap",children:e.content})}),p.jsx(xc,{role:"user"})]})}):p.jsxs("div",{className:"flex gap-3 group",children:[p.jsx(xc,{role:"assistant"}),p.jsxs("div",{className:"flex-1 min-w-0",children:[e.toolCalls&&e.toolCalls.length>0&&p.jsx("div",{className:"mb-2 space-y-1",children:e.toolCalls.map((a,o)=>p.jsx(l1,{toolCall:a},o))}),p.jsx(u1,{content:e.content}),e.elements&&e.elements.length>0&&p.jsx("div",{className:"mt-3 space-y-3",children:e.elements.map((a,o)=>p.jsx(_S,{element:a,className:"w-full"},o))}),e.images&&e.images.length>0&&p.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.images.map((a,o)=>p.jsx("img",{src:a,alt:"",className:"max-w-full rounded-md max-h-64 object-contain"},o))}),e.actions&&e.actions.length>0&&p.jsx(hY,{actions:e.actions,messageId:e.id,sessionId:t}),p.jsxs("div",{className:"mt-1 flex items-center gap-1 relative",children:[p.jsx(SY,{text:e.content}),p.jsx(xY,{messageId:e.id})]})]})]})}function _Y({onSend:e,onCancel:t,isStreaming:n=!1,placeholder:a="Type a message...",enableFileUpload:o=!1}){const[s,u]=v.useState(""),[c,f]=v.useState([]),g=v.useRef(null),h=v.useRef(null),m=v.useCallback(()=>{const A=s.trim();(A||c.length>0)&&!n&&(e(A,c.length>0?c:void 0),u(""),f([]),g.current&&(g.current.style.height="auto"))},[s,c,n,e]),E=v.useCallback(A=>{const _=Array.from(A.target.files||[]);f(N=>[...N,..._]),h.current&&(h.current.value="")},[]),S=v.useCallback(()=>{h.current?.click()},[]),x=v.useCallback(A=>{f(_=>_.filter((N,L)=>L!==A))},[]),w=v.useCallback(A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),m())},[m]),T=v.useCallback(()=>{const A=g.current;A&&(A.style.height="auto",A.style.height=`${Math.min(A.scrollHeight,200)}px`)},[]);return p.jsx("div",{className:"p-4 pb-6",children:p.jsxs("div",{className:"max-w-3xl mx-auto",children:[p.jsxs("div",{className:"rounded-2xl border bg-background/80 backdrop-blur-sm shadow-lg",children:[c.length>0&&p.jsx("div",{className:"flex flex-wrap gap-1 px-4 pt-3",children:c.map((A,_)=>p.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-muted rounded-lg text-xs",children:[p.jsx("span",{className:"truncate max-w-[100px]",children:A.name}),p.jsx("button",{type:"button",onClick:()=>x(_),className:"hover:text-destructive",children:"×"})]},`${A.name}-${_}`))}),p.jsxs("div",{className:"flex items-end gap-2 p-2",children:[o&&p.jsxs(p.Fragment,{children:[p.jsx("input",{ref:h,type:"file",multiple:!0,onChange:E,className:"hidden",accept:"image/*,audio/*,video/*,.pdf,.doc,.docx,.txt,.csv,.json"}),p.jsx("button",{type:"button",onClick:S,className:"p-2 rounded-xl hover:bg-accent text-muted-foreground transition-colors",title:"Attach file",children:p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"})})})]}),p.jsx("textarea",{ref:g,value:s,onChange:A=>u(A.target.value),onKeyDown:w,onInput:T,placeholder:a,disabled:n,rows:1,className:"flex-1 resize-none bg-transparent px-3 py-2.5 text-sm focus:outline-none disabled:opacity-50 placeholder:text-muted-foreground/60",style:{maxHeight:"200px"}}),n?p.jsx("button",{type:"button",onClick:t,className:"p-2 rounded-xl bg-destructive text-destructive-foreground hover:bg-destructive/90 transition-colors",title:"Stop",children:p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:p.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}):p.jsx("button",{type:"button",onClick:m,disabled:!s.trim(),className:"p-2 rounded-xl bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-30 disabled:cursor-not-allowed transition-colors",title:"Send",children:p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:p.jsx("path",{d:"M5 12h14M12 5l7 7-7 7"})})})]})]}),p.jsx("p",{className:"text-[10px] text-center text-muted-foreground/50 mt-2",children:"Press Enter to send, Shift+Enter for new line"
Line truncated
|
||||
`),m=v.useCallback(async()=>{!n.trim()||s||f(n)},[n,s,f]),E=v.useCallback(()=>{a("")},[]);return p.jsxs("div",{className:"min-h-screen bg-background text-foreground flex flex-col",children:[p.jsxs("header",{className:"border-b px-6 py-4 flex items-center justify-between",children:[p.jsx("h1",{className:"text-xl font-semibold",children:t||"Playground"}),p.jsx("div",{className:"flex items-center gap-2",children:p.jsx("button",{onClick:E,className:"px-3 py-1.5 text-sm rounded-md border hover:bg-accent",children:"Clear"})})]}),p.jsxs("div",{className:"flex-1 flex",children:[p.jsxs("div",{className:"flex-1 flex flex-col border-r",children:[p.jsx("div",{className:"px-4 py-2 border-b bg-muted/30",children:p.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Input"})}),p.jsx("div",{className:"flex-1 p-4",children:p.jsx("textarea",{value:n,onChange:S=>a(S.target.value),placeholder:"Enter your prompt here...",className:"w-full h-full resize-none bg-transparent border rounded-md p-3 focus:outline-none focus:ring-2 focus:ring-primary"})}),p.jsx("div",{className:"px-4 py-3 border-t flex justify-end gap-2",children:s?p.jsx("button",{onClick:g,className:"px-4 py-2 bg-destructive text-destructive-foreground rounded-md hover:bg-destructive/90",children:"Stop"}):p.jsx("button",{onClick:m,disabled:!n.trim(),className:"px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed",children:"Submit"})})]}),p.jsxs("div",{className:"flex-1 flex flex-col",children:[p.jsxs("div",{className:"px-4 py-2 border-b bg-muted/30 flex items-center justify-between",children:[p.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Output"}),s&&p.jsx("span",{className:"text-xs text-muted-foreground animate-pulse",children:"Processing..."})]}),p.jsx("div",{className:"flex-1 p-4 overflow-auto",children:h?p.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none whitespace-pre-wrap",children:h}):p.jsx("div",{className:"h-full flex items-center justify-center text-muted-foreground text-sm",children:"Output will appear here"})})]})]}),e?.features&&p.jsxs("div",{className:"border-t px-6 py-3 bg-muted/20 flex items-center gap-4 text-sm text-muted-foreground",children:[e.features.streaming&&p.jsx("span",{children:"✓ Streaming"}),e.features.reasoning&&p.jsx("span",{children:"✓ Reasoning"}),e.features.tools&&p.jsx("span",{children:"✓ Tools"})]})]})}function fW(e,t){const n=e.replace(/^\/+|\/+$/g,""),o=t.replace(/^\/+|\/+$/g,"").replace(/\*\*/g,"{{GLOB}}").replace(/\*/g,"[^/]+").replace(/\{\{GLOB\}\}/g,".*");return new RegExp(`^${o}$`).test(n)}function gW(e,t,n){const o=[...t.routes??[]].sort((s,u)=>(u.priority??0)-(s.priority??0));for(const s of o){if(!fW(e,s.pattern))continue;const u=n[s.template];return u?{template:s.template,layout:u.layout??"ThreeColumnLayout",slots:u.slots??{},slotOverrides:s.slotOverrides}:(console.warn(`Template "${s.template}" not found`),null)}return null}function mW(e,t){if(t)return t.slotOverrides&&e in t.slotOverrides?t.slotOverrides[e]:t.slots[e]}function hW(e){return mW("right",e)!==null}function bW(e){return e.title.trim().toLowerCase()}function S1(e){const t=[];e.path&&t.push(e.path.toLowerCase());for(const n of e.children??[])t.push(...S1(n));return t}function yW(e,t){const n=t.replace(/^\/+/,"").toLowerCase(),a=e.replace(/\/+$/,"").toLowerCase();if(n==="index")return a.endsWith("/index")||a==="/docs";const o=`/${n}`;return a.endsWith(o)||a.endsWith(`${o}/index`)}function vW(e,t){if(!t.groups?.length)return!1;const n=bW(e),a=S1(e);for(const o of t.groups){const s=o.group.toLowerCase();if(n===s)return!0;if(o.prefix){const u=o.prefix.toLowerCase();if(n===u||n===u.replace(/-/g," "))return!0;const c=`/docs/${u}`;if(a.some(f=>f===c||f.startsWith(`${c}/`)))return!0}if(o.pages?.some(u=>a.some(c=>yW(c,u)))||!e.children?.length&&o.pages?.some(u=>{const c=u.split("/").pop()?.replace(/-/g," ")??"";return n===c||n===u.toLowerCase()}))return!0}return!1}function EW(e,t){const n=t.toLowerCase();let a=-1,o=0;for(let s=0;s<e.length;s++){const u=e[s];for(const c of u.groups??[]){if(!c.prefix)continue;const f=`/${c.prefix.toLowerCase()}/`;n.includes(f)&&f.length>o&&(a=s,o=f.length)}}return a>=0?a:0}function SW(e,t){return t?e.filter(n=>vW(n,t)):e}function Xu({enabled:e}){return e?p.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:top-4 focus:left-4 z-50 bg-primary text-primary-foreground px-4 py-2 rounded-md text-sm font-medium",children:"Skip to main content"}):null}function xW(){const[e,t]=v.useState({}),[n,a]=v.useState({}),[o,s]=v.useState({}),[u,c]=v.useState(!0),[f,g]=v.useState(null),[h,m]=v.useState(null),[E,S]=v.useState(""),[x,w]=v.useState(()=>Pt(window.location.pathname)),[T,A]=v.useState(!1),[_,N]=v.useState(0),L=e.navigation?.tabs??[],U=v.useMemo(()=>L.length?{items:SW(n.items??[],L[_])}:n,[n,L,_]);v.useEffect(()=>{L.length&&N(EW(L,x))},[x,L]);const D=(M,j)=>{con
Line truncated
|
||||
@@ -0,0 +1,67 @@
|
||||
import{j as s,r as y,R as W}from"./index.js";import{A as E,o as u,p as g,c as m,a as D,b as G,s as v,d as q,e as b,g as ke,i as Se,n as V,f as Te,h as T,D as S,u as Z,C as te,j as $,k as F,l as Ce,m as De,q as Me,r as Oe,t as Ae,v as Pe,G as ie}from"./common-types.js";const U=class U{parse(t,n=0){if(n>U.MAX_DEPTH)throw new E("Max recursion depth reached in parse");if(!t||!t.includes("${"))return[t];const a=[],r=new oe(t);for(;!r.isAtEnd();)if(r.matches("${")){r.advance(2);const i=this.extractInterpolationContent(r),o=this.parseExpression(i,n+1);o!==null&&a.push(o)}else if(r.peek()==="\\"&&r.peek(1)==="$"&&r.peek(2)==="{")r.advance(),a.push("${"),r.advance(2);else{const i=r.pos;for(;!r.isAtEnd()&&!(r.matches("${")||r.peek()==="\\"&&r.peek(1)==="$"&&r.peek(2)==="{");)r.advance();a.push(r.input.substring(i,r.pos))}return a.filter(i=>i!==null&&i!=="")}extractInterpolationContent(t){const n=t.pos;let a=1;for(;!t.isAtEnd()&&a>0;){const r=t.advance();if(r==="{")a++;else if(r==="}")a--;else if(r==="'"||r==='"'){const i=r;for(;!t.isAtEnd();){const o=t.advance();if(o==="\\")t.advance();else if(o===i)break}}}if(a>0)throw new E("Unclosed interpolation: missing '}'");return t.input.substring(n,t.pos-1)}parseExpression(t,n=0){if(t=t.trim(),!t)return"";const a=new oe(t),r=this.parseExpressionInternal(a,n);if(!a.isAtEnd())throw new E(`Unexpected characters at end of expression: '${a.input.substring(a.pos)}'`);return r}parseExpressionInternal(t,n){if(t.skipWhitespace(),t.isAtEnd())return"";if(t.matches("${")){t.advance(2);const r=this.extractInterpolationContent(t);return this.parseExpression(r,n+1)}if(t.matchesString("'")||t.matchesString('"'))return this.parseStringLiteral(t);if(this.isDigit(t.peek()))return this.parseNumberLiteral(t);if(t.matchesKeyword("true"))return!0;if(t.matchesKeyword("false"))return!1;if(t.matchesKeyword("null"))return"";const a=this.scanPathOrIdentifier(t);return t.skipWhitespace(),t.peek()==="("?this.parseFunctionCall(a,t,n):a?{path:a}:""}scanPathOrIdentifier(t){const n=t.pos;for(;!t.isAtEnd();){const a=t.peek();if(this.isAlnum(a)||a==="/"||a==="."||a==="_"||a==="-")t.advance();else break}return t.input.substring(n,t.pos)}parseFunctionCall(t,n,a){n.match("("),n.skipWhitespace();const r={};for(;!n.isAtEnd()&&n.peek()!==")";){const i=this.scanIdentifier(n);if(n.skipWhitespace(),!n.match(":"))throw new E(`Expected ':' after argument name '${i}' in function '${t}'`);n.skipWhitespace(),r[i]=this.parseExpressionInternal(n,a),n.skipWhitespace(),n.peek()===","&&(n.advance(),n.skipWhitespace())}if(!n.match(")"))throw new E(`Expected ')' after function arguments for '${t}'`);return{call:t,args:r,returnType:"any"}}scanIdentifier(t){const n=t.pos;for(;!t.isAtEnd()&&(this.isAlnum(t.peek())||t.peek()==="_");)t.advance();return t.input.substring(n,t.pos)}parseStringLiteral(t){const n=t.advance();let a="";for(;!t.isAtEnd();){const r=t.advance();if(r==="\\"){const i=t.advance();i==="n"?a+=`
|
||||
`:i==="t"?a+=" ":i==="r"?a+="\r":a+=i}else{if(r===n)break;a+=r}}return a}parseNumberLiteral(t){const n=t.pos;for(;!t.isAtEnd()&&(this.isDigit(t.peek())||t.peek()===".");)t.advance();return Number(t.input.substring(n,t.pos))}isAlnum(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"}isDigit(t){return t>="0"&&t<="9"}};U.MAX_DEPTH=10;let ee=U;class oe{constructor(t){this.input=t,this.pos=0}isAtEnd(){return this.pos>=this.input.length}peek(t=0){return this.pos+t>=this.input.length?"\0":this.input[this.pos+t]}advance(t=1){const n=this.input.substring(this.pos,this.pos+t);return this.pos+=t,n}match(t){return this.peek()===t?(this.advance(),!0):!1}matches(t){return!!this.input.startsWith(t,this.pos)}matchesString(t){return this.peek()===t}matchesKeyword(t){if(this.input.startsWith(t,this.pos)){const n=this.peek(t.length);if(!/[a-zA-Z0-9_]/.test(n))return this.advance(t.length),!0}return!1}skipWhitespace(){for(;!this.isAtEnd()&&/\s/.test(this.peek());)this.advance()}}const be=6048e5,je=864e5,se=Symbol.for("constructDateFrom");function P(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&se in e?e[se](t):e instanceof Date?new e.constructor(t):new Date(t)}function C(e,t){return P(t||e,e)}let Ie={};function X(){return Ie}function L(e,t){const n=X(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=C(e,t?.in),i=r.getDay(),o=(i<a?7:0)+i-a;return r.setDate(r.getDate()-o),r.setHours(0,0,0,0),r}function H(e,t){return L(e,{...t,weekStartsOn:1})}function ge(e,t){const n=C(e,t?.in),a=n.getFullYear(),r=P(n,0);r.setFullYear(a+1,0,4),r.setHours(0,0,0,0);const i=H(r),o=P(n,0);o.setFullYear(a,0,4),o.setHours(0,0,0,0);const c=H(o);return n.getTime()>=i.getTime()?a+1:n.getTime()>=c.getTime()?a:a-1}function ce(e){const t=C(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Ne(e,...t){const n=P.bind(null,t.find(a=>typeof a=="object"));return t.map(n)}function ue(e,t){const n=C(e,t?.in);return n.setHours(0,0,0,0),n}function Ee(e,t,n){const[a,r]=Ne(n?.in,e,t),i=ue(a),o=ue(r),c=+i-ce(i),h=+o-ce(o);return Math.round((c-h)/je)}function We(e,t){const n=ge(e,t),a=P(e,0);return a.setFullYear(n,0,4),a.setHours(0,0,0,0),H(a)}function Fe(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ze(e){return!(!Fe(e)&&typeof e!="number"||isNaN(+C(e)))}function Re(e,t){const n=C(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Ye={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},qe=(e,t,n)=>{let a;const r=Ye[e];return typeof r=="string"?a=r:t===1?a=r.one:a=r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+a:a+" ago":a};function J(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const $e={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Le={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},_e={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Be={date:J({formats:$e,defaultWidth:"full"}),time:J({formats:Le,defaultWidth:"full"}),dateTime:J({formats:_e,defaultWidth:"full"})},Ve={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},He=(e,t,n,a)=>Ve[e];function z(e){return(t,n)=>{const a=n?.context?String(n.context):"standalone";let r;if(a==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,c=n?.width?String(n.width):o;r=e.formattingValues[c]||e.formattingValues[o]}else{const o=e.defaultWidth,c=n?.width?String(n.width):e.defaultWidth;r=e.values[c]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return r[i]}}const Ue={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ge={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter"
Line truncated
|
||||
:where(:root) {
|
||||
color-scheme: light dark;
|
||||
}
|
||||
|
||||
:where(.a2ui-dark) {
|
||||
color-scheme: dark;
|
||||
}
|
||||
|
||||
:where(.a2ui-light) {
|
||||
color-scheme: light;
|
||||
}
|
||||
|
||||
:where(:root), :where(.a2ui-dark), :where(.a2ui-light) {
|
||||
--a2ui-color-background: light-dark(#eee, #111);
|
||||
--a2ui-color-on-background: light-dark(#333, #eee);
|
||||
|
||||
--a2ui-color-surface: light-dark(
|
||||
color-mix(in oklab, var(--a2ui-color-background) 85%, white),
|
||||
color-mix(in oklab, var(--a2ui-color-background) 95%, white)
|
||||
);
|
||||
--a2ui-color-on-surface: light-dark(#333, #eee);
|
||||
|
||||
--a2ui-color-primary: #17e;
|
||||
--a2ui-color-primary-light: ${N("light",{colorVar:"--a2ui-color-primary"})};
|
||||
--a2ui-color-primary-dark: ${N("dark",{colorVar:"--a2ui-color-primary"})};
|
||||
--a2ui-color-primary-hover: ${N("hover",{darkVar:"--a2ui-color-primary-dark",lightVar:"--a2ui-color-primary-light"})};
|
||||
--a2ui-color-on-primary: #fff;
|
||||
|
||||
--a2ui-color-secondary: light-dark(#ddd, #333);
|
||||
--a2ui-color-secondary-light: ${N("light",{colorVar:"--a2ui-color-secondary"})};
|
||||
--a2ui-color-secondary-dark: ${N("dark",{colorVar:"--a2ui-color-secondary",percentage:95})};
|
||||
--a2ui-color-secondary-hover: ${N("hover",{darkVar:"--a2ui-color-secondary-dark",lightVar:"--a2ui-color-secondary-light"})};
|
||||
--a2ui-color-on-secondary: light-dark(#333, #eee);
|
||||
|
||||
--a2ui-border-radius: 0.25rem;
|
||||
--a2ui-color-border: light-dark(#ccc, #444);
|
||||
--a2ui-border-width: 1px;
|
||||
--a2ui-border: 1px solid var(--a2ui-color-border, #ccc);
|
||||
|
||||
--a2ui-font-family-title: inherit;
|
||||
--a2ui-font-family-monospace: monospace;
|
||||
--a2ui-color-input: light-dark(#fff, #2a2a2a);
|
||||
--a2ui-color-on-input: light-dark(#333, #eee);
|
||||
|
||||
--a2ui-grid-base: 0.5rem;
|
||||
--a2ui-spacing-xs: calc(var(--a2ui-spacing-s) / 2);
|
||||
--a2ui-spacing-s: calc(var(--a2ui-spacing-m) / 2);
|
||||
--a2ui-spacing-m: var(--a2ui-grid-base);
|
||||
--a2ui-spacing-l: calc(var(--a2ui-spacing-m) * 2);
|
||||
--a2ui-spacing-xl: calc(var(--a2ui-spacing-l) * 2);
|
||||
|
||||
--a2ui-font-size: 1rem;
|
||||
--a2ui-font-scale: 1.2;
|
||||
--a2ui-font-size-xs: calc(var(--a2ui-font-size-s) / var(--a2ui-font-scale));
|
||||
--a2ui-font-size-s: calc(var(--a2ui-font-size-m) / var(--a2ui-font-scale));
|
||||
--a2ui-font-size-m: var(--a2ui-font-size);
|
||||
--a2ui-font-size-l: calc(var(--a2ui-font-size-m) * var(--a2ui-font-scale));
|
||||
--a2ui-font-size-xl: calc(var(--a2ui-font-size-l) * var(--a2ui-font-scale));
|
||||
--a2ui-font-size-2xl: calc(var(--a2ui-font-size-xl) * var(--a2ui-font-scale));
|
||||
|
||||
--a2ui-line-height-headings: 1.2;
|
||||
--a2ui-line-height-body: 1.5;
|
||||
}
|
||||
`;let B;function na(){return B||(B=new CSSStyleSheet,B.replaceSync(ta)),B}function aa(){if(typeof document>"u")return;const e=na();document.adoptedStyleSheets.includes(e)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,e])}function N(e,t){switch(e){case"light":{const n=t;return`color-mix(in oklab, var(${n.colorVar}) ${n.percentage??85}%, ${n.mixColor??"white"})`}case"dark":{const n=t;return`color-mix(in oklab, var(${n.colorVar}) ${n.percentage??85}%, ${n.mixColor??"black"})`}case"hover":{const n=t;return`light-dark(var(${n.darkVar}), var(${n.lightVar}))`}}}var xe=y.memo(({surface:e,id:t,basePath:n,compImpl:a,componentModel:r})=>{const i=a.render,o=y.useMemo(()=>new Pe(e,t,n),[e,t,n,r]),c=y.useCallback((h,l)=>{const d=l||o.dataContext.path;return s.jsx(ne,{surface:e,id:h,basePath:d},`${h}-${d}`)},[e,o.dataContext.path]);return s.jsx(i,{context:o,buildChild:c})});xe.displayName="ResolvedChild";var ne=y.memo(({surface:e,id:t,basePath:n})=>{const a=y.useMemo(()=>{let o=0;return{subscribe:c=>{const h=e.componentsModel.onCreated.subscribe(d=>{d.id===t&&(o++,c())}),l=e.componentsModel.onDeleted.subscribe(d=>{d===t&&(o++,c())});return()=>{h.unsubscribe(),l.unsubscribe()}},getSnapshot:()=>{const c=e.componentsModel.get(t);return c?`${c.type}-${o}`:`missing-${o}`}}},[e,t]);y.useSyncExternalStore(a.subscribe,a.getSnapshot);const r=e.componentsModel.get(t);if(!r)return s.jsxs("div",{style:{color:"gray",padding:"4px"},children:["[Loading ",t,"...]"]});const i=e.catalog.components.get(r.type);return i?s.jsx(xe,{surface:e,id:t,basePath:n,componentModel:r,compImpl:i}):s.jsxs("div",{style:{color:"red"},children:["Unknown component: ",r.type]})});ne.displayName="DeferredChild";var Ia=({surface:e})=>s.jsx(ne,{surface:e,id:"root",basePath:"/"});function w(e,t){const n=y.memo(t,(r,i)=>!(r.props!==i.props||r.context.componentModel.id!==i.context.componentModel.id||r.context.dataContext.path!==i.context.dataContext.path)),a=({context:r,buildChild:i})=>{const o=y.useRef(null);o.current?o.current.context!==r&&(o.current.dispose(),o.current=new ie(r,e.schema)):o.current=new ie(r,e.schema);const c=o.current,h=y.useCallback(f=>{const M=c.subscribe(f);return()=>M.unsubscribe()},[c]),l=y.useCallback(()=>c.snapshot,[c]),d=y.useSyncExternalStore(h,l);return y.useEffect(()=>()=>c.dispose(),[c]),s.jsx(n,{props:d||{},buildChild:i,context:r})};return{name:e.name,schema:e.schema,render:a}}function Na(e,t){return{name:e.name,schema:e.schema,render:t}}var k=()=>{y.useEffect(()=>{typeof document<"u"&&document.adoptedStyleSheets&&aa()},[])},we=e=>{switch(e){case"center":return"center";case"end":return"flex-end";case"spaceAround":return"space-around";case"spaceBetween":return"space-between";case"spaceEvenly":return"space-evenly";case"start":return"flex-start";case"stretch":return"stretch";default:return"flex-start"}},ae=e=>{switch(e){case"start":return"flex-start";case"center":return"center";case"end":return"flex-end";case"stretch":return"stretch";default:return"stretch"}},Q=()=>({boxSizing:"border-box"}),ra=()=>({boxSizing:"border-box"}),_=e=>typeof e!="number"?{}:{flex:`${e}`,minWidth:0,minHeight:0},ia=y.createContext(void 0),oa=()=>y.useContext(ia),fe=!1;function sa(e,t){const n=oa(),[a,r]=y.useState(null),i=JSON.stringify(t);return y.useEffect(()=>{if(!n){fe||(console.warn("[useMarkdown]",`can't render markdown because no markdown renderer is configured.
|
||||
`,"Use `@a2ui/markdown-it`, or your own markdown renderer."),fe=!0),r(null);return}let o=!0;const c=i?JSON.parse(i):void 0;return n(e,c).then(h=>{o&&r(h)}).catch(h=>{console.error("[useMarkdown] Render failed:",h)}),()=>{o=!1}},[e,n,i]),a}var pe={},ca=(e,t)=>{switch(t){case"h1":return`# ${e}`;case"h2":return`## ${e}`;case"h3":return`### ${e}`;case"h4":return`#### ${e}`;case"h5":return`##### ${e}`;case"caption":return`*${e}*`;default:return e}},ua=w(Fn,({props:e})=>{k();const t=typeof e.text=="string"?e.text:String(e.text??""),n=ca(t,e.variant),a=sa(n),r={...Q(),..._(e.weight)},i=e.variant==="caption",o=[pe.a2uiText,i?pe.a2uiCaption:e.variant||"body"];a===null&&o.push("no-markdown-renderer");const c=a!==null?{dangerouslySetInnerHTML:{__html:a}}:{children:n};return i?s.jsx("span",{className:o.join(" "),style:r,...c}):s.jsx("div",{className:o.join(" "),style:r,...c})}),la=w(zn,({props:e})=>{k();const t=a=>a==="scaleDown"?"scale-down":a||"fill",n={...Q(),..._(e.weight),objectFit:t(e.fit),display:"block",borderRadius:"var(--a2ui-image-border-radius, 0)"};return e.variant==="icon"?(n.width="var(--a2ui-image-icon-size, 24px)",n.height="var(--a2ui-image-icon-size, 24px)"):e.variant==="avatar"?(n.width="var(--a2ui-image-avatar-size, 40px)",n.height="var(--a2ui-image-avatar-size, 40px)",n.borderRadius="50%"):e.variant==="smallFeature"?n.maxWidth="var(--a2ui-image-small-feature-size, 100px)":e.variant==="largeFeature"?n.maxHeight="var(--a2ui-image-large-feature-size, 400px)":e.variant==="header"&&(n.height="var(--a2ui-image-header-size, 200px)",n.objectFit="cover"),s.jsx("img",{src:e.url,alt:e.description||"",style:n})}),da={play:"play_arrow",rewind:"fast_rewind",favoriteOff:"favorite_border",starOff:"star_border"};function ha(e){return da[e]??e.replace(/[A-Z]/g,t=>"_"+t.toLowerCase())}var ma=w(Yn,({props:e})=>{k();const t=typeof e.name=="object"&&e.name!==null&&"svgPath"in e.name,n={...Q(),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"var(--a2ui-icon-size, var(--a2ui-font-size-xl, 24px))",color:"var(--a2ui-icon-color, inherit)",lineHeight:1};if(t){const i=e.name.svgPath;return s.jsx("svg",{className:"a2ui-icon svg",viewBox:"0 0 24 24",style:{...n,fill:"currentColor",width:"var(--a2ui-icon-size, 24px)",height:"var(--a2ui-icon-size, 24px)"},children:s.jsx("path",{d:i})})}const a=typeof e.name=="string"?ha(e.name):"",r={...n,fontFamily:'var(--a2ui-icon-font-family, "Material Symbols Outlined", sans-serif)',fontVariationSettings:'var(--a2ui-icon-font-variation-settings, "FILL" 1)',fontWeight:"normal",fontStyle:"normal",letterSpacing:"normal",textTransform:"none"};return s.jsx("span",{className:"material-symbols-outlined",style:r,children:a})}),fa=w(qn,({props:e})=>{k();const t={...Q(),width:"100%",height:"auto",borderRadius:"var(--a2ui-video-border-radius, 0)"};return s.jsx("video",{src:e.url,controls:!0,style:t})}),pa=w($n,({props:e})=>{k();const t={display:"flex",flexDirection:"column",gap:"var(--a2ui-spacing-xs, 0.25rem)",background:"var(--a2ui-audioplayer-background, transparent)",borderRadius:"var(--a2ui-audioplayer-border-radius, 0)",padding:"var(--a2ui-audioplayer-padding, 0)"};return s.jsxs("div",{style:t,children:[e.description&&s.jsx("span",{style:{fontSize:"var(--a2ui-font-size-xs, 0.75rem)",color:"var(--a2ui-text-caption-color, light-dark(#666, #aaa))"},children:e.description}),s.jsx("audio",{src:e.url,controls:!0})]})}),re=({childList:e,buildChild:t})=>Array.isArray(e)?s.jsx(s.Fragment,{children:e.map((n,a)=>{if(n&&typeof n=="object"&&"id"in n){const r=n;return s.jsx(W.Fragment,{children:t(r.id,r.basePath)},`${r.id}-${a}`)}return typeof n=="string"?s.jsx(W.Fragment,{children:t(n)},`${n}-${a}`):null})}):null,ba=w(Ln,({props:e,buildChild:t,context:n})=>(k(),s.jsx("div",{style:{..._(e.weight),display:"flex",flexDirection:"row",justifyContent:we(e.justify),alignItems:ae(e.align),gap:"var(--a2ui-row-gap, var(--a2ui-spacing-m))"},children:s.jsx(re,{childList:e.children,buildChild:t,context:n})}))),ga=w(_n,({props:e,buildChild:t,context:n})=>(k(),s.jsx("div",{style:{..._(e.weight),display:"flex",flexDirection:"column",justifyContent:we(e.justify),alignItems:ae(e.align),gap:"var(--a2ui-column-gap, var(--a2ui-spacing-m))"},children:s.jsx(re,{childList:e.children,buildChild:t,context:n})}))),ya=w(Bn,({props:e,buildChild:t,context:n})=>{k();const a=e.direction==="horizontal",r={display:"flex",flexDirection:a?"row":"column",alignItems:ae(e.align),overflowX:a?"auto":"hidden",overflowY:a?"hidden":"auto",gap:"var(--a2ui-list-gap, var(--a2ui-spacing-s))",padding:"var(--a2ui-list-padding, 0)"};return s.jsx("div",{style:r,children:s.jsx(re,{childList:e.children,buildChild:t,context:n})})}),va=w(Vn,({props:e,buildChild:t})=>{k();const n={...ra(),..._(e.weight),display:"block",border:"var(--a2ui-card-border, var(--a2ui-border))",borderRadius:"var(--a2ui-card-border-radius, var(--a2ui-border-radius, 8px))",padding:"var(--a2ui-card-padding, var(--a2ui-spacing-m, 16px))",background:"var(--a2ui-card-b
Line truncated
|
||||
@@ -0,0 +1,5 @@
|
||||
import{y as Q,w as _,x as X,z as E,B as w,o as f,E as q,a as O,s as m,F as S,u as $,b as N,H as k,d as Y,I as K}from"./common-types.js";import{J as mt,A as ht,f as gt,l as yt,t as bt,K as vt,k as St,C as At,L as _t,v as wt,j as Mt,M as It,N as Zt,m as kt,r as Dt,q as Pt,D as jt,O as Ct,P as Ot,G as $t,Q as Nt,g as Et,e as Tt,i as xt,R as Ut}from"./common-types.js";class v{constructor(){this.listeners=new Set}subscribe(e){return this.listeners.add(e),{unsubscribe:()=>this.listeners.delete(e)}}async emit(e){for(const t of this.listeners)try{await t(e)}catch(a){console.error("EventEmitter error:",a)}}dispose(){this.listeners.clear()}}function D(n){return/^\d+$/.test(n)}class ee{constructor(e={}){this.data={},this.signals=new Map,this.subscriptions=new Set,this.data=e}getSignal(e){const t=this.normalizePath(e);return this.signals.has(t)||this.signals.set(t,Q(this.get(t))),this.signals.get(t)}set(e,t){if(e==null)throw new _("Path cannot be null or undefined.");if(e==="/"||e==="")return this.data=t,this.notifyAllSignals(),this;const a=this.parsePath(e),s=a.pop();this.data||(this.data={});let r=this.data;for(let i=0;i<a.length;i++){const o=a[i];if(Array.isArray(r)&&!D(o))throw new _(`Cannot use non-numeric segment '${o}' on an array in path '${e}'.`,e);if(r[o]!==void 0&&r[o]!==null&&typeof r[o]!="object")throw new _(`Cannot set path '${e}': segment '${o}' is a primitive value.`,e);if(r[o]===void 0||r[o]===null){const c=i<a.length-1?a[i+1]:s;r[o]=D(c)?[]:{}}r=r[o]}if(Array.isArray(r)&&!D(s))throw new _(`Cannot use non-numeric segment '${s}' on an array in path '${e}'.`,e);return t===void 0?Array.isArray(r)?r[parseInt(s,10)]=void 0:delete r[s]:r[s]=t,this.notifySignals(e),this}get(e){if(e==null)throw new _("Path cannot be null or undefined.");if(e==="/"||e==="")return this.data;const t=this.parsePath(e);let a=this.data;for(const s of t){if(a==null)return;a=a[s]}return a}subscribe(e,t){const a=this.getSignal(e);let s=!0,r=a.peek();const i=X(()=>{const o=a.value;r=o,s||t(o)});return s=!1,this.subscriptions.add(i),{get value(){return r},unsubscribe:()=>{i(),this.subscriptions.delete(i)}}}dispose(){for(const e of this.subscriptions)e();this.subscriptions.clear(),this.signals.clear()}normalizePath(e){return e.length>1&&e.endsWith("/")?e.slice(0,-1):e||"/"}parsePath(e){return e.split("/").filter(t=>t.length>0)}notifySignals(e){const t=this.normalizePath(e);E(()=>{this.updateSignal(t);let a=t;for(;a!=="/"&&a!=="";)a=a.substring(0,a.lastIndexOf("/"))||"/",this.updateSignal(a);for(const s of this.signals.keys())this.isDescendant(s,t)&&this.updateSignal(s)})}updateSignal(e){const t=this.signals.get(e);if(t){const a=this.get(e);Array.isArray(a)?t.value=[...a]:typeof a=="object"&&a!==null?t.value={...a}:t.value=a}}notifyAllSignals(){E(()=>{for(const e of this.signals.keys())this.updateSignal(e)})}isDescendant(e,t){return t==="/"||t===""?e!=="/":e.startsWith(t+"/")}}class te{constructor(){this.components=new Map,this._onCreated=new v,this._onDeleted=new v,this.onCreated=this._onCreated,this.onDeleted=this._onDeleted}get(e){return this.components.get(e)}get entries(){return this.components.entries()}addComponent(e){if(this.components.has(e.id))throw new w(`Component with id '${e.id}' already exists.`);this.components.set(e.id,e),this._onCreated.emit(e)}removeComponent(e){const t=this.components.get(e);t&&(this.components.delete(e),t.dispose(),this._onDeleted.emit(e))}dispose(){for(const e of this.components.values())e.dispose();this.components.clear(),this._onCreated.dispose(),this._onDeleted.dispose()}}const V=f({name:m().describe("The name of the action, taken from the component's action.event.name property."),surfaceId:m().describe("The id of the surface where the event originated."),sourceComponentId:m().describe("The id of the component that triggered the event."),timestamp:m().datetime().describe("An ISO 8601 timestamp of when the event occurred."),context:q(O()).describe("A JSON object containing the key-value pairs from the component's action.event.context, after resolving all data bindings.")}).strict(),ne=f({code:S("VALIDATION_FAILED"),surfaceId:m().describe("The id of the surface where the error occurred."),path:m().describe("The JSON pointer to the field that failed validation (e.g. '/components/0/text')."),message:m().describe("A short one or two sentence description of why validation failed.")}).strict(),ae=f({code:m().refine(n=>n!=="VALIDATION_FAILED"),message:m().describe("A short one or two sentence description of why the error occurred."),surfaceId:m().describe("The id of the surface where the error occurred.")}).passthrough(),se=$([ne,ae]),re=f({version:S("v0.9")}).and($([f({action:V}),f({error:se})])),ot=f({version:S("v0.9"),surfaces:q(f({}).passthrough()).describe("A map of surface IDs to their current data models.")}).strict(),ie=N(re).describe("A list of client messages."),ct=f({messages:ie}).strict().describe("An object wrapping a list of client messages.");class oe{constructor(e,t,a={},s=!1){this.id=e,thLine truncated
|
||||
]))`;continue}else if(a[c]==="$"){s+=`($|(?=[\r
|
||||
]))`;continue}}if(t.s&&a[c]==="."){s+=i?`${a[c]}\r
|
||||
`:`[${a[c]}\r
|
||||
]`;continue}s+=a[c],a[c]==="\\"?r=!0:i&&a[c]==="]"?i=!1:!i&&a[c]==="["&&(i=!0)}try{new RegExp(s)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),n.source}return s}function H(n,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&n.keyType?._def.typeName===u.ZodEnum)return{type:"object",required:n.keyType._def.values,properties:n.keyType._def.values.reduce((a,s)=>({...a,[s]:l(n.valueType._def,{...e,currentPath:[...e.currentPath,"properties",s]})??g(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};const t={type:"object",additionalProperties:l(n.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return t;if(n.keyType?._def.typeName===u.ZodString&&n.keyType._def.checks?.length){const{type:a,...s}=G(n.keyType._def,e);return{...t,propertyNames:s}}else{if(n.keyType?._def.typeName===u.ZodEnum)return{...t,propertyNames:{enum:n.keyType._def.values}};if(n.keyType?._def.typeName===u.ZodBranded&&n.keyType._def.type._def.typeName===u.ZodString&&n.keyType._def.type._def.checks?.length){const{type:a,...s}=J(n.keyType._def,e);return{...t,propertyNames:s}}}return t}function Ie(n,e){if(e.mapStrategy==="record")return H(n,e);const t=l(n.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||g(e),a=l(n.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||g(e);return{type:"array",maxItems:125,items:{type:"array",items:[t,a],minItems:2,maxItems:2}}}function Ze(n){const e=n.values,a=Object.keys(n.values).filter(r=>typeof e[e[r]]!="number").map(r=>e[r]),s=Array.from(new Set(a.map(r=>typeof r)));return{type:s.length===1?s[0]==="string"?"string":"number":["string","number"],enum:a}}function ke(n){return n.target==="openAi"?void 0:{not:g({...n,currentPath:[...n.currentPath,"not"]})}}function De(n){return n.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}const Z={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Pe(n,e){if(e.target==="openApi3")return R(n,e);const t=n.options instanceof Map?Array.from(n.options.values()):n.options;if(t.every(a=>a._def.typeName in Z&&(!a._def.checks||!a._def.checks.length))){const a=t.reduce((s,r)=>{const i=Z[r._def.typeName];return i&&!s.includes(i)?[...s,i]:s},[]);return{type:a.length>1?a:a[0]}}else if(t.every(a=>a._def.typeName==="ZodLiteral"&&!a.description)){const a=t.reduce((s,r)=>{const i=typeof r._def.value;switch(i){case"string":case"number":case"boolean":return[...s,i];case"bigint":return[...s,"integer"];case"object":if(r._def.value===null)return[...s,"null"];default:return s}},[]);if(a.length===t.length){const s=a.filter((r,i,o)=>o.indexOf(r)===i);return{type:s.length>1?s:s[0],enum:t.reduce((r,i)=>r.includes(i._def.value)?r:[...r,i._def.value],[])}}}else if(t.every(a=>a._def.typeName==="ZodEnum"))return{type:"string",enum:t.reduce((a,s)=>[...a,...s._def.values.filter(r=>!a.includes(r))],[])};return R(n,e)}const R=(n,e)=>{const t=(n.options instanceof Map?Array.from(n.options.values()):n.options).map((a,s)=>l(a._def,{...e,currentPath:[...e.currentPath,"anyOf",`${s}`]})).filter(a=>!!a&&(!e.strictUnions||typeof a=="object"&&Object.keys(a).length>0));return t.length?{anyOf:t}:void 0};function je(n,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(n.innerType._def.typeName)&&(!n.innerType._def.checks||!n.innerType._def.checks.length))return e.target==="openApi3"?{type:Z[n.innerType._def.typeName],nullable:!0}:{type:[Z[n.innerType._def.typeName],"null"]};if(e.target==="openApi3"){const a=l(n.innerType._def,{...e,currentPath:[...e.currentPath]});return a&&"$ref"in a?{allOf:[a],nullable:!0}:a&&{...a,nullable:!0}}const t=l(n.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return t&&{anyOf:[t,{type:"null"}]}}function Ce(n,e){const t={type:"number"};if(!n.checks)return t;for(const a of n.checks)switch(a.kind){case"int":t.type="integer",B(t,"type",a.message,e);break;case"min":e.target==="jsonSchema7"?a.inclusive?d(t,"minimum",a.value,a.message,e):d(t,"exclusiveMinimum",a.value,a.message,e):(a.inclusive||(t.exclusiveMinimum=!0),d(t,"minimum",a.value,a.message,e));break;case"max":e.target==="jsonSchema7"?a.inclusive?d(t,"maximum",a.value,a.message,e):d(t,"exclusiveMaximum",a.value,a.message,e):(a.inclusive||(t.exclusiveMaximum=!0),d(t,"maximum",a.value,a.message,e));break;case"multipleOf":d(t,"multipleOf",a.value,a.message,e);break}return t}function Oe(n,e){const t=e.target==="openAi",a={type:"object",properties:{}},s=[],r=n.shape();for(const o in r){let c=r[o];if(c===void 0||c._def===void 0)continue;let p=Ne(c);p&&t&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),p=!1);const A=l(c._def,{...e,currentPath:[..
Line truncated
|
||||
@@ -0,0 +1,2 @@
|
||||
import{_ as e,l as s,D as o,d as i}from"./mermaid.core.js";import{p as g}from"./cynefin-OW5HDTMX.js";import"./index.js";var p={parse:e(async r=>{const a=await g("info",r);s.debug(a)},"parse")},d={version:"11.17.2"},v=e(()=>d.version,"getVersion"),m={getVersion:v},c=e((r,a,n)=>{s.debug(`rendering info diagram
|
||||
`+r);const t=o(a);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw"),l={draw:c},b={parser:p,db:m,renderer:l};export{b as diagram};
|
||||
@@ -0,0 +1 @@
|
||||
function t(e,a){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(a).domain(e);break}return this}export{t as i};
|
||||
@@ -0,0 +1,70 @@
|
||||
import{_ as o,c as ot,L as ut,D as dt,an as yt,p as ft,k as pt,n as it,a as gt,b as kt,g as mt,s as wt,o as _t,d as bt}from"./mermaid.core.js";import"./index.js";var J=(function(){var e=o(function(T,t,s,i){for(s=s||{},i=T.length;i--;s[T[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],u=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],D={trace:o(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:o(function(t,s,i,c,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return c;case 15:c.addNode(n[w-1].length,n[w].trim());break;case 16:c.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(u,[2,18],{14:[1,21]}),e(u,[2,16]),e(u,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(u,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],c=[],p=[null],n=[],v=this.table,w="",I=0,$=0,L=2,A=1,C=n.slice.call(arguments,1),b=Object.create(this.lexer),S={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(S.yy[P]=this.yy[P]);b.setInput(t,S.yy),S.yy.lexer=b,S.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var R=b.yylloc;n.push(R);var G=b.options&&b.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Y(B){i.length=i.length-2*B,p.length=p.length-B,n.length=n.length-B}o(Y,"popStack");function tt(){var B;return B=c.pop()||b.lex()||A,typeof B!="number"&&(B instanceof Array&&(c=B,B=c.pop()),B=s.symbols_[B]||B),B}o(tt,"lex");for(var M,W,N,K,F={},U,V,et,Z;;){if(W=i[i.length-1],this.defaultActions[W]?N=this.defaultActions[W]:((M===null||typeof M>"u")&&(M=tt()),N=v[W]&&v[W][M]),typeof N>"u"||!N.length||!N[0]){var q="";Z=[];for(U in v[W])this.terminals_[U]&&U>L&&Z.push("'"+this.terminals_[U]+"'");b.showPosition?q="Parse error on line "+(I+1)+`:
|
||||
`+b.showPosition()+`
|
||||
Expecting `+Z.join(", ")+", got '"+(this.terminals_[M]||M)+"'":q="Parse error on line "+(I+1)+": Unexpected "+(M==A?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(q,{text:b.match,token:this.terminals_[M]||M,line:b.yylineno,loc:R,expected:Z})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+M);switch(N[0]){case 1:i.push(M),p.push(b.yytext),n.push(b.yylloc),i.push(N[1]),M=null,$=b.yyleng,w=b.yytext,I=b.yylineno,R=b.yylloc;break;case 2:if(V=this.productions_[N[1]][1],F.$=p[p.length-V],F._$={first_line:n[n.length-(V||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(V||1)].first_column,last_column:n[n.length-1].last_column},G&&(F._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),K=this.performAction.apply(F,[w,$,I,S.yy,N[1],p,n].concat(C)),typeof K<"u")return K;V&&(i=i.slice(0,-1*V*2),p=p.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[N[1]][0]),p.push(F.$),n.push(F._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=(function(){var T={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||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:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.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),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;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),i.length-1&&(this.yylineno-=i.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:i?(i.length===c.length?this.yylloc.first_column:0)+c[c.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(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:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(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:o(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:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
|
||||
`+s+"^"},"showPosition"),test_match:o(function(t,s){var i,c,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))),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],i=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var n in p)this[n]=p[n];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,s,i,c;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),n=0;n<p.length;n++)if(i=this._input.match(this.rules[p[n]]),i&&(!s||i[0].length>s[0].length)){if(s=i,c=n,this.options.backtrack_lexer){if(t=this.test_match(i,p[n]),t!==!1)return t;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(t=this.test_match(s,p[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:o(function(){var s=this.next();return s||this.lex()},"lex"),begin:o(function(s){this.conditionStack.push(s)},"begin"),popState:o(function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(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:o(function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},"topState"),pushState:o(function(s){this.begin(s)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(s,i,c,p){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 T})();D.lexer=O;function E(){this.yy={}}return o(E,"Parser"),E.prototype=D,D.Parser=E,new E})();J.parser=J;var xt=J,H,vt=(H=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,ft()}getRoot(){return this.root}addNode(h,r){const a=pt.sanitizeText(r,ot());if(!this.root){this.root={text:a,children:[]},this.stack=[{level:0,node:this.root}],it(a);return}this.baseLevel??=h;let l=h-this.baseLevel+1;for(l<=0&&(l=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=l;)this.stack.pop();const y=this.stack[this.stack.length-1].node,f={text:a,children:[]};y.children.push(f),this.stack.push({level:l,node:f})}getAccTitle(){return gt()}setAccTitle(h){kt(h)}getAccDescription(){return mt()}setAccDescription(h){wt(h)}getDiagramTitle(){return _t()}setDiagramTitle(h){it(h)}},o(H,"IshikawaDB"),H),St=14,j=250,$t=30,Et=60,At=5,ht=82*Math.PI/180,st=Math.cos(ht),nt=Math.sin(ht),at=o((e,h,r)=>{const a=e.node().getBBox(),l=a.width+h*2,y=a.height+h*2;bt(e,y,l,r),e.attr("viewBox",`${a.x-h} ${a.y-h} ${l} ${y}`)},"applyPaddedViewBox"),It=o((e,h,r,a)=>{const y=a.db.getRoot();if(!y)return;const f=ot(),{look:d,handDrawnSeed:m,themeVariables:u}=f,k=ut(f.fontSize)[0]??St,g=d==="handDrawn",_=y.children??[],x=f.ishikawa?.diagramPadding??20,D=f.ishikawa?.useMaxWidth??!1,O=dt(h),E=O.append("g").attr("class","ishikawa"),T=g?yt.svg(O.node()):void 0,t=T?{roughSvg:T,seed:m??0,lineColor:u?.lineColor??"#333",fillColor:u?.mainBkg??"#fff"}:void 0,s=`ishikawa-arrow-${h}`;g||E.append("defs").append("marker").attr("id",s).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 i=0,c=j;const p=g?void 0:z(E,i,c,i,c,"ishikawa-spine");if(Lt(E,i,c,y.text,k,t),!_.length){g&&z(E,i,c,i,c,"ishikawa-spine",t),at(O,x,D);return}i-=20;const n=_.filter((S,P)=>P%2===0),v=_.filter((S,P)=>P%2===1),w=rt(n),I=rt(v),$=w.total+I.total;let L=j,A=j;if($>0){const S=j*2,P=j*.3;L=Math.max(P,S*(w.total/$)),A=Math.max(P,S*(I.total/$))}const C=k*2;L=Math.max(L,w.max*C),A=Math.max(A,I.max*C),c=Math.max(L,j),p&&p.attr("y1",c).attr("y2",c),E.select(".ishikawa-head-group").attr("transform",`translate(0,${c})`);const b=Math.ceil(_.length/2);for(let S=0;S<b;S++){const P=E.append("g").attr("class","ishikawa-pair");for(const[R,G,Y]of[[_[S*2],-1,L],[_[S*2+1],1,A]])R&&Pt(P,R,i,c,G,Y,k,t);i=P.selectAll("text").nodes().reduce((R,G)=>Math.min(R,G.getBBox().x),1/0)}if(g)z(E,i,c,0,c,"ishikawa-spine",t);else{p.attr("x1",i);const S=`url(#${s})`;E.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",S)}at(O,x,D)},"draw"),rt=o(e=>{const h=o(r=>r.children.reduce((a,l)=>a+1+h(l),0),"countDescendants");return e.reduce((r,a)=>{const l=h(a);return r.total+=l,r.max=Math.max(r.max,l),r},{total:0,max:0})},"sideStats"),Lt=o((e,h,r,a,l,y)=>{const f=Math.max(6,Math.floor(110/(l*.6))),d=e.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${h},${r})`),m=X(d,ct(a,f),0,0,"ishikawa-head-label","start",l),u=m.node().getBBox(),k=Math.max(60,u.width+6),g=Math.max(40,u.height*2+40),_=`M 0 ${-g/2} L 0 ${g/2} Q ${k*2.4} 0 0 ${-g/2} Z`;if(y){const x=y.roughSvg.path(_,{roughness:1.5,seed:y.seed,fill:y.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:y.lineColor,strokeWidth:2});d.insert(()=>x,":first-child").attr("class","ishikawa-head")}else d.insert("path",":first-child").attr("class","ishikawa-head").attr("d",_);m.attr("transform",`translate(${(k-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),Tt=o((e,h)=>{const r=[],a=[],l=o
Line truncated
|
||||
`)},"wrapText"),X=o((e,h,r,a,l,y,f)=>{const d=Bt(h),m=f*1.05,u=e.append("text").attr("class",l).attr("text-anchor",y).attr("x",r).attr("y",a-(d.length-1)*m/2);for(const[k,g]of d.entries())u.append("tspan").attr("x",r).attr("dy",k===0?0:m).text(g);return u},"drawMultilineText"),lt=o((e,h,r)=>e+(h-e)*r,"lerp"),z=o((e,h,r,a,l,y,f)=>{if(f){const d=f.roughSvg.line(h,r,a,l,{roughness:1.5,seed:f.seed,stroke:f.lineColor,strokeWidth:2});e.append(()=>d).attr("class",y);return}return e.append("line").attr("class",y).attr("x1",h).attr("y1",r).attr("x2",a).attr("y2",l)},"drawLine"),Nt={draw:It},Dt=o(e=>`
|
||||
.ishikawa .ishikawa-spine,
|
||||
.ishikawa .ishikawa-branch,
|
||||
.ishikawa .ishikawa-sub-branch {
|
||||
stroke: ${e.lineColor};
|
||||
stroke-width: 2;
|
||||
fill: none;
|
||||
}
|
||||
|
||||
.ishikawa .ishikawa-sub-branch {
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
.ishikawa .ishikawa-arrow {
|
||||
fill: ${e.lineColor};
|
||||
}
|
||||
|
||||
.ishikawa .ishikawa-head {
|
||||
fill: ${e.mainBkg};
|
||||
stroke: ${e.lineColor};
|
||||
stroke-width: 2;
|
||||
}
|
||||
|
||||
.ishikawa .ishikawa-label-box {
|
||||
fill: ${e.mainBkg};
|
||||
stroke: ${e.lineColor};
|
||||
stroke-width: 2;
|
||||
}
|
||||
|
||||
.ishikawa text {
|
||||
font-family: ${e.fontFamily};
|
||||
font-size: ${e.fontSize};
|
||||
fill: ${e.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"),Ot=Dt,Rt={parser:xt,get db(){return new vt},renderer:Nt,styles:Ot};export{Rt as diagram};
|
||||
@@ -0,0 +1,139 @@
|
||||
import{g as gt}from"./chunk-5VM5RSS4.js";import{a as mt,b as lt,h as xt,d as kt}from"./chunk-F27PBJKO.js";import{g as _t,s as vt,a as bt,b as wt,o as Tt,n as St,_ as s,c as R,j as X,d as $t,p as Mt}from"./mermaid.core.js";import{d as it}from"./arc.js";import"./index.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(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:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),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:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,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:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
|
||||
`+_.showPosition()+`
|
||||
Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":H="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(H,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=(function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||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:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.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),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;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),l.length-1&&(this.yylineno-=l.length-1);var d=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:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(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:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(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:s(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:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
||||
`+n+"^"},"showPosition"),test_match:s(function(r,n){var l,y,d;if(this.options.backtrack_lexer&&(d={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&&(d.yylloc.range=this.yylloc.range.slice(0))),y=r[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+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],l=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var c in d)this[c]=d[c];return!1}return!1},"test_match"),next:s(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,n,l,y;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),c=0;c<d.length;c++)if(l=this._input.match(this.rules[d[c]]),l&&(!n||l[0].length>n[0].length)){if(n=l,y=c,this.options.backtrack_lexer){if(r=this.test_match(l,d[c]),r!==!1)return r;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(r=this.test_match(n,d[y]),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:s(function(){var n=this.next();return n||this.lex()},"lex"),begin:s(function(n){this.conditionStack.push(n)},"begin"),popState:s(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:s(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:s(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:s(function(n){this.begin(n)},"pushState"),stateStackSize:s(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:s(function(n,l,y,d){switch(y){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 h})();g.lexer=m;function x(){this.yy={}}return s(x,"Parser"),x.prototype=g,g.Parser=x,new x})();U.parser=U;var Et=U,V="",J=[],L=[],B=[],Ct=s(function(){J.length=0,L.length=0,V="",B.length=0,Mt()},"clear"),Pt=s(function(t){V=t,J.push(t)},"addSection"),It=s(function(){return J},"getSections"),At=s(function(){let t=rt();const e=100;let a=0;for(;!t&&a<e;)t=rt(),a++;return L.push(...B),L},"getTasks"),Ft=s(function(){const t=[];return L.forEach(a=>{a.people&&t.push(...a.people)}),[...new Set(t)].sort()},"updateActors"),Vt=s(function(t,e){const a=e.substr(1).split(":");let f=0,i=[];a.length===1?(f=Number(a[0]),i=[]):(f=Number(a[0]),i=a[1].split(","));const u=i.map(o=>o.trim()),p={section:V,type:V,people:u,task:t,score:f};B.push(p)},"addTask"),Rt=s(function(t){const e={section:V,type:V,description:t,task:t,classes:[]};L.push(e)},"addTaskOrg"),rt=s(function(){const t=s(function(a){return B[a].processed},"compileTask");let e=!0;for(const[a,f]of B.entries())t(a),e=e&&f.processed;return e},"compileTasks"),Lt=s(function(){return Ft()},"getActors"),nt={getConfig:s(()=>R().journey,"getConfig"),clear:Ct,setDiagramTitle:St,getDiagramTitle:Tt,setAccTitle:wt,getAccTitle:bt,setAccDescription:vt,getAccDescription:_t,addSection:Pt,getSections:It,getTasks:At,addTask:Vt,addTaskOrg:Rt,getActors:Lt},Bt=s(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};
|
||||
}
|
||||
|
||||
.edgePaths .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}`:""};
|
||||
}
|
||||
${gt()}
|
||||
`,"getStyles"),jt=Bt,K=s(function(t,e){return kt(t,e)},"drawRect"),Nt=s(function(t,e){const f=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 u(g){const m=it().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}s(u,"smile");function p(g){const m=it().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}s(p,"sad");function o(g){g.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 s(o,"ambivalent"),e.score>3?u(i):e.score<3?p(i):o(i),f},"drawFace"),ot=s(function(t,e){const a=t.append("circle");return a.attr("cx",e.cx),a.attr("cy",e.cy),a.attr("class","actor-"+e.pos),a.attr("fill",e.fill),a.attr("stroke",e.stroke),a.attr("r",e.r),a.class!==void 0&&a.attr("class",a.class),e.title!==void 0&&a.append("title").text(e.title),a},"drawCircle"),ct=s(function(t,e){return xt(t,e)},"drawText"),zt=s(function(t,e){function a(i,u,p,o,g){return i+","+u+" "+(i+p)+","+u+" "+(i+p)+","+(u+o-g)+" "+(i+p-g*1.2)+","+(u+o)+" "+i+","+(u+o)}s(a,"genPoints");const f=t.append("polygon");f.attr("points",a(e.x,e.y,50,20,7)),f.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,ct(t,e)},"drawLabel"),Wt=s(function(t,e,a){const f=t.append("g"),i=lt();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=a.width*e.taskCount+a.diagramMarginX*(e.taskCount-1),i.height=a.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,K(f,i),ht(a)(e.text,f,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},a,e.colour)},"drawSection"),Z=-1,Ot=s(function(t,e,a,f){const i=e.x+a.width/2,u=t.append("g");Z++,u.append("line").attr("id",f+"-task"+Z).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"),Nt(u,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=lt();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=a.width,o.height=a.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,K(u,o);let g=e.x+14;e.people.forEach(m=>{const x=e.actors[m].color,h={cx:g,cy:e.y,r:7,fill:x,stroke:"#000",title:m,pos:e.actors[m].position};ot(u,h),g+=10}),ht(a)(e.task,u,o.x,o.y,o.width,o.height,{class:"task"},a,e.colour)},"drawTask"),Yt=s(function(t,e){mt(t,e)},"drawBackgroundRect"),ht=(function(){function t(i,u,p,o,g,m,x,h){const r=u.append("text").attr("x",p+g/2).attr("y",o+m/2+5).style("font-color",h).style("text-anchor","middle").text(i);f(r,x)}s(t,"byText");function e(i,u,p,o,g,m,x,h,r){const{taskFontSize:n,taskFontFamily:l}=h,y=i.split(/<br\s*\/?>/gi);for(let d=0;d<y.length;d++){const c=d*n-n*(y.length-1)/2,v=u.append("text").attr("x",p+g/2).attr("y",o).attr("fill",r).style("text-anchor","middle").style("font-size",n).style("font-family",l);v.append("tspan").attr("x",p+g/2).attr("dy",c).text(y[d]),v.attr("y",o+m/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),f(v,x)}}s(e,"byTspan");function a(i,u,p,o,g,m,x,h){const r=u.append("switch"),l=r.append("foreignObject").attr("x",p).attr("y",o).attr("width",g).attr("height",m).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");l.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),e(i,r,p,o,g,m,x,h),f(l,x)}s(a,"byFo");function f(i,u){for(const p in u)p in u&&i.attr(p,u[p])}return s(f,"_setTextAttrs"),function(i){return i.textPlacement==="fo"?a:i.textPlacement==="old"?t:e}})(),qt=s(function(t,e){Z=-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"),j={drawRect:K,drawCircle:ot,drawSection:Wt,drawText:ct,drawLabel:zt,drawTask:Ot,drawBackgroundRect:Yt,initGraphics:qt},Ht=s(function(t){Object.keys(t).forEach(function(a){$[a]=t[a]})},"setConf"),E={},W=0;function ut(t){const e=R().journey,a=e.maxLabelWidth;W=0;let f=60;Object.keys(E).forEach(i=>{const u=E[i].color,p={cx:20,cy:f,r:7,fill:u,stroke:"#000",pos:E[i].position};j.drawCircle(t,p);let o=t.append("text").attr("visibility","hidden").text(i);const g=o.node().getBoundingClientRect().width;o.remov
Line truncated
|
||||
@@ -0,0 +1,89 @@
|
||||
import{_ as o,l as te,c as U,D as fe,af as ye,ag as be,ah as me,Y as _e,B as Y,i as F,H as ke,J as Ee,V as Se,W as ce,X as le}from"./mermaid.core.js";import{g as Ne}from"./chunk-5VM5RSS4.js";import"./index.js";var $=(function(){var e=o(function(O,i,n,r){for(n=n||{},r=O.length;r--;n[O[r]]=i);return n},"o"),h=[1,4],p=[1,13],s=[1,12],d=[1,15],_=[1,16],m=[1,20],l=[1,19],D=[6,7,8],I=[1,26],g=[1,24],w=[1,25],k=[6,7,11],G=[1,31],N=[6,7,11,24],V=[1,6,13,16,17,20,23],f=[1,35],A=[1,36],L=[1,6,7,11,13,16,17,20,23],H=[1,38],T={trace:o(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:o(function(i,n,r,a,u,t,M){var c=t.length-1;switch(u){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",t[c-1].id),a.addNode(t[c-2].length,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 16:a.getLogger().info("Node: ",t[c].id),a.addNode(t[c-1].length,t[c].id,t[c].descr,t[c].type);break;case 17:a.getLogger().trace("Icon: ",t[c]),a.decorateNode({icon:t[c]});break;case 18:case 23:a.decorateNode({class:t[c]});break;case 19:a.getLogger().trace("SPACELIST");break;case 20:a.getLogger().trace("Node: ",t[c-1].id),a.addNode(0,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 21:a.getLogger().trace("Node: ",t[c].id),a.addNode(0,t[c].id,t[c].descr,t[c].type);break;case 22:a.decorateNode({icon:t[c]});break;case 27:a.getLogger().trace("node found ..",t[c-2]),this.$={id:t[c-1],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 28:this.$={id:t[c],descr:t[c],type:0};break;case 29:a.getLogger().trace("node found ..",t[c-3]),this.$={id:t[c-3],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 30:this.$=t[c-1]+t[c];break;case 31:this.$=t[c];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:p,7:[1,10],9:9,12:11,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},e(D,[2,3]),{1:[2,2]},e(D,[2,4]),e(D,[2,5]),{1:[2,6],6:p,12:21,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},{6:p,9:22,12:11,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},{6:I,7:g,10:23,11:w},e(k,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:m,23:l}),e(k,[2,19]),e(k,[2,21],{15:30,24:G}),e(k,[2,22]),e(k,[2,23]),e(N,[2,25]),e(N,[2,26]),e(N,[2,28],{20:[1,32]}),{21:[1,33]},{6:I,7:g,10:34,11:w},{1:[2,7],6:p,12:21,13:s,14:14,16:d,17:_,18:17,19:18,20:m,23:l},e(V,[2,14],{7:f,11:A}),e(L,[2,8]),e(L,[2,9]),e(L,[2,10]),e(k,[2,16],{15:37,24:G}),e(k,[2,17]),e(k,[2,18]),e(k,[2,20],{24:H}),e(N,[2,31]),{21:[1,39]},{22:[1,40]},e(V,[2,13],{7:f,11:A}),e(L,[2,11]),e(L,[2,12]),e(k,[2,15],{24:H}),e(N,[2,30]),{22:[1,41]},e(N,[2,27]),e(N,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(i,n){if(n.recoverable)this.trace(i);else{var r=new Error(i);throw r.hash=n,r}},"parseError"),parse:o(function(i){var n=this,r=[0],a=[],u=[null],t=[],M=this.table,c="",W=0,se=0,ue=2,re=1,ge=t.slice.call(arguments,1),b=Object.create(this.lexer),R={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(R.yy[J]=this.yy[J]);b.setInput(i,R.yy),R.yy.lexer=b,R.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var q=b.yylloc;t.push(q);var de=b.options&&b.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){r.length=r.length-2*S,u.length=u.length-S,t.length=t.length-S}o(pe,"popStack");function ae(){var S;return S=a.pop()||b.lex()||re,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=n.symbols_[S]||S),S}o(ae,"lex");for(var E,P,x,Q,j={},z,C,oe,X;;){if(P=r[r.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=ae()),x=M[P]&&M[P][E]),typeof x>"u"||!x.length||!x[0]){var Z="";X=[];for(z in M[P])this.terminals_[z]&&z>ue&&X.push("'"+this.terminals_[z]+"'");b.showPosition?Z="Parse error on line "+(W+1)+`:
|
||||
`+b.showPosition()+`
|
||||
Expecting `+X.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Z="Parse error on line "+(W+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Z,{text:b.match,token:this.terminals_[E]||E,line:b.yylineno,loc:q,expected:X})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+E);switch(x[0]){case 1:r.push(E),u.push(b.yytext),t.push(b.yylloc),r.push(x[1]),E=null,se=b.yyleng,c=b.yytext,W=b.yylineno,q=b.yylloc;break;case 2:if(C=this.productions_[x[1]][1],j.$=u[u.length-C],j._$={first_line:t[t.length-(C||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(C||1)].first_column,last_column:t[t.length-1].last_column},de&&(j._$.range=[t[t.length-(C||1)].range[0],t[t.length-1].range[1]]),Q=this.performAction.apply(j,[c,se,W,R.yy,x[1],u,t].concat(ge)),typeof Q<"u")return Q;C&&(r=r.slice(0,-1*C*2),u=u.slice(0,-1*C),t=t.slice(0,-1*C)),r.push(this.productions_[x[1]][0]),u.push(j.$),t.push(j._$),oe=M[r[r.length-2]][r[r.length-1]],r.push(oe);break;case 3:return!0}}return!0},"parse")},K=(function(){var O={EOF:1,parseError:o(function(n,r){if(this.yy.parser)this.yy.parser.parseError(n,r);else throw new Error(n)},"parseError"),setInput:o(function(i,n){return this.yy=n||this.yy||{},this._input=i,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:o(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var n=i.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),i},"input"),unput:o(function(i){var n=i.length,r=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var a=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),r.length-1&&(this.yylineno-=r.length-1);var u=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:r?(r.length===a.length?this.yylloc.first_column:0)+a[a.length-r.length].length-r[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(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:o(function(i){this.unput(this.match.slice(i))},"less"),pastInput:o(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var i=this.pastInput(),n=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
||||
`+n+"^"},"showPosition"),test_match:o(function(i,n){var r,a,u;if(this.options.backtrack_lexer&&(u={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&&(u.yylloc.range=this.yylloc.range.slice(0))),a=i[0].match(/(?:\r\n?|\n).*/g),a&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,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(i[0].length),this.matched+=i[0],r=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var t in u)this[t]=u[t];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,n,r,a;this._more||(this.yytext="",this.match="");for(var u=this._currentRules(),t=0;t<u.length;t++)if(r=this._input.match(this.rules[u[t]]),r&&(!n||r[0].length>n[0].length)){if(n=r,a=t,this.options.backtrack_lexer){if(i=this.test_match(r,u[t]),i!==!1)return i;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(i=this.test_match(n,u[a]),i!==!1?i:!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:o(function(){var n=this.next();return n||this.lex()},"lex"),begin:o(function(n){this.conditionStack.push(n)},"begin"),popState:o(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(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:o(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:o(function(n){this.begin(n)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(n,r,a,u){switch(a){case 0:return this.pushState("shapeData"),r.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const t=/\n\s*/g;return r.yytext=r.yytext.replace(t,"<br/>"),24;case 4:return 24;case 5:this.popState();break;case 6:return n.getLogger().trace("Found comment",r.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:n.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return n.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:n.getLogger().trace("end icon"),this.popState();break;case 16:return n.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return n.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return n.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return n.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:n.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return n.getLogger().trace("description:",r.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),n.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),n.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),n.getLogger().trace("node end ...",r.yytext),"NODE_DEND";case 36:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 41:return n.getLogger().trace("Long description:",r.yytext),21;case 42:return n.getLogger().trace("Long description:",r.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 O})();T.lexer=K;function B(){this.yy={}}return o(B,"Parser"),B.prototype=T,T.Parser=B,new B})();$.parser=$;var xe=$,v=[],ne=[],ee=0,ie={},ve=o(()=>{v=[],ne=[],ee=0,ie={}},"clear"),De=o(e=>{if(v.length===0)return null;const h=v[0].level;let p=null;for(let s=v.length-1;s>=0;s--)if(v[s].level===h&&!p&&(p=v[s]),v[s].level<h)throw new Error('Items without section detected, found section ("'+v[s].label+'")');return e===p?.level?null:p},"getSection"),he=o(function(){return ne},"getSections"),Le=o(function(){const e=[],h=[],p=he(),s=U();for(const d of p){const _={id:d.id,label:F(d.label??"",s),labelType:"markdown",isGroup:!0,ticket:d.ticket,shape:"kanbanSection",level:d.level,look:s.look};h.push(_);const m=v.filter(l=>l.parentId===d.id);for(const l of m){const D={id:l.id,parentId:d.id,label:F(l.label??"",s),labelType:"markdown",isGroup:!1,ticket:l?.ticket,priority:l?.priority,assigned:l?.assignedLine truncated
|
||||
`)?I=d+`
|
||||
`:I=`{
|
||||
`+d+`
|
||||
}`;const g=ke(I,{schema:Ee});if(g.shape&&(g.shape!==g.shape.toLowerCase()||g.shape.includes("_")))throw new Error(`No such shape: ${g.shape}. Shape names should be lowercase.`);g?.shape&&g.shape==="kanbanItem"&&(l.shape=g?.shape),g?.label&&(l.label=g?.label),g?.icon&&(l.icon=g?.icon.toString()),g?.assigned&&(l.assigned=g?.assigned.toString()),g?.ticket&&(l.ticket=g?.ticket.toString()),g?.priority&&(l.priority=g?.priority)}const D=De(e);D?l.parentId=D.id||"kbn"+ee++:ne.push(l),v.push(l)},"addNode"),y={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Ie=o((e,h)=>{switch(te.debug("In get type",e,h),e){case"[":return y.RECT;case"(":return h===")"?y.ROUNDED_RECT:y.CLOUD;case"((":return y.CIRCLE;case")":return y.CLOUD;case"))":return y.BANG;case"{{":return y.HEXAGON;default:return y.DEFAULT}},"getType"),Ce=o((e,h)=>{ie[e]=h},"setElementForId"),we=o(e=>{if(!e)return;const h=U(),p=v[v.length-1];e.icon&&(p.icon=F(e.icon,h)),e.class&&(p.cssClasses=F(e.class,h))},"decorateNode"),Ae=o(e=>{switch(e){case y.DEFAULT:return"no-border";case y.RECT:return"rect";case y.ROUNDED_RECT:return"rounded-rect";case y.CIRCLE:return"circle";case y.CLOUD:return"cloud";case y.BANG:return"bang";case y.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Te=o(()=>te,"getLogger"),Re=o(e=>ie[e],"getElementById"),Pe={clear:ve,addNode:Oe,getSections:he,getData:Le,nodeType:y,getType:Ie,setElementForId:Ce,decorateNode:we,type2Str:Ae,getLogger:Te,getElementById:Re},Ve=Pe,Be=o(async(e,h,p,s)=>{te.debug(`Rendering kanban diagram
|
||||
`+e);const _=s.db.getData(),m=U();m.htmlLabels=!1;const l=fe(h);for(const f of _.nodes)f.domId=`${h}-${f.id}`;const D=l.append("g");D.attr("class","sections");const I=l.append("g");I.attr("class","items");const g=_.nodes.filter(f=>f.isGroup);let w=0;const k=10,G=[];let N=25;for(const f of g){const A=m?.kanban?.sectionWidth||200;w=w+1,f.x=A*w+(w-1)*k/2,f.width=A,f.y=0,f.height=A*3,f.rx=5,f.ry=5,f.cssClasses=f.cssClasses+" section-"+w;const L=await ye(D,f);N=Math.max(N,L?.labelBBox?.height),G.push(L)}let V=0;for(const f of g){const A=G[V];V=V+1;const L=m?.kanban?.sectionWidth||200,H=-L*3/2+N;let T=H;const K=_.nodes.filter(i=>i.parentId===f.id);for(const i of K){if(i.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");i.x=f.x,i.width=L-1.5*k;const r=(await be(I,i,{config:m})).node().getBBox();i.y=T+r.height/2,await me(i),T=i.y+r.height/2+k/2}const B=A.cluster.select("rect"),O=Math.max(T-H+3*k,50)+(N-25);B.attr("height",O)}_e(void 0,l,m.mindmap?.padding??Y.kanban.padding,m.mindmap?.useMaxWidth??Y.kanban.useMaxWidth)},"draw"),je={draw:Be},Fe=o(e=>{let h="";for(let s=0;s<e.THEME_COLOR_LIMIT;s++)e["lineColor"+s]=e["lineColor"+s]||e["cScaleInv"+s],Se(e["lineColor"+s])?e["lineColor"+s]=ce(e["lineColor"+s],20):e["lineColor"+s]=le(e["lineColor"+s],20);const p=o((s,d)=>e.darkMode?le(s,d):ce(s,d),"adjuster");for(let s=0;s<e.THEME_COLOR_LIMIT;s++){const d=""+(17-3*s);h+=`
|
||||
.section-${s-1} rect, .section-${s-1} path, .section-${s-1} circle, .section-${s-1} polygon, .section-${s-1} path {
|
||||
fill: ${p(e["cScale"+s],10)};
|
||||
stroke: ${p(e["cScale"+s],10)};
|
||||
|
||||
}
|
||||
.section-${s-1} text {
|
||||
fill: ${e["cScaleLabel"+s]};
|
||||
}
|
||||
.node-icon-${s-1} {
|
||||
font-size: 40px;
|
||||
color: ${e["cScaleLabel"+s]};
|
||||
}
|
||||
.section-edge-${s-1}{
|
||||
stroke: ${e["cScale"+s]};
|
||||
}
|
||||
.edge-depth-${s-1}{
|
||||
stroke-width: ${d};
|
||||
}
|
||||
.section-${s-1} line {
|
||||
stroke: ${e["cScaleInv"+s]} ;
|
||||
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: ${e.background};
|
||||
stroke: ${e.nodeBorder};
|
||||
stroke-width: 1px;
|
||||
}
|
||||
|
||||
.kanban-ticket-link {
|
||||
fill: ${e.background};
|
||||
stroke: ${e.nodeBorder};
|
||||
text-decoration: underline;
|
||||
}
|
||||
`}return h},"genSections"),Ge=o(e=>`
|
||||
.edge {
|
||||
stroke-width: 3;
|
||||
}
|
||||
${Fe(e)}
|
||||
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
|
||||
fill: ${e.git0};
|
||||
}
|
||||
.section-root text {
|
||||
fill: ${e.gitBranchLabel0};
|
||||
}
|
||||
.icon-container {
|
||||
height:100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.edge {
|
||||
fill: none;
|
||||
}
|
||||
.cluster-label, .label {
|
||||
color: ${e.textColor};
|
||||
fill: ${e.textColor};
|
||||
}
|
||||
.kanban-label {
|
||||
dy: 1em;
|
||||
alignment-baseline: middle;
|
||||
text-anchor: middle;
|
||||
dominant-baseline: middle;
|
||||
text-align: center;
|
||||
}
|
||||
${Ne()}
|
||||
`,"getStyles"),He=Ge,ze={db:Ve,renderer:je,parser:xe,styles:He};export{ze as diagram};
|
||||
+257
@@ -0,0 +1,257 @@
|
||||
class S extends Error{constructor(e,t){var a="KaTeX parse error: "+e,i,s,u=t&&t.loc;if(u&&u.start<=u.end){var h=u.lexer.input;i=u.start,s=u.end,i===h.length?a+=" at end of input: ":a+=" at position "+(i+1)+": ";var c=h.slice(i,s).replace(/[^]/g,"$&̲"),v;i>15?v="…"+h.slice(i-15,i):v=h.slice(0,i);var p;s+15<h.length?p=h.slice(s,s+15)+"…":p=h.slice(s),a+=v+c+p}super(a),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,S.prototype),this.position=i,i!=null&&s!=null&&(this.length=s-i),this.rawMessage=e}}var Y1=/([A-Z])/g,$1=r=>r.replace(Y1,"-$1").toLowerCase(),W1={"&":"&",">":">","<":"<",'"':""","'":"'"},j1=/[&><"']/g,i0=r=>String(r).replace(j1,e=>W1[e]),Ce=r=>r.type==="ordgroup"||r.type==="color"?r.body.length===1?Ce(r.body[0]):r:r.type==="font"?Ce(r.body):r,Z1=new Set(["mathord","textord","atom"]),D0=r=>Z1.has(Ce(r).type),K1=r=>{var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(r);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},dt={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:r=>"#"+r},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:(r,e)=>(e.push(r),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:r=>Math.max(0,r),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:r=>Math.max(0,r),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:r=>Math.max(0,r),cli:"-e, --max-expand <n>",cliProcessor:r=>r==="Infinity"?1/0:parseInt(r)},globalGroup:{type:"boolean",cli:!1}};function J1(r){if(typeof r!="string")return r.enum[0];switch(r){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 Q1(r){if(r.default!==void 0)return r.default;var e=Array.isArray(r.type)?r.type[0]:r.type;return J1(e)}function _1(r,e,t,a){var i=t[e];r[e]=i!==void 0?a.processor?a.processor(i):i:Q1(a)}class Et{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 t of Object.keys(dt)){var a=dt[t];a&&_1(this,t,e,a)}}reportNonstrict(e,t,a){var i=this.strict;if(typeof i=="function"&&(i=i(e,t,a)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new S("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+e+"]"),a);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible iLine truncated
|
||||
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)+" "+t+"h400000v"+(40+e)+"h-400000z"},ua=function(e,t){return"M263,"+(601+e+t)+`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)+" "+t+"h400000v"+(40+e)+"h-400000z"},oa=function(e,t){return"M983 "+(10+e+t)+`
|
||||
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)+" "+t+"h400000v"+(40+e)+"h-400000z"},ha=function(e,t){return"M424,"+(2398+e+t)+`
|
||||
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)+" "+t+`
|
||||
h400000v`+(40+e)+"h-400000z"},ma=function(e,t){return"M473,"+(2713+e+t)+`
|
||||
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)+" "+t+"h400000v"+(40+e)+"H1017.7z"},ca=function(e){var t=e/2;return"M400000 "+e+" H0 L"+t+" 0 l65 45 L145 "+(e-80)+" H400000z"},da=function(e,t,a){var i=a-54-t-e;return"M702 "+(e+t)+"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 `+t+"H400000v"+(40+e)+"H742z"},fa=function(e,t,a){t=1e3*t;var i="";switch(e){case"sqrtMain":i=la(t,Q0);break;case"sqrtSize1":i=ua(t,Q0);break;case"sqrtSize2":i=oa(t,Q0);break;case"sqrtSize3":i=ha(t,Q0);break;case"sqrtSize4":i=ma(t,Q0);break;case"sqrtTall":i=da(t,Q0,a)}return i},va=function(e,t){switch(e){case"⎜":return r0("M291 0 H417 V"+t+" H291z");case"∣":return r0("M145 0 H188 V"+t+" H145z");case"∥":return r0("M145 0 H188 V"+t+" H145z")+r0("M367 0 H410 V"+t+" H367z");case"⎟":return r0("M457 0 H583 V"+t+" H457z");case"⎢":return r0("M319 0 H403 V"+t+" H319z");case"⎥":return r0("M263 0 H347 V"+t+" H263z");case"⎪":return r0("M384 0 H504 V"+t+" H384z");case"⏐":return r0("M312 0 H355 V"+t+" H312z");case"‖":return r0("M257 0 H300 V"+t+" H257z")+r0("M478 0 H521 V"+t+" H478z");default:return""}},ar={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:r0("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:r0("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:r0("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:r0("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:r0("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:r0("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:r0("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:r0("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`},pa=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 v84 h347 v-84
|
||||
H403z M403 1759 V0 H319 V1759 v`+t+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v1759 H0 v84 H347z
|
||||
M347 1759 V0 H263 V1759 v`+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15
|
||||
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
||||
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15
|
||||
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
||||
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
|
||||
M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
|
||||
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
||||
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+` v1715 h263 v84 H319z
|
||||
MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+` v1799 H0 v-84 H319z
|
||||
MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v602 h84z
|
||||
M403 1759 V0 H319 V1759 v`+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v602 h84z
|
||||
M347 1759 V0 h-84 V1759 v`+t+" 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,`+(t+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,-`+(t+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,`+(t+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,-`+(t+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 ga(r){return"toText"in r}class ae{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(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(ga(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var vt={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},ba={ex:!0,em:!0,mu:!0},Ur=function(e){return typeof e!="string"&&(e=e.unit),e in vt||e in ba||e==="ex"},K=function(e,t){var a;if(e.unit in vt)a=vt[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit==="mu")a=t.fontMetrics().cssEmPerMu;else{var i;if(t.style.isTight()?i=t.havingStyle(t.style.text()):i=t,e.unit==="ex")a=i.fontMetrics().xHeight;else if(e.unit==="em")a=i.fontMetrics().quad;else throw new S("Invalid unit: '"+e.unit+"'");i!==t&&(a*=i.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*a,t.maxSize)},A=function(e){return+e.toFixed(4)+"em"},L0=function(e){return e.filter(t=>t).join(" ")},It=function(e){var t="";for(var a of Object.keys(e)){var i=e[a];i!==void 0&&(t+=$1(a)+":"+i+";")}return t},Vr=function(e,t,a){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=a||{},t){t.style.isTight()&&this.classes.push("mtight");var i=t.getColor();i&&(this.style.color=i)}},Xr=function(e){var t=document.createElement(e);t.className=L0(this.classes),Object.assign(t.style,this.style);for(var a of Object.keys(this.attributes))t.setAttribute(a,this.attributes[a]);for(var i=0;i<this.children.length;i++)t.appendChild(this.children[i].toNode());return t},ya=/[\s"'>/=\x00-\x1f]/,Yr=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+i0(L0(this.classes))+'"');var a=It(this.style);a&&(t+=' style="'+i0(a)+'"');for(var i of Object.keys(this.attributes)){if(ya.test(i))throw new S("Invalid attribute name '"+i+"'");t+=" "+i+'="'+i0(this.attributes[i])+'"'}t+=">";for(var s=0;s<this.children.length;s++)t+=this.children[s].toMarkup();return t+="</"+e+">",t};class ie{constructor(e,t,a,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,Vr.call(this,e,a,i),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return Xr.call(this,"span")}toMarkup(){return Yr.call(this,"span")}}class Fe{constructor(e,t,a,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,Vr.call(this,t,i),this.children=a||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return Xr.call(this,"a")}toMarkup(){return Yr.call(this,"a")}}class xa{constructor(e,t,a){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=t,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=a}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="'+i0(this.src)+'"'+(' alt="'+i0(this.alt)+'"'),t=It(this.style);return t&&(e+=' style="'+i0(t)+'"'),e+="'/>",e}}var wa={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class d0{constructor(e,t,a,i,s,u,h,c){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=t||0,this.depth=a||0,this.italic=i||0,this.skew=s||0,this.width=u||0,this.classes=h||[],this.style=c||{},this.maxFontSize=0;var v=sa(this.text.charCodeAt(0));v&&this.classes.push(v+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=wa[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement("span"),t.style.marginRight=A(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=L0(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=i0(L0(
Line truncated
|
||||
`+P+" children.");for(var U=0;U<P;U++){var o0=new P0(R[U]),m0=new C0([o0],{width:"400em",height:A(O),viewBox:"0 0 "+h+" "+L,preserveAspectRatio:Y[U]+" slice"}),Q=G0([G[U]],[m0],t);if(P===1)return{span:Q,minWidth:F,height:O};Q.style.height=A(O),q.push(Q)}return{span:k(["stretchy"],q,t),minWidth:F,height:O}}}var{span:i,minWidth:s,height:u}=a();return i.height=u,i.style.height=A(u),s>0&&(i.style.minWidth=A(s)),i},Za=function(e,t,a,i,s){var u,h=e.height+e.depth+a+i;if(/fbox|color|angl/.test(t)){if(u=k(["stretchy",t],[],s),t==="fbox"){var c=s.color&&s.getColor();c&&(u.style.borderColor=c)}}else{var v=[];/^[bx]cancel$/.test(t)&&v.push(new pt({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&v.push(new pt({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var p=new C0(v,{width:"100%",height:A(h)});u=G0([],[p],s)}return u.height=h,u.style.height=A(h),u},Ka={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Ja={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Qa(r){return r in Ka}function H(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function Ge(r){var e=Ue(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function Ue(r){return r&&(r.type==="atom"||Ja.hasOwnProperty(r.type))?r:null}var a1=r=>{if(r instanceof d0)return r;if(za(r)&&r.children.length===1)return a1(r.children[0])},Pt=(r,e)=>{var t,a,i;r&&r.type==="supsub"?(a=H(r.base,"accent"),t=a.base,r.base=t,i=Sa(X(r,e)),r.base=a):(a=H(r,"accent"),t=a.base);var s=X(t,e.havingCrampedStyle()),u=a.isShifty&&D0(t),h=0;if(u){var c,v;h=(c=(v=a1(s))==null?void 0:v.skew)!=null?c:0}var p=a.label==="\\c",b=p?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),x;if(a.isStretchy)x=Pe(a,e),x=V({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:x,wrapperClasses:["svg-align"],wrapperStyle:h>0?{width:"calc(100% - "+A(2*h)+")",marginLeft:A(2*h)}:void 0}]});else{var y,T;a.label==="\\vec"?(y=Kr("vec",e),T=Zr.vec[1]):(y=Oe({mode:a.mode,text:a.label},e,"textord"),y=ka(y),y.italic=0,T=y.width,p&&(b+=y.depth)),x=k(["accent-body"],[y]);var M=a.label==="\\textcircled";M&&(x.classes.push("accent-full"),b=s.height);var q=h;M||(q-=T/2),x.style.left=A(q),a.label==="\\textcircled"&&(x.style.top=".2em"),x=V({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-b},{type:"elem",elem:x}]})}var C=k(["mord","accent"],[x],e);return i?(i.children[0]=C,i.height=Math.max(C.height,i.height),i.classes[0]="mord",i):C},i1=(r,e)=>{var t=r.isStretchy?Le(r.label):new z("mo",[g0(r.label,r.mode)]),a=new z("mover",[$(r.base,e),t]);return a.setAttribute("accent","true"),a},_a=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));B({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:(r,e)=>{var t=Ne(e[0]),a=!_a.test(r.funcName),i=!a||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:a,isShifty:i,base:t}},htmlBuilder:Pt,mathmlBuilder:i1});B({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,e)=>{var t=e[0],a=r.parser.mode;return a==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),a="text"),{type:"accent",mode:a,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:Pt,mathmlBuilder:i1});B({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:a}=r,i=e[0];return{type:"accentUnder",mode:t.mode,label:a,base:i}},htmlBuilder:(r,e)=>{var t=X(r.base,e),a=Pe(r,e),i=r.label==="\\utilde"?.12:0,s=V({positionType:"top",positionData:t.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:t}]});return k(["mord","accentunder"],[s],e)},mathmlBuilder:(r,e)=>{var t=Le(r.label),a=new z("munder",[$(r.base,e),t]);return a.setAttribute("accentunder","true"),a}});var Me=r=>{var e=new z("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};B({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoLine truncated
|
||||
]`,T4="\\\\[a-zA-Z@]+",B4="\\\\[^\uD800-\uDFFF]",C4="("+T4+")"+q1+"*",D4=`\\\\(
|
||||
|[ \r ]+
|
||||
?)[ \r ]*`,qt="[̀-ͯ]",q4=new RegExp(qt+"+$"),E4="("+q1+"+)|"+(D4+"|")+"([!-\\[\\]-‧-豈-]"+(qt+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(qt+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+C4)+("|"+B4+")");class Fr{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(E4,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new c0("EOF",new h0(this,t,t));var a=this.tokenRegex.exec(e);if(a===null||a.index!==t)throw new S("Unexpected character: '"+e[t]+"'",new c0(e[t],new h0(this,t,t+1)));var i=a[6]||a[3]||(a[2]?"\\ ":" ");if(this.catcodes[i]===14){var s=e.indexOf(`
|
||||
`,this.tokenRegex.lastIndex);return s===-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=s+1,this.lex()}return new c0(i,new h0(this,t,this.tokenRegex.lastIndex))}}class R4{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new S("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}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,t,a){if(a===void 0&&(a=!1),a){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]=t)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}}var I4=x1;m("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});m("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}});m("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}});m("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}});m("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});m("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");m("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var Hr={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};m("\\char",function(r){var e=r.popToken(),t,a=0;if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")a=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new S("\\char` missing argument");a=e.text.charCodeAt(0)}else t=10;if(t){if(a=Hr[e.text],a==null||a>=t)throw new S("Invalid base-"+t+" digit "+e.text);for(var i;(i=Hr[r.future().text])!=null&&i<t;)a*=t,a+=i,r.popToken()}return"\\@char{"+a+"}"});var Xt=(r,e,t,a)=>{var i=r.consumeArg().tokens;if(i.length!==1)throw new S("\\newcommand's first argument must be a macro name");var s=i[0].text,u=r.isDefined(s);if(u&&!e)throw new S("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!u&&!t)throw new S("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var h=0;if(i=r.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var c="",v=r.expandNextToken();v.text!=="]"&&v.text!=="EOF";)c+=v.text,v=r.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new S("Invalid number of arguments: "+c);h=parseInt(c),i=r.consumeArg().tokens}return u&&a||r.macros.set(s,{tokens:i,numArgs:h}),""};m("\\newcommand",r=>Xt(r,!1,!0,!1));m("\\renewcommand",r=>Xt(r,!0,!1,!1));m("\\providecommand",r=>Xt(r,!0,!0,!0));m("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""});m("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""});m("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),O0[t],W.math[t],W.text[t]),""});m("\\bgroup","{");m("\\egroup","}");m("~","\\nobreakspace");m("\\lq","`");m("\\rq","'");m("\\aa","\\r a");m("\\AA","\\r A");m("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");m("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");m("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");m("ℬ","\\mathscr{B}");m("ℰ","\\mathscr{E}");m("ℱ","\\mathscr{F}");m("ℋ","\\mathscr{H}");m("ℐ","\\mathscr{I}");m("ℒ","\\mathscr{L}");m("ℳ","\\mathscr{M}");m("ℛ","\\mathscr{R}");m("ℭ","\\mathfrak{C}");m("ℌ","\\mathfrak{H}");m("ℨ","\\mathfrak{Z}");m("\\Bbbk","\\Bbb{k}");m("\\llap","\\mathllap{\\textrm{#1}}");m("\\rlap","\\mathrlap{\\textrm{#1}}");m("\\clap","\\mathclap{\\textrm{#1}}");m("\\mathstrut","\\vphantom{(}");m("\\underbar","\\underline{\\text{#1}}");m("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');m("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");m("\\ne","\\neq");m("≠","\\neq");m("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");m("∉","\\notin");m("≘","\\htmLine truncated
|
||||
please report what input caused this bug`);return a=a.slice(1,-1),{type:"verb",mode:"text",body:a,star:i}}Pr.hasOwnProperty(t[0])&&!W[this.mode][t[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=Pr[t[0]]+t.slice(1));var s=q4.exec(t);s&&(t=t.substring(0,s.index),t==="i"?t="ı":t==="j"&&(t="ȷ"));var u;if(W[this.mode][t]){this.settings.strict&&this.mode==="math"&>.includes(t)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var h=W[this.mode][t].group,c=h0.range(e),v;Qa(h)?v={type:"atom",mode:this.mode,family:h,loc:c,text:t}:v={type:h,mode:this.mode,loc:c,text:t},u=v}else if(t.charCodeAt(0)>=128)this.settings.strict&&(Gr(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),u={type:"textord",mode:"text",loc:h0.range(e),text:t};else return null;if(this.consume(),s)for(var p=0;p<s[0].length;p++){var b=s[0][p];if(!ct[b])throw new S("Unknown accent ' "+b+"'",e);var x=ct[b][this.mode]||ct[b].text;if(!x)throw new S("Accent "+b+" unsupported in "+this.mode+" mode",e);u={type:"accent",mode:this.mode,loc:h0.range(e),label:x,isStretchy:!1,isShifty:!0,base:u}}return u}}je.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var $t=function(e,t){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var a=new je(e,t);delete a.gullet.macros.current["\\df@tag"];var i=a.parse();if(delete a.gullet.macros.current["\\current@color"],delete a.gullet.macros.current["\\color"],a.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new S("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:a.subparse([new c0("\\df@tag")])}]}return i},N1=function(e,t,a){t.textContent="";var i=Wt(e,a).toNode();t.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."),N1=function(){throw new S("KaTeX doesn't work in quirks mode.")});var H4=function(e,t){var a=Wt(e,t).toMarkup();return a},O4=function(e,t){var a=new Et(t);return $t(e,a)},F1=function(e,t,a){if(a.throwOnError||!(e instanceof S))throw e;var i=k(["katex-error"],[new d0(t)]);return i.setAttribute("title",e.toString()),i.setAttribute("style","color:"+a.errorColor),i},Wt=function(e,t){var a=new Et(t);try{var i=$t(e,a);return Xa(i,e,a)}catch(s){return F1(s,e,a)}},L4=function(e,t){var a=new Et(t);try{var i=$t(e,a);return Ya(i,e,a)}catch(s){return F1(s,e,a)}},P4="0.16.47",G4={Span:ie,Anchor:Fe,SymbolNode:d0,SvgNode:C0,PathNode:P0,LineNode:pt},U4={version:P4,render:N1,renderToString:H4,ParseError:S,SETTINGS_SCHEMA:dt,__parse:O4,__renderToDomTree:Wt,__renderToHTMLTree:L4,__setFontMetrics:Aa,__defineSymbol:n,__defineFunction:B,__defineMacro:m,__domTree:G4};export{S as ParseError,dt as SETTINGS_SCHEMA,B as __defineFunction,m as __defineMacro,n as __defineSymbol,G4 as __domTree,O4 as __parse,Wt as __renderToDomTree,L4 as __renderToHTMLTree,Aa as __setFontMetrics,U4 as default,N1 as render,H4 as renderToString,P4 as version};
|
||||
@@ -0,0 +1 @@
|
||||
import{bn as B,bo as y,bp as ye,bq as V,br as U,bs as Ue,bt as oe,bu as We,bv as In,bw as qe,bx as _n,by as kn,bz as jn,bA as ue,bB as An,bC as Mn,bD as xe,bE as Oe,bF as fe,bG as de,bH as G,bI as Xe,bJ as He,bK as Rn,bL as T,bM as Sn,bN as $n,bO as Fn,bP as Ee,bQ as Bn,bR as Ke,bS as N,bT as Gn,bU as Dn,bV as Yn,bW as S,bX as ze,bY as Je,bZ as Vn,b_ as se,b$ as Qe,c0 as Un,c1 as Ze,c2 as Wn,c3 as qn,Q as x,c4 as c,c5 as Xn,c6 as m,c7 as M,c8 as P,c9 as W}from"./mermaid.core.js";var Hn=/\s/;function Kn(e){for(var n=e.length;n--&&Hn.test(e.charAt(n)););return n}var zn=/^\s+/;function Jn(e){return e&&e.slice(0,Kn(e)+1).replace(zn,"")}var Te=NaN,Qn=/^[-+]0x[0-9a-f]+$/i,Zn=/^0b[01]+$/i,er=/^0o[0-7]+$/i,nr=parseInt;function rr(e){if(typeof e=="number")return e;if(B(e))return Te;if(y(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=y(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Jn(e);var r=Zn.test(e);return r||er.test(e)?nr(e.slice(2),r?2:8):Qn.test(e)?Te:+e}var Pe=1/0,tr=17976931348623157e292;function $(e){if(!e)return e===0?e:0;if(e=rr(e),e===Pe||e===-Pe){var n=e<0?-1:1;return n*tr}return e===e?e:0}function ir(e){var n=$(e),r=n%1;return n===n?r?n-r:n:0}var Le=Object.create,ar=(function(){function e(){}return function(n){if(!y(n))return{};if(Le)return Le(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}})();function or(e,n){var r=-1,t=e.length;for(n||(n=Array(t));++r<t;)n[r]=e[r];return n}function q(e,n,r){n=="__proto__"&&ye?ye(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[n]=r}var ur=Object.prototype,fr=ur.hasOwnProperty;function X(e,n,r){var t=e[n];(!(fr.call(e,n)&&V(t,r))||r===void 0&&!(n in e))&&q(e,n,r)}function dr(e,n,r,t){var i=!r;r||(r={});for(var o=-1,a=n.length;++o<a;){var u=n[o],f=void 0;f===void 0&&(f=e[u]),i?q(r,u,f):X(r,u,f)}return r}function k(e,n,r){if(!y(r))return!1;var t=typeof n;return(t=="number"?U(r)&&Ue(n,r.length):t=="string"&&n in r)?V(r[n],e):!1}function sr(e){return oe(function(n,r){var t=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&k(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),n=Object(n);++t<i;){var u=r[t];u&&e(n,u,t,o)}return n})}function cr(e){var n=[];if(e!=null)for(var r in Object(e))n.push(r);return n}var lr=Object.prototype,hr=lr.hasOwnProperty;function vr(e){if(!y(e))return cr(e);var n=We(e),r=[];for(var t in e)t=="constructor"&&(n||!hr.call(e,t))||r.push(t);return r}function H(e){return U(e)?In(e,!0):vr(e)}function C(e){var n=e==null?0:e.length;return n?qe(e):[]}function pr(e){return _n(kn(e,void 0,C),e+"")}var en=jn(Object.getPrototypeOf,Object),br="[object Object]",wr=Function.prototype,gr=Object.prototype,nn=wr.toString,mr=gr.hasOwnProperty,yr=nn.call(Object);function xr(e){if(!ue(e)||An(e)!=br)return!1;var n=en(e);if(n===null)return!0;var r=mr.call(n,"constructor")&&n.constructor;return typeof r=="function"&&r instanceof r&&nn.call(r)==yr}var rn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ne=rn&&typeof module=="object"&&module&&!module.nodeType&&module,Or=Ne&&Ne.exports===rn,Ce=Or?Mn.Buffer:void 0,Ie=Ce?Ce.allocUnsafe:void 0;function tn(e,n){if(n)return e.slice();var r=e.length,t=Ie?Ie(r):new e.constructor(r);return e.copy(t),t}var Er=Object.prototype,Tr=Er.hasOwnProperty;function Pr(e){var n=e.length,r=new e.constructor(n);return n&&typeof e[0]=="string"&&Tr.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function ce(e){var n=new e.constructor(e.byteLength);return new xe(n).set(new xe(e)),n}function Lr(e,n){var r=ce(e.buffer);return new e.constructor(r,e.byteOffset,e.byteLength)}var Nr=/\w*$/;function Cr(e){var n=new e.constructor(e.source,Nr.exec(e));return n.lastIndex=e.lastIndex,n}var _e=Oe?Oe.prototype:void 0,ke=_e?_e.valueOf:void 0;function Ir(e){return ke?Object(ke.call(e)):{}}function an(e,n){var r=n?ce(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var _r="[object Boolean]",kr="[object Date]",jr="[object Map]",Ar="[object Number]",Mr="[object RegExp]",Rr="[object Set]",Sr="[object String]",$r="[object Symbol]",Fr="[object ArrayBuffer]",Br="[object DataView]",Gr="[object Float32Array]",Dr="[object Float64Array]",Yr="[object Int8Array]",Vr="[object Int16Array]",Ur="[object Int32Array]",Wr="[object Uint8Array]",qr="[object Uint8ClampedArray]",Xr="[object Uint16Array]",Hr="[object Uint32Array]";function Kr(e,n,r){var t=e.constructor;switch(n){case Fr:return ce(e);case _r:case kr:return new t(+e);case Br:return Lr(e);case Gr:case Dr:case Yr:case Vr:case Ur:case Wr:case qr:case Xr:case Hr:return an(e,r);case jr:return new t;case Ar:case Sr:return new t(e);case Mr:return Cr(e);case Rr:return new t;case $r:return Ir(e)}}function on(e){return typeof e.constructor=="function"&&!We(e)?ar(en(e)):{}}var zr="[object Map]";function Jr(e){return ue(e)&&fe(e)==zr}var je=G&&G.isMap,Qr=je?de(je):Jr,Zr="[object Set]";function et(e){return ue(e)&&fe(e)==Zr}var Ae=G&&G.isSet,nt=Ae?de(Ae):et,rt=1,un="[object Arguments]",tt="[object Array]",it="[object BoLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{b8 as j,b9 as p,ba as w,bb as k,bc as q}from"./mermaid.core.js";import{i as D}from"./init.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function E(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function G(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function H(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function J(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function K(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=d(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function L(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function Q(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=d(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function d(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?L:J(r)?H:Array.isArray(r)?K:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Q:p)(n,r)}function U(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function W(n){return Math.max(0,-g(Math.abs(n)))}function X(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Y(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function Z(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function N(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:Z(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=N(u,e),f=t(a,f)):(e=N(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=N(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=x(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=d,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);breakLine truncated
|
||||
@@ -0,0 +1,310 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sizeCapture-INFHLROL.js","assets/index.js","assets/index.css","assets/dagre-GXQ25YYZ.js","assets/layout.js","assets/swimlanes-42K2YHIH.js","assets/cose-bilkent-JH36ORCC.js","assets/cytoscape.esm.js","assets/c4Diagram-7LVT6UL2.js","assets/chunk-F27PBJKO.js","assets/flowDiagram-HODETNUW.js","assets/chunk-5VM5RSS4.js","assets/chunk-XXDRQBXY.js","assets/chunk-POPQ4Y6H.js","assets/channel.js","assets/swimlanesDiagram-VR7AAH4N.js","assets/erDiagram-RLTQ6QDP.js","assets/gitGraphDiagram-WWUBYQGX.js","assets/chunk-2Q5K7J3B.js","assets/chunk-JWPE2WC7.js","assets/cynefin-OW5HDTMX.js","assets/ganttDiagram-EL5Y4UJY.js","assets/linear.js","assets/init.js","assets/defaultLocale.js","assets/infoDiagram-27XIBGKW.js","assets/pieDiagram-E7YTZNPT.js","assets/arc.js","assets/ordinal.js","assets/quadrantDiagram-AXDQQJYC.js","assets/xychartDiagram-S5SC5T6Z.js","assets/requirementDiagram-BXWQKSXE.js","assets/sequenceDiagram-WJ2MYXX4.js","assets/classDiagram-ZZMXUADV.js","assets/chunk-TICWLB2K.js","assets/classDiagram-v2-VYDZK3BY.js","assets/stateDiagram-D77RDMKH.js","assets/chunk-IMKFNOWR.js","assets/stateDiagram-v2-MP3YSRHH.js","assets/journeyDiagram-3NMN7TZE.js","assets/timeline-definition-24CTP7MA.js","assets/mindmap-definition-YA3MSWOX.js","assets/kanban-definition-UXKFOSKX.js","assets/sankeyDiagram-P5KCCOFB.js","assets/diagram-Z3DM3KII.js","assets/diagram-UQ7AKVKN.js","assets/blockDiagram-I7D4REHJ.js","assets/diagram-S7CK7UJ4.js","assets/architectureDiagram-5GKGNRK7.js","assets/diagram-VSXAHHWV.js","assets/ishikawaDiagram-5VMMS53U.js","assets/vennDiagram-4TSXK5OY.js","assets/diagram-VX7I27RA.js","assets/wardleyDiagram-VM6X3IG4.js","assets/cynefinDiagram-5FMLGOSQ.js","assets/railroadDiagram-O6MQD6OU.js","assets/chunk-SVP7TREG.js","assets/ebnfDiagram-PWID7BFC.js","assets/abnfDiagram-VCTEODGH.js","assets/pegDiagram-XKGWAZYB.js"])))=>i.map(i=>d[i]);
|
||||
import{g as gl,_ as At}from"./index.js";var Hd=Object.defineProperty,p=(e,t)=>Hd(e,"name",{value:t,configurable:!0}),I0=(e,t)=>{for(var r in t)Hd(e,r,{get:t[r],enumerable:!0})},po={exports:{}},P0=po.exports,ec;function R0(){return ec||(ec=1,(function(e,t){(function(r,i){e.exports=i()})(P0,(function(){var r=1e3,i=6e4,s=36e5,o="millisecond",a="second",n="minute",l="hour",c="day",h="week",u="month",d="quarter",f="year",m="date",y="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|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,k={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(E){var O=["th","st","nd","rd"],B=E%100;return"["+E+(O[(B-20)%10]||O[B]||O[0])+"]"}},T=function(E,O,B){var N=String(E);return!N||N.length>=O?E:""+Array(O+1-N.length).join(B)+E},S={s:T,z:function(E){var O=-E.utcOffset(),B=Math.abs(O),N=Math.floor(B/60),D=B%60;return(O<=0?"+":"-")+T(N,2,"0")+":"+T(D,2,"0")},m:function E(O,B){if(O.date()<B.date())return-E(B,O);var N=12*(B.year()-O.year())+(B.month()-O.month()),D=O.clone().add(N,u),rt=B-D<0,tt=O.clone().add(N+(rt?-1:1),u);return+(-(N+(B-D)/(rt?D-tt:tt-D))||0)},a:function(E){return E<0?Math.ceil(E)||0:Math.floor(E)},p:function(E){return{M:u,y:f,w:h,d:c,D:m,h:l,m:n,s:a,ms:o,Q:d}[E]||String(E||"").toLowerCase().replace(/s$/,"")},u:function(E){return E===void 0}},_="en",L={};L[_]=k;var A="$isDayjsObject",F=function(E){return E instanceof it||!(!E||!E[A])},V=function E(O,B,N){var D;if(!O)return _;if(typeof O=="string"){var rt=O.toLowerCase();L[rt]&&(D=rt),B&&(L[rt]=B,D=rt);var tt=O.split("-");if(!D&&tt.length>1)return E(tt[0])}else{var pt=O.name;L[pt]=O,D=pt}return!N&&D&&(_=D),D||!N&&_},Y=function(E,O){if(F(E))return E.clone();var B=typeof O=="object"?O:{};return B.date=E,B.args=arguments,new it(B)},R=S;R.l=V,R.i=F,R.w=function(E,O){return Y(E,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var it=(function(){function E(B){this.$L=V(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[A]=!0}var O=E.prototype;return O.parse=function(B){this.$d=(function(N){var D=N.date,rt=N.utc;if(D===null)return new Date(NaN);if(R.u(D))return new Date;if(D instanceof Date)return new Date(D);if(typeof D=="string"&&!/Z$/i.test(D)){var tt=D.match(x);if(tt){var pt=tt[2]-1||0,St=(tt[7]||"0").substring(0,3);return rt?new Date(Date.UTC(tt[1],pt,tt[3]||1,tt[4]||0,tt[5]||0,tt[6]||0,St)):new Date(tt[1],pt,tt[3]||1,tt[4]||0,tt[5]||0,tt[6]||0,St)}}return new Date(D)})(B),this.init()},O.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},O.$utils=function(){return R},O.isValid=function(){return this.$d.toString()!==y},O.isSame=function(B,N){var D=Y(B);return this.startOf(N)<=D&&D<=this.endOf(N)},O.isAfter=function(B,N){return Y(B)<this.startOf(N)},O.isBefore=function(B,N){return this.endOf(N)<Y(B)},O.$g=function(B,N,D){return R.u(B)?this[N]:this.set(D,B)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(B,N){var D=this,rt=!!R.u(N)||N,tt=R.p(B),pt=function(wt,It){var Mt=R.w(D.$u?Date.UTC(D.$y,It,wt):new Date(D.$y,It,wt),D);return rt?Mt:Mt.endOf(c)},St=function(wt,It){return R.w(D.toDate()[wt].apply(D.toDate("s"),(rt?[0,0,0,0]:[23,59,59,999]).slice(It)),D)},Tt=this.$W,ft=this.$M,Bt=this.$D,st="set"+(this.$u?"UTC":"");switch(tt){case f:return rt?pt(1,0):pt(31,11);case u:return rt?pt(1,ft):pt(0,ft+1);case h:var kt=this.$locale().weekStart||0,xt=(Tt<kt?Tt+7:Tt)-kt;return pt(rt?Bt-xt:Bt+(6-xt),ft);case c:case m:return St(st+"Hours",0);case l:return St(st+"Minutes",1);case n:return St(st+"Seconds",2);case a:return St(st+"Milliseconds",3);default:return this.clone()}},O.endOf=function(B){return this.startOf(B,!1)},O.$set=function(B,N){var D,rt=R.p(B),tt="set"+(this.$u?"UTC":""),pt=(D={},D[c]=tt+"Date",D[m]=tt+"Date",D[u]=tt+"Month",D[f]=tt+"FullYear",D[l]=tt+"Hours",D[n]=tt+"Minutes",D[a]=tt+"Seconds",D[o]=tt+"Milliseconds",D)[rt],St=rt===c?this.$D+(N-this.$W):N;if(rt===u||rt===f){var Tt=this.clone().set(m,1);Tt.$d[pt](St),Tt.init(),this.$d=Tt.set(m,Math.min(this.$D,Tt.daysInMonth())).$d}else pt&&this.$d[pt](St);return this.init(),this},O.set=function(B,N){return this.clone().$set(B,N)},O.get=function(B){return this[R.p(B)]()},O.add=function(B,N){var D,rt=this;B=Number(B);var tt=R.p(N),pt=function(ft){var Bt=Y(rt);return R.w(Bt.date(Bt.date()+Math.round(ft*B)),rt)};if(tt===u)return this.set(u,this.$M+B);if(tt===f)return this.set(f,this.$y+B);if(tt===c)return pt(1);if(tt===h)return pt(7);var St=(D={},D[n]=i,D[l]=s,D[a]=r,D)[tt]||1,Tt=this.$d.getTime()+B*St;return R.w(Tt,this)},O.subtract=function(B,N){return this.add(-1*B,N)},O.format=fLine truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function K0(e,t){return X0(e)||V0(e,t)||Q0(e,t)||Z0()}function Q0(e,t){if(e){if(typeof e=="string")return rc(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?rc(e,t):void 0}}const jd=Object.entries,ic=Object.setPrototypeOf,J0=Object.isFrozen,tx=Object.getPrototypeOf,ex=Object.getOwnPropertyDescriptor;let xe=Object.freeze,Me=Object.seal,xi=Object.create,Gd=typeof Reflect<"u"&&Reflect,_n=Gd.apply,vn=Gd.construct;xe||(xe=function(t){return t});Me||(Me=function(t){return t});_n||(_n=function(t,r){for(var i=arguments.length,s=new Array(i>2?i-2:0),o=2;o<i;o++)s[o-2]=arguments[o];return t.apply(r,s)});vn||(vn=function(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return new t(...i)});const ci=Jt(Array.prototype.forEach),rx=Jt(Array.prototype.lastIndexOf),sc=Jt(Array.prototype.pop),ui=Jt(Array.prototype.push),ix=Jt(Array.prototype.splice),me=Array.isArray,us=Jt(String.prototype.toLowerCase),Fa=Jt(String.prototype.toString),oc=Jt(String.prototype.match),di=Jt(String.prototype.replace),ac=Jt(String.prototype.indexOf),sx=Jt(String.prototype.trim),ox=Jt(Number.prototype.toString),ax=Jt(Boolean.prototype.toString),nc=typeof BigInt>"u"?null:Jt(BigInt.prototype.toString),lc=typeof Symbol>"u"?null:Jt(Symbol.prototype.toString),Gt=Jt(Object.prototype.hasOwnProperty),es=Jt(Object.prototype.toString),oe=Jt(RegExp.prototype.test),Ks=nx(TypeError);function Jt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return _n(e,t,i)}}function nx(e){return function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return vn(e,r)}}function Et(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:us;if(ic&&ic(e,null),!me(t))return e;let i=t.length;for(;i--;){let s=t[i];if(typeof s=="string"){const o=r(s);o!==s&&(J0(t)||(t[i]=o),s=o)}e[s]=!0}return e}function lx(e){for(let t=0;t<e.length;t++)Gt(e,t)||(e[t]=null);return e}function Te(e){const t=xi(null);for(const i of jd(e)){var r=K0(i,2);const s=r[0],o=r[1];Gt(e,s)&&(me(o)?t[s]=lx(o):o&&typeof o=="object"&&o.constructor===Object?t[s]=Te(o):t[s]=o)}return t}function hx(e){switch(typeof e){case"string":return e;case"number":return ox(e);case"boolean":return ax(e);case"bigint":return nc?nc(e):"0";case"symbol":return lc?lc(e):"Symbol()";case"undefined":return es(e);case"function":case"object":{if(e===null)return es(e);const t=e,r=Hr(t,"toString");if(typeof r=="function"){const i=r(t);return typeof i=="string"?i:es(i)}return es(e)}default:return es(e)}}function Hr(e,t){for(;e!==null;){const i=ex(e,t);if(i){if(i.get)return Jt(i.get);if(typeof i.value=="function")return Jt(i.value)}e=tx(e)}function r(){return null}return r}function cx(e){try{return oe(e,""),!0}catch{return!1}}const hc=xe(["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"]),Aa=xe(["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"]),Ea=xe(["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"]),ux=xe(["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","s
Line truncated
|
||||
`+ke),Ce&&ci([O,B,N],Br=>{ke=di(ke,Br," ")}),L&&le?L.createHTML(ke):ke},t.setConfig=function(){let bt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_a(bt),ar=!0},t.clearConfig=function(){hi=null,ar=!1},t.isValidAttribute=function(bt,v,Z){hi||_a({});const ct=zt(bt),Dt=zt(v);return Zh(ct,Dt,Z)},t.addHook=function(bt,v){typeof v=="function"&&ui(E[bt],v)},t.removeHook=function(bt,v){if(v!==void 0){const Z=rx(E[bt],v);return Z===-1?void 0:ix(E[bt],Z,1)[0]}return sc(E[bt])},t.removeHooks=function(bt){E[bt]=[]},t.removeAllHooks=function(){E=pc()},t}var zi=Xd(),Bn=p((e,t,{depth:r=2}={})=>{const i={depth:r};if(Array.isArray(t)&&!Array.isArray(e))return t.forEach(s=>Bn(e,s,i)),e;if(Array.isArray(t)&&Array.isArray(e))return t.forEach(s=>{e.includes(s)||e.push(s)}),e;if(e==null||r<=0)return e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t;if(t!=null&&typeof e=="object"&&typeof t=="object"){const s=e;Object.entries(t).forEach(([o,a])=>{if(typeof a=="object"){if(a===null)return;Object.hasOwn(e,o)||Object.defineProperty(e,o,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),s[o]===void 0&&(s[o]=Array.isArray(a)?[]:{}),typeof s[o]=="object"&&(s[o]=Bn(s[o],a,{depth:r-1}))}else typeof s[o]!="object"&&(Object.hasOwn(e,o)?s[o]=a:Object.defineProperty(e,o,{value:a,writable:!0,enumerable:!0,configurable:!0}))})}return e},"assignWithDepth"),ie=Bn,er="#ffffff",rr="#f2f2f2",vt=p((e,t)=>t?b(e,{s:-40,l:10}):b(e,{s:-40,l:-10}),"mkBorder"),Bi,Sx=(Bi=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(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||vt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||vt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||vt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||vt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?W(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||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||q(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.
Line truncated
|
||||
`);for(const[r,{detector:i}]of Object.entries(Qr))if(i(e,t))return r;throw new of(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),Ln=p((...e)=>{for(const{id:t,detector:r,loader:i}of e)af(t,r,i)},"registerLazyLoadedDiagrams"),af=p((e,t,r)=>{Qr[e]&&P.warn(`Detector with key ${e} already exists. Overwriting.`),Qr[e]={detector:t,loader:r},P.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),rC=p(e=>Qr[e].loader,"getDiagramLoader"),qs=/<br\s*\/?>/gi,iC=p(e=>e?hf(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),sC=(()=>{let e=!1;return()=>{e||(nf(),e=!0)}})();function nf(){const e="data-temp-href-target";zi.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),zi.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}p(nf,"setupDompurifyHooks");var lf=p(e=>(sC(),zi.sanitize(e)),"removeScript"),mc=p((e,t)=>{if(fe(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=lf(e):r!=="loose"&&(e=hf(e),e=e.replace(/</g,"<").replace(/>/g,">"),e=e.replace(/=/g,"="),e=lC(e))}return e},"sanitizeMore"),$e=p((e,t)=>e&&(t.dompurifyConfig?e=zi.sanitize(mc(e,t),t.dompurifyConfig).toString():e=zi.sanitize(mc(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),oC=p((e,t)=>typeof e=="string"?$e(e,t):e.flat().map(r=>$e(r,t)),"sanitizeTextOrArray"),aC=p(e=>qs.test(e),"hasBreaks"),nC=p(e=>e.split(qs),"splitBreaks"),lC=p(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),hf=p(e=>e.replace(qs,"#br#"),"breakToPlaceholder"),hC=p(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),cC=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),uC=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),yc=p(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i<t.length;i++){let s=t[i];if(s===","&&i>0&&i+1<t.length){const o=t[i-1],a=t[i+1];dC(o,a)&&(s=o+","+a,i++,r.pop())}r.push(fC(s))}return r.join("")},"parseGenericTypes"),Fn=p((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),dC=p((e,t)=>{const r=Fn(e,"~"),i=Fn(t,"~");return r===1&&i===1},"shouldCombineSets"),fC=p(e=>{const t=Fn(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let s=i.indexOf("~"),o=i.lastIndexOf("~");for(;s!==-1&&o!==-1&&s!==o;)i[s]="<",i[o]=">",s=i.indexOf("~"),o=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),xc=p(()=>window.MathMLElement!==void 0,"isMathMLSupported"),An=/\$\$(.*?)\$\$/g,Ls=p(e=>(e.match(An)?.length??0)>0,"hasKatex"),XM=p(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await cf(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const s={width:r.clientWidth,height:r.clientHeight};return r.remove(),s},"calculateMathMLDimensions"),pC=p(async(e,t)=>{if(!Ls(e))return e;if(!(xc()||t.legacyMathML||t.forceLegacyMathML))return e.replace(An,"MathML is unsupported in this environment.");{const{default:r}=await At(async()=>{const{default:s}=await import("./katex.js");return{default:s}},[]),i=t.forceLegacyMathML||!xc()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(qs).map(s=>Ls(s)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${s}</div>`:`<div>${s}</div>`).join("").replace(An,(s,o)=>r.renderToString(o,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),cf=p(async(e,t)=>$e(await pC(e,t),t),"renderKatexSanitized"),Ws={getRows:iC,sanitizeText:$e,sanitizeTextOrArray:oC,hasBreaks:aC,splitBreaks:nC,lineBreakRegex:qs,removeScript:lf,getUrl:hC,evaluate:ir,getMax:cC,getMin:uC},gC=p(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),mC=p(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),uf=p(function(e,t,r,i){const s=mC(t,r,i);gC(e,s)},"configureSvgSize"),yC=p(function(e,t,r,i){const s=t.node().getBBox(),o=s.width,a=s.height;P.info(`SVG bounds: ${o}x${a}`,s);let n=0,l=0;P.info(`Graph bounds: ${n}x${l}`,e),n=o+r*2,l=a+r*2,P.info(`Calculated bounds: ${n}x${l}`),uf(t,l,n,i);const c=`${s.x-r} ${s.y-r} ${s.width+2*r} ${s.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),mo={};function En(e){return[...e.cssRules].map(t=>t.cssText).join(`
|
||||
`)}p(En,"cssStyleSheetToString");var xC=p((e,t,r,i)=>{let s="";return e in mo&&mo[e]?s=mo[e]({...r,svgId:i}):P.warn(`No theme found for ${e}`),`& {
|
||||
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
|
||||
}
|
||||
|
||||
${s}
|
||||
.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("+i+"-gradient)":r.nodeBorder};
|
||||
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
|
||||
}
|
||||
[data-look="neo"].swimlane.cluster rect {
|
||||
filter: none;
|
||||
}
|
||||
|
||||
|
||||
[data-look="neo"].node path {
|
||||
stroke: ${r.useGradient?"url("+i+"-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(${i}-drop-shadow)`):"none"};
|
||||
}
|
||||
|
||||
[data-look="neo"].node .neo-line path {
|
||||
stroke: ${r.nodeBorder};
|
||||
filter: none;
|
||||
}
|
||||
|
||||
[data-look="neo"].node circle{
|
||||
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
|
||||
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
|
||||
}
|
||||
|
||||
[data-look="neo"].node circle .state-start{
|
||||
fill: #000000;
|
||||
}
|
||||
|
||||
[data-look="neo"].icon-shape .icon {
|
||||
fill: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
|
||||
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
|
||||
}
|
||||
|
||||
[data-look="neo"].icon-shape .icon-neo path {
|
||||
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
|
||||
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
|
||||
}
|
||||
|
||||
${t}
|
||||
`},"getStyles"),CC=p((e,t)=>{t!==void 0&&(mo[e]=t)},"addStylesForDiagram"),bC=xC,df={};I0(df,{clear:()=>kC,getAccDescription:()=>_C,getAccTitle:()=>TC,getDiagramTitle:()=>BC,setAccDescription:()=>SC,setAccTitle:()=>wC,setDiagramTitle:()=>vC});var xl="",Cl="",bl="",kl=p(e=>$e(e,Ut()),"sanitizeText"),kC=p(()=>{xl="",bl="",Cl=""},"clear"),wC=p(e=>{xl=kl(e).replace(/^\s+/g,"")},"setAccTitle"),TC=p(()=>xl,"getAccTitle"),SC=p(e=>{bl=kl(e).replace(/\n\s+/g,`
|
||||
`)},"setAccDescription"),_C=p(()=>bl,"getAccDescription"),vC=p(e=>{Cl=kl(e)},"setDiagramTitle"),BC=p(()=>Cl,"getDiagramTitle"),Cc=P,LC=ml,$t=Ut,VM=tf,ZM=Hi,wl=p(e=>$e(e,$t()),"sanitizeText"),FC=yC,AC=p(()=>df,"getCommonDb"),Ao={},Eo=p((e,t,r)=>{Ao[e]&&Cc.warn(`Diagram with id ${e} already registered. Overwriting.`),Ao[e]=t,r&&af(e,r),CC(e,t.styles),t.injectUtils?.(Cc,LC,$t,wl,FC,AC(),()=>{})},"registerDiagram"),Mn=p(e=>{if(e in Ao)return Ao[e];throw new EC(e)},"getDiagram"),Ni,EC=(Ni=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},p(Ni,"DiagramNotFoundError"),Ni),MC={value:()=>{}};function ff(){for(var e=0,t=arguments.length,r={},i;e<t;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new yo(r)}function yo(e){this._=e}function $C(e,t){return e.trim().split(/^|\s+/).map(function(r){var i="",s=r.indexOf(".");if(s>=0&&(i=r.slice(s+1),r=r.slice(0,s)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}yo.prototype=ff.prototype={constructor:yo,on:function(e,t){var r=this._,i=$C(e+"",r),s,o=-1,a=i.length;if(arguments.length<2){for(;++o<a;)if((s=(e=i[o]).type)&&(s=OC(r[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(s=(e=i[o]).type)r[s]=bc(r[s],e.name,t);else if(t==null)for(s in r)r[s]=bc(r[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new yo(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var r=new Array(s),i=0,s,o;i<s;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],i=0,s=o.length;i<s;++i)o[i].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],s=0,o=i.length;s<o;++s)i[s].value.apply(t,r)}};function OC(e,t){for(var r=0,i=e.length,s;r<i;++r)if((s=e[r]).name===t)return s.value}function bc(e,t,r){for(var i=0,s=e.length;i<s;++i)if(e[i].name===t){e[i]=MC,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var $n="http://www.w3.org/1999/xhtml";const kc={svg:"http://www.w3.org/2000/svg",xhtml:$n,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ea(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),kc.hasOwnProperty(t)?{space:kc[t],local:e}:e}function DC(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===$n&&t.documentElement.namespaceURI===$n?t.createElement(e):t.createElementNS(r,e)}}function IC(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function pf(e){var t=ea(e);return(t.local?IC:DC)(t)}function PC(){}function Tl(e){return e==null?PC:function(){return this.querySelector(e)}}function RC(e){typeof e!="function"&&(e=Tl(e));for(var t=this._groups,r=t.length,i=new Array(r),s=0;s<r;++s)for(var o=t[s],a=o.length,n=i[s]=new Array(a),l,c,h=0;h<a;++h)(l=o[h])&&(c=e.call(l,l.__data__,h,o))&&("__data__"in l&&(c.__data__=l.__data__),n[h]=c);return new Ae(i,this._parents)}function NC(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function qC(){return[]}function gf(e){return e==null?qC:function(){return this.querySelectorAll(e)}}function WC(e){return function(){return NC(e.apply(this,arguments))}}function zC(e){typeof e=="function"?e=WC(e):e=gf(e);for(var t=this._groups,r=t.length,i=[],s=[],o=0;o<r;++o)for(var a=t[o],n=a.length,l,c=0;c<n;++c)(l=a[c])&&(i.push(e.call(l,l.__data__,c,a)),s.push(l));return new Ae(i,s)}function mf(e){return function(){return this.matches(e)}}function yf(e){return function(t){return t.matches(e)}}var HC=Array.prototype.find;function YC(e){return function(){return HC.call(this.children,e)}}function UC(){return this.firstElementChild}function jC(e){return this.select(e==null?UC:YC(typeof e=="function"?e:yf(e)))}var GC=Array.prototype.filter;function XC(){return Array.from(this.children)}function VC(e){return function(){return GC.call(this.children,e)}}function ZC(e){return this.selectAll(e==null?XC:VC(typeof e=="function"?e:yf(e)))}function KC(e){typeof e!="function"&&(e=mf(e));for(var t=this._groups,r=t.length,i=new Array(r),s=0;s<r;++s)for(var o=t[s],a=o.length,n=i[s]=[],l,c=0;c<a;++c)(l=o[c])&&e.call(l,l.__data__,c,o)&&n.push(l);return new Ae(i,this._parents)}function xf(e){return new Array(e.length)}function QC(){return new Ae(this._enter||this._groups.map(xf),this._parents)}function Mo(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Mo.prototype={constructor:Mo,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function JC(e){retur
Line truncated
|
||||
`,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),P.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const s=[];for(;(i=Ts.exec(e))!==null;)if(i.index===Ts.lastIndex&&Ts.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const o=i[1]?i[1]:i[2],a=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;s.push({type:o,args:a})}return s.length===0?{type:e,args:null}:s.length===1?s[0]:s}catch(r){return P.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),yw=p(function(e){return e.replace(Ts,"")},"removeDirectives"),xw=p(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function Nl(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return pw[r]??t}p(Nl,"interpolateToCurve");function Cp(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?P2.sanitizeUrl(r):r}p(Cp,"formatUrl");var Cw=p((e,...t)=>{const r=e.split("."),i=r.length-1,s=r[i];let o=window;for(let a=0;a<i;a++)if(o=o[r[a]],!o){P.error(`Function name: ${e} not found in window`);return}o[s](...t)},"runFunc");function ql(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}p(ql,"distance");function bp(e){let t,r=0;e.forEach(s=>{r+=ql(s,t),t=s});const i=r/2;return Wl(e,i)}p(bp,"traverseEdge");function kp(e){return e.length===1?e[0]:bp(e)}p(kp,"calcLabelPosition");var Kc=p((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),Wl=p((e,t)=>{let r,i=t;for(const s of e){if(r){const o=ql(s,r);if(o===0)return r;if(o<i)i-=o;else{const a=i/o;if(a<=0)return r;if(a>=1)return{x:s.x,y:s.y};if(a>0&&a<1)return{x:Kc((1-a)*r.x+a*s.x,5),y:Kc((1-a)*r.y+a*s.y,5)}}}r=s}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),bw=p((e,t,r)=>{P.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const s=Wl(t,25),o=e?10:5,a=Math.atan2(t[0].y-s.y,t[0].x-s.x),n={x:0,y:0};return n.x=Math.sin(a)*o+(t[0].x+s.x)/2,n.y=-Math.cos(a)*o+(t[0].y+s.y)/2,n},"calcCardinalityPosition");function wp(e,t,r){const i=structuredClone(r);P.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const s=25+e,o=Wl(i,s),a=10+e*.5,n=Math.atan2(i[0].y-o.y,i[0].x-o.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*a+(i[0].x+o.x)/2,l.y=-Math.cos(n+Math.PI)*a+(i[0].y+o.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*a+(i[0].x+o.x)/2-5,l.y=-Math.cos(n-Math.PI)*a+(i[0].y+o.y)/2-5):t==="end_left"?(l.x=Math.sin(n)*a+(i[0].x+o.x)/2-5,l.y=-Math.cos(n)*a+(i[0].y+o.y)/2-5):(l.x=Math.sin(n)*a+(i[0].x+o.x)/2,l.y=-Math.cos(n)*a+(i[0].y+o.y)/2),l}p(wp,"calcTerminalLabelPosition");function Tp(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}p(Tp,"getStylesFromArray");var Qc=0,kw=p(()=>(Qc++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Qc),"generateId");function Sp(e){let t="";const r="0123456789abcdef",i=r.length;for(let s=0;s<e;s++)t+=r.charAt(Math.floor(Math.random()*i));return t}p(Sp,"makeRandomHex");var ww=p(e=>Sp(e.length),"random"),Tw=p(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"),Sw=p(function(e,t){const r=t.text.replace(Ws.lineBreakRegex," "),[,i]=aa(t.fontSize),s=e.append("text");s.attr("x",t.x),s.attr("y",t.y),s.style("text-anchor",t.anchor),s.style("font-family",t.fontFamily),s.style("font-size",i),s.style("font-weight",t.fontWeight),s.attr("fill",t.fill),t.class!==void 0&&s.attr("class",t.class);const o=s.append("tspan");return o.attr("x",t.x+t.textMargin*2),o.attr("fill",t.fill),o.text(r),s},"drawSimpleText"),_w=Us((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),Ws.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),s=[];let o="";return i.forEach((a,n)=>{const l=br(`${a} `,r),c=br(o,r);if(l>t){const{hyphenatedStrings:d,remainingWord:f}=vw(a,t,"-",r);s.push(o,...d),o=f}else c+l>=t?(s.push(o),o=a):o=[o,a].filter(Boolean).join(" ");n+1===i.length&&s.push(o)}),s.filter(a=>a!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),vw=Us((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const s=[...e],o=[];let a="";return s.forEach((n,l)=>{const c=`${a}${n}`;if(br(c,i)>=t){const u=l+1,d=s.length===u,f=`${c}${r}`;o.push(d?c:f),a=""}else a=c}),{hyphenatedStrings:o,remainingWord:a}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function _p(e,t){return zl(e,t).height}p(_p,"calculateTextHeight");function br(e,t){return zl(e,t).width}p(br,"calculateTextWidth");var zl=Us((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:s=400}=t;if(!e)return{width:0,height:0};const[,o]=aa(r),a=["sans-serif",i],n=e.split(Ws.
Line truncated
|
||||
]`).replace("lheading",Fp).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Zw=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Kw=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ep=/^( {2,}|\\)\n(?!\s*$)/,Qw=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,la=/[\p{P}\p{S}]/u,Kl=/[\s\p{P}\p{S}]/u,Mp=/[^\s\p{P}\p{S}]/u,Jw=Nt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Kl).getRegex(),$p=/(?!~)[\p{P}\p{S}]/u,tT=/(?!~)[\s\p{P}\p{S}]/u,eT=/(?:[^\s\p{P}\p{S}]|~)/u,rT=Nt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Pw?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Op=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,iT=Nt(Op,"u").replace(/punct/g,la).getRegex(),sT=Nt(Op,"u").replace(/punct/g,$p).getRegex(),Dp="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",oT=Nt(Dp,"gu").replace(/notPunctSpace/g,Mp).replace(/punctSpace/g,Kl).replace(/punct/g,la).getRegex(),aT=Nt(Dp,"gu").replace(/notPunctSpace/g,eT).replace(/punctSpace/g,tT).replace(/punct/g,$p).getRegex(),nT=Nt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Mp).replace(/punctSpace/g,Kl).replace(/punct/g,la).getRegex(),lT=Nt(/\\(punct)/,"gu").replace(/punct/g,la).getRegex(),hT=Nt(/^<(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(),cT=Nt(Vl).replace("(?:-->|$)","-->").getRegex(),uT=Nt("^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",cT).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),zo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,dT=Nt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",zo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ip=Nt(/^!?\[(label)\]\[(ref)\]/).replace("label",zo).replace("ref",Xl).getRegex(),Pp=Nt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Xl).getRegex(),fT=Nt("reflink|nolink(?!\\()","g").replace("reflink",Ip).replace("nolink",Pp).getRegex(),iu=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ql={_backpedal:_s,anyPunctuation:lT,autolink:hT,blockSkip:rT,br:Ep,code:Kw,del:_s,emStrongLDelim:iT,emStrongRDelimAst:oT,emStrongRDelimUnd:nT,escape:Zw,link:dT,nolink:Pp,punctuation:Jw,reflink:Ip,reflinkSearch:fT,tag:uT,text:Qw,url:_s},pT={...Ql,link:Nt(/^!?\[(label)\]\((.*?)\)/).replace("label",zo).getRegex(),reflink:Nt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",zo).getRegex()},jn={...Ql,emStrongRDelimAst:aT,emStrongLDelim:sT,url:Nt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",iu).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:Nt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",iu).getRegex()},gT={...jn,br:Nt(Ep).replace("{2,}","*").getRegex(),text:Nt(jn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},so={normal:Zl,gfm:Xw,pedantic:Vw},is={normal:Ql,gfm:jn,breaks:gT,pedantic:pT},mT={"&":"&","<":"<",">":">",'"':""","'":"'"},su=e=>mT[e];function Ge(e,t){if(t){if(ye.escapeTest.test(e))return e.replace(ye.escapeReplace,su)}else if(ye.escapeTestNoEncode.test(e))return e.replace(ye.escapeReplaceNoEncode,su);return e}function ou(e){try{e=encodeURI(e).replace(ye.percentDecode,"%")}catch{return null}return e}function au(e,t){let r=e.replace(ye.findPipe,(o,a,n)=>{let l=!1,c=a;for(;--c>=0&&n[c]==="\\";)l=!l;return l?"|":" |"}),i=r.split(ye.splitPipe),s=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;s<i.length;s++)i[s]=i[s].trim().replace(yeLine truncated
|
||||
`).map(o=>{let a=o.match(r.other.beginningSpace);if(a===null)return o;let[n]=a;return n.length>=s.length?o.slice(s.length):o}).join(`
|
||||
`)}var Ho=class{options;rules;lexer;constructor(t){this.options=t||oi}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:ss(i,`
|
||||
`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],s=xT(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:s}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let s=ss(i,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(i=s.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:ss(r[0],`
|
||||
`)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=ss(r[0],`
|
||||
`).split(`
|
||||
`),s="",o="",a=[];for(;i.length>0;){let n=!1,l=[],c;for(c=0;c<i.length;c++)if(this.rules.other.blockquoteStart.test(i[c]))l.push(i[c]),n=!0;else if(!n)l.push(i[c]);else break;i=i.slice(c);let h=l.join(`
|
||||
`),u=h.replace(this.rules.other.blockquoteSetextReplace,`
|
||||
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
||||
${h}`:h,o=o?`${o}
|
||||
${u}`:u;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,a,!0),this.lexer.state.top=d,i.length===0)break;let f=a.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let m=f,y=m.raw+`
|
||||
`+i.join(`
|
||||
`),x=this.blockquote(y);a[a.length-1]=x,s=s.substring(0,s.length-m.raw.length)+x.raw,o=o.substring(0,o.length-m.text.length)+x.text;break}else if(f?.type==="list"){let m=f,y=m.raw+`
|
||||
`+i.join(`
|
||||
`),x=this.list(y);a[a.length-1]=x,s=s.substring(0,s.length-f.raw.length)+x.raw,o=o.substring(0,o.length-m.raw.length)+x.raw,i=y.substring(a.at(-1).raw.length).split(`
|
||||
`);continue}}return{type:"blockquote",raw:s,tokens:a,text:o}}}list(t){let r=this.rules.block.list.exec(t);if(r){let i=r[1].trim(),s=i.length>1,o={type:"list",raw:"",ordered:s,start:s?+i.slice(0,-1):"",loose:!1,items:[]};i=s?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=s?i:"[*+-]");let a=this.rules.other.listItemRegex(i),n=!1;for(;t;){let c=!1,h="",u="";if(!(r=a.exec(t))||this.rules.block.hr.test(t))break;h=r[0],t=t.substring(h.length);let d=r[2].split(`
|
||||
`,1)[0].replace(this.rules.other.listReplaceTabs,k=>" ".repeat(3*k.length)),f=t.split(`
|
||||
`,1)[0],m=!d.trim(),y=0;if(this.options.pedantic?(y=2,u=d.trimStart()):m?y=r[1].length+1:(y=r[2].search(this.rules.other.nonSpaceChar),y=y>4?1:y,u=d.slice(y),y+=r[1].length),m&&this.rules.other.blankLine.test(f)&&(h+=f+`
|
||||
`,t=t.substring(f.length+1),c=!0),!c){let k=this.rules.other.nextBulletRegex(y),T=this.rules.other.hrRegex(y),S=this.rules.other.fencesBeginRegex(y),_=this.rules.other.headingBeginRegex(y),L=this.rules.other.htmlBeginRegex(y);for(;t;){let A=t.split(`
|
||||
`,1)[0],F;if(f=A,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),F=f):F=f.replace(this.rules.other.tabCharGlobal," "),S.test(f)||_.test(f)||L.test(f)||k.test(f)||T.test(f))break;if(F.search(this.rules.other.nonSpaceChar)>=y||!f.trim())u+=`
|
||||
`+F.slice(y);else{if(m||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(d)||_.test(d)||T.test(d))break;u+=`
|
||||
`+f}!m&&!f.trim()&&(m=!0),h+=A+`
|
||||
`,t=t.substring(A.length+1),d=F.slice(y)}}o.loose||(n?o.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(n=!0));let x=null,C;this.options.gfm&&(x=this.rules.other.listIsTask.exec(u),x&&(C=x[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:h,task:!!x,checked:C,loose:!1,text:u,tokens:[]}),o.raw+=h}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let c=0;c<o.items.length;c++)if(this.lexer.state.top=!1,o.items[c].tokens=this.lexer.blockTokens(o.items[c].text,[]),!o.loose){let h=o.items[c].tokens.filter(d=>d.type==="space"),u=h.length>0&&h.some(d=>this.rules.other.anyLine.test(d.raw));o.loose=u}if(o.loose)for(let c=0;c<o.items.length;c++)o.items[c].loose=!0;return o}}html(t){let r=this.rules.block.html.exec(t);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let i=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:i,raw:r[0],href:s,title:o}}}table(t){let r=this.rules.block.table.exec(t);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let i=au(r[1]),s=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
||||
`):[],a={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===s.length){for(let n of s)this.rules.other.tableAlignRight.test(n)?a.align.push("right"):this.rules.other.tableAlignCenter.test(n)?a.align.push("center"):this.rules.other.tableAlignLeft.test(n)?a.align.push("left"):a.align.push(null);for(let n=0;n<i.length;n++)a.header.push({text:i[n],tokens:this.lexer.inline(i[n]),header:!0,align:a.align[n]});for(let n of o)a.rows.push(au(n,a.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[c]})));return a}}lheading(t){let r=this.rules.block.lheading.exec(t);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(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===`
|
||||
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);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(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let a=ss(i.slice(0,-1),"\\");if((i.length-a.length)%2===0)return}else{let a=yT(r[2],"()");if(a===-2)return;if(a>-1){let n=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,n).trim(),r[3]=""}}let s=r[2],o="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(s);a&&(s=a[1],o=a[3])}else o=r[3]?r[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?s=s.slice(1):s=s.slice(1,-1)),nu(r,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let s=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=r[s.toLowerCase()];if(!o){let a=i[0].charAt(0);return{type:"text",raw:a,text:a}}return nu(i,o,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||s[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!i||this.rules.inline.punctuation.exec(i))){let o=[...s[0]].length-1,a,n,l=o,c=0,h=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+o);(s=h.exec(r))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(n=[...a].length,s[3]||s[4]){l+=n;continue}else if((s[5]||s[6])&&o%3&&!((o+n)%3)){c+=n;continue}if(l-=n,l>0)continue;n=Math.min(n,n+l+c);let u=[...s[0]][0].length,d=t.slice(0,o+s.index+u+n);if(Math.min(o,n)%2){let m=d.slice(1,-1);return{type:"em",raw:d,text:m,tokens:this.lexer.inlineTokens(m)}}let f=d.slice(2,-2);return{type:"strong",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(i),o=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return s&&o&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,s;return r[2]==="@"?(i=r[1],s="mailto:"+i):(i=r[1],s=i),{type:"link",raw:r[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let i,s;if(r[2]==="@")i=r[0],s="mailto:"+i;else{let o;do o=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(o!==r[0]);i=r[0],r[1]==="www."?s="http://"+r[0]:s=r[0]}return{type:"link",raw:r[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},Re=class Gn{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||oi,this.options.tokenizer=this.options.tokenizer||new Ho,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:ye,block:so.normal,inline:is.normal};this.options.pedantic?(r.block=so.pedantic,r.inline=is.pedantic):this.options.gfm&&(r.block=so.gfm,this.options.breaks?r.inline=is.breaks:r.inline=is.gfm),this.tokenizer.rules=r}static get rules(){return{block:so,inline:is}}static lex(t,r){return new Gn(r).lex(t)}static lexInline(t,r){return new Gn(r).inlineTokens(t)}lex(t){t=t.replace(ye.carriageReturn,`
|
||||
`),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let i=this.inlineQueue[r];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],i=!1){for(this.options.pedantic&&(t=t.replace(ye.tabCharGlobal," ").replace(ye.spaceLine,""));t;){let s;if(this.options.extensions?.block?.some(a=>(s=a.call({lexer:this},t,r))?(t=t.substring(s.raw.length),r.push(s),!0):!1))continue;if(s=this.tokenizer.space(t)){t=t.substring(s.raw.length);let a=r.at(-1);s.raw.length===1&&a!==void 0?a.raw+=`
|
||||
`:r.push(s);continue}if(s=this.tokenizer.code(t)){t=t.substring(s.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
||||
`)?"":`
|
||||
`)+s.raw,a.text+=`
|
||||
`+s.text,this.inlineQueue.at(-1).src=a.text):r.push(s);continue}if(s=this.tokenizer.fences(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.heading(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.hr(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.blockquote(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.list(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.html(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.def(t)){t=t.substring(s.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
||||
`)?"":`
|
||||
`)+s.raw,a.text+=`
|
||||
`+s.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},r.push(s));continue}if(s=this.tokenizer.table(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.lheading(t)){t=t.substring(s.raw.length),r.push(s);continue}let o=t;if(this.options.extensions?.startBlock){let a=1/0,n=t.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},n),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(o=t.substring(0,a+1))}if(this.state.top&&(s=this.tokenizer.paragraph(o))){let a=r.at(-1);i&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
|
||||
`)?"":`
|
||||
`)+s.raw,a.text+=`
|
||||
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(s),i=o.length!==t.length,t=t.substring(s.raw.length);continue}if(s=this.tokenizer.text(t)){t=t.substring(s.raw.length);let a=r.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
||||
`)?"":`
|
||||
`)+s.raw,a.text+=`
|
||||
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(s);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let i=t,s=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,s.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)o=s[2]?s[2].length:0,i=i.slice(0,s.index+o)+"["+"a".repeat(s[0].length-o-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let a=!1,n="";for(;t;){a||(n=""),a=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let h=r.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(l=this.tokenizer.emStrong(t,i,n)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),r.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),r.push(l);continue}let c=t;if(this.options.extensions?.startInline){let h=1/0,u=t.slice(1),d;this.options.extensions.startInline.forEach(f=>{d=f.call({lexer:this},u),typeof d=="number"&&d>=0&&(h=Math.min(h,d))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(l=this.tokenizer.inlineText(c)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(n=l.raw.slice(-1)),a=!0;let h=r.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return r}},Yo=class{options;parser;constructor(t){this.options=t||oi}space(t){return""}code({text:t,lang:r,escaped:i}){let s=(r||"").match(ye.notSpaceStart)?.[0],o=t.replace(ye.endingNewline,"")+`
|
||||
`;return s?'<pre><code class="language-'+Ge(s)+'">'+(i?o:Ge(o,!0))+`</code></pre>
|
||||
`:"<pre><code>"+(i?o:Ge(o,!0))+`</code></pre>
|
||||
`}blockquote({tokens:t}){return`<blockquote>
|
||||
${this.parser.parse(t)}</blockquote>
|
||||
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`<h${r}>${this.parser.parseInline(t)}</h${r}>
|
||||
`}hr(t){return`<hr>
|
||||
`}list(t){let r=t.ordered,i=t.start,s="";for(let n=0;n<t.items.length;n++){let l=t.items[n];s+=this.listitem(l)}let o=r?"ol":"ul",a=r&&i!==1?' start="'+i+'"':"";return"<"+o+a+`>
|
||||
`+s+"</"+o+`>
|
||||
`}listitem(t){let r="";if(t.task){let i=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=i+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=i+" "+Ge(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`<li>${r}</li>
|
||||
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
||||
`}table(t){let r="",i="";for(let o=0;o<t.header.length;o++)i+=this.tablecell(t.header[o]);r+=this.tablerow({text:i});let s="";for(let o=0;o<t.rows.length;o++){let a=t.rows[o];i="";for(let n=0;n<a.length;n++)i+=this.tablecell(a[n]);s+=this.tablerow({text:i})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
||||
<thead>
|
||||
`+r+`</thead>
|
||||
`+s+`</table>
|
||||
`}tablerow({text:t}){return`<tr>
|
||||
${t}</tr>
|
||||
`}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+`</${i}>
|
||||
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Ge(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,tokens:i}){let s=this.parser.parseInline(i),o=ou(t);if(o===null)return s;t=o;let a='<a href="'+t+'"';return r&&(a+=' title="'+Ge(r)+'"'),a+=">"+s+"</a>",a}image({href:t,title:r,text:i,tokens:s}){s&&(i=this.parser.parseInline(s,this.parser.textRenderer));let o=ou(t);if(o===null)return Ge(i);t=o;let a=`<img src="${t}" alt="${i}"`;return r&&(a+=` title="${Ge(r)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ge(t.text)}},Jl=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Ne=class Xn{options;renderer;textRenderer;constructor(t){this.options=t||oi,this.options.renderer=this.options.renderer||new Yo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Jl}static parse(t,r){return new Xn(r).parse(t)}static parseInline(t,r){return new Xn(r).parseInline(t)}parse(t,r=!0){let i="";for(let s=0;s<t.length;s++){let o=t[s];if(this.options.extensions?.renderers?.[o.type]){let n=o,l=this.options.extensions.renderers[n.type].call({parser:this},n);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(n.type)){i+=l||"";continue}}let a=o;switch(a.type){case"space":{i+=this.renderer.space(a);continue}case"hr":{i+=this.renderer.hr(a);continue}case"heading":{i+=this.renderer.heading(a);continue}case"code":{i+=this.renderer.code(a);continue}case"table":{i+=this.renderer.table(a);continue}case"blockquote":{i+=this.renderer.blockquote(a);continue}case"list":{i+=this.renderer.list(a);continue}case"html":{i+=this.renderer.html(a);continue}case"def":{i+=this.renderer.def(a);continue}case"paragraph":{i+=this.renderer.paragraph(a);continue}case"text":{let n=a,l=this.renderer.text(n);for(;s+1<t.length&&t[s+1].type==="text";)n=t[++s],l+=`
|
||||
`+this.renderer.text(n);r?i+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):i+=l;continue}default:{let n='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}parseInline(t,r=this.renderer){let i="";for(let s=0;s<t.length;s++){let o=t[s];if(this.options.extensions?.renderers?.[o.type]){let n=this.options.extensions.renderers[o.type].call({parser:this},o);if(n!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){i+=n||"";continue}}let a=o;switch(a.type){case"escape":{i+=r.text(a);break}case"html":{i+=r.html(a);break}case"link":{i+=r.link(a);break}case"image":{i+=r.image(a);break}case"strong":{i+=r.strong(a);break}case"em":{i+=r.em(a);break}case"codespan":{i+=r.codespan(a);break}case"br":{i+=r.br(a);break}case"del":{i+=r.del(a);break}case"text":{i+=r.text(a);break}default:{let n='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}},gs=class{options;block;constructor(t){this.options=t||oi}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?Re.lex:Re.lexInline}provideParser(){return this.block?Ne.parse:Ne.parseInline}},CT=class{defaults=Ul();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ne;Renderer=Yo;TextRenderer=Jl;Lexer=Re;Tokenizer=Ho;Hooks=gs;constructor(...t){this.use(...t)}walkTokens(t,r){let i=[];for(let s of t)switch(i=i.concat(r.call(this,s)),s.type){case"table":{let o=s;for(let a of o.header)i=i.concat(this.walkTokens(a.tokens,r));for(let a of o.rows)for(let n of a)i=i.concat(this.walkTokens(n.tokens,r));break}case"list":{let o=s;i=i.concat(this.walkTokens(o.items,r));break}default:{let o=s;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(a=>{let n=o[a].flat(1/0);i=i.concat(this.walkTokens(n,r))}):o.tokens&&(i=i.concat(this.walkTokens(o.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let s={...i};if(s.async=this.defaults.async||s.async||!1,i.extensions&&(i.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let a=r.renderers[o.name];a?r.renderers[o.name]=function(...n){let l=o.renderer.apply(this,n);return l===!1&&(l=a.apply(this,n)),l}:r.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[o.level];a?a.unshift(o.tokenizer):r[o.level]=[o.tokenizer],o.start&&(o.level==="block"?r.startBlock?r.startBlock.push(o.start):r.startBlock=[o.start]:o.level==="inline"&&(r.startInline?r.startInline.push(o.start):r.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(r.childTokens[o.name]=o.childTokens)}),s.extensions=r),i.renderer){let o=this.defaults.renderer||new Yo(this.defaults);for(let a in i.renderer){if(!(a in o))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let n=a,l=i.renderer[n],c=o[n];o[n]=(...h)=>{let u=l.apply(o,h);return u===!1&&(u=c.apply(o,h)),u||""}}s.renderer=o}if(i.tokenizer){let o=this.defaults.tokenizer||new Ho(this.defaults);for(let a in i.tokenizer){if(!(a in o))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let n=a,l=i.tokenizer[n],c=o[n];o[n]=(...h)=>{let u=l.apply(o,h);return u===!1&&(u=c.apply(o,h)),u}}s.tokenizer=o}if(i.hooks){let o=this.defaults.hooks||new gs;for(let a in i.hooks){if(!(a in o))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let n=a,l=i.hooks[n],c=o[n];gs.passThroughHooks.has(a)?o[n]=h=>{if(this.defaults.async&&gs.passThroughHooksRespectAsync.has(a))return(async()=>{let d=await l.call(o,h);return c.call(o,d)})();let u=l.call(o,h);return c.call(o,u)}:o[n]=(...h)=>{if(this.defaults.async)return(async()=>{let d=await l.apply(o,h);return d===!1&&(d=await c.apply(o,h)),d})();let u=l.apply(o,h);return u===!1&&(u=c.apply(o,h)),u}}s.hooks=o}if(i.walkTokens){let o=this.defaults.walkTokens,a=i.walkTokens;s.walkTokens=function(n){let l=[];return l.push(a.call(this,n)),o&&(l=l.concat(o.call(this,n))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return Re.lex(t,r??this.defaults)}parser(t,r){return Ne.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let s={...i},o={...this.defaults,...s},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option
Line truncated
|
||||
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+Ge(i.message+"",!0)+"</pre>";return r?Promise.resolve(s):s}if(r)return Promise.reject(i);throw i}}},ti=new CT;function Wt(e,t){return ti.parse(e,t)}Wt.options=Wt.setOptions=function(e){return ti.setOptions(e),Wt.defaults=ti.defaults,Bp(Wt.defaults),Wt};Wt.getDefaults=Ul;Wt.defaults=oi;Wt.use=function(...e){return ti.use(...e),Wt.defaults=ti.defaults,Bp(Wt.defaults),Wt};Wt.walkTokens=function(e,t){return ti.walkTokens(e,t)};Wt.parseInline=ti.parseInline;Wt.Parser=Ne;Wt.parser=Ne.parse;Wt.Renderer=Yo;Wt.TextRenderer=Jl;Wt.Lexer=Re;Wt.lexer=Re.lex;Wt.Tokenizer=Ho;Wt.Hooks=gs;Wt.parse=Wt;Wt.options;Wt.setOptions;Wt.use;Wt.walkTokens;Wt.parseInline;Ne.parse;Re.lex;function Rp(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var i=Array.from(typeof e=="string"?[e]:e);i[i.length-1]=i[i.length-1].replace(/\r?\n([\t ]*)$/,"");var s=i.reduce(function(n,l){var c=l.match(/\n([\t ]+|(?!\s).)/g);return c?n.concat(c.map(function(h){var u,d;return(d=(u=h.match(/[\t ]/g))===null||u===void 0?void 0:u.length)!==null&&d!==void 0?d:0})):n},[]);if(s.length){var o=new RegExp(`
|
||||
[ ]{`.concat(Math.min.apply(Math,s),"}"),"g");i=i.map(function(n){return n.replace(o,`
|
||||
`)})}i[0]=i[0].replace(/^\r?\n/,"");var a=i[0];return t.forEach(function(n,l){var c=a.match(/(?:^|\n)( *)$/),h=c?c[1]:"",u=n;typeof n=="string"&&n.includes(`
|
||||
`)&&(u=String(n).split(`
|
||||
`).map(function(d,f){return f===0?d:"".concat(h).concat(d)}).join(`
|
||||
`)),a+=u+i[l+1]}),a}var Vn=typeof performance<"u"&&typeof performance.now=="function",gi=p(()=>Vn?performance.now():0,"now"),qa="🧜 ",bT="Mermaid render",kT="Mermaid",wT={parse:"tertiary",prepare:"secondary",measure:"primary",layout:"primary-dark",layoutCore:"error",draw:"primary-light",paint:"secondary-dark",serialize:"tertiary-dark",render:"primary-light"},Wi;Wi=class{constructor(){this.enabled=!1,this.autoPrint=!0,this.records=[],this.maxRecords=200,this.roots=[],this.stack=[],this.buckets={}}enable(){return this.enabled=!0,this}disable(){return this.enabled=!1,this}start(t){this.enabled&&(this.roots=[],this.stack=[],this.buckets={},this.begin(t))}tickSync(t,r){if(!this.enabled)return r();const i=gi();try{return r()}finally{this.buckets[t]=(this.buckets[t]??0)+(gi()-i)}}async tick(t,r){if(!this.enabled)return r();const i=gi();try{return await r()}finally{this.buckets[t]=(this.buckets[t]??0)+(gi()-i)}}stop(){if(!this.enabled)return;for(;this.stack.length>0;)this.end();const t=this.roots.at(-1),r=this.runLabel??t?.name;return t&&(this.records.push({label:r??t.name,tree:t,buckets:{...this.buckets}}),this.records.length>this.maxRecords&&this.records.splice(0,this.records.length-this.maxRecords),this.autoPrint&&this.printSummary(t,r)),this.runLabel=void 0,t}begin(t){if(!this.enabled)return;const r={name:t,start:gi(),duration:-1,children:[]},i=this.stack.at(-1);if(i?i.children.push(r):this.roots.push(r),this.stack.push(r),Vn&&typeof performance.mark=="function")try{performance.mark(`${qa}${t} ▶`)}catch{}}end(){if(!this.enabled)return;const t=this.stack.pop();if(!t)return;const r=gi();if(t.duration=r-t.start,Vn&&typeof performance.measure=="function")try{performance.measure(`${qa}${t.name}`,{start:t.start,end:r,detail:{devtools:{dataType:"track-entry",track:bT,trackGroup:kT,color:wT[t.name]??"primary",tooltipText:`${t.name} — ${t.duration.toFixed(1)} ms`}}})}catch{}}async span(t,r){if(!this.enabled)return r();this.begin(t);try{return await r()}finally{this.end()}}report(){return this.records.at(-1)?.tree??this.roots.at(-1)}clear(){this.records.length=0,this.roots=[],this.stack=[],this.runLabel=void 0}reset(){this.roots=[],this.stack=[]}printSummary(t=this.report(),r){if(!t)return;const i=t.duration,s=r&&r!==t.name?`${t.name} [${r}]`:t.name,o=["ms % phase"],a=p((l,c)=>{const h=" ".repeat(c),u=l.duration.toFixed(1).padStart(8),d=i>0?`${(l.duration/i*100).toFixed(0).padStart(3)}%`:" -";o.push(`${u} ${d} ${h}${l.name}`);for(const f of l.children)a(f,c+1);if(l.children.length>0){const f=l.children.reduce((y,x)=>y+x.duration,0),m=l.duration-f;if(m>.5){const y=m.toFixed(1).padStart(8);o.push(`${y} ${h} (self)`)}}},"walk");a(t,0);const n=Object.keys(this.buckets);if(n.length>0){o.push("—— buckets (summed) ——");for(const l of n)o.push(`${this.buckets[l].toFixed(1).padStart(8)} ${l}`)}console.log(`${qa}mermaid render profile · ${s}
|
||||
${o.join(`
|
||||
`)}`)}},p(Wi,"Profiler");globalThis.injected??={includeLargeFeatures:!0,profiling:!1,version:"0.0.0"};var TT=$w.extend({raf(e){typeof queueMicrotask=="function"?queueMicrotask(e):setTimeout(e,0)}}).extend(Iw),ei=TT;function Np(e,{markdownAutoWrap:t}){const i=e.replace(/<br\/>/g,`
|
||||
`).replace(/\n{2,}/g,`
|
||||
`);return Rp(i)}p(Np,"preprocessMarkdown");function qp(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}p(qp,"nonMarkdownToLines");function Wp(e,t={}){const r=Np(e,t),i=Wt.lexer(r),s=[[]];let o=0;function a(n,l="normal"){n.type==="text"?n.text.split(`
|
||||
`).forEach((h,u)=>{u!==0&&(o++,s.push([])),h.split(" ").forEach(d=>{d=d.replace(/'/g,"'"),d&&s[o].push({content:d,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{a(c,n.type)}):n.type==="html"&&s[o].push({content:n.text,type:"normal"})}return p(a,"processNode"),i.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(l=>{a(l)}):n.type==="html"?s[o].push({content:n.text,type:"normal"}):s[o].push({content:n.raw,type:"normal"})}),s}p(Wp,"markdownToLines");function zp(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}p(zp,"nonMarkdownToHTML");function Hp(e,{markdownAutoWrap:t}={}){const r=Wt.lexer(e);function i(s){return s.type==="text"?t===!1?s.text.replace(/\n */g,"<br/>").replace(/ /g," "):s.text.replace(/\n */g,"<br/>"):s.type==="strong"?`<strong>${s.tokens?.map(i).join("")}</strong>`:s.type==="em"?`<em>${s.tokens?.map(i).join("")}</em>`:s.type==="paragraph"?`<p>${s.tokens?.map(i).join("")}</p>`:s.type==="space"?"":s.type==="html"?`${s.text}`:s.type==="escape"?s.text:(P.warn(`Unsupported markdown: ${s.type}`),s.raw)}return p(i,"output"),r.map(i).join("")}p(Hp,"markdownToHTML");function Yp(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}p(Yp,"splitTextToChars");function Up(e,t){const r=Yp(t.content);return th(e,[],r,t.type)}p(Up,"splitWordToFitWidth");function th(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[s,...o]=r,a=[...t,s];return e([{content:a.join(""),type:i}])?th(e,a,o,i):(t.length===0&&s&&(t.push(s),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}p(th,"splitWordToFitWidthRecursion");function jp(e,t){if(e.some(({content:r})=>r.includes(`
|
||||
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Uo(e,t)}p(jp,"splitLineToFitWidth");function Uo(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let s="";e[0].content===" "&&(s=" ",e.shift());const o=e.shift()??{content:" ",type:"normal"},a=[...i];if(s!==""&&a.push({content:s,type:"normal"}),a.push(o),t(a))return Uo(e,t,r,a);if(i.length>0)r.push(i),e.unshift(o);else if(o.content){const[n,l]=Up(t,o);r.push([n]),l.content&&e.unshift(l)}return Uo(e,t,r)}p(Uo,"splitLineToFitWidthRecursion");function Zn(e,t){t&&e.attr("style",t)}p(Zn,"applyStyle");var lu=16384;async function Gp(e,t,r,i,s=!1,o=Ut()){const a=e.append("foreignObject");a.attr("width",`${Math.min(10*r,lu)}px`),a.attr("height",`${Math.min(10*r,lu)}px`);const n=a.append("xhtml:div"),l=Ls(t.label)?await cf(t.label.replace(Ws.lineBreakRegex,`
|
||||
`),o):$e(t.label,o),c=t.isNode?"nodeLabel":"edgeLabel",h=n.append("span");return h.html(l),Zn(h,t.labelStyle),h.attr("class",`${c} ${i}`),Zn(n,t.labelStyle),n.style("display","table-cell"),n.style("white-space","nowrap"),n.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(n.style("max-width",r+"px"),n.style("text-align","center")),n.attr("xmlns","http://www.w3.org/1999/xhtml"),s&&n.attr("class","labelBkg"),(await ei.measure(()=>n.node().getBoundingClientRect())).width===r&&(n.style("display","table"),n.style("white-space","break-spaces"),n.style("width",r+"px")),a.node()}p(Gp,"addHtmlSpan");function ha(e,t,r,i=!1){const s=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&s.attr("text-anchor","middle"),s}p(ha,"createTspan");function Xp(e,t,r){const i=e.append("text"),s=ha(i,1,t);ca(s,r);const o=s.node().getComputedTextLength();return i.remove(),o}p(Xp,"computeWidthOfText");function ST(e,t,r){const i=e.append("text"),s=ha(i,1,t);ca(s,[{content:r,type:"normal"}]);const o=s.node()?.getBoundingClientRect();return o&&i.remove(),o}p(ST,"computeDimensionOfText");function Vp(e,t,r,i=!1,s=!1){const a=t.append("g"),n=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1");s&&l.attr("text-anchor","middle");let c=0;for(const h of r){const u=p(f=>Xp(a,1.1,f)<=e,"checkWidth"),d=u(h)?[h]:jp(h,u);for(const f of d){const m=ha(l,c,1.1,s);ca(m,f),c++}}if(i){const h=l.node().getBBox(),u=2;return n.attr("x",h.x-u).attr("y",h.y-u).attr("width",h.width+2*u).attr("height",h.height+2*u),a.node()}else return l.node()}p(Vp,"createFormattedText");function Kn(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(r,i)=>{switch(i){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}p(Kn,"decodeHTMLEntities");function ca(e,t){e.text(""),t.forEach((r,i)=>{const s=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?s.text(Kn(r.content)):s.text(" "+Kn(r.content))})}p(ca,"updateTextContentAndStyles");async function Zp(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(s,o,a)=>(r.push((async()=>{const n=`${o}:${a}`;return await O2(n)?await Ys(n,void 0,{class:"label-icon"}):`<i class='${$e(s,t).replace(":"," ")}'></i>`})()),s));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}p(Zp,"replaceIconSubstring");var Ye=p(async(e,t="",{style:r="",isTitle:i=!1,classes:s="",useHtmlLabels:o=!0,markdown:a=!0,isNode:n=!0,width:l=200,addSvgBackground:c=!1}={},h)=>{if(P.debug("XYZ createText",t,r,i,s,o,n,"addSvgBackground: ",c),o){const u=a?Hp(t,h):zp(t),d=await Zp(Dr(u),h),f=t.replace(/\\\\/g,"\\"),m={isNode:n,label:Ls(t)?f:d,labelStyle:r.replace("fill:","color:")};return await Gp(e,m,l,s,c,h)}else{const u=Dr(t.replace(/<br\s*\/?>/g,"<br/>")),d=a?Wp(u.replace("<br>","<br/>"),h):qp(u),f=Vp(l,e,d,t?c:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Ft(f).attr("style",m)}else{const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");Ft(f).select("rect").attr("style",m.replace(/background:/g,"fill:"));const y=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Ft(f).select("text").attr("style",y)}return i?Ft(f).selectAll("tspan.text-outer-tspan").classed("title-row",!0):Ft(f).selectAll("tspan.text-outer-tspan").classed("row",!0),f}},"createText");function Wa(e,t,r){if(e&&e.length){const[i,s]=t,o=Math.PI/180*r,a=Math.cos(o),n=Math.sin(o);for(const l of e){const[c,h]=l;l[0]=(c-i)*a-(h-s)*n+i,l[1]=(c-i)*n+(h-s)*a+s}}}function _T(e,t){return e[0]===t[0]&&e[1]===t[1]}function vT(e,t,r,i=1){const s=r,o=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(s)for(const c of a)Wa(c,n,s);const l=(function(c,h,u){const d=[];for(const k of c){const T=[...k];_T(T[0],T[T.length-1])||T.push([T[0][0],T[0][1]]),T.length>2&&d.push(T)}const f=[];h=Math.max(h,.1);const m=[];for(const k of d)for(let T=0;T<k.length-1;T++){const S=k[T],_=k[T+1];if(S[1]!==_[1]){const L=Math.min(S[1],_[1]);m.push({ymin:L,ymax:Math.max(S[1],_[1]),x:L===S[1]?S[0]:_[0],islope:(_[0]-S[0])/(_[1]-S[1])})}}if(m.sort(((k,T)=>k.ymin<T.ymin?-1:k.ymin>T.ymin?1:k.x<T.x?-1:k.x>T.x?1:k.ymax===T.ymax?0:(k.ymax-T.ymax)/Math.abs(k.ymax-T.ymax))),!m.length)return f;let y=[],x=m[0].ymin,C=0;for(;y.length||m.length;){if(m.length){let k=-1;for(let T=0;T<m.length&&!(m[T].ymin>x);T++)k=T;m.splice(0,k+1).forEach((T=>{y.push({s:x,edge:T})}))}if(y=y.filter((k=>!(k.edge.ymax<=x))),y.sort(((k,T)=>k.edge.x===T.edge.x?0:(k.edge.x-T.edge.x)/Math.abs(k.edge.x-T.edge.x))),(u!==1||C%h==0)&&y.length>1)for(let k=0;k<y.lengthLine truncated
|
||||
M ${s.x},${s.y} L ${a.x},${a.y}`}p(bg,"createLine");function kg(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r,t.label="";const s=e.insert("g").attr("class",yt(t)).attr("id",t.domId??t.id),o=Math.max(30,t?.width??0),{cssStyles:a}=t,n=lt.svg(s),l=nt(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,o*2,l),h=bg(o),u=n.path(h,l),d=s.insert(()=>c,":first-child");return d.insert(()=>u),d.attr("class","outer-path"),a&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",i),ut(t,d),t.intersect=function(f){return P.info("crossedCircle intersect",t,{radius:o,point:f}),ot.circle(t,o,f)},s}p(kg,"crossedCircle");function pr(e,t,r,i=100,s=0,o=180){const a=[],n=s*Math.PI/180,h=(o*Math.PI/180-n)/(i-1);for(let u=0;u<i;u++){const d=n+u*h,f=e+r*Math.cos(d),m=t+r*Math.sin(d);a.push({x:-f,y:-m})}return a}p(pr,"generateCirclePoints");async function wg(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:a}=await mt(e,t,yt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=o.width+n,h=o.height+l,u=Math.max(5,h*.1),{cssStyles:d}=t,f=[...pr(c/2,-h/2,u,30,-90,0),{x:-c/2-u,y:u},...pr(c/2+u*2,-u,u,20,-180,-270),...pr(c/2+u*2,u,u,20,-90,-180),{x:-c/2-u,y:-h/2},...pr(c/2,h/2,u,20,0,90)],m=[{x:c/2,y:-h/2-u},{x:-c/2,y:-h/2-u},...pr(c/2,-h/2,u,20,-90,0),{x:-c/2-u,y:-u},...pr(c/2+c*.1,-u,u,20,-180,-270),...pr(c/2+c*.1,u,u,20,-90,-180),{x:-c/2-u,y:h/2},...pr(c/2,h/2,u,20,0,90),{x:-c/2,y:h/2+u},{x:c/2,y:h/2+u}],y=lt.svg(s),x=nt(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const k=Rt(f).replace("Z",""),T=y.path(k,x),S=Rt(m),_=y.path(S,{...x}),L=s.insert("g",":first-child");return L.insert(()=>_,":first-child").attr("stroke-opacity",0),L.insert(()=>T,":first-child"),L.attr("class","text"),d&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",i),L.attr("transform",`translate(${u}, 0)`),a.attr("transform",`translate(${-c/2+u-(o.x-(o.left??0))},${-h/2+(t.padding??0)/2-(o.y-(o.top??0))})`),ut(t,L),t.intersect=function(A){return ot.polygon(t,m,A)},s}p(wg,"curlyBraceLeft");function gr(e,t,r,i=100,s=0,o=180){const a=[],n=s*Math.PI/180,h=(o*Math.PI/180-n)/(i-1);for(let u=0;u<i;u++){const d=n+u*h,f=e+r*Math.cos(d),m=t+r*Math.sin(d);a.push({x:f,y:m})}return a}p(gr,"generateCirclePoints");async function Tg(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:a}=await mt(e,t,yt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=o.width+(t.look==="neo"?n*2:n),h=o.height+(t.look==="neo"?l*2:l),u=Math.max(5,h*.1),{cssStyles:d}=t,f=[...gr(c/2,-h/2,u,20,-90,0),{x:c/2+u,y:-u},...gr(c/2+u*2,-u,u,20,-180,-270),...gr(c/2+u*2,u,u,20,-90,-180),{x:c/2+u,y:h/2},...gr(c/2,h/2,u,20,0,90)],m=[{x:-c/2,y:-h/2-u},{x:c/2,y:-h/2-u},...gr(c/2,-h/2,u,20,-90,0),{x:c/2+u,y:-u},...gr(c/2+u*2,-u,u,20,-180,-270),...gr(c/2+u*2,u,u,20,-90,-180),{x:c/2+u,y:h/2},...gr(c/2,h/2,u,20,0,90),{x:c/2,y:h/2+u},{x:-c/2,y:h/2+u}],y=lt.svg(s),x=nt(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const k=Rt(f).replace("Z",""),T=y.path(k,x),S=Rt(m),_=y.path(S,{...x}),L=s.insert("g",":first-child");return L.insert(()=>_,":first-child").attr("stroke-opacity",0),L.insert(()=>T,":first-child"),L.attr("class","text"),d&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",i),L.attr("transform",`translate(${-u}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(o.x-(o.left??0))},${-h/2+(t.padding??0)/2-(o.y-(o.top??0))})`),ut(t,L),t.intersect=function(A){return ot.polygon(t,m,A)},s}p(Tg,"curlyBraceRight");function ae(e,t,r,i=100,s=0,o=180){const a=[],n=s*Math.PI/180,h=(o*Math.PI/180-n)/(i-1);for(let u=0;u<i;u++){const d=n+u*h,f=e+r*Math.cos(d),m=t+r*Math.sin(d);a.push({x:-f,y:-m})}return a}p(ae,"generateCirclePoints");async function Sg(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:a}=await mt(e,t,yt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=o.width+(t.look==="neo"?n*2:n),h=o.height+(t.look==="neo"?l*2:l),u=Math.max(5,h*.1),{cssStyles:d}=t,f=[...ae(c/2,-h/2,u,30,-90,0),{x:-c/2-u,y:u},...ae(c/2+u*2,-u,u,20,-180,-270),...ae(c/2+u*2,u,u,20,-90,-180),{x:-c/2-u,y:-h/2},...ae(c/2,h/2,u,20,0,90)],m=[...ae(-c/2+u+u/2,-h/2,u,20,-90,-180),{x:c/2-u/2,y:u},...ae(-c/2-u/2,-u,u,20,0,90),...ae(-c/2-u/2,u,u,20,-90,0),{x:c/2-u/2,y:-u},...ae(-c/2+u+u/2,h/2,u,30,-180,-270)],y=[{x:c/2,y:-h/2-u},{x:-c/2,y:-h/2-u},...ae(c/2,-h/2,u,20,-90,0),{x:-c/2-u,y:-u},...ae(c/2+u*2,-u,u,20,-180,-270),...ae(c/2+u*2,u,u,20,-90,-180),{x:-c/2-u,y:h/2},...ae(c/2,h/2,u,20,0,90),{x:-c/2,y:h/2+u},{x:c/2-u-u/2,y:h/2+u},...ae(-c/2+u+u/2,-h/2,u,20,-90,-180),{x:c/2-u/2,y:u},...ae(-c/2-u/2,-u,u,20,0,90),...ae(-c/2-u/2,u,u,20,-90,0),{x:c/2-u/2,y:-u
Line truncated
|
||||
a${s},${o} 0,0,1 0,${-i}
|
||||
l${r},0
|
||||
a${s},${o} 0,0,1 0,${i}
|
||||
M${r},${-i}
|
||||
a${s},${o} 0,0,0 0,${i}
|
||||
l${-r},0`,"createCylinderPathD"),uS=p((e,t,r,i,s,o)=>[`M${e},${t}`,`M${e+r},${t}`,`a${s},${o} 0,0,0 0,${-i}`,`l${-r},0`,`a${s},${o} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),dS=p((e,t,r,i,s,o)=>[`M${e+r/2},${-i/2}`,`a${s},${o} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),Bu=5,Lu=10;async function pm(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?12:s/2,a=t.height??0;if(t.height&&(t.height=t.height-o,t.height<Bu&&(t.height=Bu)),t.width){const C=a/2/(2.5+a/50);t.width=t.width-o-C*3,t.width<Lu&&(t.width=Lu)}const{shapeSvg:n,bbox:l,label:c}=await mt(e,t,yt(t)),h=Math.max(t.height??0,l.height)+o,u=h/2,d=u/(2.5+h/50),f=Math.max(t.width??0,l.width)+d+o,{cssStyles:m}=t;let y;if(t.look==="handDrawn"){const x=lt.svg(n),C=uS(0,0,f,h,d,u),k=dS(0,0,f,h,d,u),T=x.path(C,nt(t,{})),S=x.path(k,nt(t,{fill:"none"}));y=n.insert(()=>S,":first-child"),y=n.insert(()=>T,":first-child"),y.attr("class","basic label-container"),m&&y.attr("style",m)}else{const x=cS(0,0,f,h,d,u);y=n.insert("path",":first-child").attr("d",x).attr("class","basic label-container").attr("style",Qt(m)).attr("style",i),y.attr("class","basic label-container outer-path"),m&&y.selectAll("path").attr("style",m),i&&y.selectAll("path").attr("style",i)}return y.attr("label-offset-x",d),y.attr("transform",`translate(${-f/2}, ${h/2} )`),c.attr("transform",`translate(${-(l.width/2)-d-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),ut(t,y),t.intersect=function(x){const C=ot.rect(t,x),k=C.y-(t.y??0);if(u!=0&&(Math.abs(k)<(t.height??0)/2||Math.abs(k)==(t.height??0)/2&&Math.abs(C.x-(t.x??0))>(t.width??0)/2-d)){let T=d*d*(1-k*k/(u*u));T!=0&&(T=Math.sqrt(Math.abs(T))),T=d-T,x.x-(t.x??0)>0&&(T=-T),C.x+=T}return C},n}p(pm,"tiltedCylinder");async function gm(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r;const s=t.padding??0,o=(t.look==="neo",s),a=t.look==="neo"?s*2:s,{shapeSvg:n,bbox:l}=await mt(e,t,yt(t)),c=Math.max(l.height+o,t.height??0),h=Math.max(l.width+a,(t.width??0)-c),u=[{x:-3*c/6,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:0,y:-c}];let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const m=lt.svg(n),y=nt(t,{}),x=Rt(u),C=m.path(x,y);d=n.insert(()=>C,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&d.attr("style",f)}else d=or(n,h,c,u);return i&&d.attr("style",i),t.width=h,t.height=c,ut(t,d),t.intersect=function(m){return ot.polygon(t,u,m)},n}p(gm,"trapezoid");async function mm(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s,n=15,l=5;(t.width||t.height)&&(t.height=(t.height??0)-a*2,t.height<l&&(t.height=l),t.width=(t.width??0)-o*2,t.width<n&&(t.width=n));const{shapeSvg:c,bbox:h}=await mt(e,t,yt(t)),u=(t?.width?t?.width:h.width)+o*2,d=(t?.height?t?.height:h.height)+a*2,{cssStyles:f}=t,m=lt.svg(c),y=nt(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-u/2*.8,y:-d/2},{x:u/2*.8,y:-d/2},{x:u/2,y:-d/2*.6},{x:u/2,y:d/2},{x:-u/2,y:d/2},{x:-u/2,y:-d/2*.6}],C=Rt(x),k=m.path(C,y),T=c.insert(()=>k,":first-child");return T.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),ut(t,T),t.intersect=function(S){return ot.polygon(t,x,S)},c}p(mm,"trapezoidalPentagon");var Fu=10,Au=10;async function ym(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?s*2:s;(t.width||t.height)&&(t.width=((t?.width??0)-o)/2,t.width<Au&&(t.width=Au),t.height=t?.height??0,t.height<Fu&&(t.height=Fu));const{shapeSvg:a,bbox:n,label:l}=await mt(e,t,yt(t)),c=ir($t().flowchart?.htmlLabels),h=(t?.width?t?.width:n.width)+o,u=t?.height?t?.height:h+n.height,d=u,f=[{x:0,y:0},{x:d,y:0},{x:d/2,y:-u}],{cssStyles:m}=t,y=lt.svg(a),x=nt(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=Rt(f),k=y.path(C,x),T=a.insert(()=>k,":first-child").attr("transform",`translate(${-u/2}, ${u/2})`).attr("class","outer-path");return m&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",m),i&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),t.width=h,t.height=u,ut(t,T),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${u/2-(n.height+(t.padding??0)/(c?2:1)-(n.y-(n.top??0)))})`),t.intersect=function(S){return P.info("Triangle intersect",t,f,S),ot.polygon(t,f,S)},a}p(ym,"triangle");async function xm(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s;let n=!0;(t.width||t.height)&&(n=!1,t.width=(t?.width??0)-o*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10));const{shapeSvg:l,bbox:c,label:h}=await mt(e,t,yt(t)),u=(t?.width?t?.width:c.width)+(o??0)*2,d=(t?.height?t?.height:c.height)+(a??0)*2,f=t.look==="neo"?d/4:d/8,m=d+(n?f:-f),{cssStyles:y}=t,C=14-u,k=C>0?C/2:0,T=lt.svg(l),S=nt(t,{});t.look!=="ha
Line truncated
|
||||
M${f-jt},${m} L${f+u},${m}
|
||||
M${f},${m-jt} L${f},${m+d}`;t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const S=x.path(T,C),_=a.insert(()=>S,":first-child");return _.attr("transform",`translate(${jt/2}, ${jt/2})`),_.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),l.attr("transform",`translate(${-(n.width/2)+jt/2-(n.x-(n.left??0))}, ${-(n.height/2)+jt/2-(n.y-(n.top??0))})`),ut(t,_),t.intersect=function(L){return ot.polygon(t,k,L)},a}p(bm,"windowPane");var Eu=new Set(["redux-color","redux-dark-color"]),fS=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function nh(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:s}=Ut(),{rowEven:o,rowOdd:a,nodeBorder:n,borderColorArray:l}=s;if(t.look==="handDrawn"){const{themeVariables:st}=Ut(),{background:kt}=st,xt={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${kt}`]};await nh(e,xt)}const c=Ut();t.useHtmlLabels=c.htmlLabels;let h=c.er?.diagramPadding??10,u=c.er?.entityPadding??6;const{cssStyles:d}=t,{labelStyles:f,nodeStyles:m}=dt(t);if(r.attributes.length===0&&t.label){const st={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};br(t.label,c)+st.labelPaddingX*2<c.er.minEntityWidth&&(t.width=c.er.minEntityWidth);const kt=await Zi(e,t,st);if(i!=null&&Eu.has(i)){const xt=r.colorIndex??0;kt.attr("data-color-id",`color-${xt%l.length}`)}if(!ir(c.htmlLabels)){const xt=kt.select("text"),wt=xt.node()?.getBBox();xt.attr("transform",`translate(${-wt.width/2}, 0)`)}return kt}c.htmlLabels||(h*=1.25,u*=1.25);let y=yt(t);y||(y="node default");const x=e.insert("g").attr("class",y).attr("id",t.domId||t.id),C=await Ci(x,t.label??"",c,0,0,["name"],f);C.height+=u;let k=0;const T=[],S=[];let _=0,L=0,A=0,F=0,V=!0,Y=!0;for(const st of r.attributes){const kt=await Ci(x,st.type,c,0,k,["attribute-type"],f);_=Math.max(_,kt.width+h);const xt=await Ci(x,st.name,c,0,k,["attribute-name"],f);L=Math.max(L,xt.width+h);const wt=await Ci(x,st.keys.join(),c,0,k,["attribute-keys"],f);A=Math.max(A,wt.width+h);const It=await Ci(x,st.comment,c,0,k,["attribute-comment"],f);F=Math.max(F,It.width+h);const Mt=Math.max(kt.height,xt.height,wt.height,It.height)+u;S.push({yOffset:k,rowHeight:Mt}),k+=Mt}let R=4;A<=h&&(V=!1,A=0,R--),F<=h&&(Y=!1,F=0,R--);const it=x.node().getBBox();if(C.width+h*2-(_+L+A+F)>0){const st=C.width+h*2-(_+L+A+F);_+=st/R,L+=st/R,A>0&&(A+=st/R),F>0&&(F+=st/R)}const U=_+L+A+F,E=lt.svg(x),O=nt(t,{});t.look!=="handDrawn"&&(O.roughness=0,O.fillStyle="solid");let B=0;S.length>0&&(B=S.reduce((st,kt)=>st+(kt?.rowHeight??0),0));const N=Math.max(it.width+h*2,t?.width||0,U),D=Math.max((B??0)+C.height,t?.height||0),rt=-N/2,tt=-D/2;if(x.selectAll("g:not(:first-child)").each((st,kt,xt)=>{const wt=Ft(xt[kt]),It=wt.attr("transform");let Mt=0,ee=0;if(It){const Be=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(It);Be&&(Mt=parseFloat(Be[1]),ee=parseFloat(Be[2]),wt.attr("class").includes("attribute-name")?Mt+=_:wt.attr("class").includes("attribute-keys")?Mt+=_+L:wt.attr("class").includes("attribute-comment")&&(Mt+=_+L+A))}wt.attr("transform",`translate(${rt+h/2+Mt}, ${ee+tt+C.height+u/2})`)}),x.select(".name").attr("transform","translate("+-C.width/2+", "+(tt+u/2)+")"),i!=null&&Eu.has(i)){const st=r.colorIndex??0;x.attr("data-color-id",`color-${st%l.length}`)}const pt=E.rectangle(rt,tt,N,D,O),St=x.insert(()=>pt,":first-child").attr("class","outer-path").attr("style",d.join(""));T.push(0);for(const[st,kt]of S.entries()){const wt=(st+1)%2===0&&kt.yOffset!==0,It=E.rectangle(rt,C.height+tt+kt?.yOffset,N,kt?.rowHeight,{...O,fill:wt?o:a,stroke:n});x.insert(()=>It,"g.label").attr("style",d.join("")).attr("class",`row-rect-${wt?"even":"odd"}`)}const Tt=1e-4;let ft=bi(rt,C.height+tt,N+rt,C.height+tt,Tt),Bt=E.polygon(ft.map(st=>[st.x,st.y]),O);if(x.insert(()=>Bt).attr("class","divider"),ft=bi(_+rt,C.height+tt,_+rt,D+tt,Tt),Bt=E.polygon(ft.map(st=>[st.x,st.y]),O),x.insert(()=>Bt).attr("class","divider"),V){const st=_+L+rt;ft=bi(st,C.height+tt,st,D+tt,Tt),Bt=E.polygon(ft.map(kt=>[kt.x,kt.y]),O),x.insert(()=>Bt).attr("class","divider")}if(Y){const st=_+L+A+rt;ft=bi(st,C.height+tt,st,D+tt,Tt),Bt=E.polygon(ft.map(kt=>[kt.x,kt.y]),O),x.insert(()=>Bt).attr("class","divider")}for(const st of T){const kt=C.height+tt+st;ft=bi(rt,kt,N+rt,kt,Tt),Bt=E.polygon(ft.map(xt=>[xt.x,xt.y]),O),x.insert(()=>Bt).attr("class","divider")}if(ut(t,St),m&&t.look!=="handDrawn")if(i!=null&&fS.has(i))x.selectAll("path").attr("style",m);else{const kt=m.split(";")?.filter(xt=>xt.includes("stroke"))?.map(xt=>`${xt}`).join("; ");x.selectAll("path").attr("style",kt??""),x.selectAll(".row-rect-even path").attr("style",m)}return t.intersect=function(st){return ot.rect(t,st)},x}p(nh,"erBox");async function Ci(e,t,r,i=0,s=0,o=[],a=""){const n=e.insert("g").attr("class",`label ${o.join(" ")}`).attr("transform",`translate(${i}, ${s})`).attr("styl
Line truncated
|
||||
a${h},${h} 1 0,0 ${m*.25},${-1*y*.1}
|
||||
a${h},${h} 1 0,0 ${m*.25},0
|
||||
a${h},${h} 1 0,0 ${m*.25},0
|
||||
a${h},${h} 1 0,0 ${m*.25},${y*.1}
|
||||
|
||||
a${h},${h} 1 0,0 ${m*.15},${y*.33}
|
||||
a${h*.8},${h*.8} 1 0,0 0,${y*.34}
|
||||
a${h},${h} 1 0,0 ${-1*m*.15},${y*.33}
|
||||
|
||||
a${h},${h} 1 0,0 ${-1*m*.25},${y*.15}
|
||||
a${h},${h} 1 0,0 ${-1*m*.25},0
|
||||
a${h},${h} 1 0,0 ${-1*m*.25},0
|
||||
a${h},${h} 1 0,0 ${-1*m*.25},${-1*y*.15}
|
||||
|
||||
a${h},${h} 1 0,0 ${-1*m*.1},${-1*y*.33}
|
||||
a${h*.8},${h*.8} 1 0,0 0,${-1*y*.34}
|
||||
a${h},${h} 1 0,0 ${m*.1},${-1*y*.33}
|
||||
H0 V0 Z`;if(t.look==="handDrawn"){const k=lt.svg(s),T=nt(t,{}),S=k.path(C,T);x=s.insert(()=>S,":first-child"),x.attr("class","basic label-container").attr("style",Qt(u))}else x=s.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",C);return x.attr("transform",`translate(${-m/2}, ${-y/2})`),ut(t,x),t.calcIntersect=function(k,T){return ot.rect(k,T)},t.intersect=function(k){return P.info("Bang intersect",t,k),ot.rect(t,k)},s}p(_m,"bang");async function vm(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,halfPadding:a,label:n}=await mt(e,t,yt(t)),l=o.width+2*a,c=o.height+2*a,h=.15*l,u=.25*l,d=.35*l,f=.2*l,{cssStyles:m}=t;let y;const x=`M0 0
|
||||
a${h},${h} 0 0,1 ${l*.25},${-1*l*.1}
|
||||
a${d},${d} 1 0,1 ${l*.4},${-1*l*.1}
|
||||
a${u},${u} 1 0,1 ${l*.35},${l*.2}
|
||||
|
||||
a${h},${h} 1 0,1 ${l*.15},${c*.35}
|
||||
a${f},${f} 1 0,1 ${-1*l*.15},${c*.65}
|
||||
|
||||
a${u},${h} 1 0,1 ${-1*l*.25},${l*.15}
|
||||
a${d},${d} 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*c*.35}
|
||||
a${f},${f} 1 0,1 ${l*.1},${-1*c*.65}
|
||||
H0 V0 Z`;if(t.look==="handDrawn"){const C=lt.svg(s),k=nt(t,{}),T=C.path(x,k);y=s.insert(()=>T,":first-child"),y.attr("class","basic label-container").attr("style",Qt(m))}else y=s.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",x);return n.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`),y.attr("transform",`translate(${-l/2}, ${-c/2})`),ut(t,y),t.calcIntersect=function(C,k){return ot.rect(C,k)},t.intersect=function(C){return P.info("Cloud intersect",t,C),ot.rect(t,C)},s}p(vm,"cloud");async function Bm(e,t){const{labelStyles:r,nodeStyles:i}=dt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,halfPadding:a,label:n}=await mt(e,t,yt(t)),l=o.width+8*a,c=o.height+2*a,h=5,u=t.look==="neo"?`
|
||||
M${-l/2} ${c/2-h}
|
||||
v${-c+2*h}
|
||||
q0,-${h} ${h},-${h}
|
||||
h${l-2*h}
|
||||
q${h},0 ${h},${h}
|
||||
v${c-h}
|
||||
H${-l/2}
|
||||
Z
|
||||
`:`
|
||||
M${-l/2} ${c/2-h}
|
||||
v${-c+2*h}
|
||||
q0,-${h} ${h},-${h}
|
||||
h${l-2*h}
|
||||
q${h},0 ${h},${h}
|
||||
v${c-2*h}
|
||||
q0,${h} ${-h},${h}
|
||||
h${-(l-2*h)}
|
||||
q${-h},0 ${-h},${-h}
|
||||
Z
|
||||
`;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const d=s.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",u);return s.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`),s.append(()=>n.node()),ut(t,d),t.calcIntersect=function(f,m){return ot.rect(f,m)},t.intersect=function(f){return ot.rect(t,f)},s}p(Bm,"defaultMindmapNode");async function Lm(e,t){const r={padding:t.padding??0};return ah(e,t,r)}p(Lm,"mindmapCircle");var gS=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:om},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:rm},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:am},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:cm},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Bg},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Lg},{semanticName:"Folder",name:"Folder",shortName:"folder",description:"Folder or directory",aliases:["directory"],handler:$g},{semanticName:"Bucket",name:"Bucket",shortName:"bucket",description:"Object storage bucket",handler:dg},{semanticName:"Console",name:"Console (terminal window)",shortName:"console",description:"Terminal or console window",handler:Cg},{semanticName:"Browser",name:"Browser",shortName:"browser",description:"Browser window",handler:gg},{semanticName:"Person",name:"Person",shortName:"person",description:"Person (circular head above a rounded body)",handler:vg},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:ah},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:_m},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:vm},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Jg},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Ig},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:jg},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Ug},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:gm},{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:Hg},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Ag},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:fm},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:mg},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:im},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:hm},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:lm},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Og},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Pg},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:wg},{semanticName:"Comment Right",nam
Line truncated
|
||||
outsidePoint: ${JSON.stringify(t)}
|
||||
insidePoint : ${JSON.stringify(r)}
|
||||
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,s=e.y,o=Math.abs(i-r.x),a=e.width/2;let n=r.x<t.x?a-o:a+o;const l=e.height/2,c=Math.abs(t.y-r.y),h=Math.abs(t.x-r.x);if(Math.abs(s-t.y)*a>Math.abs(i-t.x)*l){let u=r.y<t.y?t.y-l-s:s-l-t.y;n=h*u/c;const d={x:r.x<t.x?r.x+n:r.x-h+n,y:r.y<t.y?r.y+c-u:r.y-c+u};return n===0&&(d.x=t.x,d.y=t.y),h===0&&(d.x=t.x),c===0&&(d.y=t.y),P.debug(`abc89 top/bottom calc, Q ${c}, q ${u}, R ${h}, r ${n}`,d),d}else{r.x<t.x?n=t.x-a-i:n=i-a-t.x;let u=c*n/h,d=r.x<t.x?r.x+h-n:r.x-h+n,f=r.y<t.y?r.y+u:r.y-u;return P.debug(`sides calc abc89, Q ${c}, q ${u}, R ${h}, r ${n}`,{_x:d,_y:f}),n===0&&(d=t.x,f=t.y),h===0&&(d=t.x),c===0&&(f=t.y),{x:d,y:f}}},"intersection"),Du=p((e,t)=>{P.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],s=!1;return e.forEach(o=>{if(P.info("abc88 checking point",o,t),!DS(t,o)&&!s){const a=IS(t,i,o);P.debug("abc88 inside",o,i,a),P.debug("abc88 intersection",a,t);let n=!1;r.forEach(l=>{n=n||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)?P.warn("abc88 no intersect",a,r):r.push(a),s=!0}else P.warn("abc88 outside",o,i),i=o,s||r.push(o)}),P.debug("returning points",r),r},"cutPathAtIntersect");function Om(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const s=e[i-1],o=e[i],a=e[i+1];(s.x===o.x&&o.y===a.y&&Math.abs(o.x-a.x)>5&&Math.abs(o.y-s.y)>5||s.y===o.y&&o.x===a.x&&Math.abs(o.x-s.x)>5&&Math.abs(o.y-a.y)>5)&&(t.push(o),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}p(Om,"extractCornerPoints");var Iu=p(function(e,t,r){const i=t.x-e.x,s=t.y-e.y,o=Math.sqrt(i*i+s*s),a=r/o;return{x:t.x-a*i,y:t.y-a*s}},"findAdjacentPoint"),PS=p(function(e){const{cornerPointPositions:t}=Om(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const s=e[i-1],o=e[i+1],a=e[i],n=Iu(s,a,5),l=Iu(o,a,5),c=l.x-n.x,h=l.y-n.y;r.push(n);const u=Math.sqrt(2)*2;let d={x:a.x,y:a.y};if(Math.abs(o.x-s.x)>10&&Math.abs(o.y-s.y)>=10){P.debug("Corner point fixing",Math.abs(o.x-s.x),Math.abs(o.y-s.y));const f=5;a.x===n.x?d={x:c<0?n.x-f+u:n.x+f-u,y:h<0?n.y-u:n.y+u}:d={x:c<0?n.x-u:n.x+u,y:h<0?n.y-f+u:n.y+f-u}}else P.debug("Corner point skipping fixing",Math.abs(o.x-s.x),Math.abs(o.y-s.y));r.push(d,l)}else r.push(e[i]);return r},"fixCorners"),RS=p((e,t,r)=>{const i=e-t-r,s=2,o=2,a=s+o,n=Math.floor(i/a),l=Number.isFinite(n)?Math.max(0,n):0,c=Array(l).fill(`${s} ${o}`).join(" ");return`0 ${t} ${c} ${r}`},"generateDashArray"),Dm=p(function(e,t,r,i,s,o,a,n=!1){if(!a)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:c}=$t();let h=t.points,u=!1;const d=s;var f=o;const m=[];for(const D in t.cssCompiledStyles)lp(D)||m.push(t.cssCompiledStyles[D]);if(c==="swimlane"){if(f.intersect&&d.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[d.intersect(h[0]),f.intersect(h[1])];else{const D=h.slice(1,-1),rt=D[0],tt=D[D.length-1],pt=.5,St=Math.abs(h[h.length-1].x-tt.x)<pt&&Math.abs(h[h.length-1].y-tt.y)<pt,Tt=d.intersect(rt),ft=St?tt:f.intersect(tt),Bt=Math.abs(ft.x-tt.x)<pt&&Math.abs(ft.y-tt.y)<pt,kt=Math.abs(Tt.x-rt.x)<pt&&Math.abs(Tt.y-rt.y)<pt?[]:[Tt],xt=Bt?[]:[ft];h=[...kt,...D,...xt]}h=OS(t,h)}else f.intersect&&d.intersect&&!n&&(h=h.slice(1,t.points.length-1),h.unshift(d.intersect(h[0])),h.push(f.intersect(h[h.length-1])));const y=btoa(JSON.stringify(h));t.toCluster&&(P.info("to cluster abc88",r.get(t.toCluster)),h=Du(t.points,r.get(t.toCluster).node),u=!0),t.fromCluster&&(P.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(h,null,2)),h=Du(h.reverse(),r.get(t.fromCluster).node).reverse(),u=!0);let x=h.filter(D=>!Number.isNaN(D.y));const C=ES(t.curve);C!=="rounded"&&(x=PS(x));let k=Ss;switch(C){case"linear":k=Ss;break;case"basis":k=zn;break;case"cardinal":k=Gf;break;case"bumpX":k=zf;break;case"bumpY":k=Hf;break;case"catmullRom":k=Vf;break;case"monotoneX":k=ep;break;case"monotoneY":k=rp;break;case"natural":k=sp;break;case"step":k=op;break;case"stepAfter":k=np;break;case"stepBefore":k=ap;break;case"rounded":k=Ss;break;default:k=zn}const{x:T,y:S}=BS(t),_=Jk().x(T).y(S).curve(k);let L;switch(t.thickness){case"normal":L="edge-thickness-normal";break;case"thick":L="edge-thickness-thick";break;case"invisible":L="edge-thickness-invisible";break;default:L="edge-thickness-normal"}switch(t.pattern){case"solid":L+=" edge-pattern-solid";break;case"dotted":L+=" edge-pattern-dotted";break;case"dashed":L+=" edge-pattern-dashed";break;default:L+=" edge-pattern-solid"}let A,F=C==="rounded"?Im(Pm(x,t),5):_(x);const V=Array.isArray(t.style)?t.style:[t.style];let Y=V.find(D=>D?.startsWith("stroke:")),R="";t.animate&&(R="edge-animation-fast"),t.animation&&(R="edge-animation-"+t.animation);let it=!1;if(t.look==="handDrawn"){const D=lt.svg(e);Object.assign([],x);const rt=D.path(F,{roughness:.3,seed:l});L+=" transition",A=Ft(rt).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+L+(t.classes?" "+t.classes:"")+(R?" "+R:"")).attr("style",V?V.reduce((pt,St)=>pt+";"+St,""):"");let tt=A
Line truncated
|
||||
L20,10
|
||||
M20,10
|
||||
L0,20`)},"requirement_arrow"),o_=p((e,t,r)=>{const i=Ut(),{themeVariables:s}=i,{strokeWidth:o}=s;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${o}`).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"),a_=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),n_=p((e,t,r)=>{const i=Ut(),{themeVariables:s}=i,{strokeWidth:o}=s,a=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${o}`)},"requirement_contains_neo"),l_={extension:qS,composition:WS,aggregation:zS,dependency:HS,lollipop:YS,point:US,circle:jS,cross:GS,barb:XS,barbNeo:VS,only_one:ZS,zero_or_one:KS,one_or_more:QS,zero_or_more:JS,only_one_neo:t_,zero_or_one_neo:e_,one_or_more_neo:r_,zero_or_more_neo:i_,requirement_arrow:s_,requirement_contains:a_,requirement_arrow_neo:o_,requirement_contains_neo:n_},Rm=NS,Nm=typeof global=="object"&&global&&global.Object===Object&&global,h_=typeof self=="object"&&self&&self.Object===Object&&self,wr=Nm||h_||Function("return this")(),tr=wr.Symbol,qm=Object.prototype,c_=qm.hasOwnProperty,u_=qm.toString,hs=tr?tr.toStringTag:void 0;function d_(e){var t=c_.call(e,hs),r=e[hs];try{e[hs]=void 0;var i=!0}catch{}var s=u_.call(e);return i&&(t?e[hs]=r:delete e[hs]),s}var f_=Object.prototype,p_=f_.toString;function g_(e){return p_.call(e)}var m_="[object Null]",y_="[object Undefined]",Pu=tr?tr.toStringTag:void 0;function Ki(e){return e==null?e===void 0?y_:m_:Pu&&Pu in Object(e)?d_(e):g_(e)}function ri(e){return e!=null&&typeof e=="object"}var x_="[object Symbol]";function ch(e){return typeof e=="symbol"||ri(e)&&Ki(e)==x_}function Wm(e,t){for(var r=-1,i=e==null?0:e.length,s=Array(i);++r<i;)s[r]=t(e[r],r,e);return s}var ve=Array.isArray,Ru=tr?tr.prototype:void 0,Nu=Ru?Ru.toString:void 0;function zm(e){if(typeof e=="string")return e;if(ve(e))return Wm(e,zm)+"";if(ch(e))return Nu?Nu.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function uh(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function pa(e){return e}var C_="[object AsyncFunction]",b_="[object Function]",k_="[object GeneratorFunction]",w_="[object Proxy]";function Zo(e){if(!uh(e))return!1;var t=Ki(e);return t==b_||t==k_||t==C_||t==w_}var Va=wr["__core-js_shared__"],qu=(function(){var e=/[^.]+$/.exec(Va&&Va.keys&&Va.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function T_(e){return!!qu&&qu in e}var S_=Function.prototype,__=S_.toString;function ni(e){if(e!=null){try{return __.call(e)}catch{}try{return e+""}catch{}}return""}var v_=/[\\^$.*+?()[\]{}|]/g,B_=/^\[object .+?Constructor\]$/,L_=Function.prototype,F_=Object.prototype,A_=L_.toString,E_=F_.hasOwnProperty,M_=RegExp("^"+A_.call(E_).replace(v_,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $_(e){if(!uh(e)||T_(e))return!1;var t=Zo(e)?M_:B_;return t.test(ni(e))}function O_(e,t){return e?.[t]}function li(e,t){var r=O_(e,t);return $_(r)?r:void 0}var ol=li(wr,"WeakMap");function D_(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function I_(){}var P_=800,R_=16,N_=Date.now;function q_(e){var t=0,r=0;return function(){var i=N_(),s=R_-(i-r);if(r=i,s>0){if(++t>=P_)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Cs(e){return function(){return e}}var Wu=(function(){try{var e=li(Object,"defineProperty");return e({},"",{}),e}catch{}})(),W_=Wu?function(e,t){return Wu(e,"toString",{configurable:!0,enumerable:!1,value:Cs(t),writable:!0})}:pa,z_=q_(W_);function H_(e,t){for(var r=-1,i=e==null?0:e.length;++r<i&&t(e[r],r,e)!==!1;);return e}function Y_(e,t,r,i){for(var s=e.length,o=r+-1;++o<s;)if(t(e[o],o,e))return o;return-1}function U_(e){return e!==e}function j_(e,t,r){for(var i=r-1,s=e.length;++i<s;)if(e[i]===t)return i;return-1}function G_(e,t,r){return t===t?j_(e,t,r):Y_(e,U_,r)}function X_(e,t){var r=e==null?0:e.length;return!!r&&G_(e,t,0)>-1}var V_=9007199254740991,Z_=/^(?:0|[1-9]\d*)$/;function Hm(e,t){var r=typeof e;return t=t??V_,!!t&&(r=="number"||r!="symbol"&&Z_.test(e))&&e>-1&&e%1==0&&e<t}function Ym(e,t){return e===t||e!==e&&t!==t}var zu=Math.max;function K_(e,t,r){return t=zu(t===void 0?e.length-1:t,0),function(){for(var i=arguments,s=-1,o=zu(i.length-t,0),a=Array(o);++s<o;)a[s]=i[t+s];s=-1;for(var n=
Line truncated
|
||||
|
||||
`+r.mark.snippet),o+" "+s):o}p(e,"formatError");function t(r,i){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=i,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return p(t,"YAMLException2"),t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=p(function(i){return this.name+": "+e(this,i)},"toString"),tn=t,tn}p(Ji,"requireException");var en,pd;function Sy(){if(pd)return en;pd=1;const e=Qi();function t(s,o,a,n,l){let c="",h="";const u=Math.floor(l/2)-1;return n-o>u&&(c=" ... ",o=n-u+c.length),a-n>u&&(h=" ...",a=n+u-h.length),{str:c+s.slice(o,a).replace(/\t/g,"→")+h,pos:n-o+c.length}}p(t,"getLine");function r(s,o){return e.repeat(" ",o-s.length)+s}p(r,"padStart");function i(s,o){if(o=Object.create(o||null),!s.buffer)return null;o.maxLength||(o.maxLength=79),typeof o.indent!="number"&&(o.indent=1),typeof o.linesBefore!="number"&&(o.linesBefore=3),typeof o.linesAfter!="number"&&(o.linesAfter=2);const a=/\r?\n|\r|\0/g,n=[0],l=[];let c,h=-1;for(;c=a.exec(s.buffer);)l.push(c.index),n.push(c.index+c[0].length),s.position<=c.index&&h<0&&(h=n.length-2);h<0&&(h=n.length-1);let u="";const d=Math.min(s.line+o.linesAfter,l.length).toString().length,f=o.maxLength-(o.indent+d+3);for(let y=1;y<=o.linesBefore&&!(h-y<0);y++){const x=t(s.buffer,n[h-y],l[h-y],s.position-(n[h]-n[h-y]),f);u=e.repeat(" ",o.indent)+r((s.line-y+1).toString(),d)+" | "+x.str+`
|
||||
`+u}const m=t(s.buffer,n[h],l[h],s.position,f);u+=e.repeat(" ",o.indent)+r((s.line+1).toString(),d)+" | "+m.str+`
|
||||
`,u+=e.repeat("-",o.indent+d+3+m.pos)+`^
|
||||
`;for(let y=1;y<=o.linesAfter&&!(h+y>=l.length);y++){const x=t(s.buffer,n[h+y],l[h+y],s.position-(n[h]-n[h+y]),f);u+=e.repeat(" ",o.indent)+r((s.line+y+1).toString(),d)+" | "+x.str+`
|
||||
`}return u.replace(/\n$/,"")}return p(i,"makeSnippet"),en=i,en}p(Sy,"requireSnippet");var rn,gd;function pe(){if(gd)return rn;gd=1;const e=Ji(),t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r=["scalar","sequence","mapping"];function i(o){const a={};return o!==null&&Object.keys(o).forEach(function(n){o[n].forEach(function(l){a[String(l)]=n})}),a}p(i,"compileStyleAliases");function s(o,a){if(a=a||{},Object.keys(a).forEach(function(n){if(t.indexOf(n)===-1)throw new e('Unknown option "'+n+'" is met in definition of "'+o+'" YAML type.')}),this.options=a,this.tag=o,this.kind=a.kind||null,this.resolve=a.resolve||function(){return!0},this.construct=a.construct||function(n){return n},this.instanceOf=a.instanceOf||null,this.predicate=a.predicate||null,this.represent=a.represent||null,this.representName=a.representName||null,this.defaultStyle=a.defaultStyle||null,this.multi=a.multi||!1,this.styleAliases=i(a.styleAliases||null),r.indexOf(this.kind)===-1)throw new e('Unknown kind "'+this.kind+'" is specified for "'+o+'" YAML type.')}return p(s,"Type2"),rn=s,rn}p(pe,"requireType");var sn,md;function wh(){if(md)return sn;md=1;const e=Ji(),t=pe();function r(o,a){const n=[];return o[a].forEach(function(l){let c=n.length;n.forEach(function(h,u){h.tag===l.tag&&h.kind===l.kind&&h.multi===l.multi&&(c=u)}),n[c]=l}),n}p(r,"compileList");function i(){const o={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function a(n){n.multi?(o.multi[n.kind].push(n),o.multi.fallback.push(n)):o[n.kind][n.tag]=o.fallback[n.tag]=n}p(a,"collectType");for(let n=0,l=arguments.length;n<l;n+=1)arguments[n].forEach(a);return o}p(i,"compileMap");function s(o){return this.extend(o)}return p(s,"Schema2"),s.prototype.extend=p(function(a){let n=[],l=[];if(a instanceof t)l.push(a);else if(Array.isArray(a))l=l.concat(a);else if(a&&(Array.isArray(a.implicit)||Array.isArray(a.explicit)))a.implicit&&(n=n.concat(a.implicit)),a.explicit&&(l=l.concat(a.explicit));else throw new e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(h){if(!(h instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(h.loadKind&&h.loadKind!=="scalar")throw new e("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(h.multi)throw new e("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),l.forEach(function(h){if(!(h instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.")});const c=Object.create(s.prototype);return c.implicit=(this.implicit||[]).concat(n),c.explicit=(this.explicit||[]).concat(l),c.compiledImplicit=r(c,"implicit"),c.compiledExplicit=r(c,"explicit"),c.compiledTypeMap=i(c.compiledImplicit,c.compiledExplicit),c},"extend"),sn=s,sn}p(wh,"requireSchema");var on,yd;function Th(){if(yd)return on;yd=1;const e=pe();return on=new e("tag:yaml.org,2002:str",{kind:"scalar",construct:p(function(t){return t!==null?t:""},"construct")}),on}p(Th,"requireStr");var an,xd;function Sh(){if(xd)return an;xd=1;const e=pe();return an=new e("tag:yaml.org,2002:seq",{kind:"sequence",construct:p(function(t){return t!==null?t:[]},"construct")}),an}p(Sh,"requireSeq");var nn,Cd;function _h(){if(Cd)return nn;Cd=1;const e=pe();return nn=new e("tag:yaml.org,2002:map",{kind:"mapping",construct:p(function(t){return t!==null?t:{}},"construct")}),nn}p(_h,"requireMap");var ln,bd;function vh(){if(bd)return ln;bd=1;const e=wh();return ln=new e({explicit:[Th(),Sh(),_h()]}),ln}p(vh,"requireFailsafe");var hn,kd;function Bh(){if(kd)return hn;kd=1;const e=pe();function t(s){if(s===null)return!0;const o=s.length;return o===1&&s==="~"||o===4&&(s==="null"||s==="Null"||s==="NULL")}p(t,"resolveYamlNull");function r(){return null}p(r,"constructYamlNull");function i(s){return s===null}return p(i,"isNull"),hn=new e("tag:yaml.org,2002:null",{kind:"scalar",resolve:t,construct:r,predicate:i,represent:{canonical:p(function(){return"~"},"canonical"),lowercase:p(function(){return"null"},"lowercase"),uppercase:p(function(){return"NULL"},"uppercase"),camelcase:p(function(){return"Null"},"camelcase"),empty:p(function(){return""},"empty")},defaultStyle:"lowercase"}),hn}p(Bh,"require_null");var cn,wd;function Lh(){if(wd)return cn;wd=1;const e=pe();function t(s){if(s===null)return!1;const o=s.length;return o===4&&(s==="true"||s==="True"||s==="TRUE")||o===5&&(s==="false"||s==="False"||s==="FALSE")}p(t,"resolveYamlBoolean");function r(s){return s==="true"||s==="True"||s==="TRUE"}p(r,"constructYamlBoolean");function i(s){return Object.prototype.toString.call(s)==="[object Boolean]"}return p(i,"isBoolean"),cn=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:t,construct:r,predicate:i,represent:{lowercase:p(
Line truncated
|
||||
\r`;function r(a){if(a===null)return!1;let n=0;const l=a.length,c=t;for(let h=0;h<l;h++){const u=c.indexOf(a.charAt(h));if(!(u>64)){if(u<0)return!1;n+=6}}return n%8===0}p(r,"resolveYamlBinary");function i(a){const n=a.replace(/[\r\n=]/g,""),l=n.length,c=t;let h=0;const u=[];for(let f=0;f<l;f++)f%4===0&&f&&(u.push(h>>16&255),u.push(h>>8&255),u.push(h&255)),h=h<<6|c.indexOf(n.charAt(f));const d=l%4*6;return d===0?(u.push(h>>16&255),u.push(h>>8&255),u.push(h&255)):d===18?(u.push(h>>10&255),u.push(h>>2&255)):d===12&&u.push(h>>4&255),new Uint8Array(u)}p(i,"constructYamlBinary");function s(a){let n="",l=0;const c=a.length,h=t;for(let d=0;d<c;d++)d%3===0&&d&&(n+=h[l>>18&63],n+=h[l>>12&63],n+=h[l>>6&63],n+=h[l&63]),l=(l<<8)+a[d];const u=c%3;return u===0?(n+=h[l>>18&63],n+=h[l>>12&63],n+=h[l>>6&63],n+=h[l&63]):u===2?(n+=h[l>>10&63],n+=h[l>>4&63],n+=h[l<<2&63],n+=h[64]):u===1&&(n+=h[l>>2&63],n+=h[l<<4&63],n+=h[64],n+=h[64]),n}p(s,"representYamlBinary");function o(a){return Object.prototype.toString.call(a)==="[object Uint8Array]"}return p(o,"isBinary"),yn=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:s}),yn}p(Dh,"requireBinary");var xn,Ad;function Ih(){if(Ad)return xn;Ad=1;const e=pe(),t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function i(o){if(o===null)return!0;const a=[],n=o;for(let l=0,c=n.length;l<c;l+=1){const h=n[l];let u=!1;if(r.call(h)!=="[object Object]")return!1;let d;for(d in h)if(t.call(h,d))if(!u)u=!0;else return!1;if(!u)return!1;if(a.indexOf(d)===-1)a.push(d);else return!1}return!0}p(i,"resolveYamlOmap");function s(o){return o!==null?o:[]}return p(s,"constructYamlOmap"),xn=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:i,construct:s}),xn}p(Ih,"requireOmap");var Cn,Ed;function Ph(){if(Ed)return Cn;Ed=1;const e=pe(),t=Object.prototype.toString;function r(s){if(s===null)return!0;const o=s,a=new Array(o.length);for(let n=0,l=o.length;n<l;n+=1){const c=o[n];if(t.call(c)!=="[object Object]")return!1;const h=Object.keys(c);if(h.length!==1)return!1;a[n]=[h[0],c[h[0]]]}return!0}p(r,"resolveYamlPairs");function i(s){if(s===null)return[];const o=s,a=new Array(o.length);for(let n=0,l=o.length;n<l;n+=1){const c=o[n],h=Object.keys(c);a[n]=[h[0],c[h[0]]]}return a}return p(i,"constructYamlPairs"),Cn=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:i}),Cn}p(Ph,"requirePairs");var bn,Md;function Rh(){if(Md)return bn;Md=1;const e=pe(),t=Object.prototype.hasOwnProperty;function r(s){if(s===null)return!0;const o=s;for(const a in o)if(t.call(o,a)&&o[a]!==null)return!1;return!0}p(r,"resolveYamlSet");function i(s){return s!==null?s:{}}return p(i,"constructYamlSet"),bn=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:i}),bn}p(Rh,"requireSet");var kn,$d;function ka(){return $d||($d=1,kn=Mh().extend({implicit:[$h(),Oh()],explicit:[Dh(),Ih(),Ph(),Rh()]})),kn}p(ka,"require_default");var Od;function _y(){if(Od)return uo;Od=1;const e=Qi(),t=Ji(),r=Sy(),i=ka(),s=Object.prototype.hasOwnProperty,o=1,a=2,n=3,l=4,c=1,h=2,u=3,d=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,f=/[\x85\u2028\u2029]/,m=/[,\[\]{}]/,y=/^(?:!|!!|![0-9A-Za-z-]+!)$/,x=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function C(g){return Object.prototype.toString.call(g)}p(C,"_class");function k(g){return g===10||g===13}p(k,"isEol");function T(g){return g===9||g===32}p(T,"isWhiteSpace");function S(g){return g===9||g===32||g===10||g===13}p(S,"isWsOrEol");function _(g){return g===44||g===91||g===93||g===123||g===125}p(_,"isFlowIndicator");function L(g){if(g>=48&&g<=57)return g-48;const $=g|32;return $>=97&&$<=102?$-97+10:-1}p(L,"fromHexCode");function A(g){return g===120?2:g===117?4:g===85?8:0}p(A,"escapedHexLen");function F(g){return g>=48&&g<=57?g-48:-1}p(F,"fromDecimalCode");function V(g){switch(g){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
||||
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"
";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}p(V,"simpleEscapeSequence");function Y(g){return g<=65535?String.fromCharCode(g):String.fromCharCode((g-65536>>10)+55296,(g-65536&1023)+56320)}p(Y,"charFromCodepoint");function R(g,$,H){$==="__proto__"?Object.defineProperty(g,$,{configurable:!0,enumerable:!0,writable:!0,value:H}):g[$]=H}p(R,"setProperty");const it=new Array(256),U=new Array(256);for(let g=0;g<256;g++)it[g]=V(g)?1:0,U[g]=V(g);function E(g,$){this.input=g,this.filename=$.filename||null,this.schema=$.schema||i,this.onWarning=$.onWarning||null,this.legacy=$.legacy||!1,this.json=$.json||!1,this.listener=$.listener||null,this.maxDepth=typeof $.maxDepth=="number"?$.maxDepth:100,this.maxTotalMergeKeys=typeof $.maxTotalMergeKeys=="number"?$.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=g.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}p(E,"State");function O(g,$){const H={name:g.filename,buffer:g.input.slice(0,-1),position:g.position,line:g.line,column:g.position-g.lineStart};return H.snippet=r(H),new t($,H)}p(O,"generateError");function B(g,$){throw O(g,$)}p(B,"throwError");function N(g,$){g.onWarning&&g.onWarning.call(null,O(g,$))}p(N,"throwWarning");function D(g,$,H){const X=g.anchorMapTransactions;if(X.length!==0){const z=X[X.length-1];s.call(z,$)||(z[$]={existed:s.call(g.anchorMap,$),value:g.anchorMap[$]})}g.anchorMap[$]=H}p(D,"storeAnchor");function rt(g){g.anchorMapTransactions.push(Object.create(null))}p(rt,"beginAnchorTransaction");function tt(g){const $=g.anchorMapTransactions.pop(),H=g.anchorMapTransactions;if(H.length===0)return;const X=H[H.length-1],z=Object.keys($);for(let et=0,w=z.length;et<w;et+=1){const I=z[et];s.call(X,I)||(X[I]=$[I])}}p(tt,"commitAnchorTransaction");function pt(g){const $=g.anchorMapTransactions.pop(),H=Object.keys($);for(let X=H.length-1;X>=0;X-=1){const z=$[H[X]];z.existed?g.anchorMap[H[X]]=z.value:delete g.anchorMap[H[X]]}}p(pt,"rollbackAnchorTransaction");function St(g){return{position:g.position,line:g.line,lineStart:g.lineStart,lineIndent:g.lineIndent,firstTabInLine:g.firstTabInLine,tag:g.tag,anchor:g.anchor,kind:g.kind,result:g.result}}p(St,"snapshotState");function Tt(g,$){g.position=$.position,g.line=$.line,g.lineStart=$.lineStart,g.lineIndent=$.lineIndent,g.firstTabInLine=$.firstTabInLine,g.tag=$.tag,g.anchor=$.anchor,g.kind=$.kind,g.result=$.result}p(Tt,"restoreState");const ft={YAML:p(function($,H,X){$.version!==null&&B($,"duplication of %YAML directive"),X.length!==1&&B($,"YAML directive accepts exactly one argument");const z=/^([0-9]+)\.([0-9]+)$/.exec(X[0]);z===null&&B($,"ill-formed argument of the YAML directive");const et=parseInt(z[1],10),w=parseInt(z[2],10);et!==1&&B($,"unacceptable YAML version of the document"),$.version=X[0],$.checkLineBreaks=w<2,w!==1&&w!==2&&N($,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:p(function($,H,X){let z;X.length!==2&&B($,"TAG directive accepts exactly two arguments");const et=X[0];z=X[1],y.test(et)||B($,"ill-formed tag handle (first argument) of the TAG directive"),s.call($.tagMap,et)&&B($,'there is a previously declared suffix for "'+et+'" tag handle'),x.test(z)||B($,"ill-formed tag prefix (second argument) of the TAG directive");try{z=decodeURIComponent(z)}catch{B($,"tag prefix is malformed: "+z)}$.tagMap[et]=z},"handleTagDirective")};function Bt(g,$,H,X){if($<H){const z=g.input.slice($,H);if(X)for(let et=0,w=z.length;et<w;et+=1){const I=z.charCodeAt(et);I===9||I>=32&&I<=1114111||B(g,"expected valid JSON character")}else d.test(z)&&B(g,"the stream contains non-printable characters");g.result+=z}}p(Bt,"captureSegment");function st(g,$,H,X){e.isObject(H)||B(g,"cannot merge mappings; the provided source object is unacceptable");const z=Object.keys(H);for(let et=0,w=z.length;et<w;et+=1){const I=z[et];g.maxTotalMergeKeys!==-1&&++g.totalMergeKeys>g.maxTotalMergeKeys&&B(g,"merge keys exceeded maxTotalMergeKeys ("+g.maxTotalMergeKeys+")"),s.call($,I)||(R($,I,H[I]),X[I]=!0)}}p(st,"mergeMappings");function kt(g,$,H,X,z,et,w,I,J){if(Array.isArray(z)){z=Array.prototype.slice.call(z);for(let G=0,j=z.length;G<j;G+=1)Array.isArray(z[G])&&B(g,"nested arrays are not supported inside keys"),typeof z=="object"&&C(z[G])==="[object Object]"&&(z[G]="[object Object]")}if(typeof z=="object"&&C(z)==="[object Object]"&&(z="[object Object]"),z=String(z),$===null&&($={}),X==="tag:yaml.org,2002:merge")if(Array.isArray(et))for(let G=0,j=et.length;G<j;G+=1)st(g,$,et[G],H);else st(g,$,et,H);else!g.json&&!s.call(H,z)&&s.call($,z)&&(g.line=w||g.line,g.lineStart=I||g.lineStart,g.position=J||g.position,B(g,"duplica
Line truncated
|
||||
`,$-1))}p(Mt,"writeFoldedLines");function ee(g,$,H){let X,z,et,w,I,J;const G=g.kind,j=g.result;let K=g.input.charCodeAt(g.position);if(S(K)||_(K)||K===35||K===38||K===42||K===33||K===124||K===62||K===39||K===34||K===37||K===64||K===96)return!1;if(K===63||K===45){const Q=g.input.charCodeAt(g.position+1);if(S(Q)||H&&_(Q))return!1}for(g.kind="scalar",g.result="",X=z=g.position,et=!1;K!==0;){if(K===58){const Q=g.input.charCodeAt(g.position+1);if(S(Q)||H&&_(Q))break}else if(K===35){const Q=g.input.charCodeAt(g.position-1);if(S(Q))break}else{if(g.position===g.lineStart&&It(g)||H&&_(K))break;if(k(K))if(w=g.line,I=g.lineStart,J=g.lineIndent,wt(g,!1,-1),g.lineIndent>=$){et=!0,K=g.input.charCodeAt(g.position);continue}else{g.position=z,g.line=w,g.lineStart=I,g.lineIndent=J;break}}et&&(Bt(g,X,z,!1),Mt(g,g.line-w),X=z=g.position,et=!1),T(K)||(z=g.position+1),K=g.input.charCodeAt(++g.position)}return Bt(g,X,z,!1),g.result?!0:(g.kind=G,g.result=j,!1)}p(ee,"readPlainScalar");function ge(g,$){let H,X,z=g.input.charCodeAt(g.position);if(z!==39)return!1;for(g.kind="scalar",g.result="",g.position++,H=X=g.position;(z=g.input.charCodeAt(g.position))!==0;)if(z===39)if(Bt(g,H,g.position,!0),z=g.input.charCodeAt(++g.position),z===39)H=g.position,g.position++,X=g.position;else return!0;else k(z)?(Bt(g,H,X,!0),Mt(g,wt(g,!1,$)),H=X=g.position):g.position===g.lineStart&&It(g)?B(g,"unexpected end of the document within a single quoted scalar"):(g.position++,T(z)||(X=g.position));B(g,"unexpected end of the stream within a single quoted scalar")}p(ge,"readSingleQuotedScalar");function Be(g,$){let H,X,z,et=g.input.charCodeAt(g.position);if(et!==34)return!1;for(g.kind="scalar",g.result="",g.position++,H=X=g.position;(et=g.input.charCodeAt(g.position))!==0;){if(et===34)return Bt(g,H,g.position,!0),g.position++,!0;if(et===92){if(Bt(g,H,g.position,!0),et=g.input.charCodeAt(++g.position),k(et))wt(g,!1,$);else if(et<256&&it[et])g.result+=U[et],g.position++;else if((z=A(et))>0){let w=z,I=0;for(;w>0;w--)et=g.input.charCodeAt(++g.position),(z=L(et))>=0?I=(I<<4)+z:B(g,"expected hexadecimal character");g.result+=Y(I),g.position++}else B(g,"unknown escape sequence");H=X=g.position}else k(et)?(Bt(g,H,X,!0),Mt(g,wt(g,!1,$)),H=X=g.position):g.position===g.lineStart&&It(g)?B(g,"unexpected end of the document within a double quoted scalar"):(g.position++,T(et)||(X=g.position))}B(g,"unexpected end of the stream within a double quoted scalar")}p(Be,"readDoubleQuotedScalar");function _r(g,$){let H=!0,X,z,et;const w=g.tag;let I;const J=g.anchor;let G,j,K,Q;const ht=Object.create(null);let at,gt,Ct,Ot=g.input.charCodeAt(g.position);if(Ot===91)G=93,Q=!1,I=[];else if(Ot===123)G=125,Q=!0,I={};else return!1;for(g.anchor!==null&&D(g,g.anchor,I),Ot=g.input.charCodeAt(++g.position);Ot!==0;){if(wt(g,!0,$),Ot=g.input.charCodeAt(g.position),Ot===G)return g.position++,g.tag=w,g.anchor=J,g.kind=Q?"mapping":"sequence",g.result=I,!0;if(H?Ot===44&&B(g,"expected the node content, but found ','"):B(g,"missed comma between flow collection entries"),gt=at=Ct=null,j=K=!1,Ot===63){const qt=g.input.charCodeAt(g.position+1);S(qt)&&(j=K=!0,g.position++,wt(g,!0,$))}X=g.line,z=g.lineStart,et=g.position,le(g,$,o,!1,!0),gt=g.tag,at=g.result,wt(g,!0,$),Ot=g.input.charCodeAt(g.position),(K||g.line===X)&&Ot===58&&(j=!0,Ot=g.input.charCodeAt(++g.position),wt(g,!0,$),le(g,$,o,!1,!0),Ct=g.result),Q?kt(g,I,ht,gt,at,Ct,X,z,et):j?I.push(kt(g,null,ht,gt,at,Ct,X,z,et)):I.push(at),wt(g,!0,$),Ot=g.input.charCodeAt(g.position),Ot===44?(H=!0,Ot=g.input.charCodeAt(++g.position)):H=!1}B(g,"unexpected end of the stream within a flow collection")}p(_r,"readFlowCollection");function Ce(g,$){let H,X=c,z=!1,et=!1,w=$,I=0,J=!1,G,j=g.input.charCodeAt(g.position);if(j===124)H=!1;else if(j===62)H=!0;else return!1;for(g.kind="scalar",g.result="";j!==0;)if(j=g.input.charCodeAt(++g.position),j===43||j===45)c===X?X=j===43?u:h:B(g,"repeat of a chomping mode identifier");else if((G=F(j))>=0)G===0?B(g,"bad explicit indentation width of a block scalar; it cannot be less than one"):et?B(g,"repeat of an indentation width identifier"):(w=$+G-1,et=!0);else break;if(T(j)){do j=g.input.charCodeAt(++g.position);while(T(j));if(j===35)do j=g.input.charCodeAt(++g.position);while(!k(j)&&j!==0)}for(;j!==0;){for(xt(g),g.lineIndent=0,j=g.input.charCodeAt(g.position);(!et||g.lineIndent<w)&&j===32;)g.lineIndent++,j=g.input.charCodeAt(++g.position);if(!et&&g.lineIndent>w&&(w=g.lineIndent),k(j)){I++;continue}if(!et&&w===0&&B(g,"missing indentation for block scalar"),g.lineIndent<w){X===u?g.result+=e.repeat(`
|
||||
`,z?1+I:I):X===c&&z&&(g.result+=`
|
||||
`);break}H?T(j)?(J=!0,g.result+=e.repeat(`
|
||||
`,z?1+I:I)):J?(J=!1,g.result+=e.repeat(`
|
||||
`,I+1)):I===0?z&&(g.result+=" "):g.result+=e.repeat(`
|
||||
`,I):g.result+=e.repeat(`
|
||||
`,z?1+I:I),z=!0,et=!0,I=0;const K=g.position;for(;!k(j)&&j!==0;)j=g.input.charCodeAt(++g.position);Bt(g,K,g.position,!1)}return!0}p(Ce,"readBlockScalar");function ne(g,$){const H=g.tag,X=g.anchor,z=[];let et=!1;if(g.firstTabInLine!==-1)return!1;g.anchor!==null&&D(g,g.anchor,z);let w=g.input.charCodeAt(g.position);for(;w!==0&&(g.firstTabInLine!==-1&&(g.position=g.firstTabInLine,B(g,"tab characters must not be used in indentation")),w===45);){const I=g.input.charCodeAt(g.position+1);if(!S(I))break;if(et=!0,g.position++,wt(g,!0,-1)&&g.lineIndent<=$){z.push(null),w=g.input.charCodeAt(g.position);continue}const J=g.line;if(le(g,$,n,!1,!0),z.push(g.result),wt(g,!0,-1),w=g.input.charCodeAt(g.position),(g.line===J||g.lineIndent>$)&&w!==0)B(g,"bad indentation of a sequence entry");else if(g.lineIndent<$)break}return et?(g.tag=H,g.anchor=X,g.kind="sequence",g.result=z,!0):!1}p(ne,"readBlockSequence");function be(g,$,H){let X,z,et,w;const I=g.tag,J=g.anchor,G={},j=Object.create(null);let K=null,Q=null,ht=null,at=!1,gt=!1;if(g.firstTabInLine!==-1)return!1;g.anchor!==null&&D(g,g.anchor,G);let Ct=g.input.charCodeAt(g.position);for(;Ct!==0;){!at&&g.firstTabInLine!==-1&&(g.position=g.firstTabInLine,B(g,"tab characters must not be used in indentation"));const Ot=g.input.charCodeAt(g.position+1),qt=g.line;if((Ct===63||Ct===58)&&S(Ot))Ct===63?(at&&(kt(g,G,j,K,Q,null,z,et,w),K=Q=ht=null),gt=!0,at=!0,X=!0):at?(at=!1,X=!0):B(g,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),g.position+=1,Ct=Ot;else{if(z=g.line,et=g.lineStart,w=g.position,!le(g,H,a,!1,!0))break;if(g.line===qt){for(Ct=g.input.charCodeAt(g.position);T(Ct);)Ct=g.input.charCodeAt(++g.position);if(Ct===58)Ct=g.input.charCodeAt(++g.position),S(Ct)||B(g,"a whitespace character is expected after the key-value separator within a block mapping"),at&&(kt(g,G,j,K,Q,null,z,et,w),K=Q=ht=null),gt=!0,at=!1,X=!1,K=g.tag,Q=g.result;else if(gt)B(g,"can not read an implicit mapping pair; a colon is missed");else return g.tag=I,g.anchor=J,!0}else if(gt)B(g,"can not read a block mapping entry; a multiline key may not be an implicit key");else return g.tag=I,g.anchor=J,!0}if((g.line===qt||g.lineIndent>$)&&(at&&(z=g.line,et=g.lineStart,w=g.position),le(g,$,l,!0,X)&&(at?Q=g.result:ht=g.result),at||(kt(g,G,j,K,Q,ht,z,et,w),K=Q=ht=null),wt(g,!0,-1),Ct=g.input.charCodeAt(g.position)),(g.line===qt||g.lineIndent>$)&&Ct!==0)B(g,"bad indentation of a mapping entry");else if(g.lineIndent<$)break}return at&&kt(g,G,j,K,Q,null,z,et,w),gt&&(g.tag=I,g.anchor=J,g.kind="mapping",g.result=G),gt}p(be,"readBlockMapping");function ar(g){let $=!1,H=!1,X,z,et=g.input.charCodeAt(g.position);if(et!==33)return!1;g.tag!==null&&B(g,"duplication of a tag property"),et=g.input.charCodeAt(++g.position),et===60?($=!0,et=g.input.charCodeAt(++g.position)):et===33?(H=!0,X="!!",et=g.input.charCodeAt(++g.position)):X="!";let w=g.position;if($){do et=g.input.charCodeAt(++g.position);while(et!==0&&et!==62);g.position<g.length?(z=g.input.slice(w,g.position),et=g.input.charCodeAt(++g.position)):B(g,"unexpected end of the stream within a verbatim tag")}else{for(;et!==0&&!S(et);)et===33&&(H?B(g,"tag suffix cannot contain exclamation marks"):(X=g.input.slice(w-1,g.position+1),y.test(X)||B(g,"named tag handle cannot contain such characters"),H=!0,w=g.position+1)),et=g.input.charCodeAt(++g.position);z=g.input.slice(w,g.position),m.test(z)&&B(g,"tag suffix cannot contain flow indicator characters")}z&&!x.test(z)&&B(g,"tag name cannot contain such characters: "+z);try{z=decodeURIComponent(z)}catch{B(g,"tag name is malformed: "+z)}return $?g.tag=z:s.call(g.tagMap,X)?g.tag=g.tagMap[X]+z:X==="!"?g.tag="!"+z:X==="!!"?g.tag="tag:yaml.org,2002:"+z:B(g,'undeclared tag handle "'+X+'"'),!0}p(ar,"readTagProperty");function Ue(g){let $=g.input.charCodeAt(g.position);if($!==38)return!1;g.anchor!==null&&B(g,"duplication of an anchor property"),$=g.input.charCodeAt(++g.position);const H=g.position;for(;$!==0&&!S($)&&!_($);)$=g.input.charCodeAt(++g.position);return g.position===H&&B(g,"name of an anchor node must contain at least one character"),g.anchor=g.input.slice(H,g.position),!0}p(Ue,"readAnchorProperty");function Le(g){let $=g.input.charCodeAt(g.position);if($!==42)return!1;$=g.input.charCodeAt(++g.position);const H=g.position;for(;$!==0&&!S($)&&!_($);)$=g.input.charCodeAt(++g.position);g.position===H&&B(g,"name of an alias node must contain at least one character");const X=g.input.slice(H,g.position);return s.call(g.anchorMap,X)||B(g,'unidentified alias "'+X+'"'),g.result=g.anchorMap[X],wt(g,!0,-1),!0}p(Le,"readAlias");function je(g,$,H,X){const z=St(g);return rt(g),Tt(g,$),g.tag=null,g.anchor=null,g.kind=null,g.result=null,be(g,H,X)&&g.kind==="mapping"?(tt(g),!0):(pt(g),Tt(g,z),!1)}p(je,"tryReadBlockMappingFromProperty");function le(g,$,H,X,z){let et,w,I=1,J=!1,G=!1,j=null,K,Q,ht;g.depth>=g.maxDepth&&B(g,"nesting exceeded maxDepth ("+g.maxDepth+")"),g.depth+=1,g.listener!==null&&g.list
Line truncated
|
||||
`),g.charCodeAt(0)===65279&&(g=g.slice(1)));const H=new E(g,$),X=g.indexOf("\0");for(X!==-1&&(H.position=X,B(H,"null byte is not allowed in input")),H.input+="\0";H.input.charCodeAt(H.position)===32;)H.lineIndent+=1,H.position+=1;for(;H.position<H.length-1;)vr(H);return H.documents}p(nr,"loadDocuments");function lr(g,$,H){$!==null&&typeof $=="object"&&typeof H>"u"&&(H=$,$=null);const X=nr(g,H);if(typeof $!="function")return X;for(let z=0,et=X.length;z<et;z+=1)$(X[z])}p(lr,"loadAll2");function hr(g,$){const H=nr(g,$);if(H.length!==0){if(H.length===1)return H[0];throw new t("expected a single document in the stream, but found more")}}return p(hr,"load2"),uo.loadAll=lr,uo.load=hr,uo}p(_y,"requireLoader");var wn={},Dd;function vy(){if(Dd)return wn;Dd=1;const e=Qi(),t=Ji(),r=ka(),i=Object.prototype.toString,s=Object.prototype.hasOwnProperty,o=65279,a=9,n=10,l=13,c=32,h=33,u=34,d=35,f=37,m=38,y=39,x=42,C=44,k=45,T=58,S=61,_=62,L=63,A=64,F=91,V=93,Y=96,R=123,it=124,U=125,E={};E[0]="\\0",E[7]="\\a",E[8]="\\b",E[9]="\\t",E[10]="\\n",E[11]="\\v",E[12]="\\f",E[13]="\\r",E[27]="\\e",E[34]='\\"',E[92]="\\\\",E[133]="\\N",E[160]="\\_",E[8232]="\\L",E[8233]="\\P";const O=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],B=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function N(w,I){if(I===null)return{};const J={},G=Object.keys(I);for(let j=0,K=G.length;j<K;j+=1){let Q=G[j],ht=String(I[Q]);Q.slice(0,2)==="!!"&&(Q="tag:yaml.org,2002:"+Q.slice(2));const at=w.compiledTypeMap.fallback[Q];at&&s.call(at.styleAliases,ht)&&(ht=at.styleAliases[ht]),J[Q]=ht}return J}p(N,"compileStyleMap");function D(w){let I,J;const G=w.toString(16).toUpperCase();if(w<=255)I="x",J=2;else if(w<=65535)I="u",J=4;else if(w<=4294967295)I="U",J=8;else throw new t("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+I+e.repeat("0",J-G.length)+G}p(D,"encodeHex");const rt=1,tt=2;function pt(w){this.schema=w.schema||r,this.indent=Math.max(1,w.indent||2),this.noArrayIndent=w.noArrayIndent||!1,this.skipInvalid=w.skipInvalid||!1,this.flowLevel=e.isNothing(w.flowLevel)?-1:w.flowLevel,this.styleMap=N(this.schema,w.styles||null),this.sortKeys=w.sortKeys||!1,this.lineWidth=w.lineWidth||80,this.noRefs=w.noRefs||!1,this.noCompatMode=w.noCompatMode||!1,this.condenseFlow=w.condenseFlow||!1,this.quotingType=w.quotingType==='"'?tt:rt,this.forceQuotes=w.forceQuotes||!1,this.replacer=typeof w.replacer=="function"?w.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}p(pt,"State");function St(w,I){const J=e.repeat(" ",I);let G=0,j="";const K=w.length;for(;G<K;){let Q;const ht=w.indexOf(`
|
||||
`,G);ht===-1?(Q=w.slice(G),G=K):(Q=w.slice(G,ht+1),G=ht+1),Q.length&&Q!==`
|
||||
`&&(j+=J),j+=Q}return j}p(St,"indentString");function Tt(w,I){return`
|
||||
`+e.repeat(" ",w.indent*I)}p(Tt,"generateNextLine");function ft(w,I){for(let J=0,G=w.implicitTypes.length;J<G;J+=1)if(w.implicitTypes[J].resolve(I))return!0;return!1}p(ft,"testImplicitResolving");function Bt(w){return w===c||w===a}p(Bt,"isWhitespace");function st(w){return w>=32&&w<=126||w>=161&&w<=55295&&w!==8232&&w!==8233||w>=57344&&w<=65533&&w!==o||w>=65536&&w<=1114111}p(st,"isPrintable");function kt(w){return st(w)&&w!==o&&w!==l&&w!==n}p(kt,"isNsCharOrWhitespace");function xt(w,I,J){const G=kt(w),j=G&&!Bt(w);return(J?G:G&&w!==C&&w!==F&&w!==V&&w!==R&&w!==U)&&w!==d&&!(I===T&&!j)||kt(I)&&!Bt(I)&&w===d||I===T&&j}p(xt,"isPlainSafe");function wt(w){return st(w)&&w!==o&&!Bt(w)&&w!==k&&w!==L&&w!==T&&w!==C&&w!==F&&w!==V&&w!==R&&w!==U&&w!==d&&w!==m&&w!==x&&w!==h&&w!==it&&w!==S&&w!==_&&w!==y&&w!==u&&w!==f&&w!==A&&w!==Y}p(wt,"isPlainSafeFirst");function It(w){return!Bt(w)&&w!==T}p(It,"isPlainSafeLast");function Mt(w,I){const J=w.charCodeAt(I);let G;return J>=55296&&J<=56319&&I+1<w.length&&(G=w.charCodeAt(I+1),G>=56320&&G<=57343)?(J-55296)*1024+G-56320+65536:J}p(Mt,"codePointAt");function ee(w){return/^\n* /.test(w)}p(ee,"needIndentIndicator");const ge=1,Be=2,_r=3,Ce=4,ne=5;function be(w,I,J,G,j,K,Q,ht){let at,gt=0,Ct=null,Ot=!1,qt=!1;const Xs=G!==-1;let Rr=-1,zt=wt(Mt(w,0))&&It(Mt(w,w.length-1));if(I||Q)for(at=0;at<w.length;gt>=65536?at+=2:at++){if(gt=Mt(w,at),!st(gt))return ne;zt=zt&&xt(gt,Ct,ht),Ct=gt}else{for(at=0;at<w.length;gt>=65536?at+=2:at++){if(gt=Mt(w,at),gt===n)Ot=!0,Xs&&(qt=qt||at-Rr-1>G&&w[Rr+1]!==" ",Rr=at);else if(!st(gt))return ne;zt=zt&&xt(gt,Ct,ht),Ct=gt}qt=qt||Xs&&at-Rr-1>G&&w[Rr+1]!==" "}return!Ot&&!qt?zt&&!Q&&!j(w)?ge:K===tt?ne:Be:J>9&&ee(w)?ne:Q?K===tt?ne:Be:qt?Ce:_r}p(be,"chooseScalarStyle");function ar(w,I,J,G,j){w.dump=(function(){if(I.length===0)return w.quotingType===tt?'""':"''";if(!w.noCompatMode&&(O.indexOf(I)!==-1||B.test(I)))return w.quotingType===tt?'"'+I+'"':"'"+I+"'";const K=w.indent*Math.max(1,J),Q=w.lineWidth===-1?-1:Math.max(Math.min(w.lineWidth,40),w.lineWidth-K),ht=G||w.flowLevel>-1&&J>=w.flowLevel;function at(gt){return ft(w,gt)}switch(p(at,"testAmbiguity"),be(I,ht,w.indent,Q,at,w.quotingType,w.forceQuotes&&!G,j)){case ge:return I;case Be:return"'"+I.replace(/'/g,"''")+"'";case _r:return"|"+Ue(I,w.indent)+Le(St(I,K));case Ce:return">"+Ue(I,w.indent)+Le(St(je(I,Q),K));case ne:return'"'+vr(I)+'"';default:throw new t("impossible error: invalid scalar style")}})()}p(ar,"writeScalar");function Ue(w,I){const J=ee(w)?String(I):"",G=w[w.length-1]===`
|
||||
`,K=G&&(w[w.length-2]===`
|
||||
`||w===`
|
||||
`)?"+":G?"":"-";return J+K+`
|
||||
`}p(Ue,"blockHeader");function Le(w){return w[w.length-1]===`
|
||||
`?w.slice(0,-1):w}p(Le,"dropEndingNewline");function je(w,I){const J=/(\n+)([^\n]*)/g;let G=(function(){let ht=w.indexOf(`
|
||||
`);return ht=ht!==-1?ht:w.length,J.lastIndex=ht,le(w.slice(0,ht),I)})(),j=w[0]===`
|
||||
`||w[0]===" ",K,Q;for(;Q=J.exec(w);){const ht=Q[1],at=Q[2];K=at[0]===" ",G+=ht+(!j&&!K&&at!==""?`
|
||||
`:"")+le(at,I),j=K}return G}p(je,"foldString");function le(w,I){if(w===""||w[0]===" ")return w;const J=/ [^ ]/g;let G,j=0,K,Q=0,ht=0,at="";for(;G=J.exec(w);)ht=G.index,ht-j>I&&(K=Q>j?Q:ht,at+=`
|
||||
`+w.slice(j,K),j=K+1),Q=ht;return at+=`
|
||||
`,w.length-j>I&&Q>j?at+=w.slice(j,Q)+`
|
||||
`+w.slice(Q+1):at+=w.slice(j),at.slice(1)}p(le,"foldLine");function vr(w){let I="",J=0;for(let G=0;G<w.length;J>=65536?G+=2:G++){J=Mt(w,G);const j=E[J];!j&&st(J)?(I+=w[G],J>=65536&&(I+=w[G+1])):I+=j||D(J)}return I}p(vr,"escapeString");function nr(w,I,J){let G="";const j=w.tag;for(let K=0,Q=J.length;K<Q;K+=1){let ht=J[K];w.replacer&&(ht=w.replacer.call(J,String(K),ht)),(H(w,I,ht,!1,!1)||typeof ht>"u"&&H(w,I,null,!1,!1))&&(G!==""&&(G+=","+(w.condenseFlow?"":" ")),G+=w.dump)}w.tag=j,w.dump="["+G+"]"}p(nr,"writeFlowSequence");function lr(w,I,J,G){let j="";const K=w.tag;for(let Q=0,ht=J.length;Q<ht;Q+=1){let at=J[Q];w.replacer&&(at=w.replacer.call(J,String(Q),at)),(H(w,I+1,at,!0,!0,!1,!0)||typeof at>"u"&&H(w,I+1,null,!0,!0,!1,!0))&&((!G||j!=="")&&(j+=Tt(w,I)),w.dump&&n===w.dump.charCodeAt(0)?j+="-":j+="- ",j+=w.dump)}w.tag=K,w.dump=j||"[]"}p(lr,"writeBlockSequence");function hr(w,I,J){let G="";const j=w.tag,K=Object.keys(J);for(let Q=0,ht=K.length;Q<ht;Q+=1){let at="";G!==""&&(at+=", "),w.condenseFlow&&(at+='"');const gt=K[Q];let Ct=J[gt];w.replacer&&(Ct=w.replacer.call(J,gt,Ct)),H(w,I,gt,!1,!1)&&(w.dump.length>1024&&(at+="? "),at+=w.dump+(w.condenseFlow?'"':"")+":"+(w.condenseFlow?"":" "),H(w,I,Ct,!1,!1)&&(at+=w.dump,G+=at))}w.tag=j,w.dump="{"+G+"}"}p(hr,"writeFlowMapping");function g(w,I,J,G){let j="";const K=w.tag,Q=Object.keys(J);if(w.sortKeys===!0)Q.sort();else if(typeof w.sortKeys=="function")Q.sort(w.sortKeys);else if(w.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let ht=0,at=Q.length;ht<at;ht+=1){let gt="";(!G||j!=="")&&(gt+=Tt(w,I));const Ct=Q[ht];let Ot=J[Ct];if(w.replacer&&(Ot=w.replacer.call(J,Ct,Ot)),!H(w,I+1,Ct,!0,!0,!0))continue;const qt=w.tag!==null&&w.tag!=="?"||w.dump&&w.dump.length>1024;qt&&(w.dump&&n===w.dump.charCodeAt(0)?gt+="?":gt+="? "),gt+=w.dump,qt&&(gt+=Tt(w,I)),H(w,I+1,Ot,!0,qt)&&(w.dump&&n===w.dump.charCodeAt(0)?gt+=":":gt+=": ",gt+=w.dump,j+=gt)}w.tag=K,w.dump=j||"{}"}p(g,"writeBlockMapping");function $(w,I,J){const G=J?w.explicitTypes:w.implicitTypes;for(let j=0,K=G.length;j<K;j+=1){const Q=G[j];if((Q.instanceOf||Q.predicate)&&(!Q.instanceOf||typeof I=="object"&&I instanceof Q.instanceOf)&&(!Q.predicate||Q.predicate(I))){if(J?Q.multi&&Q.representName?w.tag=Q.representName(I):w.tag=Q.tag:w.tag="?",Q.represent){const ht=w.styleMap[Q.tag]||Q.defaultStyle;let at;if(i.call(Q.represent)==="[object Function]")at=Q.represent(I,ht);else if(s.call(Q.represent,ht))at=Q.represent[ht](I,ht);else throw new t("!<"+Q.tag+'> tag resolver accepts not "'+ht+'" style');w.dump=at}return!0}}return!1}p($,"detectType");function H(w,I,J,G,j,K,Q){w.tag=null,w.dump=J,$(w,J,!1)||$(w,J,!0);const ht=i.call(w.dump),at=G;G&&(G=w.flowLevel<0||w.flowLevel>I);const gt=ht==="[object Object]"||ht==="[object Array]";let Ct,Ot;if(gt&&(Ct=w.duplicates.indexOf(J),Ot=Ct!==-1),(w.tag!==null&&w.tag!=="?"||Ot||w.indent!==2&&I>0)&&(j=!1),Ot&&w.usedDuplicates[Ct])w.dump="*ref_"+Ct;else{if(gt&&Ot&&!w.usedDuplicates[Ct]&&(w.usedDuplicates[Ct]=!0),ht==="[object Object]")G&&Object.keys(w.dump).length!==0?(g(w,I,w.dump,j),Ot&&(w.dump="&ref_"+Ct+w.dump)):(hr(w,I,w.dump),Ot&&(w.dump="&ref_"+Ct+" "+w.dump));else if(ht==="[object Array]")G&&w.dump.length!==0?(w.noArrayIndent&&!Q&&I>0?lr(w,I-1,w.dump,j):lr(w,I,w.dump,j),Ot&&(w.dump="&ref_"+Ct+w.dump)):(nr(w,I,w.dump),Ot&&(w.dump="&ref_"+Ct+" "+w.dump));else if(ht==="[object String]")w.tag!=="?"&&ar(w,w.dump,I,K,at);else{if(ht==="[object Undefined]")return!1;if(w.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+ht)}if(w.tag!==null&&w.tag!=="?"){let qt=encodeURI(w.tag[0]==="!"?w.tag.slice(1):w.tag).replace(/!/g,"%21");w.tag[0]==="!"?qt="!"+qt:qt.slice(0,18)==="tag:yaml.org,2002:"?qt="!!"+qt.slice(18):qt="!<"+qt+">",w.dump=qt+" "+w.dump}}return!0}p(H,"writeNode");function X(w,I){const J=[],G=[];z(w,J,G);const j=G.length;for(let K=0;K<j;K+=1)I.duplicates.push(J[G[K]]);I.usedDuplicates=new Array(j)}p(X,"getDuplicateReferences");function z(w,I,J){if(w!==null&&typeof w=="object"){const G=I.indexOf(w);if(G!==-1)J.indexOf(G)===-1&&J.push(G);else if(I.push(w),Array.isArray(w))for(let j=0,K=w.length;j<K;j+=1)z(w[j],I,J);else{const j=Object.keys(w);for(let K=0,Q=j.length;K<Q;K+=1)z(w[j[K]],I,J)}}}p(z,"inspectNode");function et(w,I){I=I||{};const J=new pt(I);J.noRefs||X(w,J);let G=w;return J.replacer&&(G=J.replacer.call({"":G},"",G)),H(J,0,G,!0,!0)?J.dump+`
|
||||
`:""}return p(et,"dump2"),wn.dump=et,wn}p(vy,"requireDumper");var Id;function By(){if(Id)return he;Id=1;const e=_y(),t=vy();function r(i,s){return function(){throw new Error("Function yaml."+i+" is removed in js-yaml 4. Use yaml."+s+" instead, which is now safe by default.")}}return p(r,"renamed"),he.Type=pe(),he.Schema=wh(),he.FAILSAFE_SCHEMA=vh(),he.JSON_SCHEMA=Eh(),he.CORE_SCHEMA=Mh(),he.DEFAULT_SCHEMA=ka(),he.load=e.load,he.loadAll=e.loadAll,he.dump=t.dump,he.YAMLException=Ji(),he.types={binary:Dh(),float:Ah(),map:_h(),null:Bh(),pairs:Ph(),set:Rh(),timestamp:$h(),bool:Lh(),int:Fh(),merge:Oh(),omap:Ih(),seq:Sh(),str:Th()},he.safeLoad=r("safeLoad","load"),he.safeLoadAll=r("safeLoadAll","loadAll"),he.safeDump=r("safeDump","dump"),he}p(By,"requireJsYaml");var eF=By(),rF=Ty(eF),{Type:y5,Schema:x5,FAILSAFE_SCHEMA:C5,JSON_SCHEMA:iF,CORE_SCHEMA:b5,DEFAULT_SCHEMA:k5,load:sF,loadAll:w5,dump:T5,YAMLException:S5,types:_5,safeLoad:v5,safeLoadAll:B5,safeDump:L5}=rF,oF={common:Ws,getConfig:Ut,insertCluster:Mm,insertEdge:Dm,insertEdgeLabel:hh,insertMarkers:Rm,insertNode:lh,interpolateToCurve:Nl,labelHelper:mt,log:P,positionEdgeLabel:$S},Ps={},Ly=p(e=>{for(const t of e)Ps[t.name]=t},"registerLayoutLoaders"),aF=p(()=>{Ly([{name:"dagre",loader:p(async()=>await At(()=>import("./dagre-GXQ25YYZ.js"),__vite__mapDeps([3,4,1,2])),"loader")},{name:"swimlane",loader:p(async()=>await At(()=>import("./swimlanes-42K2YHIH.js"),__vite__mapDeps([5,1,2])),"loader")},{name:"cose-bilkent",loader:p(async()=>await At(()=>import("./cose-bilkent-JH36ORCC.js"),__vite__mapDeps([6,7,1,2])),"loader")}])},"registerDefaultLayoutLoaders");aF();var F5=p(async(e,t)=>{if(!(e.layoutAlgorithm in Ps))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const h of e.nodes){const u=h.domId||h.id;h.domId=`${e.diagramId}-${u}`}const r=Ps[e.layoutAlgorithm],i=await r.loader(),{theme:s,themeVariables:o}=e.config,{useGradient:a,gradientStart:n,gradientStop:l}=o,c=t.attr("id");if(t.append("defs").append("filter").attr("id",`${c}-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",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${c}-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",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),a){const h=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");h.append("svg:stop").attr("offset","0%").attr("stop-color",n).attr("stop-opacity",1),h.append("svg:stop").attr("offset","100%").attr("stop-color",l).attr("stop-opacity",1)}return i.render(e,t,oF,{algorithm:r.algorithm})},"render"),A5=p((e="",{fallback:t="dagre"}={})=>{if(e in Ps)return e;if(t in Ps)return P.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),Nh="comm",Fy="rule",Ay="decl",nF="@media",lF="@import",hF="@supports",cF="@namespace",hl="@keyframes",Ey="@layer",uF="@scope",dF=Math.abs,Bs=String.fromCharCode;function My(e){return e.trim()}function cl(e,t,r){return e.replace(t,r)}function vi(e,t){return e.charCodeAt(t)|0}function Gi(e,t,r){return e.slice(t,r)}function Ve(e){return e.length}function $y(e){return e.length}function fo(e,t){return t.push(e),e}var wa=1,Xi=1,Oy=0,Oe=0,Kt=0,ts="";function qh(e,t,r,i,s,o,a,n){return{value:e,root:t,parent:r,type:i,props:s,children:o,line:wa,column:Xi,length:a,return:"",siblings:n}}function fF(){return Kt}function pF(){return Kt=Oe>0?vi(ts,--Oe):0,Xi--,Kt===10&&(Xi=1,wa--),Kt}function We(){return Kt=Oe<Oy?vi(ts,Oe++):0,Xi++,Kt===10&&(Xi=1,wa++),Kt}function Mr(){return vi(ts,Oe)}function _o(){return Oe}function Ta(e,t){return Gi(ts,e,t)}function Rs(e){switch(e){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 gF(e){return wa=Xi=1,Oy=Ve(ts=e),Oe=0,[]}function mF(e){return ts="",e}function Tn(e){return My(Ta(Oe-1,ul(e===91?e+2:e===40?e+1:e)))}function yF(e){for(;(Kt=Mr())&&Kt<33;)We();return Rs(e)>2||Rs(Kt)>3?"":" "}function xF(e,t){for(;--t&&We()&&!(Kt<48||Kt>102||Kt>57&&Kt<65||Kt>70&&Kt<97););return Ta(e,_o()+(t<6&&Mr()==32&&We()==32))}function ul(e){for(;We();)switch(Kt){case e:return Oe;case 34:case 39:e!==34&&e!==39&&ul(Kt);break;case 40:e===41&&ul(e);break;case 92:We();break}return Oe}function CF(e,t){for(;We()&&e+Kt!==57;)if(e+Kt===84&&Mr()===47)break;return"/*"+Ta(t,Oe-1)+"*"+Bs(e===47?e:We())}function bF(e){for(;!Rs(Mr());)We();return Ta(e,Oe)}function kF(e)
Line truncated
|
||||
`);const i=l2(t),s=i.append("g");i.attr("viewBox","0 0 2412 512"),uf(i,100,512,!0),s.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"),s.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"),s.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"),s.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"),s.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"),s.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"),s.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"),s.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"),Jy={draw:WA},zA=Jy,HA={db:{},renderer:Jy,parser:{parse:p(()=>{},"parse")}},YA=HA,t0="flowchart-elk",UA=p((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),jA=p(async()=>{const{diagram:e}=await At(async()=>{const{diagram:t}=await import("./flowDiagram-HODETNUW.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([10,11,12,13,9,14]));return{id:t0,diagram:e}},"loader"),GA={id:t0,detector:UA,loader:jA},XA=GA,e0="timeline",VA=p(e=>/^\s*timeline/.test(e),"detector"),ZA=p(async()=>{const{diagram:e}=await At(async()=>{const{diagram:t}=await import("./timeline-definition-24CTP7MA.js");return{diagram:t}},__vite__mapDeps([40,27,1,2]));return{id:e0,diagram:e}},"loader"),KA={id:e0,detector:VA,loader:ZA},QA=KA,r0="mindmap",JA=p(e=>/^\s*mindmap/.test(e),"detector"),tE=p(async()=>{const{diagram:e}=await At(async()=>{const{diagram:t}=await import("./mindmap-definition-YA3MSWOX.js");return{diagram:t}},__vite__mapDeps([41,12,13,1,2]));return{id:r0,diagram:e}},"loader"),eE={id:r0,detector:JA,loader:tE},rE=eE,i0="kanban",iE=p(e=>/^\s*kanban/.test(e),"detector"),sE=p(async()=>{const{diagram:e}=await At(async()=>{const{diagram:t}=await import("./kanban-definition-UXKFOSKX.js");return{diagram:t}},__vite__mapDeps([42,11,1,2]));return{id:i0,diagram:e}},"loader"),oE={id:i0,detector:iE,loader:sE},aE=oE,s0="sankey",nE=p(e=>/^\s*sankey(-beta)?/.test(e),"detector"),lE=p(async()=>{const{diagram:e}=await At(async()=>{const{diagram:t}=await import("./sankeyDiagram-P5KCCOFB.js");return{diagram:t}},__vite__mapDeps([43,28,23,1,2]));return{id:s0,diagram:e}},"loader"),hE={id:s0,detector:nE,loader:lE},cE=hE,o0="packet",uE=p(e=>/^\s*packet(-beta)?/.test(e),"detector"),dE=p(async()=>{const{diagram:e}=await At(async()=>{const{diagram:t}=await import("./diagram-Z3DM3KII.js");return{diagram:t}},__vite__mapDeps([44,19,20,1,2]));return{id:o0,diagram:e}},"loader"),fE={id:o0,detector:uE,loader:dE},a0="radar",pE=p(e=>/^\s*radar-beta/.test(e),"detector"),gE=p(async()=>{const{diagram:e}=await At(async()=>{const{diagram:t}=await import("./diagram-UQ7AKVKN.js");return{diagram:t}},__vite__mapDeps([45,19,20,1,2]));return{id:a0,diagram:e}},"loader"),mE={id:a0,detector:pE,loader:gE},n0="block",yE=p(e=>/^\s*block(-beta)?/.test(e),"detector"),xE=p(async()=>{const{diagram:e}=await At(async()=>{const{diagram:t}=await import("./blockDiagram-I7D4REHJ.js");return{diagram:t}},__vite__mapDeps([46,11,14,1,2]));return{id:n0,diagram:e}},"loader"),CE={id:n0,detector:yE,loader:xE},bE=CE,l0="treeView",kE=p(e=>/^\s*treeView-beta/.test(e),"detector"),wE=p(async()=>{const{diagram:e}=await At(async()=>{const{diagram:t}=await import("./diagram-S7CK7UJ4.js");return{diagram:t}},__vite__mapDeps([47,18,19,20,1,2]));return{id:l0,diagram:e}},"loader"),TE={id:l0,detector:kE,loader:wE},SE=TE,h0="architecture",_E=p(e=>/^
Line truncated
|
||||
`;try{Mn(s)}catch{const c=rC(s);if(!c)throw new of(`Diagram ${s} not found.`);const{id:h,diagram:u}=await c();Eo(h,u)}const{db:o,parser:a,renderer:n,init:l}=Mn(s);return a.parser&&(a.parser.yy=o),o.clear?.(),l?.(i),r.title&&o.setDiagramTitle?.(r.title),await a.parse(t),new Zr(s,t,o,a,n)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},p(Zr,"Diagram"),Zr),qd=[],cM=p(()=>{qd.forEach(e=>{e()}),qd=[]},"attachFunctions"),uM=p(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function w0(e){const t=e.match(sf);if(!t)return{text:e,metadata:{}};const r=t[1],i=r?t[2].split(`
|
||||
`).map(a=>a.startsWith(r)?a.slice(r.length):a).join(`
|
||||
`):t[2];let s=sF(i,{schema:iF})??{};s=typeof s=="object"&&!Array.isArray(s)?s:{};const o={};return s.displayMode&&(o.displayMode=s.displayMode.toString()),s.title&&(o.title=s.title.toString()),s.config&&(o.config=s.config),{text:e.slice(t[0].length),metadata:o}}p(w0,"extractFrontMatter");var dM=p(e=>e.replace(/\r\n?/g,`
|
||||
`).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),fM=p(e=>{const{text:t,metadata:r}=w0(e),{displayMode:i,title:s,config:o={}}=r;return i&&(o.gantt||(o.gantt={}),o.gantt.displayMode=i),{title:s,config:o,text:t}},"processFrontmatter"),pM=p(e=>{const t=de.detectInit(e)??{},r=de.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:yw(e),directive:t}},"processDirectives");function Wh(e){const t=dM(e),r=fM(t),i=pM(r.text),s=Yl(r.config,i.directive);return e=uM(i.text),{code:e,title:r.title,config:s}}p(Wh,"preprocessDiagram");function T0(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}p(T0,"toBase64");var gM=5e4,mM="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",yM="sandbox",xM="loose",CM="http://www.w3.org/2000/svg",bM="http://www.w3.org/1999/xlink",kM="http://www.w3.org/1999/xhtml",wM="100%",TM="100%",SM="border:0;margin:0;",_M="margin:0",vM="allow-top-navigation-by-user-activation allow-popups",BM='The "iframe" tag is not supported by your browser.',LM=["foreignobject"],FM=["dominant-baseline"];function zh(e){const t=Wh(e);return Fo(),Qx(t.config??{}),t}p(zh,"processAndSetConfigs");async function S0(e,t){Sa();try{const{code:r,config:i}=zh(e);return{diagramType:(await v0(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}}p(S0,"parse");var Wd=p((e,t,r=[])=>{const i=Qd(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${i}`},"cssImportantStyles"),AM=p((e,t=new Map)=>{const r=new CSSStyleSheet;if(e.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,r.cssRules.length),e.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,r.cssRules.length),t instanceof Map){const n=fe(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(l=>{Zc(l.styles)||n.forEach(c=>{r.insertRule(Wd(l.id,c,l.styles),r.cssRules.length)}),Zc(l.textStyles)||r.insertRule(Wd(l.id,"tspan",(l?.textStyles||[]).map(c=>c.replace("color","fill"))),r.cssRules.length)})}let i="";if(e.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const s=new CSSStyleSheet;s.replaceSync(e.themeCSS),i=En(s)+`
|
||||
`}else i+=`${e.themeCSS}
|
||||
`;return i+En(r)},"createCssStyles"),EM=p((e,t)=>dl(kF(`${e}{${t}}`),SF([p(function(i,s,o,a){if(i.type==="rule"&&Array.isArray(i.props)){if(i.parent&&i.parent.type===hl)return;i.props=i.props.map(n=>n===e&&Array.isArray(i.children)&&i.children.every(c=>c.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(c.props))||(n.startsWith(`${e} `)||n.startsWith(`${e}>`))&&!n.startsWith(`${e} ||`)?n:`${e} ${n}`)}else i.type.startsWith("@")&&([...[nF,hF,Ey,uF,"@container","@starting-style"],hl].includes(i.type)||(P.warn(`Removing unsupported at-rule ${i.type} from CSS`),i.type=Nh))},"addNamespace"),TF])),"compileCSS"),MM=p((e,t,r,i)=>{const s=AM(e,r),o=bC(t,s,{...e.themeVariables,theme:e.theme,look:e.look},i);return EM(i,o)},"createUserStyles"),$M=p((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=Dr(i),i=i.replace(/<br>/g,"<br/>"),i},"cleanUpSvgCode"),OM=p((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":TM,i=T0(`<body style="${_M}">${e}</body>`);return`<iframe style="width:${wM};height:${r};${SM}" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="${vM}">
|
||||
${BM}
|
||||
</iframe>`},"putIntoIFrame"),zd=p((e,t,r,i,s)=>{const o=e.append("div");o.attr("id",r),i&&o.attr("style",i);const a=o.append("svg").attr("id",t).attr("width","100%").attr("xmlns",CM);return s&&a.attr("xmlns:xlink",s),a.append("g"),e},"appendDivSvgG");function pl(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}p(pl,"sandboxedIframe");var DM=p((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),IM=p(async function(e,t,r){Sa();const i=zh(t);t=i.code;const s=Ut();P.debug(s),t.length>(s?.maxTextSize??gM)&&(t=mM);const o=`#${e}`,a="i"+e,n="#"+a,l="d"+e,c="#"+l,h=p(()=>{const E=Ft(d?n:c).node();E&&"remove"in E&&E.remove()},"removeTempElements");let u=Ft(document.body);const d=s.securityLevel===yM,f=s.securityLevel===xM,m=s.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),d){const U=pl(Ft(r),a);u=Ft(U.nodes()[0].contentDocument.body),u.node().style.margin="0"}else u=Ft(r);zd(u,e,l,`font-family: ${m}`,bM)}else{if(DM(document,e,l,a),d){const U=pl(Ft(document.body),a);u=Ft(U.nodes()[0].contentDocument.body),u.node().style.margin="0"}else u=Ft("body");zd(u,e,l)}let y,x;try{y=await fl.fromText(t,{title:i.title})}catch(U){if(s.suppressErrorRendering)throw h(),U;y=await fl.fromText("error"),x=U}const C=u.select(c).node(),k=y.type,T=C.firstChild,S=T.firstChild,_=y.renderer.getClasses?.(t,y),L=MM(s,k,_,o),A=document.createElement("style");A.innerHTML=L,T.insertBefore(A,S);try{await y.renderer.draw(t,e,"11.17.2",y)}catch(U){throw s.suppressErrorRendering?h():zA.draw(t,e,"11.17.2"),U}const F=u.select(`${c} svg`),V=y.db.getAccTitle?.(),Y=y.db.getAccDescription?.();B0(k,F,V,Y);const it=p(()=>{u.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",kM);let U=u.select(c).node().innerHTML;if(P.debug("config.arrowMarkerAbsolute",s.arrowMarkerAbsolute),U=$M(U,d,ir(s.arrowMarkerAbsolute)),d){const E=u.select(c+" svg").node();U=OM(U,E)}else f||(U=zi.sanitize(U,{ADD_TAGS:LM,ADD_ATTR:FM,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return cM(),U},"serializeSvg")();if(x)throw x;return h(),{diagramType:k,svg:it,bindFunctions:y.db.bindFunctions}},"render");function _0(e={}){const t=ie({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),Zx(t),t?.theme&&t.theme in yr?t.themeVariables=yr[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=yr.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?Vx(t):Jd();ml(r.logLevel),Sa()}p(_0,"initialize");var v0=p((e,t={})=>{const{code:r}=Wh(e);return fl.fromText(r,t)},"getDiagramFromText");function B0(e,t,r,i){b0(t,e),k0(t,r,i,t.attr("id"))}p(B0,"addA11yInfo");var si=Object.freeze({render:IM,parse:S0,getDiagramFromText:v0,initialize:_0,getConfig:Ut,setConfig:tf,getSiteConfig:Jd,updateSiteConfig:Kx,reset:p(()=>{Fo()},"reset"),globalReset:p(()=>{Fo(Hi)},"globalReset"),defaultConfig:Hi});ml(Ut().logLevel);Fo(Ut());var PM=p((e,t,r)=>{P.warn(e),Hl(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),L0=p(async function(e={querySelector:".mermaid"}){try{await RM(e)}catch(t){if(Hl(t)&&P.error(t.str),kr.parseError&&kr.parseError(t),!e.suppressErrors)throw P.error("Use the suppressErrors option to suppress these errors"),t}},"run"),RM=p(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=si.getConfig();P.debug(`${e?"":"No "}Callback function found`);let s;if(r)s=r;else if(t)s=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");P.debug(`Found ${s.length} diagrams`),i?.startOnLoad!==void 0&&(P.debug("Start On Load: "+i?.startOnLoad),si.updateSiteConfig({startOnLoad:i?.startOnLoad}));const o=new de.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const n=[];for(const l of Array.from(s)){if(P.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${o.next()}`;a=l.innerHTML,a=Rp(de.entityDecode(a)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=de.detectInit(a);h&&P.debug("Detected early reinit: ",h);try{const{svg:u,bindFunctions:d}=await M0(c,a,l);l.innerHTML=u,e&&await e(c),d&&d(l)}catch(u){PM(u,n,kr.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),F0=p(function(e){si.initialize(e)},"initialize"),NM=p(async function(e,t,r){P.warn("mermaid.init is deprecated. Please use run instead."),e&&F0(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await L0(i)},"init"),qM=p(async(e,{lazyLoad:t=!0}={})=>{Sa(),Ln(...e),t===!1&&await lM()},"registerExternalDiagrams"),A0=p(function(){if(kr.startOnLoad){const{startOnLoad:e}=si.getConfig();e&&kr.run().catch(t=>P.error("MermaiLine truncated
|
||||
@@ -0,0 +1,96 @@
|
||||
import{g as ae}from"./chunk-XXDRQBXY.js";import{s as ce}from"./chunk-POPQ4Y6H.js";import{_ as h,l as I,u as le,v as he,y as de,B as j,c as P,i as G,b4 as ge,V as ue,W as pe,X as fe}from"./mermaid.core.js";import"./index.js";const _=[];for(let t=0;t<256;++t)_.push((t+256).toString(16).slice(1));function me(t,e=0){return(_[t[e+0]]+_[t[e+1]]+_[t[e+2]]+_[t[e+3]]+"-"+_[t[e+4]]+_[t[e+5]]+"-"+_[t[e+6]]+_[t[e+7]]+"-"+_[t[e+8]]+_[t[e+9]]+"-"+_[t[e+10]]+_[t[e+11]]+_[t[e+12]]+_[t[e+13]]+_[t[e+14]]+_[t[e+15]]).toLowerCase()}const ye=new Uint8Array(16);function Ee(){return crypto.getRandomValues(ye)}function _e(t,e,a){return crypto.randomUUID?crypto.randomUUID():be(t)}function be(t,e,a){t=t||{};const l=t.random??t.rng?.()??Ee();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,me(l)}var q=(function(){var t=h(function(L,s,i,o){for(i=i||{},o=L.length;o--;i[L[o]]=s);return i},"o"),e=[1,4],a=[1,13],l=[1,12],n=[1,15],d=[1,16],f=[1,20],y=[1,19],E=[6,7,8],b=[1,26],v=[1,24],R=[1,25],g=[6,7,11],A=[1,6,13,15,16,19,22],J=[1,33],K=[1,34],$=[1,6,7,11,13,15,16,19,22],H={trace:h(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:h(function(s,i,o,c,p,r,B){var u=r.length-1;switch(p){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[u].id),c.addNode(r[u-1].length,r[u].id,r[u].descr,r[u].type);break;case 16:c.getLogger().trace("Icon: ",r[u]),c.decorateNode({icon:r[u]});break;case 17:case 21:c.decorateNode({class:r[u]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[u].id),c.addNode(0,r[u].id,r[u].descr,r[u].type);break;case 20:c.decorateNode({icon:r[u]});break;case 25:c.getLogger().trace("node found ..",r[u-2]),this.$={id:r[u-1],descr:r[u-1],type:c.getType(r[u-2],r[u])};break;case 26:this.$={id:r[u],descr:r[u],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[u-3]),this.$={id:r[u-3],descr:r[u-1],type:c.getType(r[u-2],r[u])};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:a,7:[1,10],9:9,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:f,22:y},t(E,[2,3]),{1:[2,2]},t(E,[2,4]),t(E,[2,5]),{1:[2,6],6:a,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:f,22:y},{6:a,9:22,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:f,22:y},{6:b,7:v,10:23,11:R},t(g,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:f,22:y}),t(g,[2,18]),t(g,[2,19]),t(g,[2,20]),t(g,[2,21]),t(g,[2,23]),t(g,[2,24]),t(g,[2,26],{19:[1,30]}),{20:[1,31]},{6:b,7:v,10:32,11:R},{1:[2,7],6:a,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:f,22:y},t(A,[2,14],{7:J,11:K}),t($,[2,8]),t($,[2,9]),t($,[2,10]),t(g,[2,15]),t(g,[2,16]),t(g,[2,17]),{20:[1,35]},{21:[1,36]},t(A,[2,13],{7:J,11:K}),t($,[2,11]),t($,[2,12]),{21:[1,37]},t(g,[2,25]),t(g,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:h(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:h(function(s){var i=this,o=[0],c=[],p=[null],r=[],B=this.table,u="",U=0,Q=0,ie=2,Z=1,se=r.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var W in this.yy)Object.prototype.hasOwnProperty.call(this.yy,W)&&(T.yy[W]=this.yy[W]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var X=m.yylloc;r.push(X);var re=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function oe(S){o.length=o.length-2*S,p.length=p.length-S,r.length=r.length-S}h(oe,"popStack");function ee(){var S;return S=c.pop()||m.lex()||Z,typeof S!="number"&&(S instanceof Array&&(c=S,S=c.pop()),S=i.symbols_[S]||S),S}h(ee,"lex");for(var k,O,x,z,C={},V,N,te,F;;){if(O=o[o.length-1],this.defaultActions[O]?x=this.defaultActions[O]:((k===null||typeof k>"u")&&(k=ee()),x=B[O]&&B[O][k]),typeof x>"u"||!x.length||!x[0]){var Y="";F=[];for(V in B[O])this.terminals_[V]&&V>ie&&F.push("'"+this.terminals_[V]+"'");m.showPosition?Y="Parse error on line "+(U+1)+`:
|
||||
`+m.showPosition()+`
|
||||
Expecting `+F.join(", ")+", got '"+(this.terminals_[k]||k)+"'":Y="Parse error on line "+(U+1)+": Unexpected "+(k==Z?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(Y,{text:m.match,token:this.terminals_[k]||k,line:m.yylineno,loc:X,expected:F})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+k);switch(x[0]){case 1:o.push(k),p.push(m.yytext),r.push(m.yylloc),o.push(x[1]),k=null,Q=m.yyleng,u=m.yytext,U=m.yylineno,X=m.yylloc;break;case 2:if(N=this.productions_[x[1]][1],C.$=p[p.length-N],C._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},re&&(C._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),z=this.performAction.apply(C,[u,Q,U,T.yy,x[1],p,r].concat(se)),typeof z<"u")return z;N&&(o=o.slice(0,-1*N*2),p=p.slice(0,-1*N),r=r.slice(0,-1*N)),o.push(this.productions_[x[1]][0]),p.push(C.$),r.push(C._$),te=B[o[o.length-2]][o[o.length-1]],o.push(te);break;case 3:return!0}}return!0},"parse")},ne=(function(){var L={EOF:1,parseError:h(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},"parseError"),setInput:h(function(s,i){return this.yy=i||this.yy||{},this._input=s,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:h(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.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),s},"input"),unput:h(function(s){var i=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;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),o.length-1&&(this.yylineno-=o.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:o?(o.length===c.length?this.yylloc.first_column:0)+c[c.length-o.length].length-o[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(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:h(function(s){this.unput(this.match.slice(s))},"less"),pastInput:h(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:h(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:h(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
||||
`+i+"^"},"showPosition"),test_match:h(function(s,i){var o,c,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))),c=s[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+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,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(s[0].length),this.matched+=s[0],o=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var r in p)this[r]=p[r];return!1}return!1},"test_match"),next:h(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,i,o,c;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),r=0;r<p.length;r++)if(o=this._input.match(this.rules[p[r]]),o&&(!i||o[0].length>i[0].length)){if(i=o,c=r,this.options.backtrack_lexer){if(s=this.test_match(o,p[r]),s!==!1)return s;if(this._backtrack){i=!1;continue}else return!1}else if(!this.options.flex)break}return i?(s=this.test_match(i,p[c]),s!==!1?s:!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:h(function(){var i=this.next();return i||this.lex()},"lex"),begin:h(function(i){this.conditionStack.push(i)},"begin"),popState:h(function(){var i=this.conditionStack.length-1;return i>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:h(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:h(function(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},"topState"),pushState:h(function(i){this.begin(i)},"pushState"),stateStackSize:h(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:h(function(i,o,c,p){switch(c){case 0:return i.getLogger().trace("Found comment",o.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:i.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return i.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:i.getLogger().trace("end icon"),this.popState();break;case 10:return i.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return i.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return i.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return i.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:i.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return i.getLogger().trace("description:",o.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),i.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),i.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),i.getLogger().trace("node end ...",o.yytext),"NODE_DEND";case 30:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 35:return i.getLogger().trace("Long description:",o.yytext),20;case 36:return i.getLogger().trace("Long description:",o.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 L})();H.lexer=ne;function M(){this.yy={}}return h(M,"Parser"),M.prototype=H,H.Parser=M,new M})();q.parser=q;var ke=q,Se=12,D={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},w,xe=(w=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=D,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 a=this.nodes.length-1;a>=0;a--)if(this.nodes[a].level<e)return this.nodes[a];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(e,a,l,n){I.info("addNode",e,a,l,n);let d=!1;this.nodes.length===0?(this.baseLevel=e,e=0,d=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,d=!1);const f=P();let y=f.mindmap?.padding??j.mindmap.padding;switch(n){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:y*=2;break}const E={id:this.count++,nodeId:G(a,f),level:e,descr:G(l,f),type:n,children:[],width:f.mindmap?.maxNodeWidth??j.mindmap.maxNodeWidth,padding:y,isRoot:d},b=this.getParent(e);if(b)b.children.push(E),this.nodes.pushLine truncated
|
||||
`+t);const n=l.db,d=n.getData(),f=ae(e,d.config.securityLevel);if(d.type=l.type,d.layoutAlgorithm=le(d.config.layout,{fallback:"cose-bilkent"}),d.diagramId=e,!n.getMindmap())return;d.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 he(d,f);const{themeVariables:E}=de(),{useGradient:b,gradientStart:v,gradientStop:R}=E;if(b&&v&&R){const g=f.attr("id"),A=f.append("defs").append("linearGradient").attr("id",`${g}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");A.append("stop").attr("offset","0%").attr("stop-color",v).attr("stop-opacity",1),A.append("stop").attr("offset","100%").attr("stop-color",R).attr("stop-opacity",1)}ce(f,d.config.mindmap?.padding??j.mindmap.padding,"mindmapDiagram",d.config.mindmap?.useMaxWidth??j.mindmap.useMaxWidth)},"draw"),De={draw:Ne},Le=h(t=>{const{theme:e,look:a}=t;let l="";for(let n=0;n<t.THEME_COLOR_LIMIT;n++)t["lineColor"+n]=t["lineColor"+n]||t["cScaleInv"+n],ue(t["lineColor"+n])?t["lineColor"+n]=pe(t["lineColor"+n],20):t["lineColor"+n]=fe(t["lineColor"+n],20);for(let n=0;n<t.THEME_COLOR_LIMIT;n++){const d=""+(a==="neo"?Math.max(10-(n-1)*2,2):17-3*n);l+=`
|
||||
.section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} polygon, .section-${n-1} path {
|
||||
fill: ${t["cScale"+n]};
|
||||
}
|
||||
.section-${n-1} text {
|
||||
fill: ${t["cScaleLabel"+n]};
|
||||
}
|
||||
.section-${n-1} span {
|
||||
color: ${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: ${d};
|
||||
}
|
||||
.section-${n-1} line {
|
||||
stroke: ${t["cScaleInv"+n]} ;
|
||||
stroke-width: 3;
|
||||
}
|
||||
|
||||
.disabled, .disabled circle, .disabled text {
|
||||
fill: lightgray;
|
||||
}
|
||||
.disabled text {
|
||||
fill: #efefef;
|
||||
}
|
||||
[data-look="neo"].mindmap-node.section-${n-1} rect, [data-look="neo"].mindmap-node.section-${n-1} path, [data-look="neo"].mindmap-node.section-${n-1} circle, [data-look="neo"].mindmap-node.section-${n-1} polygon {
|
||||
fill: ${e==="redux"||e==="redux-dark"||e==="neutral"?t.mainBkg:t["cScale"+n]};
|
||||
stroke: ${e==="redux"||e==="redux-dark"?t.nodeBorder:t["cScale"+n]};
|
||||
stroke-width: ${t.strokeWidth??2}px;
|
||||
}
|
||||
[data-look="neo"].section-edge-${n-1}{
|
||||
stroke: ${e?.includes("redux")||e==="neo-dark"?t.nodeBorder:t["cScale"+n]};
|
||||
}
|
||||
[data-look="neo"].mindmap-node.section-${n-1} text {
|
||||
fill: ${e==="redux"||e==="redux-dark"?t.nodeBorder:t["cScaleLabel"+(e==="neutral"?1:n)]};
|
||||
}
|
||||
`}return l},"genSections"),ve=h((t,e,a)=>{let l="";for(let n=0;n<t;n++)l+=`
|
||||
[data-look="neo"].mindmap-node.section-${n-1} rect, [data-look="neo"].mindmap-node.section-${n-1} path, [data-look="neo"].mindmap-node.section-${n-1} circle, [data-look="neo"].mindmap-node.section-${n-1} polygon {
|
||||
stroke: url(${e}-gradient);
|
||||
fill: ${a};
|
||||
}
|
||||
.section-${n-1} line {
|
||||
stroke-width: 0;
|
||||
}`;return l},"genGradient"),Te=h(t=>{const{theme:e}=t,a=t.svgId,l=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${a}-drop-shadow)`):"none";return`
|
||||
.edge {
|
||||
stroke-width: 3;
|
||||
}
|
||||
${Le(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?.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: ${l};
|
||||
}
|
||||
[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?.includes("redux")?t.mainBkg:t.git0};
|
||||
}
|
||||
[data-look="neo"].mindmap-node.section-root .text-inner-tspan {
|
||||
fill: ${e?.includes("redux")?t.nodeBorder:t["cScaleLabel"+(e==="neutral"?1:0)]};
|
||||
}
|
||||
${t.useGradient&&a&&t.mainBkg?ve(t.THEME_COLOR_LIMIT,a,t.mainBkg):""}
|
||||
`},"getStyles"),Oe=Te,Ae={get db(){return new xe},renderer:De,parser:ke,styles:Oe};export{Ae as diagram};
|
||||
@@ -0,0 +1 @@
|
||||
import{i as a}from"./init.js";class o extends Map{constructor(n,t=g){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),n!=null)for(const[r,s]of n)this.set(r,s)}get(n){return super.get(c(this,n))}has(n){return super.has(c(this,n))}set(n,t){return super.set(l(this,n),t)}delete(n){return super.delete(p(this,n))}}function c({_intern:e,_key:n},t){const r=n(t);return e.has(r)?e.get(r):t}function l({_intern:e,_key:n},t){const r=n(t);return e.has(r)?e.get(r):(e.set(r,t),t)}function p({_intern:e,_key:n},t){const r=n(t);return e.has(r)&&(t=e.get(r),e.delete(r)),t}function g(e){return e!==null&&typeof e=="object"?e.valueOf():e}const f=Symbol("implicit");function h(){var e=new o,n=[],t=[],r=f;function s(u){let i=e.get(u);if(i===void 0){if(r!==f)return r;e.set(u,i=n.push(u)-1)}return t[i%t.length]}return s.domain=function(u){if(!arguments.length)return n.slice();n=[],e=new o;for(const i of u)e.has(i)||e.set(i,n.push(i)-1);return s},s.range=function(u){return arguments.length?(t=Array.from(u),s):t.slice()},s.unknown=function(u){return arguments.length?(r=u,s):r},s.copy=function(){return h(n,t).unknown(r)},a.apply(s,arguments),s}export{h as o};
|
||||
@@ -0,0 +1 @@
|
||||
import{g as l,r as m,d as a}from"./chunk-SVP7TREG.js";import{p}from"./chunk-JWPE2WC7.js";import{_ as t,l as o}from"./mermaid.core.js";import{M as u,d as c}from"./cynefin-OW5HDTMX.js";import"./index.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(P);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),P=t(e=>{const r=g(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),g=t(e=>{const r=v(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),v=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),y=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(y(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},G={parser:b,db:a,renderer:m,styles:l};export{G as diagram};
|
||||
@@ -0,0 +1,39 @@
|
||||
import{p as at}from"./chunk-JWPE2WC7.js";import{a4 as T,a7 as B,b3 as rt,g as nt,s as it,a as ot,b as st,o as lt,n as ct,_ as g,l as G,c as ut,A as dt,D as gt,L as pt,d as ht,p as ft,B as mt}from"./mermaid.core.js";import{p as vt}from"./cynefin-OW5HDTMX.js";import{d as q}from"./arc.js";import{o as xt}from"./ordinal.js";import"./index.js";import"./init.js";function St(t,n){return n<t?-1:n>t?1:n>=t?0:NaN}function yt(t){return t}function wt(){var t=yt,n=St,y=null,b=T(0),l=T(B),p=T(0);function i(e){var r,s=(e=rt(e)).length,h,w,$=0,f=new Array(s),o=new Array(s),D=+b.apply(this,arguments),E=Math.min(B,Math.max(-B,l.apply(this,arguments)-D)),k,R=Math.min(Math.abs(E)/s,p.apply(this,arguments)),u=R*(E<0?-1:1),A;for(r=0;r<s;++r)(A=o[f[r]=r]=+t(e[r],r,e))>0&&($+=A);for(n!=null?f.sort(function(M,m){return n(o[M],o[m])}):y!=null&&f.sort(function(M,m){return y(e[M],e[m])}),r=0,w=$?(E-s*u)/$:0;r<s;++r,D=k)h=f[r],A=o[h],k=D+(A>0?A*w:0)+u,o[h]={data:e[h],index:r,value:A,startAngle:D,endAngle:k,padAngle:R};return o}return i.value=function(e){return arguments.length?(t=typeof e=="function"?e:T(+e),i):t},i.sortValues=function(e){return arguments.length?(n=e,y=null,i):n},i.sort=function(e){return arguments.length?(y=e,n=null,i):y},i.startAngle=function(e){return arguments.length?(b=typeof e=="function"?e:T(+e),i):b},i.endAngle=function(e){return arguments.length?(l=typeof e=="function"?e:T(+e),i):l},i.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:T(+e),i):p},i}var At=mt.pie,I={sections:new Map,showData:!1},F=I.sections,V=I.showData,Ct=structuredClone(At),$t=g(()=>structuredClone(Ct),"getConfig"),Dt=g(()=>{F=new Map,V=I.showData,ft()},"clear"),Tt=g(({label:t,value:n})=>{if(n<0)throw new Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);F.has(t)||(F.set(t,n),G.debug(`added new section: ${t}, with value: ${n}`))},"addSection"),bt=g(()=>F,"getSections"),kt=g(t=>{V=t},"setShowData"),zt=g(()=>V,"getShowData"),J={getConfig:$t,clear:Dt,setDiagramTitle:ct,getDiagramTitle:lt,setAccTitle:st,getAccTitle:ot,setAccDescription:it,getAccDescription:nt,addSection:Tt,getSections:bt,setShowData:kt,getShowData:zt},Et=g((t,n)=>{at(t,n),n.setShowData(t.showData),t.sections.map(n.addSection)},"populateDb"),Mt={parse:g(async t=>{const n=await vt("pie",t);G.debug(n),Et(n,J)},"parse")},Lt=g(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"),Rt=Lt,Wt=g(t=>{const n=[...t.values()].reduce((l,p)=>l+p,0),y=[...t.entries()].map(([l,p])=>({label:l,value:p})).filter(l=>l.value/n*100>=1);return wt().value(l=>l.value).sort(null)(y)},"createPieArcs"),_t=g((t,n,y,b)=>{G.debug(`rendering pie chart
|
||||
`+t);const l=b.db,p=ut(),i=dt(l.getConfig(),p.pie),e=40,r=18,s=4,h=450,w=h,$=gt(n),f=$.append("g");f.attr("transform","translate("+w/2+","+h/2+")");const{themeVariables:o}=p;let[D]=pt(o.pieOuterStrokeWidth);D??=2;const E=i.legendPosition,k=i.textPosition,R=i.donutHole>0&&i.donutHole<=.9?i.donutHole:0,u=Math.min(w,h)/2-e,A=q().innerRadius(R*u).outerRadius(u),M=q().innerRadius(u*k).outerRadius(u*k),m=f.append("g");m.append("circle").attr("cx",0).attr("cy",0).attr("r",u+D/2).attr("class","pieOuterCircle");const W=l.getSections(),K=Wt(W),Q=[o.pie1,o.pie2,o.pie3,o.pie4,o.pie5,o.pie6,o.pie7,o.pie8,o.pie9,o.pie10,o.pie11,o.pie12];let H=0;W.forEach(a=>{H+=a});const U=K.filter(a=>(a.data.value/H*100).toFixed(0)!=="0"),N=xt(Q).domain([...W.keys()]);m.selectAll("mySlices").data(U).enter().append("path").attr("d",A).attr("fill",a=>N(a.data.label)).attr("class",a=>{let c="pieCircle";return i.highlightSlice==="hover"?c+=" highlightedOnHover":i.highlightSlice===a.data.label&&(c+=" highlighted"),c}),m.selectAll("mySlices").data(U).enter().append("text").text(a=>(a.data.value/H*100).toFixed(0)+"%").attr("transform",a=>"translate("+M.centroid(a)+")").style("text-anchor","middle").attr("class","slice");const Y=f.append("text").text(l.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),L=[...W.entries()].map(([a,c])=>({label:a,value:c})),C=f.selectAll(".legend").data(L).enter().append("g").attr("class","legend");C.append("rect").attr("width",r).attr("height",r).style("fill",a=>N(a.label)).style("stroke",a=>N(a.label)),C.append("text").attr("x",r+s).attr("y",r-s).text(a=>l.getShowData()?`${a.label} [${a.value}]`:a.label);const z=Math.max(...C.selectAll("text").nodes().map(a=>a?.getBoundingClientRect().width??0));let _=h,O=w+e;const d=r+s,P=L.length*d;switch(E){case"center":C.attr("transform",(a,c)=>{const v=d*L.length/2,x=-z/2-(r+s),S=c*d-v;return"translate("+x+","+S+")"});break;case"top":_+=P,C.attr("transform",(a,c)=>{const v=u,x=-z/2-(r+s),S=c*d-v;return`translate(${x}, ${S})`}),m.attr("transform",()=>`translate(0, ${P+d})`);break;case"bottom":_+=P,C.attr("transform",(a,c)=>{const v=-u-d,x=-z/2-(r+s),S=c*d-v;return"translate("+x+","+S+")"});break;case"left":O+=r+s+z,C.attr("transform",(a,c)=>{const v=d*L.length/2,x=-u-(r+s),S=c*d-v;return"translate("+x+","+S+")"}),m.attr("transform",()=>`translate(${z+r+s}, 0)`);break;default:O+=r+s+z,C.attr("transform",(a,c)=>{const v=d*L.length/2,x=12*r,S=c*d-v;return"translate("+x+","+S+")"});break}const j=Y.node()?.getBoundingClientRect().width??0,tt=w/2-j/2,et=w/2+j/2,X=Math.min(0,tt),Z=Math.max(O,et)-X;$.attr("viewBox",`${X} 0 ${Z} ${_}`),ht($,_,Z,i.useMaxWidth)},"draw"),Ft={draw:_t},Ut={parser:Mt,db:J,renderer:Ft,styles:Rt};export{Ut as diagram};
|
||||
@@ -0,0 +1,7 @@
|
||||
import{s as Ae,g as ke,o as ae,n as Fe,a as Pe,b as ve,_ as o,c as zt,l as bt,j as Lt,d as Ce,p as Le,B as z,i as Ee,E as De}from"./mermaid.core.js";import{l as ie}from"./linear.js";import"./index.js";import"./init.js";import"./defaultLocale.js";var Et=(function(){var t=o(function(Y,r,l,x){for(l=l||{},x=Y.length;x--;l[Y[x]]=r);return l},"o"),n=[1,3],f=[1,4],d=[1,5],h=[1,6],p=[1,7],y=[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],_=[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],a=[55,56,57],k=[2,36],u=[1,37],T=[1,36],q=[1,38],m=[1,35],b=[1,43],g=[1,41],A=[1,45],ht=[1,14],xt=[1,23],ft=[1,18],gt=[1,19],ct=[1,20],_t=[1,21],dt=[1,22],i=[1,24],Vt=[1,25],It=[1,26],wt=[1,27],Bt=[1,28],Rt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],H=[1,63],X=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Nt=[1,66],Wt=[1,67],Ut=[1,68],Qt=[1,69],Ot=[1,70],Ht=[1,71],Xt=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],Kt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],K=[1,91],Z=[1,92],J=[1,93],$=[1,100],tt=[1,94],et=[1,97],it=[1,95],at=[1,96],nt=[1,98],st=[1,99],At=[1,103],Zt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],kt={trace:o(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:o(function(r,l,x,c,S,e,ut){var s=e.length-1;switch(S){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],c.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),c.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),c.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),c.setAccDescription(this.$);break;case 46:c.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:c.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:c.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:c.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:c.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:c.setXAxisLeftText(e[s-2]),c.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",c.setXAxisLeftText(e[s-1]);break;case 53:c.setXAxisLeftText(e[s]);break;case 54:c.setYAxisBottomText(e[s-2]),c.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",c.setYAxisBottomText(e[s-1]);break;case 56:c.setYAxisBottomText(e[s]);break;case 57:c.setQuadrant1Text(e[s]);break;case 58:c.setQuadrant2Text(e[s]);break;case 59:c.setQuadrant3Text(e[s]);break;case 60:c.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:f,55:d,56:h,57:p},{1:[3]},{18:n,Line truncated
|
||||
`+D.showPosition()+`
|
||||
Expecting `+qt.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Ct="Parse error on line "+(yt+1)+": Unexpected "+(B==$t?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Ct,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Pt,expected:qt})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+B);switch(W[0]){case 1:x.push(B),S.push(D.yytext),e.push(D.yylloc),x.push(W[1]),B=null,Jt=D.yyleng,s=D.yytext,yt=D.yylineno,Pt=D.yylloc;break;case 2:if(M=this.productions_[W[1]][1],rt.$=S[S.length-M],rt._$={first_line:e[e.length-(M||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(M||1)].first_column,last_column:e[e.length-1].last_column},Se&&(rt._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),vt=this.performAction.apply(rt,[s,Jt,yt,j.yy,W[1],S,e].concat(be)),typeof vt<"u")return vt;M&&(x=x.slice(0,-1*M*2),S=S.slice(0,-1*M),e=e.slice(0,-1*M)),x.push(this.productions_[W[1]][0]),S.push(rt.$),e.push(rt._$),ee=ut[x[x.length-2]][x[x.length-1]],x.push(ee);break;case 3:return!0}}return!0},"parse")},qe=(function(){var Y={EOF:1,parseError:o(function(l,x){if(this.yy.parser)this.yy.parser.parseError(l,x);else throw new Error(l)},"parseError"),setInput:o(function(r,l){return this.yy=l||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:o(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var l=r.match(/(?:\r\n?|\n).*/g);return l?(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:o(function(r){var l=r.length,x=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;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),x.length-1&&(this.yylineno-=x.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:x?(x.length===c.length?this.yylloc.first_column:0)+c[c.length-x.length].length-x[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(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:o(function(r){this.unput(this.match.slice(r))},"less"),pastInput:o(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:o(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:o(function(){var r=this.pastInput(),l=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
||||
`+l+"^"},"showPosition"),test_match:o(function(r,l){var x,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=r[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+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],x=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var e in S)this[e]=S[e];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,l,x,c;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),e=0;e<S.length;e++)if(x=this._input.match(this.rules[S[e]]),x&&(!l||x[0].length>l[0].length)){if(l=x,c=e,this.options.backtrack_lexer){if(r=this.test_match(x,S[e]),r!==!1)return r;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(r=this.test_match(l,S[c]),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:o(function(){var l=this.next();return l||this.lex()},"lex"),begin:o(function(l){this.conditionStack.push(l)},"begin"),popState:o(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(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:o(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:o(function(l){this.begin(l)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(l,x,c,S){switch(c){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 Y})();kt.lexer=qe;function pt(){this.yy={}}return o(pt,"Parser"),pt.prototype=kt,kt.Parser=pt,new pt})();Et.parser=Et;var ze=Et,I=De(),ot,Ve=(ot=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(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:z.quadrantChart?.chartWidth||500,chartWidth:z.quadrantChart?.chartHeight||500,titlePadding:z.quadrantChart?.titlePadding||10,titleFontSize:z.quadrantChart?.titleFontSize||20,quadrantPadding:z.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:z.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:z.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:z.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:z.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:z.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:z.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:z.quadrantChart?.pointTextPadding||5,pointLabelFontSize:z.quadrantChart?.pointLabelFontSize||12,pointRadius:z.quadrantCLine truncated
|
||||
`+t);const a=_.securityLevel;let k;a==="sandbox"&&(k=Lt("#i"+n));const T=(a==="sandbox"?Lt(k.nodes()[0].contentDocument.body):Lt("body")).select(`[id="${n}"]`),q=T.append("g").attr("class","main"),m=_.quadrantChart?.chartWidth??500,b=_.quadrantChart?.chartHeight??500;Ce(T,b,m,_.quadrantChart?.useMaxWidth??!0),T.attr("viewBox","0 0 "+m+" "+b),d.db.setHeight(b),d.db.setWidth(m);const g=d.db.getQuadrantData(),A=q.append("g").attr("class","quadrants"),ht=q.append("g").attr("class","border"),xt=q.append("g").attr("class","data-points"),ft=q.append("g").attr("class","labels"),gt=q.append("g").attr("class","title");g.title&>.append("text").attr("x",0).attr("y",0).attr("fill",g.title.fill).attr("font-size",g.title.fontSize).attr("dominant-baseline",h(g.title.horizontalPos)).attr("text-anchor",p(g.title.verticalPos)).attr("transform",y(g.title)).text(g.title.text),g.borderLines&&ht.selectAll("line").data(g.borderLines).enter().append("line").attr("x1",i=>i.x1).attr("y1",i=>i.y1).attr("x2",i=>i.x2).attr("y2",i=>i.y2).style("stroke",i=>i.strokeFill).style("stroke-width",i=>i.strokeWidth);const ct=A.selectAll("g.quadrant").data(g.quadrants).enter().append("g").attr("class","quadrant");ct.append("rect").attr("x",i=>i.x).attr("y",i=>i.y).attr("width",i=>i.width).attr("height",i=>i.height).attr("fill",i=>i.fill),ct.append("text").attr("x",0).attr("y",0).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>h(i.text.horizontalPos)).attr("text-anchor",i=>p(i.text.verticalPos)).attr("transform",i=>y(i.text)).text(i=>i.text.text),ft.selectAll("g.label").data(g.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(i=>i.text).attr("fill",i=>i.fill).attr("font-size",i=>i.fontSize).attr("dominant-baseline",i=>h(i.horizontalPos)).attr("text-anchor",i=>p(i.verticalPos)).attr("transform",i=>y(i));const dt=xt.selectAll("g.data-point").data(g.points).enter().append("g").attr("class","data-point");dt.append("circle").attr("cx",i=>i.x).attr("cy",i=>i.y).attr("r",i=>i.radius).attr("fill",i=>i.fill).attr("stroke",i=>i.strokeColor).attr("stroke-width",i=>i.strokeWidth),dt.append("text").attr("x",0).attr("y",0).text(i=>i.text.text).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>h(i.text.horizontalPos)).attr("text-anchor",i=>p(i.text.verticalPos)).attr("transform",i=>y(i.text))},"draw"),Re={draw:Be},He={parser:ze,db:we,renderer:Re,styles:o(()=>"","styles")};export{He as diagram};
|
||||
@@ -0,0 +1 @@
|
||||
import{g as s,r as l,d as t}from"./chunk-SVP7TREG.js";import{p as m}from"./chunk-JWPE2WC7.js";import{_ as n,l as i}from"./mermaid.core.js";import{M as p,c as u}from"./cynefin-OW5HDTMX.js";import"./index.js";var d=u().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),g=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),y={parse:n(e=>{t.clear(),i.debug("[Railroad Parser] Starting Langium parse");const r=d.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const o=r.value;i.debug("[Railroad Parser] Parsed rules:",o.rules.length),g(o),i.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},x={parser:y,db:t,renderer:l,styles:s};export{x as diagram};
|
||||
@@ -0,0 +1,84 @@
|
||||
import{g as ze}from"./chunk-XXDRQBXY.js";import{s as Xe}from"./chunk-POPQ4Y6H.js";import{_ as m,y as Be,b as Je,a as Ze,s as et,g as tt,n as st,o as it,c as Ne,l as qe,p as rt,t as nt,u as at,v as lt,x as ct}from"./mermaid.core.js";import"./index.js";var Ce=(function(){var e=m(function($,i,a,o){for(a=a||{},o=$.length;o--;a[$[o]]=i);return a},"o"),r=[1,3],u=[1,4],h=[1,5],f=[1,6],n=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],c=[1,22],p=[2,7],y=[1,26],S=[1,27],k=[1,28],q=[1,29],C=[1,33],A=[1,34],V=[1,35],v=[1,36],L=[1,37],x=[1,38],O=[1,24],w=[1,31],D=[1,32],M=[1,30],R=[1,39],g=[1,40],E=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],P=[1,61],X=[89,90],Ae=[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],Ee=[27,29],Ve=[1,70],ve=[1,71],Le=[1,72],xe=[1,73],Oe=[1,74],we=[1,75],De=[1,76],ee=[1,83],U=[1,80],te=[1,84],se=[1,85],ie=[1,86],re=[1,87],ne=[1,88],ae=[1,89],le=[1,90],ce=[1,91],oe=[1,92],pe=[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],Y=[63,64],Me=[1,101],Fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],T=[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],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],he=[1,116],ue=[1,117],fe=[1,114],me=[1,115],Se={trace:m(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:m(function(i,a,o,s,d,t,de){var l=t.length-1;switch(d){case 4:this.$=t[l].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[l].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[l-3],t[l-4]);break;case 22:s.addRequirement(t[l-5],t[l-6]),s.setClass([t[l-5]],t[l-3]);break;case 23:s.setNewReqId(t[l-2]);break;case 24:s.setNewReqText(t[l-2]);break;case 25:s.setNewReqRisk(t[l-2]);break;case 26:s.setNewReqVerifyMethod(t[l-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:Line truncated
|
||||
`+_.showPosition()+`
|
||||
Expecting `+_e.join(", ")+", got '"+(this.terminals_[b]||b)+"'":Te="Parse error on line "+(ge+1)+": Unexpected "+(b==Pe?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(Te,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Ie,expected:_e})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+b);switch(N[0]){case 1:o.push(b),d.push(_.yytext),t.push(_.yylloc),o.push(N[1]),b=null,$e=_.yyleng,l=_.yytext,ge=_.yylineno,Ie=_.yylloc;break;case 2:if(F=this.productions_[N[1]][1],J.$=d[d.length-F],J._$={first_line:t[t.length-(F||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(F||1)].first_column,last_column:t[t.length-1].last_column},je&&(J._$.range=[t[t.length-(F||1)].range[0],t[t.length-1].range[1]]),ke=this.performAction.apply(J,[l,$e,ge,G.yy,N[1],d,t].concat(We)),typeof ke<"u")return ke;F&&(o=o.slice(0,-1*F*2),d=d.slice(0,-1*F),t=t.slice(0,-1*F)),o.push(this.productions_[N[1]][0]),d.push(J.$),t.push(J._$),Ye=de[o[o.length-2]][o[o.length-1]],o.push(Ye);break;case 3:return!0}}return!0},"parse")},He=(function(){var $={EOF:1,parseError:m(function(a,o){if(this.yy.parser)this.yy.parser.parseError(a,o);else throw new Error(a)},"parseError"),setInput:m(function(i,a){return this.yy=a||this.yy||{},this._input=i,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:m(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var a=i.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:m(function(i){var a=i.length,o=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;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),o.length-1&&(this.yylineno-=o.length-1);var d=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:o?(o.length===s.length?this.yylloc.first_column:0)+s[s.length-o.length].length-o[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:m(function(){return this._more=!0,this},"more"),reject:m(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:m(function(i){this.unput(this.match.slice(i))},"less"),pastInput:m(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:m(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:m(function(){var i=this.pastInput(),a=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
||||
`+a+"^"},"showPosition"),test_match:m(function(i,a){var o,s,d;if(this.options.backtrack_lexer&&(d={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&&(d.yylloc.range=this.yylloc.range.slice(0))),s=i[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+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,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(i[0].length),this.matched+=i[0],o=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var t in d)this[t]=d[t];return!1}return!1},"test_match"),next:m(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,a,o,s;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),t=0;t<d.length;t++)if(o=this._input.match(this.rules[d[t]]),o&&(!a||o[0].length>a[0].length)){if(a=o,s=t,this.options.backtrack_lexer){if(i=this.test_match(o,d[t]),i!==!1)return i;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(i=this.test_match(a,d[s]),i!==!1?i:!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:m(function(){var a=this.next();return a||this.lex()},"lex"),begin:m(function(a){this.conditionStack.push(a)},"begin"),popState:m(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:m(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:m(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:m(function(a){this.begin(a)},"pushState"),stateStackSize:m(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:m(function(a,o,s,d){switch(s){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 o.yytext=o.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 $})();Se.lexer=He;function Re(){this.yy={}}return m(Re,"Parser"),Re.prototype=Se,Se.Parser=Re,new Re})();Ce.parser=Ce;var ot=Ce,Z,ht=(Z=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:"Mediu
Line truncated
|
||||
|
||||
[data-look="${h}"][data-color-id="color-${p}"].node path {
|
||||
stroke: ${n[p]};
|
||||
fill: ${f?.length?f[p]:""};
|
||||
}
|
||||
|
||||
[data-look="${h}"][data-color-id="color-${p}"].node rect {
|
||||
stroke: ${n[p]};
|
||||
fill: ${f?.length?f[p]:""};
|
||||
}
|
||||
`;return c},"genColor"),ft=m(e=>{const r=Be(),{look:u,themeVariables:h}=r,{requirementEdgeLabelBackground:f}=h;return`
|
||||
${ut(e)}
|
||||
marker {
|
||||
fill: ${e.relationColor};
|
||||
stroke: ${e.relationColor};
|
||||
}
|
||||
|
||||
marker.cross {
|
||||
stroke: ${e.lineColor};
|
||||
}
|
||||
|
||||
svg {
|
||||
font-family: ${e.fontFamily};
|
||||
font-size: ${e.fontSize};
|
||||
}
|
||||
|
||||
.reqBox {
|
||||
fill: ${e.requirementBackground};
|
||||
fill-opacity: 1.0;
|
||||
stroke: ${e.requirementBorderColor};
|
||||
stroke-width: ${e.requirementBorderSize};
|
||||
}
|
||||
|
||||
.reqTitle, .reqLabel{
|
||||
fill: ${e.requirementTextColor};
|
||||
}
|
||||
.reqLabelBox {
|
||||
fill: ${e.relationLabelBackground};
|
||||
fill-opacity: 1.0;
|
||||
}
|
||||
|
||||
.req-title-line {
|
||||
stroke: ${e.requirementBorderColor};
|
||||
stroke-width: ${e.requirementBorderSize};
|
||||
}
|
||||
.relationshipLine {
|
||||
stroke: ${e.relationColor};
|
||||
stroke-width: ${u==="neo"?e.strokeWidth:"1px"};
|
||||
}
|
||||
.relationshipLabel {
|
||||
fill: ${e.relationLabelColor};
|
||||
}
|
||||
.edgeLabel {
|
||||
background-color: ${e.edgeLabelBackground};
|
||||
}
|
||||
.edgeLabel .label rect {
|
||||
fill: ${e.edgeLabelBackground};
|
||||
}
|
||||
.edgeLabel .label text {
|
||||
fill: ${e.relationLabelColor};
|
||||
}
|
||||
.divider {
|
||||
stroke: ${e.nodeBorder};
|
||||
stroke-width: 1;
|
||||
}
|
||||
.label {
|
||||
font-family: ${e.fontFamily};
|
||||
color: ${e.nodeTextColor||e.textColor};
|
||||
}
|
||||
.label text,span {
|
||||
fill: ${e.nodeTextColor||e.textColor};
|
||||
color: ${e.nodeTextColor||e.textColor};
|
||||
}
|
||||
.labelBkg {
|
||||
background-color: ${f??e.edgeLabelBackground};
|
||||
}
|
||||
|
||||
`},"getStyles"),mt=ft,Qe={};nt(Qe,{draw:()=>dt});var dt=m(async function(e,r,u,h){qe.info("REF0:"),qe.info("Drawing requirement diagram (unified)",r);const{securityLevel:f,state:n,layout:c,look:p}=Ne(),y=h.db.getData(),S=ze(r,f);y.type=h.type,y.layoutAlgorithm=at(c),y.nodeSpacing=n?.nodeSpacing??50,y.rankSpacing=n?.rankSpacing??50,y.markers=p==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],y.diagramId=r,await lt(y,S);const k=8;ct.insertTitle(S,"requirementDiagramTitleText",n?.titleTopMargin??25,h.db.getDiagramTitle()),Xe(S,k,"requirementDiagram",n?.useMaxWidth??!0)},"draw"),yt={parser:ot,get db(){return new ht},renderer:Qe,styles:mt};export{yt as diagram};
|
||||
@@ -0,0 +1,40 @@
|
||||
import{n as xt,o as _t,s as vt,g as bt,b as St,a as wt,_ as y,c as lt,b7 as Lt,j as X,Y as Et,p as At,k as Tt}from"./mermaid.core.js";import{o as Mt}from"./ordinal.js";import"./index.js";import"./init.js";function Nt(t){for(var n=t.length/6|0,s=new Array(n),a=0;a<n;)s[a]="#"+t.slice(a*6,++a*6);return s}const Ct=Nt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function ct(t,n){let s;if(n===void 0)for(const a of t)a!=null&&(s<a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s<u||s===void 0&&u>=u)&&(s=u)}return s}function pt(t,n){let s;if(n===void 0)for(const a of t)a!=null&&(s>a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s>u||s===void 0&&u>=u)&&(s=u)}return s}function nt(t,n){let s=0;if(n===void 0)for(let a of t)(a=+a)&&(s+=a);else{let a=-1;for(let u of t)(u=+n(u,++a,t))&&(s+=u)}return s}function Pt(t){return t.target.depth}function It(t){return t.depth}function Ot(t,n){return n-1-t.height}function kt(t,n){return t.sourceLinks.length?t.depth:n-1}function $t(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?pt(t.sourceLinks,Pt)-1:0}function q(t){return function(){return t}}function ut(t,n){return Q(t.source,n.source)||t.index-n.index}function ht(t,n){return Q(t.target,n.target)||t.index-n.index}function Q(t,n){return t.y0-n.y0}function it(t){return t.value}function jt(t){return t.index}function Dt(t){return t.nodes}function zt(t){return t.links}function ft(t,n){const s=t.get(n);if(!s)throw new Error("missing: "+n);return s}function yt({nodes:t}){for(const n of t){let s=n.y0,a=s;for(const u of n.sourceLinks)u.y0=s+u.width/2,s+=u.width;for(const u of n.targetLinks)u.y1=a+u.width/2,a+=u.width}}function Bt(){let t=0,n=0,s=1,a=1,u=24,x=8,g,k=jt,o=kt,l,h,m=Dt,_=zt,d=6;function v(){const i={nodes:m.apply(null,arguments),links:_.apply(null,arguments)};return T(i),A(i),M(i),I(i),S(i),yt(i),i}v.update=function(i){return yt(i),i},v.nodeId=function(i){return arguments.length?(k=typeof i=="function"?i:q(i),v):k},v.nodeAlign=function(i){return arguments.length?(o=typeof i=="function"?i:q(i),v):o},v.nodeSort=function(i){return arguments.length?(l=i,v):l},v.nodeWidth=function(i){return arguments.length?(u=+i,v):u},v.nodePadding=function(i){return arguments.length?(x=g=+i,v):x},v.nodes=function(i){return arguments.length?(m=typeof i=="function"?i:q(i),v):m},v.links=function(i){return arguments.length?(_=typeof i=="function"?i:q(i),v):_},v.linkSort=function(i){return arguments.length?(h=i,v):h},v.size=function(i){return arguments.length?(t=n=0,s=+i[0],a=+i[1],v):[s-t,a-n]},v.extent=function(i){return arguments.length?(t=+i[0][0],s=+i[1][0],n=+i[0][1],a=+i[1][1],v):[[t,n],[s,a]]},v.iterations=function(i){return arguments.length?(d=+i,v):d};function T({nodes:i,links:f}){for(const[e,r]of i.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const c=new Map(i.map((e,r)=>[k(e,r,i),e]));for(const[e,r]of f.entries()){r.index=e;let{source:p,target:b}=r;typeof p!="object"&&(p=r.source=ft(c,p)),typeof b!="object"&&(b=r.target=ft(c,b)),p.sourceLinks.push(r),b.targetLinks.push(r)}if(h!=null)for(const{sourceLinks:e,targetLinks:r}of i)e.sort(h),r.sort(h)}function A({nodes:i}){for(const f of i)f.value=f.fixedValue===void 0?Math.max(nt(f.sourceLinks,it),nt(f.targetLinks,it)):f.fixedValue}function M({nodes:i}){const f=i.length;let c=new Set(i),e=new Set,r=0;for(;c.size;){for(const p of c){p.depth=r;for(const{target:b}of p.sourceLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function I({nodes:i}){const f=i.length;let c=new Set(i),e=new Set,r=0;for(;c.size;){for(const p of c){p.height=r;for(const{source:b}of p.targetLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function N({nodes:i}){const f=ct(i,r=>r.depth)+1,c=(s-t-u)/(f-1),e=new Array(f);for(const r of i){const p=Math.max(0,Math.min(f-1,Math.floor(o.call(null,r,f))));r.layer=p,r.x0=t+p*c,r.x1=r.x0+u,e[p]?e[p].push(r):e[p]=[r]}if(l)for(const r of e)r.sort(l);return e}function j(i){const f=pt(i,c=>(a-n-(c.length-1)*g)/nt(c,it));for(const c of i){let e=n;for(const r of c){r.y0=e,r.y1=e+r.value*f,e=r.y1+g;for(const p of r.sourceLinks)p.width=p.value*f}e=(a-e+g)/(c.length+1);for(let r=0;r<c.length;++r){const p=c[r];p.y0+=e*(r+1),p.y1+=e*(r+1)}w(c)}}function S(i){const f=N(i);g=Math.min(x,(a-n)/(ct(f,c=>c.length)-1)),j(f);for(let c=0;c<d;++c){const e=Math.pow(.99,c),r=Math.max(1-e,(c+1)/d);R(f,e,r),C(f,e,r)}}function C(i,f,c){for(let e=1,r=i.length;e<r;++e){const p=i[e];for(const b of p){let L=0,B=0;for(const{source:Y,value:et}of b.targetLinks){let H=et*(b.layer-Y.layer);L+=P(Y,b)*H,B+=H}if(!(B>0))continue;let U=(L/B-b.y0)*f;b.y0+=U,b.y1+=U,z(b)}l===void 0&&p.sort(Q),D(p,c)}}function R(i,f,c){for(let e=i.length,r=e-2;r>=0;--r){const p=i[r];for(const b of p){let L=0,B=0;for(const{target:Y,value:et}of b.sourceLinks){let H=et*(Y.layer-b.layer);L+=E(b,Y)*H,B+=H}if(!(B>0))continue;let U=(L/B-b.y0)*f;b.y0+=U,b.y1+=U,z(b)}l===void 0&&p.sort(Q),D(p,c)}}function DLine truncated
|
||||
`+S.showPosition()+`
|
||||
Expecting `+p.join(", ")+", got '"+(this.terminals_[w]||w)+"'":b="Parse error on line "+(A+1)+": Unexpected "+(w==N?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(b,{text:S.match,token:this.terminals_[w]||w,line:S.yylineno,loc:D,expected:p})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+w);switch(E[0]){case 1:h.push(w),_.push(S.yytext),d.push(S.yylloc),h.push(E[1]),w=null,M=S.yyleng,T=S.yytext,A=S.yylineno,D=S.yylloc;break;case 2:if(e=this.productions_[E[1]][1],f.$=_[_.length-e],f._$={first_line:d[d.length-(e||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(e||1)].first_column,last_column:d[d.length-1].last_column},V&&(f._$.range=[d[d.length-(e||1)].range[0],d[d.length-1].range[1]]),i=this.performAction.apply(f,[T,M,A,C.yy,E[1],_,d].concat(j)),typeof i<"u")return i;e&&(h=h.slice(0,-1*e*2),_=_.slice(0,-1*e),d=d.slice(0,-1*e)),h.push(this.productions_[E[1]][0]),_.push(f.$),d.push(f._$),r=v[h[h.length-2]][h[h.length-1]],h.push(r);break;case 3:return!0}}return!0},"parse")},x=(function(){var k={EOF:1,parseError:y(function(l,h){if(this.yy.parser)this.yy.parser.parseError(l,h);else throw new Error(l)},"parseError"),setInput:y(function(o,l){return this.yy=l||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:y(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var l=o.match(/(?:\r\n?|\n).*/g);return l?(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:y(function(o){var l=o.length,h=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;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),h.length-1&&(this.yylineno-=h.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:h?(h.length===m.length?this.yylloc.first_column:0)+m[m.length-h.length].length-h[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(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:y(function(o){this.unput(this.match.slice(o))},"less"),pastInput:y(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:y(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:y(function(){var o=this.pastInput(),l=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
|
||||
`+l+"^"},"showPosition"),test_match:y(function(o,l){var h,m,_;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))),m=o[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+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],h=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var d in _)this[d]=_[d];return!1}return!1},"test_match"),next:y(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,l,h,m;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),d=0;d<_.length;d++)if(h=this._input.match(this.rules[_[d]]),h&&(!l||h[0].length>l[0].length)){if(l=h,m=d,this.options.backtrack_lexer){if(o=this.test_match(h,_[d]),o!==!1)return o;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(o=this.test_match(l,_[m]),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:y(function(){var l=this.next();return l||this.lex()},"lex"),begin:y(function(l){this.conditionStack.push(l)},"begin"),popState:y(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:y(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:y(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:y(function(l){this.begin(l)},"pushState"),stateStackSize:y(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:y(function(l,h,m,_){switch(m){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 k})();u.lexer=x;function g(){this.yy={}}return y(g,"Parser"),g.prototype=u,u.Parser=g,new g})();at.parser=at;var K=at,J=[],tt=[],Z=new Map,Zt=y(()=>{J=[],tt=[],Z=new Map,At()},"clear"),W,Jt=(W=class{constructor(n,s,a=0){this.source=n,this.target=s,this.value=a}},y(W,"SankeyLink"),W),te=y((t,n,s)=>{J.push(new Jt(t,n,s))},"addLink"),G,ee=(G=class{constructor(n){this.ID=n}},y(G,"SankeyNode"),G),ne=y(t=>{t=Tt.sanitizeText(t,lt());let n=Z.get(t);return n===void 0&&(n=new ee(t),Z.set(t,n),tt.push(n)),n},"findOrCreateNode"),ie=y(()=>tt,"getNodes"),re=y(()=>J,"getLinks"),se=y(()=>({nodes:tt.map(t=>({id:t.ID})),links:J.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),oe={nodesMap:Z,getConfig:y(()=>lt().sankey,"getConfig"),getNodes:ie,getLinks:re,getGraph:se,addLink:te,findOrCreateNode:ne,getAccTitle:wt,setAccTitle:St,getAccDescription:bt,setAccDescription:vt,getDiagramTitle:_t,setDiagramTitle:xt,clear:Zt},$,gt=($=class{static next(n){return new $(n+ ++$.count)}constructor(n){this.id=n,this.href=`#${n}`}toString(){return"url("+this.href+")"}},y($,"Uid"),$.count=0,$),ae={left:It,right:Ot,center:$t,justify:kt},le=y(t=>{let n=0,s=0;for(const a of t){const u=a.value??0;u>n&&(n=u,s=a.layer??0)}return s},"findCentralNodeLayer"),ce=y(function(t,n,s,a){const{securityLevel:u,sankey:x}=lt(),g=Lt.sankey;let k;u==="sandbox"&&(k=X("#i"+n));const o=u==="sandbox"?X(k.nodes()[0].contentDocument.body):X("body"),l=u==="sandbox"?o.select(`[id="${n}"]`):X(`[id="${n}"]`),h=x?.width??g.width,m=x?.height??g.width,_=x?.useMaxWidth??g.useMaxWidth,d=x?.nodeAlignment??g.nodeAlignment,v=x?.prefix??g.prefix,T=x?.suffix??g.suffix,A=x?.showValues??g.showValues,M=x?.nodeWidth??g.nodeWidth??10,I=x?.nodePadding??g.nodePadding??12,N=x?.labelStyle??g.labelStyle??"legacy",j=x?.nodeColors??{},S=a.db.getGraph(),C=ae[d];Bt().nodeId(e=>e.id).nodeWidth(M).nodePadding(I+(A?15:0)).nodeAlign(C).extent([[0,0],[h,m]])(S);const D=le(S.nodes),V=Mt(Ct),O=y(e=>j[e]??V(e),"getNodeColor");l.append("g").attr("class","nodes").selectAll(".node").data(S.nodes).join("g").attr("class","node").attr("id",e=>(e.uid=gt.next("node-")).id).attr("transform",function(e){return"translate("+e.x0+","+e.y0+")"}).attr("x",e=>e.x0).attr("y",e=>e.y0).append("rect").attr("height",e=>e.y1-e.y0).attr("width",e=>e.x1-e.x0).attr("fill",e=>O(e.id));const z=y(({id:e,value:r})=>A?`${e}
|
||||
${v}${Math.round(r*100)/100}${T}`:e,"getText"),w=y(e=>N==="outlined"?(e.layer??0)<D?{x:e.x0-6,anchor:"end"}:{x:e.x1+6,anchor:"start"}:e.x0<h/2?{x:e.x1+6,anchor:"start"}:{x:e.x0-6,anchor:"end"},"getLabelPosition"),P=l.append("g").attr("class","node-labels").attr("font-size",14),E=y(e=>P.selectAll(e?`.${e}`:"text").data(S.nodes).join("text").attr("class",e??null).attr("x",r=>w(r).x).attr("y",r=>(r.y1+r.y0)/2).attr("dy",`${A?"0":"0.35"}em`).attr("text-anchor",r=>w(r).anchor).text(z),"appendLabel");N==="outlined"?(E("sankey-label-bg"),E("sankey-label-fg")):E();const i=l.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(S.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),f=x?.linkColor??"gradient";if(f==="gradient"){const e=i.append("linearGradient").attr("id",r=>(r.uid=gt.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",r=>r.source.x1).attr("x2",r=>r.target.x0);e.append("stop").attr("offset","0%").attr("stop-color",r=>O(r.source.id)),e.append("stop").attr("offset","100%").attr("stop-color",r=>O(r.target.id))}let c;switch(f){case"gradient":c=y(e=>e.uid,"coloring");break;case"source":c=y(e=>O(e.source.id),"coloring");break;case"target":c=y(e=>O(e.target.id),"coloring");break;default:c=f}i.append("path").attr("d",Kt()).attr("stroke",c).attr("stroke-width",e=>Math.max(1,e.width)),Et(void 0,l,0,_)},"draw"),ue={draw:ce},he=y(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,`
|
||||
`).trim(),"prepareTextForParsing"),fe=y(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"),ye=fe,de=K.parse.bind(K);K.parse=t=>de(he(t));var xe={styles:ye,parser:K,db:oe,renderer:ue};export{xe as diagram};
|
||||
@@ -0,0 +1,162 @@
|
||||
import{I as er}from"./chunk-2Q5K7J3B.js";import{_ as x,F as rr,c as $,j as Yt,l as at,G as Me,d as ar,e as sr,k as N,b as De,s as ir,n as nr,a as or,g as cr,o as lr,H as hr,J as dr,p as Tr,i as Wt,x as Z,I as Q,K as kt,L as Be,Z as pr,y as Ft,M as Er,N as Ve}from"./mermaid.core.js";import{a as ur,g as se,b as dt,d as fr,c as ie,e as ne}from"./chunk-F27PBJKO.js";import"./index.js";var ee=(function(){var e=x(function(ut,S,v,P){for(v=v||{},P=ut.length;P--;v[ut[P]]=S);return v},"o"),t=[1,2],a=[1,3],r=[1,4],i=[2,4],n=[1,9],s=[1,11],c=[1,12],E=[1,14],h=[1,15],p=[1,17],_=[1,18],u=[1,19],O=[1,25],T=[1,26],g=[1,27],f=[1,28],I=[1,29],L=[1,30],b=[1,31],w=[1,32],A=[1,33],D=[1,34],M=[1,35],V=[1,36],W=[1,37],U=[1,38],G=[1,39],X=[1,40],nt=[1,42],j=[1,43],q=[1,44],st=[1,45],tt=[1,46],Y=[1,47],C=[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],St=[1,74],Dt=[1,80],m=[1,81],k=[1,82],lt=[1,83],et=[1,84],K=[1,85],Ot=[1,86],oe=[1,87],ce=[1,88],le=[1,89],he=[1,90],de=[1,91],Te=[1,92],pe=[1,93],Ee=[1,94],ue=[1,95],fe=[1,96],_e=[1,97],ge=[1,98],xe=[1,99],Ie=[1,100],ye=[1,101],Re=[1,102],Oe=[1,103],Le=[1,104],be=[1,105],me=[2,78],wt=[4,5,17,51,53,54],vt=[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],Ae=[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],Gt=[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],Se=[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],Xt=[5,52],F=[70,71,72,73],ot=[1,151],Jt={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],[1Line truncated
|
||||
`+J.showPosition()+`
|
||||
Expecting `+Vt.join(", ")+", got '"+(this.terminals_[rt]||rt)+"'":jt="Parse error on line "+(Mt+1)+": Unexpected "+(rt==Ne?"end of input":"'"+(this.terminals_[rt]||rt)+"'"),this.parseError(jt,{text:J.match,token:this.terminals_[rt]||rt,line:J.yylineno,loc:Qt,expected:Vt})}if(ct[0]instanceof Array&&ct.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xt+", token: "+rt);switch(ct[0]){case 1:P.push(rt),z.push(J.yytext),o.push(J.yylloc),P.push(ct[1]),rt=null,we=J.yyleng,d=J.yytext,Mt=J.yylineno,Qt=J.yylloc;break;case 2:if(Tt=this.productions_[ct[1]][1],Lt.$=z[z.length-Tt],Lt._$={first_line:o[o.length-(Tt||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(Tt||1)].first_column,last_column:o[o.length-1].last_column},je&&(Lt._$.range=[o[o.length-(Tt||1)].range[0],o[o.length-1].range[1]]),$t=this.performAction.apply(Lt,[d,we,Mt,gt.yy,ct[1],z,o].concat($e)),typeof $t<"u")return $t;Tt&&(P=P.slice(0,-1*Tt*2),z=z.slice(0,-1*Tt),o=o.slice(0,-1*Tt)),P.push(this.productions_[ct[1]][0]),z.push(Lt.$),o.push(Lt._$),ke=Nt[P[P.length-2]][P[P.length-1]],P.push(ke);break;case 3:return!0}}return!0},"parse")},Ze=(function(){var ut={EOF:1,parseError:x(function(v,P){if(this.yy.parser)this.yy.parser.parseError(v,P);else throw new Error(v)},"parseError"),setInput:x(function(S,v){return this.yy=v||this.yy||{},this._input=S,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 S=this._input[0];this.yytext+=S,this.yyleng++,this.offset++,this.match+=S,this.matched+=S;var v=S.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),S},"input"),unput:x(function(S){var v=S.length,P=S.split(/(?:\r\n?|\n)/g);this._input=S+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;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),P.length-1&&(this.yylineno-=P.length-1);var z=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:P?(P.length===y.length?this.yylloc.first_column:0)+y[y.length-P.length].length-P[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[z[0],z[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(S){this.unput(this.match.slice(S))},"less"),pastInput:x(function(){var S=this.matched.substr(0,this.matched.length-this.match.length);return(S.length>20?"...":"")+S.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var S=this.match;return S.length<20&&(S+=this._input.substr(0,20-S.length)),(S.substr(0,20)+(S.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var S=this.pastInput(),v=new Array(S.length+1).join("-");return S+this.upcomingInput()+`
|
||||
`+v+"^"},"showPosition"),test_match:x(function(S,v){var P,y,z;if(this.options.backtrack_lexer&&(z={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&&(z.yylloc.range=this.yylloc.range.slice(0))),y=S[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+S[0].length},this.yytext+=S[0],this.match+=S[0],this.matches=S,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(S[0].length),this.matched+=S[0],P=this.performAction.call(this,this.yy,this,v,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),P)return P;if(this._backtrack){for(var o in z)this[o]=z[o];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var S,v,P,y;this._more||(this.yytext="",this.match="");for(var z=this._currentRules(),o=0;o<z.length;o++)if(P=this._input.match(this.rules[z[o]]),P&&(!v||P[0].length>v[0].length)){if(v=P,y=o,this.options.backtrack_lexer){if(S=this.test_match(P,z[o]),S!==!1)return S;if(this._backtrack){v=!1;continue}else return!1}else if(!this.options.flex)break}return v?(S=this.test_match(v,z[y]),S!==!1?S:!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,P,y,z){switch(y){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 P.yytext=P.yytext.trim(),73;case 12:return P.yytext=P.yytext.trim(),this.begin("ALIAS"),73;case 13:return P.yytext=P.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return P.yytext=P.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 P.yytext=P.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,/^(?:\/\/--)/
Line truncated
|
||||
`)?h=n+`
|
||||
`:h=`{
|
||||
`+n+`
|
||||
}`,c=hr(h,{schema:dr})}i=c?.type??i,c?.alias&&(!r||r.text===a)&&(r={text:c.alias,wrap:r?.wrap,type:i});const E=this.state.records.actors.get(t);if(E){if(this.state.records.currentBox&&E.box&&this.state.records.currentBox!==E.box)throw new Error(`A same participant should only be defined in one Box: ${E.name} can't be in '${E.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(s=E.box?E.box:this.state.records.currentBox,E.box=s,E&&a===E.name&&r==null)return}if(r?.text==null&&(r={text:a,type:i}),(i==null||r.text==null)&&(r={text:a,type:i}),this.state.records.actors.set(t,{box:s,name:a,description:r.text,wrap:r.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const h=this.state.records.actors.get(this.state.records.prevActor);h&&(h.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let a,r=0;if(!t)return 0;for(a=0;a<this.state.records.messages.length;a++)this.state.records.messages[a].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[a].from===t&&r++,this.state.records.messages[a].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[a].from===t&&r--;return r}addMessage(t,a,r,i){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:a,message:r.text,wrap:r.wrap??this.autoWrap(),answer:i})}addSignal(t,a,r,i,n=!1,s){if(i===this.LINETYPE.ACTIVE_END&&this.activationCount(t??"")<1){const E=new Error("Trying to inactivate an inactive participant ("+t+")");throw E.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},E}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:a,message:r?.text??"",wrap:r?.wrap??this.autoWrap(),type:i,activate:n,centralConnection:s??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(t=>t.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(t){return this.state.records.actors.get(t)}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(t){this.state.records.wrapEnabled=t}extractWrap(t){if(t===void 0)return{};t=t.trim();const a=/^:?wrap:/.exec(t)!==null?!0:/^:?nowrap:/.exec(t)!==null?!1:void 0;return{cleanedText:(a===void 0?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:a}}autoWrap(){return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:$().sequence?.wrap??!1}clear(){this.state.reset(),Tr()}parseMessage(t){const a=t.trim(),{wrap:r,cleanedText:i}=this.extractWrap(a),n={text:i,wrap:r};return at.debug(`parseMessage: ${JSON.stringify(n)}`),n}parseBoxData(t){const a=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let r=a?.[1]?a[1].trim():"transparent",i=a?.[2]?a[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",r)||(r="transparent",i=t.trim());else{const c=new Option().style;c.color=r,c.color!==r&&(r="transparent",i=t.trim())}const{wrap:n,cleanedText:s}=this.extractWrap(i);return{text:s?Wt(s,$()):void 0,color:r,wrap:n}}addNote(t,a,r){const i={actor:t,placement:a,message:r.text,wrap:r.wrap??this.autoWrap()},n=[].concat(t,t);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:n[0],to:n[1],message:r.text,wrap:r.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:a})}addLinks(t,a){const r=this.getActor(t);try{let i=Wt(a.text,$());i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const n=JSON.parse(i);this.insertLinks(r,n)}catch(i){at.error("error while parsing actor link text",i)}}addALink(t,a){const r=this.getActor(t);try{const i={};let n=Wt(a.text,$());const s=n.indexOf("@");n=n.replace(/=/g,"="),n=n.replace(/&/g,"&");const c=n.slice(0,s-1).trim(),E=n.slice(s+1).trim();i[c]=E,this.insertLinks(r,i)}catch(i){at.error("error while parsing actor link text",i)}}insertLinks(t,a){if(t.links==null)t.links=a;else for(const r in a)t.links[r]=a[r]}addProperties(t,a){const r=this.getActor(t);try{const i=Wt(a.text,$()),n=JSON.parse(i);this.insertProperties(r,n)}catch(i){at.error("error while parsing actor properties text",i)}}insertProperties(t,a){if(t.properties==null)t.properties=a;else for(const r in a)t.properties[r]=a[r]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,a){const r=this.getActor(t),i=document.getElementById(a.text);try{const n=i.inLine truncated
|
||||
stroke: ${e.actorBorder};
|
||||
fill: ${e.actorBkg};
|
||||
stroke-width: ${e.strokeWidth??1};
|
||||
}
|
||||
|
||||
rect.actor.outer-path[data-look="neo"] {
|
||||
filter: ${t};
|
||||
}
|
||||
|
||||
rect.note[data-look="neo"] {
|
||||
stroke:${e.noteBorderColor};
|
||||
fill:${e.noteBkgColor};
|
||||
filter: ${t};
|
||||
}
|
||||
|
||||
text.actor > tspan {
|
||||
fill: ${e.actorTextColor};
|
||||
stroke: none;
|
||||
}
|
||||
|
||||
.actor-line {
|
||||
stroke: ${e.actorLineColor};
|
||||
}
|
||||
|
||||
.innerArc {
|
||||
stroke-width: 1.5;
|
||||
stroke-dasharray: none;
|
||||
}
|
||||
|
||||
.messageLine0 {
|
||||
stroke-width: 1.5;
|
||||
stroke-dasharray: none;
|
||||
stroke: ${e.signalColor};
|
||||
}
|
||||
|
||||
.messageLine1 {
|
||||
stroke-width: 1.5;
|
||||
stroke-dasharray: 2, 2;
|
||||
stroke: ${e.signalColor};
|
||||
}
|
||||
|
||||
[id$="-arrowhead"] path {
|
||||
fill: ${e.signalColor};
|
||||
stroke: ${e.signalColor};
|
||||
}
|
||||
|
||||
.sequenceNumber {
|
||||
fill: ${e.sequenceNumberColor};
|
||||
}
|
||||
|
||||
[id$="-sequencenumber"] {
|
||||
fill: ${e.signalColor};
|
||||
}
|
||||
|
||||
[id$="-crosshead"] path {
|
||||
fill: ${e.signalColor};
|
||||
stroke: ${e.signalColor};
|
||||
}
|
||||
|
||||
.messageText {
|
||||
fill: ${e.signalTextColor};
|
||||
stroke: none;
|
||||
}
|
||||
|
||||
.labelBox {
|
||||
stroke: ${e.labelBoxBorderColor};
|
||||
fill: ${e.labelBoxBkgColor};
|
||||
filter: ${a==="neo"?t:"none"};
|
||||
}
|
||||
|
||||
.labelText, .labelText > tspan {
|
||||
fill: ${e.labelTextColor};
|
||||
stroke: none;
|
||||
}
|
||||
|
||||
.loopText, .loopText > tspan {
|
||||
fill: ${e.loopTextColor};
|
||||
stroke: none;
|
||||
}
|
||||
|
||||
.sectionTitle, .sectionTitle > tspan {
|
||||
fill: ${e.loopTextColor};
|
||||
stroke: none;
|
||||
}
|
||||
|
||||
.loopLine {
|
||||
stroke-width: 2px;
|
||||
stroke-dasharray: 2, 2;
|
||||
stroke: ${e.labelBoxBorderColor};
|
||||
fill: ${e.labelBoxBorderColor};
|
||||
}
|
||||
|
||||
.note {
|
||||
//stroke: #decc93;
|
||||
stroke: ${e.noteBorderColor};
|
||||
fill: ${e.noteBkgColor};
|
||||
}
|
||||
|
||||
.noteText, .noteText > tspan {
|
||||
fill: ${e.noteTextColor};
|
||||
stroke: none;
|
||||
${e.noteFontWeight?`font-weight: ${e.noteFontWeight};`:""}
|
||||
}
|
||||
|
||||
.activation0 {
|
||||
fill: ${e.activationBkgColor};
|
||||
stroke: ${e.activationBorderColor};
|
||||
}
|
||||
|
||||
.activation1 {
|
||||
fill: ${e.activationBkgColor};
|
||||
stroke: ${e.activationBorderColor};
|
||||
}
|
||||
|
||||
.activation2 {
|
||||
fill: ${e.activationBkgColor};
|
||||
stroke: ${e.activationBorderColor};
|
||||
}
|
||||
|
||||
.actorPopupMenu {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.actorPopupMenuPanel {
|
||||
position: absolute;
|
||||
fill: ${e.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: ${e.actorBkg};
|
||||
stroke-width: 2px;
|
||||
}
|
||||
|
||||
g rect.rect {
|
||||
filter: ${t};
|
||||
stroke: ${e.nodeBorder};
|
||||
}
|
||||
`},"getStyles"),Or=Rr,It=36,ft="actor-top",_t="actor-bottom",qt="actor-box",yt="actor-man",pt=new Set(["redux-color","redux-dark-color"]),Pt=x(function(e,t){const a=fr(e,t);return Ft().look==="neo"&&a.attr("data-look","neo"),a},"drawRect"),Lr=x(function(e,t,a,r,i){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};const n=t.links,s=t.actorCnt,c=t.rectData;var E="none";i&&(E="block !important");const h=e.append("g");h.attr("id","actor"+s+"_popup"),h.attr("class","actorPopupMenu"),h.attr("display",E);var p="";c.class!==void 0&&(p=" "+c.class);let _=c.width>a?c.width:a;const u=h.append("rect");if(u.attr("class","actorPopupMenuPanel"+p),u.attr("x",c.x),u.attr("y",c.height),u.attr("fill",c.fill),u.attr("stroke",c.stroke),u.attr("width",_),u.attr("height",c.height),u.attr("rx",c.rx),u.attr("ry",c.ry),n!=null){var O=20;for(let f in n){var T=h.append("a"),g=Me.sanitizeUrl(n[f]);T.attr("xlink:href",g),T.attr("target","_blank"),Gr(r)(f,T,c.x+10,c.height+O,_,20,{class:"actor"},r),O+=30}}return u.attr("height",O),{height:c.height+O,width:_}},"drawPopup"),zt=x(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Ht=x(async function(e,t,a=null){let r=e.append("foreignObject");const i=await Ve(t.text,Ft()),s=r.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();if(r.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),t.class==="noteText"){const c=e.node().firstChild;c.setAttribute("height",s.height+2*t.textMargin);const E=c.getBBox();r.attr("x",Math.round(E.x+E.width/2-s.width/2)).attr("y",Math.round(E.y+E.height/2-s.height/2))}else if(a){let{startx:c,stopx:E,starty:h}=a;if(c>E){const p=c;c=E,E=p}r.attr("x",Math.round(c+Math.abs(c-E)/2-s.width/2)),t.class==="loopText"?r.attr("y",Math.round(h)):r.attr("y",Math.round(h-s.height))}return[r]},"drawKatex"),At=x(function(e,t){let a=0,r=0;const i=t.text.split(N.lineBreakRegex),[n,s]=Be(t.fontSize);let c=[],E=0,h=x(()=>t.y,"yfunc");if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0)switch(t.valign){case"top":case"start":h=x(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":h=x(()=>Math.round(t.y+(a+r+t.textMargin)/2),"yfunc");break;case"bottom":case"end":h=x(()=>Math.round(t.y+(a+r+2*t.textMargin)-t.textMargin),"yfunc");break}if(t.anchor!==void 0&&t.textMargin!==void 0&&t.width!==void 0)switch(t.anchor){case"left":case"start":t.x=Math.round(t.x+t.textMargin),t.anchor="start",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"middle":case"center":t.x=Math.round(t.x+t.width/2),t.anchor="middle",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"right":case"end":t.x=Math.round(t.x+t.width-t.textMargin),t.anchor="end",t.dominantBaseline="middle",t.alignmentBaseline="middle";break}for(let[p,_]of i.entries()){t.textMargin!==void 0&&t.textMargin===0&&n!==void 0&&(E=p*n);const u=e.append("text");u.attr("x",t.x),u.attr("y",h()),t.anchor!==void 0&&u.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline),t.fontFamily!==void 0&&u.style("font-family",t.fontFamily),s!==void 0&&u.style("font-size",s),t.fontWeight!==void 0&&u.style("font-weight",t.fontWeight),t.fill!==void 0&&u.attr("fill",t.fill),t.class!==void 0&&u.attr("class",t.class),t.dy!==void 0?u.attr("dy",t.dy):E!==0&&u.attr("dy",E);const O=_||pr;if(t.tspan){const T=u.append("tspan");T.attr("x",t.x),t.fill!==void 0&&T.attr("fill",t.fill),T.text(O)}else u.text(O);t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0&&(r+=(u._groups||u)[0][0].getBBox().height,a=r),c.push(u)}return c},"drawText"),Ye=x(function(e,t){function a(i,n,s,c,E){return i+","+n+" "+(i+s)+","+n+" "+(i+s)+","+(n+c-E)+" "+(i+s-E*1.2)+","+(n+c)+" "+i+","+(n+c)}x(a,"genPoints");const r=e.append("polygon");return r.attr("points",a(t.x,t.y,t.width,t.height,7)),r.attr("class","labelBox"),t.y=t.y+t.height/2,At(e,t),r},"drawLabel"),B=-1,We=x((e,t,a,r)=>{e.select&&a.forEach(i=>{const n=t.get(i),s=e.select("#actor"+n.actorCnt);!r.mirrorActors&&n.stopy?s.attr("y2",n.stopy+n.height/2):r.mirrorActors&&s.attr("y2",n.stopy)})},"fixLifeLineHeights"),br=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,c=n+t.height,{look:E,theme:h,themeVariables:p}=a,{bkgColorArray:_,borderColorArray:u}=p,O=e.append("g").lower();var T=O;r||(B++,Object.keys(t.links||{}).length&&!a.forceMenus&&T.attr("onclick",zt(`actor${B}_popup`)).attr("cursor","pointer"),T.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),T=O.append("g"),t.actorCnt=B,t.links!=null&&T.attr("id","root-"+B),E==="neo"&&T.attr("data-look",
Line truncated
|
||||
a ${L},${I} 0 0 0 0,${g.height}
|
||||
h ${g.width-2*L}
|
||||
a ${L},${I} 0 0 0 0,-${g.height}
|
||||
Z
|
||||
`;b.append("path").attr("d",A),w.append("path").attr("d",`M ${g.x},${g.y+I}
|
||||
a ${L},${I} 0 0 0 0,${g.height}`),b.attr("transform",`translate(${L}, ${-(g.height/2)})`),w.attr("transform",`translate(${g.width-L}, ${-g.height/2})`),t.rectData=g,E==="neo"&&b.attr("filter","url(#drop-shadow)");const D=i.get(t.name)??0;if(pt.has(h)&&(b.style("stroke",u[D%u.length]),b.style("fill",_[D%u.length]),w.style("stroke",u[D%u.length]),w.style("fill",_[D%u.length])),t.properties?.icon){const W=t.properties.icon.trim(),U=g.x+g.width-20,G=g.y+10;W.charAt(0)==="@"?ie(T,U,G,W.substr(1)):ne(T,U,G,W)}Et(a,Q(t.description))(t.description,T,g.x,g.y,g.width,g.height,{class:`actor ${qt}`},a);let M=t.height;const V=b.select("path:last-child");if(V.node()){const W=V.node().getBBox();t.height=W.height,M=W.height}return r||(T.attr("data-et","participant"),T.attr("data-type","queue"),T.attr("data-id",t.name)),M},"drawActorTypeQueue"),Sr=x(function(e,t,a,r,i,n){const s=r?t.stopy:t.starty,c=t.x+t.width/2,E=s+75,{look:h,theme:p,themeVariables:_}=a,{bkgColorArray:u,borderColorArray:O,actorBorder:T,actorBkg:g}=_,f=e.append("g").lower();r||(B++,f.append("line").attr("id","actor"+B).attr("x1",c).attr("y1",E).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B);const I=e.append("g");let L=yt;r?L+=` ${_t}`:L+=` ${ft}`,I.attr("class",L),I.attr("name",t.name);const b=dt();b.x=t.x,b.y=s,b.fill="#eaeaea",b.width=t.width,b.height=t.height,b.class="actor";const w=t.x+t.width/2,A=s+32,D=22;I.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"),I.append("circle").attr("cx",w).attr("cy",A).attr("r",D).attr("filter",`${h==="neo"?"url(#drop-shadow)":""}`),I.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${w}, ${A-D})`);const M=n.get(t.name)??0;pt.has(p)?(I.style("stroke",O[M%O.length]),I.style("fill",u[M%O.length])):(I.style("stroke",T),I.style("fill",g));const V=I.node().getBBox();return t.height=V.height+2*(a?.sequence?.labelBoxHeight??0),Et(a,Q(t.description))(t.description,I,b.x,b.y+D+(r?5:12),b.width,b.height,{class:`actor ${yt}`},a),r||(I.attr("data-et","participant"),I.attr("data-type","control"),I.attr("data-id",t.name)),t.height},"drawActorTypeControl"),wr=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,c=n+75,{look:E,theme:h,themeVariables:p}=a,{bkgColorArray:_,borderColorArray:u}=p,O=e.append("g").lower(),T=e.append("g");let g="actor";r?g+=` ${_t}`:g+=` ${ft}`,T.attr("class",g),T.attr("name",t.name);const f=dt();f.x=t.x,f.y=n,f.fill="#eaeaea",f.width=t.width,f.height=t.height,f.class="actor";const I=t.x+t.width/2,L=n+(r?10:25),b=22;T.append("circle").attr("cx",I).attr("cy",L).attr("r",b).attr("width",t.width).attr("height",t.height),T.append("line").attr("x1",I-b).attr("x2",I+b).attr("y1",L+b).attr("y2",L+b).attr("stroke-width",2),E==="neo"&&T.attr("filter","url(#drop-shadow)");const w=i.get(t.name)??0;pt.has(h)&&(T.style("stroke",u[w%u.length]),T.style("fill",_[w%u.length]));const A=T.node().getBBox();return t.height=A.height+(a?.sequence?.labelBoxHeight??0),r||(B++,O.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B),Et(a,Q(t.description))(t.description,T,f.x,f.y+(r?15:30),f.width,f.height,{class:`actor ${yt}`},a),r?T.attr("transform",`translate(0, ${b})`):(T.attr("transform",`translate(0, ${b/2-5})`),T.attr("data-et","participant"),T.attr("data-type","entity"),T.attr("data-id",t.name)),t.height},"drawActorTypeEntity"),Nr=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,c=n+t.height+2*a.boxTextMargin,{theme:E,themeVariables:h,look:p}=a,{bkgColorArray:_,borderColorArray:u,actorBorder:O}=h,T=e.append("g").lower();let g=T;r||(B++,Object.keys(t.links||{}).length&&!a.forceMenus&&g.attr("onclick",zt(`actor${B}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),g=T.append("g"),t.actorCnt=B,t.links!=null&&g.attr("id","root-"+B),p==="neo"&&g.attr("data-look","neo"));const f=dt();let I="actor";t.properties?.class?I=t.properties.class:f.fill="#eaeaea",r?I+=` ${_t}`:I+=` ${ft}`,f.x=t.x,f.y=n,f.width=t.width,f.height=t.height,f.class=I,f.name=t.name,f.x=t.x,f.y=n;const L=f.width/3,b=f.width/3,w=L/2,A=w/(2.5+L/50),D=g.append("g");D.attr("class",I);const M=`
|
||||
M ${f.x},${f.y+A}
|
||||
a ${w},${A} 0 0 0 ${L},0
|
||||
a ${w},${A} 0 0 0 -${L},0
|
||||
l 0,${b-2*A}
|
||||
a ${w},${A} 0 0 0 ${L},0
|
||||
l 0,-${b-2*A}
|
||||
`;D.append("path").attr("d",M),p==="neo"&&D.attr("filter","url(#drop-shadow)");const V=i.get(t.name)??0;pt.has(E)?(D.style("stroke",u[V%u.length]),D.style("fill",_[V%u.length])):D.style("stroke",O),D.attr("transform",`translate(${L}, ${A})`),t.rectData=f,Et(a,Q(t.description))(t.description,g,f.x,f.y+35,f.width,f.height,{class:`actor ${qt}`},a);const W=D.select("path:last-child");if(W.node()){const U=W.node().getBBox();t.height=U.height+(a.sequence.labelBoxHeight??0)}return r||(g.attr("data-et","participant"),g.attr("data-type","database"),g.attr("data-id",t.name)),t.height},"drawActorTypeDatabase"),Pr=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,c=n+80,E=22,h=e.append("g").lower(),{look:p,theme:_,themeVariables:u}=a,{bkgColorArray:O,borderColorArray:T,actorBorder:g}=u;r||(B++,h.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B);const f=e.append("g");let I=yt;r?I+=` ${_t}`:I+=` ${ft}`,f.attr("class",I),f.attr("name",t.name);const L=dt();L.x=t.x,L.y=n,L.fill="#eaeaea",L.width=t.width,L.height=t.height,L.class="actor",f.append("line").attr("id","actor-man-torso"+B).attr("x1",t.x+t.width/2-E*2.5).attr("y1",n+12).attr("x2",t.x+t.width/2-15).attr("y2",n+12),f.append("line").attr("id","actor-man-arms"+B).attr("x1",t.x+t.width/2-E*2.5).attr("y1",n+2).attr("x2",t.x+t.width/2-E*2.5).attr("y2",n+22),f.append("circle").attr("cx",t.x+t.width/2).attr("cy",n+12).attr("r",E),p==="neo"&&f.attr("filter","url(#drop-shadow)");const b=i.get(t.name)??0;pt.has(_)?(f.style("stroke",T[b%T.length]),f.style("fill",O[b%T.length])):f.style("stroke",g);const w=f.node().getBBox();return t.height=w.height+(a.sequence.labelBoxHeight??0),Et(a,Q(t.description))(t.description,f,L.x,L.y+15,L.width,L.height,{class:`actor ${yt}`},a),f.attr("transform",`translate(0,${E/2+10})`),r||(f.attr("data-et","participant"),f.attr("data-type","boundary"),f.attr("data-id",t.name)),t.height},"drawActorTypeBoundary"),kr=x(function(e,t,a,r,i){const n=r?t.stopy:t.starty,s=t.x+t.width/2,c=n+80,{look:E,theme:h,themeVariables:p}=a,{bkgColorArray:_,borderColorArray:u,actorBorder:O}=p,T=e.append("g").lower();r||(B++,T.append("line").attr("id","actor"+B).attr("x1",s).attr("y1",c).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B);const g=e.append("g");let f=yt;r?f+=` ${_t}`:f+=` ${ft}`,g.attr("class",f),g.attr("name",t.name),r||g.attr("data-et","participant").attr("data-type","actor").attr("data-id",t.name);const I=E==="neo"?.5:1,L=E==="neo"?n+(1-I)*30:n;g.append("line").attr("id","actor-man-torso"+B).attr("x1",s).attr("y1",L+25*I).attr("x2",s).attr("y2",L+45*I),g.append("line").attr("id","actor-man-arms"+B).attr("x1",s-It/2*I).attr("y1",L+33*I).attr("x2",s+It/2*I).attr("y2",L+33*I),g.append("line").attr("x1",s-It/2*I).attr("y1",L+60*I).attr("x2",s).attr("y2",L+45*I),g.append("line").attr("x1",s).attr("y1",L+45*I).attr("x2",s+(It/2-2)*I).attr("y2",L+60*I);const b=g.append("circle");b.attr("cx",t.x+t.width/2),b.attr("cy",L+10*I),b.attr("r",15*I),b.attr("width",t.width*I),b.attr("height",t.height*I);const w=g.node().getBBox();t.height=w.height;const A=dt();A.x=t.x,A.y=L,A.fill="#eaeaea",A.width=t.width,A.height=t.height/I,A.class="actor",A.rx=3,A.ry=3;const D=i.get(t.name)??0;return pt.has(h)?(g.style("stroke",u[D%u.length]),g.style("fill",_[D%u.length])):g.style("stroke",O),Et(a,Q(t.description))(t.description,g,A.x,L+35*I-(E==="neo"?10:0),A.width,A.height,{class:`actor ${yt}`},a),t.height},"drawActorTypeActor"),Dr=x(async function(e,t,a,r,i,n,s){const c=s??new Map([...n.db.getActors().values()].map((E,h)=>[E.name,h]));switch(t.type){case"actor":return await kr(e,t,a,r,c);case"participant":return await br(e,t,a,r,c);case"boundary":return await Pr(e,t,a,r,c);case"control":return await Sr(e,t,a,r,i,c);case"entity":return await wr(e,t,a,r,c);case"database":return await Nr(e,t,a,r,c);case"collections":return await mr(e,t,a,r,c);case"queue":return await Ar(e,t,a,r,c)}},"drawActor"),vr=x(function(e,t,a){const i=e.append("g");Ke(i,t),t.name&&Et(a)(t.name,i,t.x,t.y+a.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},a),i.lower()},"drawBox"),Cr=x(function(e){return e.append("g")},"anchorElement"),Mr=x(function(e,t,a,r,i,n,s){const{theme:c,themeVariables:E}=r,{bkgColorArray:h,borderColorArray:p,mainBkg:_}=E,u=dt(),O=t.anchored,T=t.actor;u.x=t.startx,u.y=t.starty,u.class="activation"+i%3,u.width=t.stopx-t.startx,u.height=a-t.starty;const g=Pt(O,u),I=(s??new Map([...n.db.getActors().values()].map((L,b)=>[L.name,b]))).get(T)??0;pt.has(c)&&(g.style("stroke",p[I%p.length]),g.style("fill",h[I%p.length]??_))},"drawActivation"),Br=x(async function(e,t,a,r,i){const{boxMargin:n,boxTextMargin:s,labelBoxHeight:c,l
Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as o}from"./mermaid.core.js";import"./index.js";var c=1;function i(){if(!(typeof globalThis>"u"))return globalThis}o(i,"getCaptureGlobal");function p(){return!!i()?.mermaidCaptureSizes}o(p,"shouldCaptureSizes");function u(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}o(u,"capturedFromLocation");function d(n,r){const t=i();if(!t)return;const e=r.node(),s=((e&&"ownerSVGElement"in e?e.ownerSVGElement:null)??e)?.id??"(unknown)";t.mermaidCapturedSizes??=[];const a={svgId:s,sizes:n};t.mermaidCapturedSizes.push(a),t.mermaidLastCapturedSizes=a}o(d,"emitCapturedSizes");function m(n,r){const t=[];for(const e of r.nodes)e.isGroup||t.push({id:e.id,width:e.width??0,height:e.height??0});t.length!==0&&d({metadata:{captureVersion:c,capturedAt:new Date().toISOString(),capturedFrom:u()},nodes:t},n)}o(m,"captureNodeSizes");export{m as captureNodeSizes,p as shouldCaptureSizes};
|
||||
@@ -0,0 +1 @@
|
||||
import{s as G,a as W,S as N}from"./chunk-IMKFNOWR.js";import{_ as f,c as t,j as H,l as S,d as P,Q as _,k as z,R as U,S as C,M as F,x as O}from"./mermaid.core.js";import{l as J}from"./layout.js";import"./chunk-XXDRQBXY.js";import"./chunk-POPQ4Y6H.js";import"./chunk-F27PBJKO.js";import"./index.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),D=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Y=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,B,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(B);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const m=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return m.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const B=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-B.x)<c&&x>p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),j=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),q=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),Q=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"<br/>");p=p.replace(/\n/g,"<br/>");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const m of a){const x=m.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),Z=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=Q(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","sLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
import{s as r,b as e,a,S as s}from"./chunk-IMKFNOWR.js";import{_ as i}from"./mermaid.core.js";import"./chunk-XXDRQBXY.js";import"./chunk-POPQ4Y6H.js";import"./chunk-F27PBJKO.js";import"./index.js";var u={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{u as diagram};
|
||||
@@ -0,0 +1 @@
|
||||
import{aq as Cr,l as In,_ as d,aB as To}from"./mermaid.core.js";import"./index.js";var Ao=5,Xe=1e-5,Ye=1e-6;function Ue(t){const e=[];for(let n=0;n<t.length-1;n++)e.push({a:t[n],b:t[n+1]});return e}d(Ue,"buildSegmentList");function Bo(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,a=o.x-n.x,l=o.y-n.y,f=s*l-r*a;if(f===0)return null;const i=n.x-t.x,g=n.y-t.y,x=(i*l-g*a)/f,C=(i*r-g*s)/f;return x<=Ye||x>=1-Ye||C<=Ye||C>=1-Ye?null:{point:{x:t.x+x*s,y:t.y+x*r},tA:x,tB:C}}d(Bo,"segmentIntersection");function Sn(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}d(Sn,"isHorizontalSeg");function ko(t){const e=[];for(let n=0;n<t.length;n++){const o=t[n],s=Ue(o.points);for(let r=n+1;r<t.length;r++){const a=t[r],l=Ue(a.points);for(const[f,i]of s.entries())for(const[g,x]of l.entries()){const C=Bo(i.a,i.b,x.a,x.b);if(!C)continue;const h=Sn(i),p=Sn(x);(h!==p?h:!1)?e.push({jumpEdgeId:o.id,otherEdgeId:a.id,segIndex:f,t:C.tA,point:C.point}):e.push({jumpEdgeId:a.id,otherEdgeId:o.id,segIndex:g,t:C.tB,point:C.point})}}}return e}d(ko,"findEdgeIntersections");function re(t){const e=Math.round(t*1e3)/1e3;return Number.isInteger(e)?`${e}`:`${e}`}d(re,"fmt");function Ae(t){return`${re(t.x)},${re(t.y)}`}d(Ae,"pointToString");function Fo(t){const e=t.b.x-t.a.x,n=t.b.y-t.a.y;return Math.abs(e)>=Math.abs(n)?e>=0?1:0:n>=0?1:0}d(Fo,"getArcSweepFlag");var vr=.001;function _o(t,e){if(t.length<2)return t.map(r=>({...r}));const n=t.map(r=>({...r})),o=e.arrowTypeStart&&To[e.arrowTypeStart];if(o){const r=t[0],a=t[1],l=Math.atan2(a.y-r.y,a.x-r.x);n[0].x=r.x+o*Math.cos(l),n[0].y=r.y+o*Math.sin(l)}const s=e.arrowTypeEnd&&To[e.arrowTypeEnd];if(s){const r=t.length,a=t[r-2],l=t[r-1],f=Math.atan2(l.y-a.y,l.x-a.x);n[r-1].x=l.x-s*Math.cos(f),n[r-1].y=l.y-s*Math.sin(f)}return n}d(_o,"applyMarkerOffsets");function Do(t,e,n,o,s){const r=t.point.x,a=t.point.y,l={x:r-e*t.r,y:a-n*t.r},f={x:r+e*t.r,y:a+n*t.r},i=[`L${Ae(l)}`];return s==="arc"?i.push(`A${re(t.r)},${re(t.r)} 0 0 ${o} ${Ae(f)}`):i.push(`M${Ae(f)}`),i}d(Do,"emitJump");function Cn(t,e,n,o){const s=e.x-t.x,r=e.y-t.y,a=n.x-e.x,l=n.y-e.y,f=Math.hypot(s,r),i=Math.hypot(a,l);if(f<Xe||i<Xe)return null;const g=s/f,x=r/f,C=a/i,h=l/i,p=g*C+x*h,c=Math.max(-1,Math.min(1,p)),y=Math.acos(c);if(y<Xe||Math.abs(Math.PI-y)<Xe)return null;const v=Math.min(o/Math.sin(y/2),f/2,i/2);return{startX:e.x-g*v,startY:e.y-x*v,endX:e.x+C*v,endY:e.y+h*v,ctrlX:e.x,ctrlY:e.y,cutLen:v}}d(Cn,"computeRoundedCorner");function Ho(t,e,n){const o=t.points;if(o.length<2)return"";const s=_o(o,t),r=t.curve==="rounded",a=Ue(s),l=new Map;for(const i of e){const g=a[i.segIndex];if(!g)continue;const x=Math.hypot(g.b.x-g.a.x,g.b.y-g.a.y),C=l.get(i.segIndex)??[];C.push({t:i.t,point:i.point,d:i.t*x,r:n.jumpRadius}),l.set(i.segIndex,C)}const f=[`M${Ae(s[0])}`];for(let i=0;i<a.length;i++){const g=a[i],x=Math.hypot(g.b.x-g.a.x,g.b.y-g.a.y),C=x===0?0:(g.b.x-g.a.x)/x,h=x===0?0:(g.b.y-g.a.y)/x,p=Fo(g);let c=0;if(r&&i>0){const E=Cn(s[i-1],s[i],s[i+1]??s[i],Ao);E&&(c=E.cutLen)}let y=x,v=null;r&&i<a.length-1&&(v=Cn(s[i],s[i+1],s[i+2]??s[i+1],Ao),v&&(y=x-v.cutLen));const M=[...l.get(i)??[]].sort((E,T)=>E.t-T.t);for(const E of M)E.r=Math.min(E.r,E.d-c,y-E.d);for(let E=0;E<M.length-1;E++){const T=M[E+1].d-M[E].d;if(M[E].r+M[E+1].r>T){const m=T/2;M[E].r=Math.min(M[E].r,m),M[E+1].r=Math.min(M[E+1].r,m)}}for(const E of M)E.r<vr||f.push(...Do(E,C,h,p,n.jumpStyle));r&&v?(f.push(`L${re(v.startX)},${re(v.startY)}`),f.push(`Q${re(v.ctrlX)},${re(v.ctrlY)} ${re(v.endX)},${re(v.endY)}`)):f.push(`L${Ae(g.b)}`)}return f.join(" ")}d(Ho,"rewriteEdgePath");function Xo(t){return/^[\d\s+,.LMelm-]*$/.test(t)}d(Xo,"isStraightPath");function Yo(t){return t?t==="linear"||t==="rounded"||t==="step"||t==="stepBefore"||t==="stepAfter":!0}d(Yo,"curveSupportsLineHops");function Go(t){if(!t)return null;try{const e=typeof atob=="function"?atob(t):Buffer.from(t,"base64").toString(),n=JSON.parse(e);if(!Array.isArray(n))return null;const o=[];for(const s of n)s&&typeof s.x=="number"&&typeof s.y=="number"&&o.push({x:s.x,y:s.y});return o.length>=2?o:null}catch{return null}}d(Go,"decodeDataPoints");function $o(t,e,n){if(!n.enabled)return;const o=t.node();if(!o)return;const s=new Map;for(const i of e)s.set(i.id,i);const r=[],a=new Map;for(const i of e){const g=typeof CSS<"u"&&CSS.escape?CSS.escape(i.id):i.id,x=o.querySelector(`path[data-id="${g}"]`);if(!x)continue;a.set(i.id,x);const h=Go(x.getAttribute("data-points"))??i.points;r.push({...i,points:h})}const l=ko(r);if(l.length===0)return;const f=new Map;for(const i of l){const g=f.get(i.jumpEdgeId)??[];g.push(i),f.set(i.jumpEdgeId,g)}for(const i of r){const g=f.get(i.id);if(!g||g.length===0)continue;const C=s.get(i.id)?.curve;if(C!==void 0&&!Yo(C))continue;const h=a.get(i.id);if(!h)continue;if(C===void 0){const E=h.getAttribute("d")??"";if(!Xo(E))continue}const p=h.getAttribute("style")??"",c=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(p),y=c?Number.parseFloat(c[1]):null,v=c?Number.parseFloat(c[2]):null,M=Ho(i,g,n);if(h.setAttributeLine truncated
|
||||
@@ -0,0 +1,8 @@
|
||||
import{c as r,s as e}from"./flowDiagram-HODETNUW.js";import{_ as a}from"./mermaid.core.js";import"./chunk-5VM5RSS4.js";import"./chunk-XXDRQBXY.js";import"./chunk-POPQ4Y6H.js";import"./chunk-F27PBJKO.js";import"./channel.js";import"./index.js";var o=a(t=>`${e(t)}
|
||||
.swimlane.cluster rect {
|
||||
stroke: ${t.clusterBorder} !important;
|
||||
}
|
||||
[data-look="neo"].cluster rect {
|
||||
filter: none;
|
||||
}
|
||||
`,"getStyles"),s=o,n=r({defaultLayout:"swimlane",styles:s});export{n as diagram};
|
||||
@@ -0,0 +1,44 @@
|
||||
:root {
|
||||
--radius: 0.5rem;
|
||||
--background: 0 0% 100%;
|
||||
--foreground: 240 10% 3.9%;
|
||||
--card: 0 0% 100%;
|
||||
--card-foreground: 240 10% 3.9%;
|
||||
--popover: 0 0% 100%;
|
||||
--popover-foreground: 240 10% 3.9%;
|
||||
--secondary: 240 4.8% 95.9%;
|
||||
--secondary-foreground: 240 5.9% 10%;
|
||||
--muted: 240 4.8% 95.9%;
|
||||
--muted-foreground: 240 3.8% 46.1%;
|
||||
--accent: 240 4.8% 95.9%;
|
||||
--accent-foreground: 240 5.9% 10%;
|
||||
--destructive: 0 84.2% 60.2%;
|
||||
--destructive-foreground: 0 0% 98%;
|
||||
--border: 240 5.9% 90%;
|
||||
--input: 240 5.9% 90%;
|
||||
--primary: 240 5.9% 10%;
|
||||
--primary-foreground: 0 0% 98%;
|
||||
--ring: 240 5.9% 10%;
|
||||
}
|
||||
|
||||
.dark {
|
||||
--background: 240 10% 3.9%;
|
||||
--foreground: 0 0% 98%;
|
||||
--card: 240 10% 3.9%;
|
||||
--card-foreground: 0 0% 98%;
|
||||
--popover: 240 10% 3.9%;
|
||||
--popover-foreground: 0 0% 98%;
|
||||
--secondary: 240 3.7% 15.9%;
|
||||
--secondary-foreground: 0 0% 98%;
|
||||
--muted: 240 3.7% 15.9%;
|
||||
--muted-foreground: 240 5% 64.9%;
|
||||
--accent: 240 3.7% 15.9%;
|
||||
--accent-foreground: 0 0% 98%;
|
||||
--destructive: 0 62.8% 30.6%;
|
||||
--destructive-foreground: 0 0% 98%;
|
||||
--border: 240 3.7% 15.9%;
|
||||
--input: 240 3.7% 15.9%;
|
||||
--primary: 0 0% 98%;
|
||||
--primary-foreground: 240 5.9% 10%;
|
||||
--ring: 240 4.9% 83.9%;
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
import{_ as o,y as pt,V as Rt,W as Ct,X as Wt,c as gt,l as E,D as Pt,L as Bt,Y as ft,j as K,t as Vt,$ as Ft,p as zt}from"./mermaid.core.js";import{d as ot}from"./arc.js";import"./index.js";var tt=(function(){var e=o(function(k,s,d,l){for(d=d||{},l=k.length;l--;d[k[l]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],h=[1,15],c=[1,16],a=[1,19],f=[1,20],g={trace:o(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:o(function(s,d,l,p,x,u,S){var v=u.length-1;switch(x){case 1:return u[v-1];case 3:p.setDirection("LR");break;case 4:p.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:p.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),p.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),p.getCommonDb().setAccDescription(this.$);break;case 15:p.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:p.addTask(u[v],0,""),this.$=u[v];break;case 19:p.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:o(function(s,d){if(d.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=d,l}},"parseError"),parse:o(function(s){var d=this,l=[0],p=[],x=[null],u=[],S=this.table,v="",I=0,R=0,W=2,O=1,L=u.slice.call(arguments,1),w=Object.create(this.lexer),H={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(H.yy[V]=this.yy[V]);w.setInput(s,H.yy),H.yy.lexer=w,H.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var F=w.yylloc;u.push(F);var j=w.options&&w.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function N(A){l.length=l.length-2*A,x.length=x.length-A,u.length=u.length-A}o(N,"popStack");function b(){var A;return A=p.pop()||w.lex()||O,typeof A!="number"&&(A instanceof Array&&(p=A,A=p.pop()),A=d.symbols_[A]||A),A}o(b,"lex");for(var _,$,T,P,C={},G,B,U,Z;;){if($=l[l.length-1],this.defaultActions[$]?T=this.defaultActions[$]:((_===null||typeof _>"u")&&(_=b()),T=S[$]&&S[$][_]),typeof T>"u"||!T.length||!T[0]){var Y="";Z=[];for(G in S[$])this.terminals_[G]&&G>W&&Z.push("'"+this.terminals_[G]+"'");w.showPosition?Y="Parse error on line "+(I+1)+`:
|
||||
`+w.showPosition()+`
|
||||
Expecting `+Z.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Y="Parse error on line "+(I+1)+": Unexpected "+(_==O?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Y,{text:w.match,token:this.terminals_[_]||_,line:w.yylineno,loc:F,expected:Z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+_);switch(T[0]){case 1:l.push(_),x.push(w.yytext),u.push(w.yylloc),l.push(T[1]),_=null,R=w.yyleng,v=w.yytext,I=w.yylineno,F=w.yylloc;break;case 2:if(B=this.productions_[T[1]][1],C.$=x[x.length-B],C._$={first_line:u[u.length-(B||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(B||1)].first_column,last_column:u[u.length-1].last_column},j&&(C._$.range=[u[u.length-(B||1)].range[0],u[u.length-1].range[1]]),P=this.performAction.apply(C,[v,R,I,H.yy,T[1],x,u].concat(L)),typeof P<"u")return P;B&&(l=l.slice(0,-1*B*2),x=x.slice(0,-1*B),u=u.slice(0,-1*B)),l.push(this.productions_[T[1]][0]),x.push(C.$),u.push(C._$),U=S[l[l.length-2]][l[l.length-1]],l.push(U);break;case 3:return!0}}return!0},"parse")},m=(function(){var k={EOF:1,parseError:o(function(d,l){if(this.yy.parser)this.yy.parser.parseError(d,l);else throw new Error(d)},"parseError"),setInput:o(function(s,d){return this.yy=d||this.yy||{},this._input=s,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:o(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var d=s.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:o(function(s){var d=s.length,l=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var p=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),l.length-1&&(this.yylineno-=l.length-1);var x=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:l?(l.length===p.length?this.yylloc.first_column:0)+p[p.length-l.length].length-l[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(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:o(function(s){this.unput(this.match.slice(s))},"less"),pastInput:o(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var s=this.pastInput(),d=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
||||
`+d+"^"},"showPosition"),test_match:o(function(s,d){var l,p,x;if(this.options.backtrack_lexer&&(x={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&&(x.yylloc.range=this.yylloc.range.slice(0))),p=s[0].match(/(?:\r\n?|\n).*/g),p&&(this.yylineno+=p.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,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(s[0].length),this.matched+=s[0],l=this.performAction.call(this,this.yy,this,d,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var u in x)this[u]=x[u];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,d,l,p;this._more||(this.yytext="",this.match="");for(var x=this._currentRules(),u=0;u<x.length;u++)if(l=this._input.match(this.rules[x[u]]),l&&(!d||l[0].length>d[0].length)){if(d=l,p=u,this.options.backtrack_lexer){if(s=this.test_match(l,x[u]),s!==!1)return s;if(this._backtrack){d=!1;continue}else return!1}else if(!this.options.flex)break}return d?(s=this.test_match(d,x[p]),s!==!1?s:!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:o(function(){var d=this.next();return d||this.lex()},"lex"),begin:o(function(d){this.conditionStack.push(d)},"begin"),popState:o(function(){var d=this.conditionStack.length-1;return d>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(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:o(function(d){return d=this.conditionStack.length-1-Math.abs(d||0),d>=0?this.conditionStack[d]:"INITIAL"},"topState"),pushState:o(function(d){this.begin(d)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(d,l,p,x){switch(p){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 k})();g.lexer=m;function y(){this.yy={}}return o(y,"Parser"),y.prototype=g,g.Parser=y,new y})();tt.parser=tt;var Ot=tt,yt={};Vt(yt,{addEvent:()=>Tt,addSection:()=>_t,addTask:()=>Et,addTaskOrg:()=>$t,clear:()=>kt,default:()=>Gt,getCommonDb:()=>xt,getDirection:()=>bt,getSections:()=>wt,getTasks:()=>St,setDirection:()=>vt});var D="",mt=0,nt="LR",rt=[],q=[],X=[],xt=o(()=>Ft,"getCommonDb"),kt=o(function(){rt.length=0,q.length=0,D="",X.length=0,nt="LR",zt()},"clear"),vt=o(function(e){nt=e},"setDirection"),bt=o(function(){return nt},"getDirection"),_t=o(function(e){D=e,rt.push(e)},"addSection"),wt=o(function(){return rt},"getSections"),St=o(function(){let e=ct();const t=100;let n=0;for(;!e&&n<t;)e=ct(),n++;return q.push(...X),q},"getTasks"),Et=o(function(e,t,n){const i={id:mt++,section:D,type:D,task:e,score:t||0,events:n?[n]:[]};X.push(i)},"addTask"),Tt=o(function(e){X.find(n=>n.id===mt-1).events.push(e)},"addEvent"),$t=o(function(e){const t={section:D,type:D,description:e,task:e,classes:[]};q.push(t)},"addTaskOrg"),ct=o(function(){const e=o(function(n){return X[n].processed},"compileTask");let t=!0;for(const[n,i]of X.entries())e(n),t=t&&i.processed;return t},"compileTasks"),Gt={clear:kt,getCommonDb:xt,getDirection:bt,setDirection:vt,addSection:_t,getSections:wt,getTasks:St,addTask:Et,addTaskOrg:$t,addEvent:Tt},Nt=0,J=o(function(e,t){const n=e.append("rect");return n.attr("x",t.x),n.attr("y",t.y),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("width",t.width),n.attr("height",t.height),n.attr("rx",t.rx),n.attr("ry",t.ry),t.class!==void 0&&n.attr("class",t.class),n},"drawRect"),Dt=o(function(e,t){const i=e.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),r=e.append("g");r.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function h(f){const g=ot().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",g).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}o(h,"smile");function c(f){const g=ot().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",g).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}o(c,"sad");function a(f){f.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return o(a,"ambivalent"),t.score>3?h(r):t.score<3?c(r):a(r),i},"drawFace"),Xt=o(function(e,t){const n=e.append("circle");return n.attr("cx",t.cx),n.attr("cy",t.cy)
Line truncated
|
||||
.section-${a-1} rect,
|
||||
.section-${a-1} path,
|
||||
.section-${a-1} circle {
|
||||
fill: ${n&&i?e.mainBkg:g};
|
||||
stroke: ${m};
|
||||
stroke-width: ${e.strokeWidth};
|
||||
filter: ${h};
|
||||
}
|
||||
|
||||
.section-${a-1} text {
|
||||
fill: ${e.nodeBorder};
|
||||
font-weight: ${e.fontWeight}
|
||||
}
|
||||
|
||||
.node-icon-${a-1} {
|
||||
font-size: 40px;
|
||||
color: ${e["cScaleLabel"+a]};
|
||||
}
|
||||
|
||||
.section-edge-${a-1} {
|
||||
stroke: ${e["cScale"+a]};
|
||||
}
|
||||
|
||||
.edge-depth-${a-1} {
|
||||
stroke-width: ${f};
|
||||
}
|
||||
|
||||
.section-${a-1} line {
|
||||
stroke: ${e["cScaleInv"+a]};
|
||||
stroke-width: 3;
|
||||
}
|
||||
|
||||
.lineWrapper line {
|
||||
stroke: ${e.nodeBorder};
|
||||
stroke-width:${e.strokeWidth}
|
||||
}
|
||||
|
||||
.disabled,
|
||||
.disabled circle,
|
||||
.disabled text {
|
||||
fill: ${e.tertiaryColor??"lightgray"};
|
||||
}
|
||||
|
||||
.disabled text {
|
||||
fill: ${e.clusterBorder??"#efefef"};
|
||||
}
|
||||
`}return c},"genReduxSections"),de=o(e=>{let t="";for(let n=0;n<e.THEME_COLOR_LIMIT;n++)e["lineColor"+n]=e["lineColor"+n]||e["cScaleInv"+n],Rt(e["lineColor"+n])?e["lineColor"+n]=Ct(e["lineColor"+n],20):e["lineColor"+n]=Wt(e["lineColor"+n],20);for(let n=0;n<e.THEME_COLOR_LIMIT;n++){const i=""+(17-3*n);t+=`
|
||||
.section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} path {
|
||||
fill: ${e["cScale"+n]};
|
||||
}
|
||||
.section-${n-1} text {
|
||||
fill: ${e["cScaleLabel"+n]};
|
||||
}
|
||||
.node-icon-${n-1} {
|
||||
font-size: 40px;
|
||||
color: ${e["cScaleLabel"+n]};
|
||||
}
|
||||
.section-edge-${n-1}{
|
||||
stroke: ${e["cScale"+n]};
|
||||
}
|
||||
.edge-depth-${n-1}{
|
||||
stroke-width: ${i};
|
||||
}
|
||||
.section-${n-1} line {
|
||||
stroke: ${e["cScaleInv"+n]} ;
|
||||
stroke-width: 3;
|
||||
}
|
||||
|
||||
.lineWrapper line{
|
||||
stroke: ${e["cScaleLabel"+n]} ;
|
||||
}
|
||||
|
||||
.disabled, .disabled circle, .disabled text {
|
||||
fill: ${e.tertiaryColor??"lightgray"};
|
||||
}
|
||||
.disabled text {
|
||||
fill: ${e.clusterBorder??"#efefef"};
|
||||
}
|
||||
`}return t},"genSections"),ue=o(e=>{const{theme:t}=pt(),n=t?.includes("redux"),i=t==="neutral",r=e.svgId?.replace(/^#/,"")??"";let h="";if(e.useGradient&&r&&e.THEME_COLOR_LIMIT&&!i)for(let c=0;c<e.THEME_COLOR_LIMIT;c++)h+=`
|
||||
.section-${c-1}[data-look="neo"] rect,
|
||||
.section-${c-1}[data-look="neo"] path,
|
||||
.section-${c-1}[data-look="neo"] circle {
|
||||
fill: ${e.mainBkg};
|
||||
stroke: url(#${r}-gradient);
|
||||
stroke-width: 2;
|
||||
}
|
||||
.section-${c-1}[data-look="neo"] line {
|
||||
stroke: url(#${r}-gradient);
|
||||
stroke-width: 2;
|
||||
}`;return`
|
||||
.edge {
|
||||
stroke-width: 3;
|
||||
}
|
||||
${n?he(e):de(e)}
|
||||
${h}
|
||||
.section-root rect, .section-root path, .section-root circle {
|
||||
fill: ${e.git0};
|
||||
}
|
||||
.section-root text {
|
||||
fill: ${e.gitBranchLabel0};
|
||||
}
|
||||
.icon-container {
|
||||
height:100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.edge {
|
||||
fill: none;
|
||||
}
|
||||
.eventWrapper {
|
||||
filter: brightness(120%);
|
||||
}
|
||||
`},"getStyles"),pe=ue,ge={setConf:o(()=>{},"setConf"),draw:o((e,t,n,i)=>(i?.db?.getDirection?.()??"LR")==="TD"?le.draw(e,t,n,i):re.draw(e,t,n,i),"draw")},xe={db:yt,renderer:ge,parser:Ot,styles:pe};export{xe as diagram};
|
||||
@@ -0,0 +1,34 @@
|
||||
import{b2 as Gt,s as Kt,g as Ht,o as Xt,n as Yt,a as Zt,b as Jt,_ as w,y as wt,D as Qt,j as ot,an as $t,V as te,W as ee,X as ne,d as se,p as ie,A as oe,B as re}from"./mermaid.core.js";import"./index.js";const kt=(t,n)=>Gt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];o+=(f.x+a.x)*(a.y-f.y);const y={x:(a.x+f.x)/2,y:(a.y+f.y)/2};let h=null;for(let b=0;b<a.parentIndex.length;++b)if(f.parentIndex.includes(a.parentIndex[b])){const p=t[a.parentIndex[b]],M=Math.atan2(a.x-p.x,a.y-p.y),E=Math.atan2(f.x-p.x,f.y-p.y);let _=E-M;_<0&&(_+=2*Math.PI);const S=E-_/2;let g=q(y,{x:p.x+p.radius*Math.sin(S),y:p.y+p.radius*Math.cos(S)});g>p.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(q(t[u],l)>Math.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u<i;++u){f/=2;const a=n+f,y=t(a);if(y*r>=0&&(n=a),Math.abs(f)<o||y===0)return a}return n+f}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function J(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,r=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,p=new Array(b+1);p[0]=n,p[0].fx=t(n),p[0].id=0;for(let v=0;v<b;++v){const c=n.slice();c[v]=c[v]?c[v]*i:o,p[v+1]=c,p[v+1].fx=t(c),p[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)p[b][c]=v[c];p[b].fx=v.fx}const E=(v,c)=>v.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(p.sort(E),s.history){const x=p.map(d=>{const D=d.slice();return D.fx=d.fx,D.id=d.id,D});x.sort((d,D)=>d.id-D.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x<b;++x)h=Math.max(h,Math.abs(p[0][x]-p[1][x]));if(Math.abs(p[0].fx-p[b].fx)<r&&h<l)break;for(let x=0;x<b;++x){_[x]=0;for(let d=0;d<b;++d)_[x]+=p[d][x];_[x]/=b}const c=p[b];if(J(S,1+f,_,-f,c),S.fx=t(S),S.fx<p[0].fx)J(m,1+u,_,-u,c),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=p[b-1].fx){let x=!1;if(S.fx>c.fx?(J(g,1+a,_,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(J(g,1-a*f,_,a*f,c),g.fx=t(g),g.fx<S.fx?M(g):x=!0),x){if(y>=1)break;for(let d=1;d<p.length;++d)J(p[d],1-y,p[0],y,p[d]),p[d].fx=t(p[d])}}else M(S)}return p.sort(E),{fx:p[0].fx,x:p[0]}}function ue(t,n,s,e,i,o,r){const l=s.fx,f=$(s.fxprime,n);let u=l,a=l,y=f,h=0;i=i||1,o=o||1e-6,r=r||.1;function b(p,M,E){for(let _=0;_<16;++_)if(i=(p+M)/2,J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||u>=E)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,E=u}return 0}for(let p=0;p<10;++p){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*Line truncated
|
||||
M`,t,n),e.push(`
|
||||
m`,-s,0),e.push(`
|
||||
a`,s,s,0,1,0,s*2,0),e.push(`
|
||||
a`,s,s,0,1,0,-s*2,0),e.join(" ")}function Me(t){const n=t.split(" ");return{x:Number.parseFloat(n[1]),y:Number.parseFloat(n[2]),radius:-Number.parseFloat(n[4])}}function Pt(t){if(t.length===0)return[];const n={};return st(t,n),n.arcs}function Bt(t,n){if(t.length===0)return"M 0 0";const s=Math.pow(10,n||0),e=n!=null?o=>Math.round(o*s)/s:o=>o;if(t.length==1){const o=t[0].circle;return ke(e(o.x),e(o.y),e(o.radius))}const i=[`
|
||||
M`,e(t[0].p2.x),e(t[0].p2.y)];for(const o of t){const r=e(o.circle.radius);i.push(`
|
||||
A`,r,r,0,o.large?1:0,o.sweep?1:0,e(o.p1.x),e(o.p1.y))}return i.join(" ")}function St(t,n){return Bt(Pt(t),n)}function Se(t,n={}){const{lossFunction:s,layoutFunction:e=At,normalize:i=!0,orientation:o=Math.PI/2,orientationOrder:r,width:l=600,height:f=350,padding:u=15,scaleToFit:a=!1,symmetricalTextCentre:y=!1,distinct:h,round:b=2}=n;let p=e(t,{lossFunction:s==="default"||!s?tt:s==="logRatio"?Dt:s,distinct:h});i&&(p=Ct(p,o,r));const M=Nt(p,l,f,u,a),E=Lt(M,t,y),_=new Map(Object.keys(M).map(m=>[m,{set:m,x:M[m].x,y:M[m].y,radius:M[m].radius}])),S=t.map(m=>{const v=m.sets.map(d=>_.get(d)),c=Pt(v),x=Bt(c,b);return{circles:v,arcs:c,path:x,area:m,has:new Set(m.sets)}});function g(m){let v="";for(const c of S)c.has.size>m.length&&m.every(x=>c.has.has(x))&&(v+=" "+c.path);return v}return S.map(({circles:m,arcs:v,path:c,area:x})=>({data:x,text:E[x.sets],circles:m,arcs:v,path:c,distinctPath:c+g(x.sets)}))}var gt=(function(){var t=w(function(S,g,m,v){for(m=m||{},v=S.length;v--;m[S[v]]=g);return m},"o"),n=[5,8],s=[7,8,11,12,17,19,22,24],e=[1,17],i=[1,18],o=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],r=[1,31],l=[1,39],f=[7,8,11,12,17,19,22,24,27],u=[1,57],a=[1,56],y=[1,58],h=[1,59],b=[1,60],p=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],M={trace:w(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:w(function(g,m,v,c,x,d,D){var I=d.length-1;switch(x){case 1:return d[I-1];case 2:case 3:case 4:this.$=[];break;case 5:d[I-1].push(d[I]),this.$=d[I-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=d[I];break;case 8:c.setDiagramTitle(d[I].substr(6)),this.$=d[I].substr(6);break;case 9:c.addSubsetData([d[I]],void 0,void 0),c.setIndentMode&&c.setIndentMode(!0);break;case 10:c.addSubsetData([d[I-1]],d[I],void 0),c.setIndentMode&&c.setIndentMode(!0);break;case 11:c.addSubsetData([d[I-2]],void 0,parseFloat(d[I])),c.setIndentMode&&c.setIndentMode(!0);break;case 12:c.addSubsetData([d[I-3]],d[I-2],parseFloat(d[I])),c.setIndentMode&&c.setIndentMode(!0);break;case 13:if(d[I].length<2)throw new Error("union requires multiple identifiers");c.validateUnionIdentifiers&&c.validateUnionIdentifiers(d[I]),c.addSubsetData(d[I],void 0,void 0),c.setIndentMode&&c.setIndentMode(!0);break;case 14:if(d[I-1].length<2)throw new Error("union requires multiple identifiers");c.validateUnionIdentifiers&&c.validateUnionIdentifiers(d[I-1]),c.addSubsetData(d[I-1],d[I],void 0),c.setIndentMode&&c.setIndentMode(!0);break;case 15:if(d[I-2].length<2)throw new Error("union requires multiple identifiers");c.validateUnionIdentifiers&&c.validateUnionIdentifiers(d[I-2]),c.addSubsetData(d[I-2],void 0,parseFloat(d[I])),c.setIndentMode&&c.setIndentMode(!0);break;case 16:if(d[I-3].length<2)throw new Error("union requires multiple identifiers");c.validateUnionIdentifiers&&c.validateUnionIdentifiers(d[I-3]),c.addSubsetData(d[I-3],d[I-2],parseFloat(d[I])),c.setIndentMode&&c.setIndentMode(!0);break;case 17:case 18:case 19:c.addTextData(d[I-1],d[I],void 0);break;case 20:case 21:c.addTextData(d[I-2],d[I-1],d[I]);break;case 23:c.addStyleData(d[I-1],d[I]);break;case 24:case 25:case 26:var C=c.getCurrentSets();if(!C)throw new Error("text requires set");c.addTextData(C,d[I],void 0);break;case 27:case 28:var C=c.getCurrentSets();if(!C)throw new Error("text requires set");c.addTextData(C,d[I-1],d[I]);break;case 29:case 41:this.$=[d[I]];break;case 30:case 42:this.$=[...d[I-2],d[I]];break;case 31:this.$=[d[I-2],d[I]];break;case 33:this.$=d[I].join(" ");break;case 34:this.$=[d[I]];break;case 35:d[I-1].push(d[I]),this.$=d[I-1];break;case 43:case 44:this.$=d[I];break}},"anonymous"),table:[t(n,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(s,[2,4],{6:5}),t(n,[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(s,[2,5]),t(s,[2,6]),t(s,[2,7]),t(s,[2,8]),{13:16,20:e,21:i},{13:20,18:19,20:e,21:i},{13:20,18:21,20:e,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:e,21:i},t(s,[2,9],{14:[1,27],15:[1,28]}),t(o,[2,43]),t(o,[2,44]),t(s,[2,13],{14:[1,29],15:[1,30],2
Line truncated
|
||||
`+T.showPosition()+`
|
||||
Expecting `+X.join(", ")+", got '"+(this.terminals_[z]||z)+"'":Z="Parse error on line "+(C+1)+": Unexpected "+(z==O?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(Z,{text:T.match,token:this.terminals_[z]||z,line:T.yylineno,loc:P,expected:X})}if(F[0]instanceof Array&&F.length>1)throw new Error("Parse Error: multiple actions possible at state: "+N+", token: "+z);switch(F[0]){case 1:v.push(z),x.push(T.yytext),d.push(T.yylloc),v.push(F[1]),z=null,U=T.yyleng,I=T.yytext,C=T.yylineno,P=T.yylloc;break;case 2:if(H=this.productions_[F[1]][1],k.$=x[x.length-H],k._$={first_line:d[d.length-(H||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(H||1)].first_column,last_column:d[d.length-1].last_column},B&&(k._$.range=[d[d.length-(H||1)].range[0],d[d.length-1].range[1]]),Y=this.performAction.apply(k,[I,U,C,A.yy,F[1],x,d].concat(R)),typeof Y<"u")return Y;H&&(v=v.slice(0,-1*H*2),x=x.slice(0,-1*H),d=d.slice(0,-1*H)),v.push(this.productions_[F[1]][0]),x.push(k.$),d.push(k._$),et=D[v[v.length-2]][v[v.length-1]],v.push(et);break;case 3:return!0}}return!0},"parse")},E=(function(){var S={EOF:1,parseError:w(function(m,v){if(this.yy.parser)this.yy.parser.parseError(m,v);else throw new Error(m)},"parseError"),setInput:w(function(g,m){return this.yy=m||this.yy||{},this._input=g,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:w(function(){var g=this._input[0];this.yytext+=g,this.yyleng++,this.offset++,this.match+=g,this.matched+=g;var m=g.match(/(?:\r\n?|\n).*/g);return m?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),g},"input"),unput:w(function(g){var m=g.length,v=g.split(/(?:\r\n?|\n)/g);this._input=g+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-m),this.offset-=m;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),v.length-1&&(this.yylineno-=v.length-1);var x=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:v?(v.length===c.length?this.yylloc.first_column:0)+c[c.length-v.length].length-v[0].length:this.yylloc.first_column-m},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-m]),this.yyleng=this.yytext.length,this},"unput"),more:w(function(){return this._more=!0,this},"more"),reject:w(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:w(function(g){this.unput(this.match.slice(g))},"less"),pastInput:w(function(){var g=this.matched.substr(0,this.matched.length-this.match.length);return(g.length>20?"...":"")+g.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:w(function(){var g=this.match;return g.length<20&&(g+=this._input.substr(0,20-g.length)),(g.substr(0,20)+(g.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:w(function(){var g=this.pastInput(),m=new Array(g.length+1).join("-");return g+this.upcomingInput()+`
|
||||
`+m+"^"},"showPosition"),test_match:w(function(g,m){var v,c,x;if(this.options.backtrack_lexer&&(x={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&&(x.yylloc.range=this.yylloc.range.slice(0))),c=g[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+g[0].length},this.yytext+=g[0],this.match+=g[0],this.matches=g,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(g[0].length),this.matched+=g[0],v=this.performAction.call(this,this.yy,this,m,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),v)return v;if(this._backtrack){for(var d in x)this[d]=x[d];return!1}return!1},"test_match"),next:w(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var g,m,v,c;this._more||(this.yytext="",this.match="");for(var x=this._currentRules(),d=0;d<x.length;d++)if(v=this._input.match(this.rules[x[d]]),v&&(!m||v[0].length>m[0].length)){if(m=v,c=d,this.options.backtrack_lexer){if(g=this.test_match(v,x[d]),g!==!1)return g;if(this._backtrack){m=!1;continue}else return!1}else if(!this.options.flex)break}return m?(g=this.test_match(m,x[c]),g!==!1?g:!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:w(function(){var m=this.next();return m||this.lex()},"lex"),begin:w(function(m){this.conditionStack.push(m)},"begin"),popState:w(function(){var m=this.conditionStack.length-1;return m>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:w(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:w(function(m){return m=this.conditionStack.length-1-Math.abs(m||0),m>=0?this.conditionStack[m]:"INITIAL"},"topState"),pushState:w(function(m){this.begin(m)},"pushState"),stateStackSize:w(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:w(function(m,v,c,x){switch(c){case 0:break;case 1:break;case 2:break;case 3:if(m.getIndentMode&&m.getIndentMode())return m.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:m.setIndentMode&&m.setIndentMode(!1),this.begin("INITIAL"),this.unput(v.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(m.consumeIndentText)m.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return v.yytext=v.yytext.slice(2,-2),14;case 17:return v.yytext=v.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 S})();M.lexer=E;function _(){this.yy={}}return w(_,"Parser"),_.prototype=M,M.Parser=_,new _})();gt.parser=gt;var we=gt,yt=[],pt=[],mt=[],bt=new Set,vt,It=!1,_e=w((t,n,s)=>{const e=it(t).sort(),i=s??10/Math.pow(t.length,2);vt=e,e.length===1&&bt.add(e[0]),yt.push({sets:e,size:i,label:n?nt(n):void 0})},"addSubsetData"),Te=w(()=>yt,"getSubsetData"),nt=w(t=>{const n=t.trim();return n.length>=2&&n.startsWith('"')&&n.endsWith('"')?n.slice(1,-1):n},"normalizeText"),Ee=w(t=>t&&nt(t),"normalizeStyleValue"),ze=w((t,n,s)=>{const e=nt(n);pt.push({sets:it(t).sort(),id:e,label:s?nt(s):void 0})},"addTextData"),Ae=w((t,n)=>{const s=it(t).sort(),e={};for(const[i,o]of n)e[i]=Ee(o)??o;mt.push({targets:s,styles:e})},"addStyleData"),Re=w(()=>mt,"getStyleData"),it=w(t=>t.map(n=>nt(n)),"normalizeIdentifierList"),De=w(t=>{const s=it(t).filter(e=>!bt.has(e));if(s.length>0)throw new Error(`unknown set identifier: ${s.join(", ")}`)},"validateUnionIdentifiers"),Ce=w(()=>pt,"getTextData"),Ne=w(()=>vt,"getCurrentSets"),Oe=w(()=>It,"getIndentMode"),je=w(t=>{It=t},"setIndentMode"),Fe=re.venn;function Vt(){return oe(Fe,wt().venn)}w(Vt,"getConfig");var Le=w(()=>{ie(),yt.length=0,pt.length=0,mt.length=0,bt.clear(),vt=void 0,It=!1},"customClear"),Pe={getConfig:Vt,clear:Le,setAccTitle:Jt,getAccTitle:Zt,setDiagramTitle:Yt,getDiagramTitle:Xt,getAccDescription:Ht,setAccDescription:Kt,addSubsetData:_e,getSubsetData:Te,addTextData:ze,addStyleData:Ae,validateUnionIdentifiers:De,getTextData:Ce,getStyleData:Re,getCurrentSets:Ne,getIndentMode:Oe,setIndentMode:je},Be=w(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"),Ve=Be;function qt(t){const n=new Map;for(const s of t){const e=s.targets.join("|"),i=n.get(e);i?Object.assign(i,s.styles):n.set(e,{...s.styles})}return n}w(qt,"buildStyleByKey");var qe=w((t,n,s,e)=>{const i=e.db,o=i.getConfig?.(),{themeVariables:r,look:l,handDrawnSeed:f}=wt(),u=l==="handDrawn",a=[r.venn1,r.venn2,r.venn3,r.venn4,r.venn5,r.venn6,r.venn7,r.venn8].filter(Boolean),y=i.getDiagramTitle?.(),h=i.getSubsetData(),b=i.getTextData(),p=qt(i.getStyleData()),M=Wt(h),E=o?.width??800,_=o?.height??450,g=E/1600,m=y?48*g:0,v=r.primaryTextColor??r.textColor,c=Qt(n);c.attr("viewBox",`0 0 ${E} ${_}`),y&&c.append("text").text(y).attr("class","venn-title").attr("font-size",`${32*g}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*g).style("fill",r.vennTitleTextColor||r.titleColor);const x=ot(document.createElement("div")),d=ve().width(E).height(_-m);x.datum(M).call(d);const D=u?$t.svg(x.select("svg").node()):void 0,I=Se(M,{width:E,height:_-m,padding:o?.padding??15}),C=new Map;for(const R of I){const T=Q([...R.data.sets].sort());C.set(T,R)}b.length>0&&Ut(o,C,x,b,g,p);const U=te(r.background||"#f4f4f4");x.selectAll(".venn-circle").each(function(R,T){const A=ot(this),P=Q([...R.sets].sort()),B=p.get(P),L=B?.fill||a[T%a.length]||r.primaryColor;A.classed(`venn-set-${T%8}`,!0);const K=B?.["fill-opacity"]??.1,z=B?.stroke||L,N=B?.["stroke-width"]||`${5*g}`;if(u&&D){const Y=C.get(P);if(Y&&Y.circles.length>0){const k=Y.circles[0],j=D.circle(k.x,k.y,k.radius*2,{roughness:.7,seed:f,fill:kt(L,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+T*60,stroke:z,strokeWidth:parseFloat(String(N))});A.select("path").remove(),A.node()?.insertBefore(j,A.select("text").node())}}else A.select("path").style("fill",L).style("fill-opacity",K).style("stroke",z).style("stroke-width",N).style("stroke-opacity",.95);const F=B?.color||(U?ee(L,30):ne(L,30));A.select("text").style("font-size",`${48*g}px`).style("fill",F)}),u&&D?x.selectAll(".venn-intersection").each(function(R){const T=ot(this),W=Q([...R.sets].sort()),P=p.get(W),B=P?.fill;if(B){const L=T.select("path"),K=L.attr("d");if(K){const z=D.path(K,{roughness:.7,seed:f,fill:kt(B,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),N=L.node();N?.parentNode?.insertBefore(z,N),L.remove()}}else T.select("path").style("fill-opacity",0);T.select("text").style("font-size",`${48*g}px`).style("fill",P?.color??r.vennSetTextColor??v)}):(x.selectAll(".venn-intersection text").style("font-size",`${48*g}px`).style("fill",R=>{const A=Q([...R.sets].sort());return p.get(A)?.color??r.vennSetTextColor??v}),x.selectAll(".venn-intersection path").style("fill-opacity",R=>{const A=Q([...R.sets].sort());return p.get(A)?.fill?1:0}).style("fill",R=>{const A=Q([...R.sets].sort());return p.get(A)?.fill??"transparent"}));const V=c.append("g").attr("transform",`translate(0, ${m})`),O=x.select("svg").node();if(O&&"childNodes"in O)for(const R of[...O.childNodes])V.node()?.appendChild(R);se(c,_,E,o?.useMaxWidth??!0)},"draw");function Q(t){return t.join("|")}w(Q,"stableSetsKey");function Ut(t,n,s,e,i,o){const r=t?.useDebugLayout??!1,f=s.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const a of e){const y=Q(a.sets),h=u.get(y);h?h.push(a):u.set(y,[a])}for(const[a,y]of u.entries()){const h=n.get(a);if(!h?.text)continue;const b=h.text.x,p=h.text.y,M=Math.min(...h.circles.map(O=>O.radius)),E=Math.min(...h.circles.map(O=>O.radius-Math.hypot(b-O.x,p-O.y)));let _=Number.isFinite(E)?Math.max(0,E):0;_===0&&Number.isFinite(M)&&(_=M*.6);const S=f.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);r&&S.append("circle").attr("class","venn-text-debug-circle").attr("cx",b).attr("cy",p).attr("r",_).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const g=Math.max(80*i,_*2*.95),m=Math.max(60*i,_*2*.95),x=(h.data.label&&h.data.label.length>0?Math.min(32*i,_*.25):0)+(y.length<=2?30*i:0),d=b-g/2,D=p-m/2+x,I=Math.max(1,Math.ceil(Math.sqrt(y.length))),C=Math.max(1,Math.ceil(y.length/I)),U=g/I,V=m/C;for(const[O,R]of y.entries()){const T=O%I,A=Math.floor(O/I),W=d+U*(T+.5),P=D+V*(A+.5);r&&S.append("rect").attr("class","venn-text-debug-cell").attr("x",d+U*T).attr("y",D+V*A).attr("width",U).attr("height",V).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const B=U*.9,L=V*.9,K=S.append("foreignObject").attr("class","venn-text-node-fo").attr("width",B).attr("height",L).attr("x",W-B/2).attr("y",P-L/2).attr("overflow","visible"),z=o.get(R.id)?.color,N=K.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(R.label??R.id);z&&N.style(
Line truncated
|
||||
@@ -0,0 +1,78 @@
|
||||
import{p as Mt}from"./chunk-JWPE2WC7.js";import{s as Nt,g as zt,o as Lt,n as Tt,a as At,b as Xt,_ as u,E as Et,y as Yt,A as J,l as Q,D as It,d as Bt,p as Ft,c as V}from"./mermaid.core.js";import{p as Rt}from"./cynefin-OW5HDTMX.js";import"./index.js";var G=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),A=u((o,r,e)=>({x:G(r,`${e} evolution`),y:G(o,`${e} visibility`)}),"toCoordinates"),K=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Ot=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(Mt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=A(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=A(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,w=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,w)}),o.notes.forEach(e=>{const h=A(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const w=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,R=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(w,d.name,R,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,w)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=K(e.fromPort)??K(e.toPort);const{flow:d,label:w}=Ot(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,g=w??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=A(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=A(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=A(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=A(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),tt={parser:{yy:void 0},parse:u(async o=>{const r=await Rt("wardley",o);Q.debug(r);const e=tt.parser?.yy;if(!e||typeof e.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.");Wt(r,e)},"parse")},E,Dt=(E=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(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[.Line truncated
|
||||
`+o);const a=jt(),d=Ht(),w=a.nodeRadius*1.6,C=h.db,g=C.getWardleyData(),R=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,Y=It(r);Y.selectAll("*").remove(),Bt(Y,b,S,a.useMaxWidth),Y.attr("viewBox",`0 0 ${S} ${b}`);const v=Y.append("g").attr("class","wardley-map"),q=Y.append("defs");q.append("marker").attr("id",`arrow-${r}`).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",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${r}`).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",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${r}`).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",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const I=S-a.padding*2,B=b-a.padding*2;R&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(R);const z=u(t=>a.padding+t/100*I,"projectX"),L=u(t=>b-a.padding-t/100*B,"projectY"),O=v.append("g").attr("class","wardley-axes");O.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const wt=g.axes.xLabel??"Evolution",mt=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+I/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(wt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+B/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+B/2})`).text(mt);const F=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:qt;if(F.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,n=[];if(s&&s.length===F.length){let i=0;s.forEach(p=>{n.push({start:i,end:p}),i=p})}else{const i=1/F.length;F.forEach((p,l)=>{n.push({start:l*i,end:(l+1)*i})})}F.forEach((i,p)=>{const l=n[p],f=a.padding+l.start*I,x=a.padding+l.end*I,y=(f+x)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const n=s/4,i=a.padding+I*n;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-B*n).attr("y2",b-a.padding-B*n).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:z(t.x),y:L(t.y),node:t})}),g.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(n=>{if(n.componentIds.length===0)return;const i=n.componentIds.map(x=>({id:x,pos:c.get(x),node:g.nodes.find(y=>y.id===x)})).filter(x=>x.pos&&x.node).sort((x,y)=>x.node.x-y.node.x);for(let x=0;x<i.length-1;x++){const y=i[x],m=i[x+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",y.pos.x).attr("y1",y.pos.y).attr("x2",m.pos.x).attr("y2",m.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,f=0;if(n.componentIds.forEach(x=>{const y=c.get(x);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){const y=a.nodeRadius*4,m=f-y/2,P=c.get(n.nodeId);if(P){const N=(p+l)/2;P.x=N,P.y=m-w/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",m).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=v.append("g").attr("class","wardley-
Line truncated
|
||||
M ${n} ${i-l/2}
|
||||
L ${n+p-f} ${i-l/2}
|
||||
L ${n+p-f} ${i-l/2-8}
|
||||
L ${n+p} ${i}
|
||||
L ${n+p-f} ${i+l/2+8}
|
||||
L ${n+p-f} ${i+l/2}
|
||||
L ${n} ${i+l/2}
|
||||
Z
|
||||
`;t.append("path").attr("d",x).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",n+p/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.name)})}if(g.deaccelerators.length>0){const t=v.append("g").attr("class","wardley-deaccelerators");g.deaccelerators.forEach(s=>{const n=z(s.x),i=L(s.y),p=60,l=30,f=20,x=`
|
||||
M ${n+p} ${i-l/2}
|
||||
L ${n+f} ${i-l/2}
|
||||
L ${n+f} ${i-l/2-8}
|
||||
L ${n} ${i}
|
||||
L ${n+f} ${i+l/2+8}
|
||||
L ${n+f} ${i+l/2}
|
||||
L ${n+p} ${i+l/2}
|
||||
Z
|
||||
`;t.append("path").attr("d",x).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",n+p/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.name)})}},"draw"),_t={draw:Vt},Zt=u(({wardley:o}={})=>{const r=Et(),e=Yt(),h=J(r,e.themeVariables),a=J(h.wardley,o);return`
|
||||
.wardley-background {
|
||||
fill: ${a.backgroundColor};
|
||||
}
|
||||
.wardley-axes line, .wardley-axes path {
|
||||
stroke: ${a.axisColor};
|
||||
}
|
||||
.wardley-axis-label {
|
||||
fill: ${a.axisTextColor};
|
||||
}
|
||||
.wardley-stage-label {
|
||||
fill: ${a.axisTextColor};
|
||||
}
|
||||
.wardley-grid line {
|
||||
stroke: ${a.gridColor};
|
||||
}
|
||||
.wardley-node circle {
|
||||
fill: ${a.componentFill};
|
||||
stroke: ${a.componentStroke};
|
||||
}
|
||||
.wardley-node-label {
|
||||
fill: ${a.componentLabelColor};
|
||||
}
|
||||
.wardley-link {
|
||||
stroke: ${a.linkStroke};
|
||||
}
|
||||
.wardley-link--dashed {
|
||||
stroke-dasharray: 4 4;
|
||||
}
|
||||
.wardley-link-label {
|
||||
fill: ${a.axisTextColor};
|
||||
}
|
||||
.wardley-trend line {
|
||||
stroke: ${a.evolutionStroke};
|
||||
}
|
||||
.wardley-annotation-line {
|
||||
stroke: ${a.annotationStroke};
|
||||
}
|
||||
.wardley-annotation circle {
|
||||
fill: ${a.annotationFill};
|
||||
stroke: ${a.annotationStroke};
|
||||
}
|
||||
.wardley-annotation text {
|
||||
fill: ${a.annotationTextColor};
|
||||
}
|
||||
.wardley-annotations-box rect {
|
||||
fill: ${a.annotationFill};
|
||||
stroke: ${a.annotationStroke};
|
||||
}
|
||||
.wardley-annotations-box text {
|
||||
fill: ${a.annotationTextColor};
|
||||
}
|
||||
.wardley-pipeline-box {
|
||||
stroke: ${a.componentStroke};
|
||||
}
|
||||
.wardley-notes text {
|
||||
fill: ${a.axisTextColor};
|
||||
}
|
||||
`},"styles"),ee={parser:tt,db:Gt,renderer:_t,styles:Zt};export{ee as diagram};
|
||||
@@ -0,0 +1,7 @@
|
||||
import{s as pi,g as mi,o as $t,n as yi,a as bi,b as wi,_ as a,l as Ut,D as Ai,d as Ci,p as Si,y as Dt,i as Ri,A as Gt,B as _i,E as ki,aC as Ti,R as Xt}from"./mermaid.core.js";import{i as Di}from"./init.js";import{o as Pi}from"./ordinal.js";import{l as Nt}from"./linear.js";import"./index.js";import"./defaultLocale.js";function vi(e,t,i){e=+e,t=+t,i=(n=arguments.length)<2?(t=e,e=0,1):n<3?1:+i;for(var s=-1,n=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(n);++s<n;)o[s]=e+s*i;return o}function St(){var e=Pi().unknown(void 0),t=e.domain,i=e.range,s=0,n=1,o,h,p=!1,u=0,f=0,R=.5;delete e.unknown;function C(){var y=t().length,E=n<s,v=E?n:s,L=E?s:n;o=(L-v)/Math.max(1,y-u+f*2),p&&(o=Math.floor(o)),v+=(L-v-o*(y-u))*R,h=o*(1-u),p&&(v=Math.round(v),h=Math.round(h));var M=vi(y).map(function(b){return v+o*b});return i(E?M.reverse():M)}return e.domain=function(y){return arguments.length?(t(y),C()):t()},e.range=function(y){return arguments.length?([s,n]=y,s=+s,n=+n,C()):[s,n]},e.rangeRound=function(y){return[s,n]=y,s=+s,n=+n,p=!0,C()},e.bandwidth=function(){return h},e.step=function(){return o},e.round=function(y){return arguments.length?(p=!!y,C()):p},e.padding=function(y){return arguments.length?(u=Math.min(1,f=+y),C()):u},e.paddingInner=function(y){return arguments.length?(u=Math.min(1,y),C()):u},e.paddingOuter=function(y){return arguments.length?(f=+y,C()):f},e.align=function(y){return arguments.length?(R=Math.max(0,Math.min(1,y)),C()):R},e.copy=function(){return St(t(),[s,n]).round(p).paddingInner(u).paddingOuter(f).align(R)},Di.apply(C(),arguments)}var Rt=(function(){var e=a(function(W,l,g,d){for(g=g||{},d=W.length;d--;g[W[d]]=l);return g},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],n=[1,5],o=[1,6],h=[1,7],p=[1,5,10,12,14,16,18,19,21,23,36,37,38],u=[1,25],f=[1,26],R=[1,28],C=[1,29],y=[1,30],E=[1,31],v=[1,32],L=[1,33],M=[1,34],b=[1,35],D=[1,36],c=[1,37],z=[1,43],F=[1,42],X=[1,47],N=[1,50],k=[1,10,12,14,16,18,19,21,23,36,37,38],H=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],A=[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],S=[1,65],O=[26,28],T={trace:a(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:a(function(l,g,d,x,_,r,lt){var m=r.length-1;switch(_){case 5:x.setOrientation(r[m]);break;case 9:x.setDiagramTitle(r[m].text.trim());break;case 12:x.setLineData({text:"",type:"text"},r[m]);break;case 13:x.setLineData(r[m-1],r[m]);break;case 14:x.setBarData({text:"",type:"text"},r[m]);break;case 15:x.setBarData(r[m-1],r[m]);break;case 16:this.$=r[m].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=r[m].trim(),x.setAccDescription(this.$);break;case 19:this.$=r[m-1];break;case 20:case 30:this.$=[r[m-2],...r[m]];break;case 21:case 31:this.$=[r[m]];break;case 22:this.$={value:Number(r[m-1]),label:r[m]};break;case 23:this.$={value:Number(r[m]),label:""};break;case 24:x.setXAxisTitle(r[m]);break;case 25:x.setXAxisTitle(r[m-1]);break;case 26:x.setXAxisTitle({type:"text",text:""});break;case 27:x.setXAxisBand(r[m]);break;case 28:x.setXAxisRangeData(Number(r[m-2]),Number(r[m]));break;case 29:this.$=r[m-1];break;case 32:x.setYAxisTitle(r[m]);break;case 33:x.setYAxisTitle(r[m-1]);break;case 34:x.setYAxisTitle({type:"text",text:""});break;case 35:x.setYAxisRangeData(Number(r[m-2]),Number(r[m]));break;case 39:this.$={text:r[m],type:"text"};break;case 40:this.$={text:r[m],type:"text"};break;case 41:this.$={text:r[m],type:"markdown"};break;case 42:this.$=r[m];break;case 43:this.$=r[m-1]+""+r[m];break}},"anonymous"),table:[e(t,i,{3:1,4:2,Line truncated
|
||||
`+P.showPosition()+`
|
||||
Expecting `+ft.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Ct="Parse error on line "+(dt+1)+": Unexpected "+(I==Vt?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Ct,{text:P.match,token:this.terminals_[I]||I,line:P.yylineno,loc:wt,expected:ft})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+I);switch(V[0]){case 1:d.push(I),_.push(P.yytext),r.push(P.yylloc),d.push(V[1]),I=null,Ot=P.yyleng,m=P.yytext,dt=P.yylineno,wt=P.yylloc;break;case 2:if(Y=this.productions_[V[1]][1],j.$=_[_.length-Y],j._$={first_line:r[r.length-(Y||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(Y||1)].first_column,last_column:r[r.length-1].last_column},xi&&(j._$.range=[r[r.length-(Y||1)].range[0],r[r.length-1].range[1]]),At=this.performAction.apply(j,[m,Ot,dt,$.yy,V[1],_,r].concat(di)),typeof At<"u")return At;Y&&(d=d.slice(0,-1*Y*2),_=_.slice(0,-1*Y),r=r.slice(0,-1*Y)),d.push(this.productions_[V[1]][0]),_.push(j.$),r.push(j._$),Wt=lt[d[d.length-2]][d[d.length-1]],d.push(Wt);break;case 3:return!0}}return!0},"parse")},ht=(function(){var W={EOF:1,parseError:a(function(g,d){if(this.yy.parser)this.yy.parser.parseError(g,d);else throw new Error(g)},"parseError"),setInput:a(function(l,g){return this.yy=g||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:a(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var g=l.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),l},"input"),unput:a(function(l){var g=l.length,d=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var x=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),d.length-1&&(this.yylineno-=d.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:d?(d.length===x.length?this.yylloc.first_column:0)+x[x.length-d.length].length-d[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(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:a(function(l){this.unput(this.match.slice(l))},"less"),pastInput:a(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:a(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:a(function(){var l=this.pastInput(),g=new Array(l.length+1).join("-");return l+this.upcomingInput()+`
|
||||
`+g+"^"},"showPosition"),test_match:a(function(l,g){var d,x,_;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))),x=l[0].match(/(?:\r\n?|\n).*/g),x&&(this.yylineno+=x.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:x?x[x.length-1].length-x[x.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],d=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),d)return d;if(this._backtrack){for(var r in _)this[r]=_[r];return!1}return!1},"test_match"),next:a(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,g,d,x;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),r=0;r<_.length;r++)if(d=this._input.match(this.rules[_[r]]),d&&(!g||d[0].length>g[0].length)){if(g=d,x=r,this.options.backtrack_lexer){if(l=this.test_match(d,_[r]),l!==!1)return l;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(l=this.test_match(g,_[x]),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:a(function(){var g=this.next();return g||this.lex()},"lex"),begin:a(function(g){this.conditionStack.push(g)},"begin"),popState:a(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(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:a(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:a(function(g){this.begin(g)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:a(function(g,d,x,_){switch(x){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 W})();T.lexer=ht;function q(){this.yy={}}return a(q,"Parser"),q.prototype=T,T.Parser=q,new q})();Rt.parser=Rt;var Li=Rt;function pt(e){return e.type==="bar"}a(pt,"isBarPlot");function mt(e){return e.type==="band"}a(mt,"isBandAxisData");function Q(e){return e.type==="linear"}a(Q,"isLinearAxisData");var K,Pt=(K=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((o,h)=>Math.max(h.length,o),0)*i,height:i};const s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const o of t){const h=Ti(n,1,o),p=h?h.width:o.length*i,u=h?h.height:i;s.width=Math.max(s.width,p),s.height=Math.max(s.height,u)}return n.remove(),s}},a(K,"TextDimensionCalculatorWithFont"),K),Yt=.7,Ht=.2,Z,qt=(Z=class{constructor(t,i,s,n){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,tLine truncated
|
||||
`+e);const C=Ai(t),y=C.append("g").attr("class","main"),E=y.append("rect").attr("width",h.width).attr("height",h.height).attr("class","background");Ci(C,h.height,h.width,!0),C.attr("viewBox",`0 0 ${h.width} ${h.height}`),E.attr("fill",o.backgroundColor),n.setTmpSVGG(C.append("g").attr("class","mermaid-tmp-group"));const v=n.getDrawableElem(),L={};function M(b){let D=y,c="";for(const[z]of b.entries()){let F=y;z>0&&L[c]&&(F=L[c]),c+=b[z],D=L[c],D||(D=L[c]=F.append("g").attr("class",b[z]))}return D}a(M,"getGroup");for(const b of v){if(b.data.length===0)continue;const D=M(b.groupTexts);switch(b.type){case"rect":if(D.selectAll("rect").data(b.data).enter().append("rect").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).attr("fill",c=>c.fill).attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth),h.showDataLabel){const c=h.showDataLabelOutsideBar;if(h.chartOrientation==="horizontal"){let z=function(S,O){const{data:T,label:ht}=S;return O*ht.length*F<=T.width-X};a(z,"fitsHorizontally");const F=.7,X=10,N=b.data.map((S,O)=>({data:S,label:p[O].toString()})).filter(S=>S.data.width>0&&S.data.height>0),k=N.map(S=>{const{data:O}=S;let T=O.height*.7;for(;!z(S,T)&&T>0;)T-=1;return T}),H=Math.floor(Math.min(...k)),A=a(S=>c?S.data.x+S.data.width+X:S.data.x+S.data.width-X,"determineLabelXPosition");D.selectAll("text").data(N).enter().append("text").attr("x",A).attr("y",S=>S.data.y+S.data.height/2).attr("text-anchor",c?"start":"end").attr("dominant-baseline","middle").attr("fill",o.dataLabelColor).attr("font-size",`${H}px`).text(S=>S.label)}else{let z=function(A,S,O){const{data:T,label:ht}=A,W=S*ht.length*.7,l=T.x+T.width/2,g=l-W/2,d=l+W/2,x=g>=T.x&&d<=T.x+T.width,_=T.y+O+S<=T.y+T.height;return x&&_};a(z,"fitsInBar");const F=10,X=b.data.map((A,S)=>({data:A,label:p[S].toString()})).filter(A=>A.data.width>0&&A.data.height>0),N=X.map(A=>{const{data:S,label:O}=A;let T=S.width/(O.length*.7);for(;!z(A,T,F)&&T>0;)T-=1;return T}),k=Math.floor(Math.min(...N)),H=a(A=>c?A.data.y-F:A.data.y+F,"determineLabelYPosition");D.selectAll("text").data(X).enter().append("text").attr("x",A=>A.data.x+A.data.width/2).attr("y",H).attr("text-anchor","middle").attr("dominant-baseline",c?"auto":"hanging").attr("fill",o.dataLabelColor).attr("font-size",`${k}px`).text(A=>A.label)}}break;case"text":D.selectAll("text").data(b.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",c=>c.fill).attr("font-size",c=>c.fontSize).attr("dominant-baseline",c=>u(c.verticalPos)).attr("text-anchor",c=>f(c.horizontalPos)).attr("transform",c=>R(c)).text(c=>c.text);break;case"path":D.selectAll("path").data(b.data).enter().append("path").attr("d",c=>c.path).attr("fill",c=>c.fill?c.fill:"none").attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth);break}}},"draw"),Gi={draw:Ui},te={parser:Li,db:$i,renderer:Gi};export{te as diagram};
|
||||
@@ -0,0 +1 @@
|
||||
{"items": [{"title": "Health Endpoints Guide", "path": "/docs/health-endpoints", "description": "PraisonAIUI provides multiple health endpoints optimized for different use cases:"}, {"title": "PraisonAIUI", "path": "/docs/index", "description": "PraisonAIUI is a YAML-driven website generator that transforms a single configuration file and a docs folder into a modern, production-ready website."}, {"title": "Testing", "path": "/docs/testing", "description": "PraisonAIUI uses pytest for all testing. Tests are split into unit and integration categories."}, {"title": "Adr", "path": "/docs/adr", "children": [{"title": "ADR 0001: PraisonAI Replay view, a clean-room design", "path": "/docs/adr/replay-view-clean-room", "description": "templates/frontend/plugins/views/replay-core.js, templates/frontend/plugins/views/replay.js"}]}, {"title": "Api", "path": "/docs/api", "children": [{"title": "CLI API Reference", "path": "/docs/api/cli", "description": "Complete reference for the aiui Python CLI."}, {"title": "Component API Reference", "path": "/docs/api/components", "description": "Python functions for building dashboard UIs. Each function returns a dict that the frontend renders as a real UI element — 36 components organized into tiers."}, {"title": "Features REST API Reference", "path": "/docs/api/features-api", "description": "Complete API reference for all 36 PraisonAIUI feature protocol endpoints."}, {"title": "Health API Reference", "path": "/docs/api/health", "description": "The AIUI health API provides endpoints to monitor server and provider health status."}, {"title": "Python SDK API", "path": "/docs/api/python", "description": "Reference for import praisonaiui as aiui."}, {"title": "Sessions API Reference", "path": "/docs/api/sessions", "description": "Create a new session."}, {"title": "API Testing Guide", "path": "/docs/api/testing", "description": "Test all 16 PraisonAIUI feature APIs using curl. Each example creates real data and verifies backend processing."}, {"title": "TypeScript SDK Reference", "path": "/docs/api/typescript", "description": "Complete API reference for the TypeScript/React runtime."}]}, {"title": "Concepts", "path": "/docs/concepts", "children": [{"title": "Architecture: AG-UI Protocol vs Gateway Integration", "path": "/docs/concepts/architecture", "description": "PraisonAIUI has two complementary integration layers with the praisonai backend. They solve different problems and run side-by-side."}, {"title": "YAML Configuration", "path": "/docs/concepts/configuration", "description": "Complete guide to the aiui.template.yaml configuration schema."}, {"title": "Providers", "path": "/docs/concepts/providers", "description": "PraisonAIUI uses a provider protocol — a simple abstraction that lets you plug in any AI backend."}, {"title": "Slots & Components", "path": "/docs/concepts/slots", "description": "Understanding the slot system and built-in components."}, {"title": "Templates & Layouts", "path": "/docs/concepts/templates", "description": "Learn how templates and layouts work in PraisonAIUI."}]}, {"title": "Examples", "path": "/docs/examples", "children": [{"title": "Advanced Examples", "path": "/docs/examples/advanced", "description": "Complex configurations and customization patterns."}, {"title": "Basic Examples", "path": "/docs/examples/basic", "description": "Simple examples to get started with PraisonAIUI."}]}, {"title": "Features", "path": "/docs/features", "children": [{"title": "A2UI canvas — agent-driven UI", "path": "/docs/features/a2ui-canvas", "description": "PraisonAIUI hosts A2UI v0.9 surfaces: agents push structured UI messages to a live canvas while users chat in the same window or on a full-page workspace."}, {"title": "Agent UI host — modular dashboard shell", "path": "/docs/features/agent-ui-host", "description": "PraisonAIUI can host any AI agent backend behind a modular dashboard shell: pages, views, layout components, optional plugins, and branding — without forking th"}, {"title": "Chat Attachments", "path": "/docs/features/attachments", "description": "Upload files to include with chat messages — PDFs, CSVs, images, and text files up to 50 MB per file. Uploaded files are automatically processed and their conte"}, {"title": "Backend Integration Contract", "path": "/docs/features/backend-integration", "description": "PraisonAIUI supports a four-layer integration model so standalone mode and SDK-integrated mode can share the same feature APIs."}, {"title": "BeautifulUI Integration Strategy", "path": "/docs/features/beautifului-integration", "description": "BeautifulUI (MIT, Shane Levine / Turbo) is a copy-paste / shadcn-registry library of React primitives for AI-native interfaces: thinking traces, streaming answe"}, {"title": "Browser Automation", "path": "/docs/features/browser-automation", "description": "Expose browser agent capabilities (CDP, Playwright) through the dashboard — run browser tasks from the UI."}, {"title": "Channel-to-Chat BridLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
ui.praison.ai
|
||||
@@ -0,0 +1,39 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
|
||||
<script id="aiui-canonical-url">(function(){var p=location.pathname.replace(/\/+$/, '')||'/';if(p!==location.pathname){history.replaceState(null,'',p+location.search+location.hash);}})();</script>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="Adr - Documentation for PraisonAIUI - YAML-driven website generator" />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:locale" content="en_US" />
|
||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
||||
<title>Adr | PraisonAIUI Docs</title>
|
||||
<script>
|
||||
(function(){try{var t=localStorage.getItem('aiui-theme-preference');var d=true;if(t==='dark'||(t==='system'&&matchMedia('(prefers-color-scheme: dark)').matches)||(!t&&d))document.documentElement.classList.add('dark');else if(t==='light')document.documentElement.classList.remove('dark');}catch(e){}})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="/assets/theme.css">
|
||||
<script type="module" crossorigin src="/assets/index.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index.css">
|
||||
<link rel="canonical" href="https://ui.praison.ai/docs/adr" />
|
||||
<meta property="og:title" content="Adr | PraisonAIUI Docs" />
|
||||
<meta property="og:description" content="Adr - Documentation for PraisonAIUI - YAML-driven website generator" />
|
||||
<meta property="og:url" content="https://ui.praison.ai/docs/adr" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:image" content="https://ui.praison.ai/icon.svg" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="Adr | PraisonAIUI Docs" />
|
||||
<meta name="twitter:description" content="Adr - Documentation for PraisonAIUI - YAML-driven website generator" />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<script type="application/ld+json">{"@context": "https://schema.org", "@type": "TechArticle", "headline": "Adr", "description": "Adr - Documentation for PraisonAIUI - YAML-driven website generator", "url": "https://ui.praison.ai/docs/adr", "isPartOf": {"@type": "WebSite", "name": "PraisonAIUI Docs", "url": "https://ui.praison.ai/"}}</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"><noscript><nav aria-label="Documentation"><ul><li><a href="https://ui.praison.ai/docs/health-endpoints">Health Endpoints Guide</a></li><li><a href="https://ui.praison.ai/docs/index">PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/testing">Testing</a></li><li><a href="https://ui.praison.ai/docs/adr">Adr</a></li><li><a href="https://ui.praison.ai/docs/adr/replay-view-clean-room">ADR 0001: PraisonAI Replay view, a clean-room design</a></li><li><a href="https://ui.praison.ai/docs/api">Api</a></li><li><a href="https://ui.praison.ai/docs/api/cli">CLI API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/components">Component API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/features-api">Features REST API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/health">Health API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/python">Python SDK API</a></li><li><a href="https://ui.praison.ai/docs/api/sessions">Sessions API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/testing">API Testing Guide</a></li><li><a href="https://ui.praison.ai/docs/api/typescript">TypeScript SDK Reference</a></li><li><a href="https://ui.praison.ai/docs/concepts">Concepts</a></li><li><a href="https://ui.praison.ai/docs/concepts/architecture">Architecture: AG-UI Protocol vs Gateway Integration</a></li><li><a href="https://ui.praison.ai/docs/concepts/configuration">YAML Configuration</a></li><li><a href="https://ui.praison.ai/docs/concepts/providers">Providers</a></li><li><a href="https://ui.praison.ai/docs/concepts/slots">Slots & Components</a></li><li><a href="https://ui.praison.ai/docs/concepts/templates">Templates & Layouts</a></li><li><a href="https://ui.praison.ai/docs/examples">Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/advanced">Advanced Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/basic">Basic Examples</a></li><li><a href="https://ui.praison.ai/docs/features">Features</a></li><li><a href="https://ui.praison.ai/docs/features/a2ui-canvas">A2UI canvas — agent-driven UI</a></li><li><a href="https://ui.praison.ai/docs/features/agent-ui-host">Agent UI host — modular dashboard shell</a></li><li><a href="https://ui.praison.ai/docs/features/attachments">Chat Attachments</a></li><li><a href="https://ui.praison.ai/docs/features/backend-integration">Backend Integration Contract</a></li><li><a href="https://ui.praison.ai/docs/features/beautifului-integration">BeautifulUI Integration Strategy</a></li><li><a href="https://ui.praison.ai/docs/features/browser-automation">Browser Automation</a></li><li><a href="https://ui.praison.ai/docs/features/channel-chat-bridge">Channel-to-Chat Bridge</a></li><li><a href="https://ui.praison.ai/docs/features/code-execution">Code Execution</a></li><li><a href="https://ui.praison.ai/docs/features/comparison-openclaw">Feature Comparison: PraisonAIUI vs OpenClaw</a></li><li><a href="https://ui.praison.ai/docs/features/config-hot-reload">Config Hot-Reload</a></li><li><a href="https://ui.praison.ai/docs/features/content-sources">Content Sources</a></li><li><a href="https://ui.praison.ai/docs/features/css-architecture">How the UI Looks Are Built</a></li><li><a href="https://ui.praison.ai/docs/features/dark-mode">Dark Mode</a></li><li><a href="https://ui.praison.ai/docs/features/dashboard">Dashboard</a></li><li><a href="https://ui.praison.ai/docs/features/deployment">Deployment Guide</a></li><li><a href="https://ui.praison.ai/docs/features/device-pairing">Device Pairing</a></li><li><a href="https://ui.praison.ai/docs/features/differentiation">What Makes PraisonAIUI Different</a></li><li><a href="https://ui.praison.ai/docs/features/feature-inventory">Feature Inventory</a></li><li><a href="https://ui.praison.ai/docs/features/gap-analysis">Gap Analysis — Validated Against praisonai SDK</a></li><li><a href="https://ui.praison.ai/docs/features/gateway-chat">Gateway Chat</a></li><li><a href="https://ui.praison.ai/docs/features/hot-reload">Hot Reload</a></li><li><a href="https://ui.praison.ai/docs/features/how-to-add-a-feature">How to Add a Feature to PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/features/i18n">Internationalization (i18n)</a></li><li><a href="https://ui.praison.ai/docs/features/image-preview-chat">Image Preview in Chat</a></li><li><a href="https://ui.praison.ai/docs/features/integration-analysis">AIUI Integration — Critical Review & Architecture Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/knowledge-embeddings">Knowledge Embedding Model Configuration</a></li><li><a href="https://ui.praison.ai/docs/features/marketplace">Plugin Marketplace</a></li><li><a href="https://ui.praison.ai/docs/features/media-analysis">Media Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/message-elements">Message Elements</a></li><li><a href="https://ui.praison.ai/docs/features/model-fallback">Model Fallback</a></li><li><a href=Line truncated
|
||||
<script src="/plugins/plugin-loader.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,94 @@
|
||||
# ADR 0001: PraisonAI Replay view, a clean-room design
|
||||
|
||||
- **Status:** accepted
|
||||
- **Date:** 2026-10-26
|
||||
- **Scope:** `src/praisonaiui/features/replay.py`, `features/_trace_jsonl.py`,
|
||||
`templates/frontend/plugins/views/replay-core.js`, `templates/frontend/plugins/views/replay.js`
|
||||
|
||||
## Context
|
||||
|
||||
PraisonAI records agent runs as context-trace JSONL (one `ContextEvent.to_dict()` per
|
||||
line). People need to see what a team or flow did: who did what, when, why, and at what
|
||||
cost, both after the fact and live. Other tools have shown that a graph plus a trace is a
|
||||
useful way to look at agent runs. We want that value without copying anyone's product,
|
||||
code or look, and without adding dependencies.
|
||||
|
||||
## Decision
|
||||
|
||||
Build our own view, in plain DOM and SVG, with our own layout code, palette and words.
|
||||
|
||||
### Ideas we took (ideas only)
|
||||
|
||||
| Idea | Where it came from | What we did with it |
|
||||
|---|---|---|
|
||||
| Show the graph of a multi-agent program next to the trace of a run | The general concept behind LangGraph Studio's graph-plus-trace view, known from public talks and articles | A **Map** view drawn by our own layered layout (`layoutMap`); the default view is a **Timeline**, which Studio does not have |
|
||||
| Parallel voices on shared time, read left to right | Musical scores and swimlane diagrams | One lane per agent plus Manager and You; parallel branches as sub-lanes; tasks and steps as "chapters" across the top |
|
||||
| Vocabulary for LLM and tool spans, tokens and cost | OpenTelemetry GenAI semantic conventions (public specification) | Block kinds (LLM, tool), token and cost totals; the wrapper's OTLP export uses the conventions, the UI only borrows the concepts |
|
||||
|
||||
### What we did not use
|
||||
|
||||
- **No third-party UI code, CSS, icons, layouts or screenshots** were used to build this
|
||||
view. Shapes, palette, spacing, wording ("Brief", "Delivered", "Waiting for you") and
|
||||
the layout algorithm are our own.
|
||||
- **LangGraph's server (Elastic License 2.0) and the proprietary LangGraph Studio were
|
||||
not consulted for code**, and none of their assets, markup or styles were copied. We
|
||||
do not use the name "Studio", any "Lang…" naming, or `__start__`/`__end__` pills.
|
||||
- No Mermaid, D3, React Flow, dagre, ELK or other graph libraries. The dashboard's
|
||||
existing Mermaid CDN plugin is not used by Replay.
|
||||
|
||||
### How it is built
|
||||
|
||||
- `replay-core.js`: pure functions (`buildModel`, `narrate`, `layoutMap`,
|
||||
`deriveGraph`). No DOM, no network. Tested with `node --test`.
|
||||
- `replay.js`: DOM/SVG rendering, keyboard handling, SSE follow and approvals. It also
|
||||
boots by itself when `window.__REPLAY_DATA__ = {events, graph}` is set, which is how
|
||||
the wrapper's single-file HTML export works (`standalone_html()` inlines both files).
|
||||
- `layoutMap` is a textbook layered layout written from scratch: depth-first search to
|
||||
find back edges (loops), longest-path layering, one virtual waypoint per crossed layer
|
||||
for long edges, and a few barycentre sweeps to order each layer. It is deterministic.
|
||||
- Narration is template text, chosen per event type. No LLM, no randomness.
|
||||
|
||||
## Palette and accessibility rationale
|
||||
|
||||
| Role | Fill | Shape | Why |
|
||||
|---|---|---|---|
|
||||
| Agent | `#8B0000` | circle | PraisonAI's brand red; white text on it is 10.0:1 |
|
||||
| Tool | `#0F7287` | rounded rectangle | Teal kept from the brand but darkened from `#189AB4` (white text on `#189AB4` fails AA); white on `#0F7287` is 5.6:1 |
|
||||
| You (human) | `#8A5A00` | diamond | Amber distinct from red and teal for common colour-vision deficiencies; white on it is 5.9:1 |
|
||||
| Manager | `#3C4A5C` | square | Neutral slate, so the manager reads as coordination, not work; white on it is 9.0:1 |
|
||||
|
||||
- **Never colour alone.** Every lane, block, node and step has a shape and a text label;
|
||||
arrows differ by dash pattern and carry words ("hands off", "delegates", "routes").
|
||||
Heat in the cost/latency overlay is a bar whose height and shade both grow, plus the
|
||||
value in text.
|
||||
- **Theme.** Follows the system setting (`prefers-color-scheme`) by default, with a
|
||||
Light/Dark override; the light theme is the design baseline.
|
||||
- **Light theme first.** Text tokens are at least 6.9:1 on their backgrounds in light mode
|
||||
and 7.7:1 in dark mode. In dark mode the palette fills keep white text at AA, and get a
|
||||
light 2 px outline so each shape's boundary stays above 3:1 against the dark page.
|
||||
- **Keyboard throughout.** ← → (and ↑ ↓ in the step list) move the replay cursor, Home
|
||||
and End jump to the ends, tabs follow the ARIA tabs pattern, map nodes use a roving
|
||||
tab stop, and every action has a real button.
|
||||
- **Screen readers.** The narration column is a real ordered list and is the main way
|
||||
through a run. Timeline blocks and map nodes are named buttons whose names start with
|
||||
their visible text (WCAG 2.5.3). Live updates are announced through a polite live
|
||||
region, throttled.
|
||||
- **Motion.** The only animation (the live dot) runs only under
|
||||
`prefers-reduced-motion: no-preference`; scrolling is instant when motion is reduced.
|
||||
- Checked with axe-core against WCAG 2.0, 2.1 and 2.2 A/AA in both themes (dev-only test
|
||||
in `tests/browser/`).
|
||||
|
||||
## Dependency licences
|
||||
|
||||
No new runtime or build dependencies. The Python side uses only the standard library and
|
||||
Starlette, which aiui already depends on. The browser side is plain ES modules with no
|
||||
imports beyond our own file. Dev-only test tools that are not shipped: Playwright
|
||||
(Apache-2.0, already used in this environment) and axe-core (MPL-2.0, loaded from a path
|
||||
given by `AXE_CORE_JS`; not vendored).
|
||||
|
||||
## Consequences
|
||||
|
||||
- We own the look and the layout code, and can change them without licence questions.
|
||||
- The layout is simpler than a dedicated graph engine. It is fine for the team and flow
|
||||
sizes we see (tens of nodes). Very large graphs may need a better crossing-reduction
|
||||
step later.
|
||||
@@ -0,0 +1,39 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
|
||||
<script id="aiui-canonical-url">(function(){var p=location.pathname.replace(/\/+$/, '')||'/';if(p!==location.pathname){history.replaceState(null,'',p+location.search+location.hash);}})();</script>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="templates/frontend/plugins/views/replay-core.js, templates/frontend/plugins/views/replay.js" />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:locale" content="en_US" />
|
||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
||||
<title>ADR 0001: PraisonAI Replay view, a clean-room design | PraisonAIUI Docs</title>
|
||||
<script>
|
||||
(function(){try{var t=localStorage.getItem('aiui-theme-preference');var d=true;if(t==='dark'||(t==='system'&&matchMedia('(prefers-color-scheme: dark)').matches)||(!t&&d))document.documentElement.classList.add('dark');else if(t==='light')document.documentElement.classList.remove('dark');}catch(e){}})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="/assets/theme.css">
|
||||
<script type="module" crossorigin src="/assets/index.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index.css">
|
||||
<link rel="canonical" href="https://ui.praison.ai/docs/adr/replay-view-clean-room" />
|
||||
<meta property="og:title" content="ADR 0001: PraisonAI Replay view, a clean-room design | PraisonAIUI Docs" />
|
||||
<meta property="og:description" content="templates/frontend/plugins/views/replay-core.js, templates/frontend/plugins/views/replay.js" />
|
||||
<meta property="og:url" content="https://ui.praison.ai/docs/adr/replay-view-clean-room" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:image" content="https://ui.praison.ai/icon.svg" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="ADR 0001: PraisonAI Replay view, a clean-room design | PraisonAIUI Docs" />
|
||||
<meta name="twitter:description" content="templates/frontend/plugins/views/replay-core.js, templates/frontend/plugins/views/replay.js" />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<script type="application/ld+json">{"@context": "https://schema.org", "@type": "TechArticle", "headline": "ADR 0001: PraisonAI Replay view, a clean-room design", "description": "templates/frontend/plugins/views/replay-core.js, templates/frontend/plugins/views/replay.js", "url": "https://ui.praison.ai/docs/adr/replay-view-clean-room", "isPartOf": {"@type": "WebSite", "name": "PraisonAIUI Docs", "url": "https://ui.praison.ai/"}}</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"><noscript><nav aria-label="Documentation"><ul><li><a href="https://ui.praison.ai/docs/health-endpoints">Health Endpoints Guide</a></li><li><a href="https://ui.praison.ai/docs/index">PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/testing">Testing</a></li><li><a href="https://ui.praison.ai/docs/adr">Adr</a></li><li><a href="https://ui.praison.ai/docs/adr/replay-view-clean-room">ADR 0001: PraisonAI Replay view, a clean-room design</a></li><li><a href="https://ui.praison.ai/docs/api">Api</a></li><li><a href="https://ui.praison.ai/docs/api/cli">CLI API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/components">Component API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/features-api">Features REST API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/health">Health API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/python">Python SDK API</a></li><li><a href="https://ui.praison.ai/docs/api/sessions">Sessions API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/testing">API Testing Guide</a></li><li><a href="https://ui.praison.ai/docs/api/typescript">TypeScript SDK Reference</a></li><li><a href="https://ui.praison.ai/docs/concepts">Concepts</a></li><li><a href="https://ui.praison.ai/docs/concepts/architecture">Architecture: AG-UI Protocol vs Gateway Integration</a></li><li><a href="https://ui.praison.ai/docs/concepts/configuration">YAML Configuration</a></li><li><a href="https://ui.praison.ai/docs/concepts/providers">Providers</a></li><li><a href="https://ui.praison.ai/docs/concepts/slots">Slots & Components</a></li><li><a href="https://ui.praison.ai/docs/concepts/templates">Templates & Layouts</a></li><li><a href="https://ui.praison.ai/docs/examples">Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/advanced">Advanced Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/basic">Basic Examples</a></li><li><a href="https://ui.praison.ai/docs/features">Features</a></li><li><a href="https://ui.praison.ai/docs/features/a2ui-canvas">A2UI canvas — agent-driven UI</a></li><li><a href="https://ui.praison.ai/docs/features/agent-ui-host">Agent UI host — modular dashboard shell</a></li><li><a href="https://ui.praison.ai/docs/features/attachments">Chat Attachments</a></li><li><a href="https://ui.praison.ai/docs/features/backend-integration">Backend Integration Contract</a></li><li><a href="https://ui.praison.ai/docs/features/beautifului-integration">BeautifulUI Integration Strategy</a></li><li><a href="https://ui.praison.ai/docs/features/browser-automation">Browser Automation</a></li><li><a href="https://ui.praison.ai/docs/features/channel-chat-bridge">Channel-to-Chat Bridge</a></li><li><a href="https://ui.praison.ai/docs/features/code-execution">Code Execution</a></li><li><a href="https://ui.praison.ai/docs/features/comparison-openclaw">Feature Comparison: PraisonAIUI vs OpenClaw</a></li><li><a href="https://ui.praison.ai/docs/features/config-hot-reload">Config Hot-Reload</a></li><li><a href="https://ui.praison.ai/docs/features/content-sources">Content Sources</a></li><li><a href="https://ui.praison.ai/docs/features/css-architecture">How the UI Looks Are Built</a></li><li><a href="https://ui.praison.ai/docs/features/dark-mode">Dark Mode</a></li><li><a href="https://ui.praison.ai/docs/features/dashboard">Dashboard</a></li><li><a href="https://ui.praison.ai/docs/features/deployment">Deployment Guide</a></li><li><a href="https://ui.praison.ai/docs/features/device-pairing">Device Pairing</a></li><li><a href="https://ui.praison.ai/docs/features/differentiation">What Makes PraisonAIUI Different</a></li><li><a href="https://ui.praison.ai/docs/features/feature-inventory">Feature Inventory</a></li><li><a href="https://ui.praison.ai/docs/features/gap-analysis">Gap Analysis — Validated Against praisonai SDK</a></li><li><a href="https://ui.praison.ai/docs/features/gateway-chat">Gateway Chat</a></li><li><a href="https://ui.praison.ai/docs/features/hot-reload">Hot Reload</a></li><li><a href="https://ui.praison.ai/docs/features/how-to-add-a-feature">How to Add a Feature to PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/features/i18n">Internationalization (i18n)</a></li><li><a href="https://ui.praison.ai/docs/features/image-preview-chat">Image Preview in Chat</a></li><li><a href="https://ui.praison.ai/docs/features/integration-analysis">AIUI Integration — Critical Review & Architecture Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/knowledge-embeddings">Knowledge Embedding Model Configuration</a></li><li><a href="https://ui.praison.ai/docs/features/marketplace">Plugin Marketplace</a></li><li><a href="https://ui.praison.ai/docs/features/media-analysis">Media Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/message-elements">Message Elements</a></li><li><a href="https://ui.praison.ai/docs/features/model-fallback">Model Fallback</a></li><li><a href=Line truncated
|
||||
<script src="/plugins/plugin-loader.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,39 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
|
||||
<script id="aiui-canonical-url">(function(){var p=location.pathname.replace(/\/+$/, '')||'/';if(p!==location.pathname){history.replaceState(null,'',p+location.search+location.hash);}})();</script>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="Api - Documentation for PraisonAIUI - YAML-driven website generator" />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:locale" content="en_US" />
|
||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
||||
<title>Api | PraisonAIUI Docs</title>
|
||||
<script>
|
||||
(function(){try{var t=localStorage.getItem('aiui-theme-preference');var d=true;if(t==='dark'||(t==='system'&&matchMedia('(prefers-color-scheme: dark)').matches)||(!t&&d))document.documentElement.classList.add('dark');else if(t==='light')document.documentElement.classList.remove('dark');}catch(e){}})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="/assets/theme.css">
|
||||
<script type="module" crossorigin src="/assets/index.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index.css">
|
||||
<link rel="canonical" href="https://ui.praison.ai/docs/api" />
|
||||
<meta property="og:title" content="Api | PraisonAIUI Docs" />
|
||||
<meta property="og:description" content="Api - Documentation for PraisonAIUI - YAML-driven website generator" />
|
||||
<meta property="og:url" content="https://ui.praison.ai/docs/api" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:image" content="https://ui.praison.ai/icon.svg" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="Api | PraisonAIUI Docs" />
|
||||
<meta name="twitter:description" content="Api - Documentation for PraisonAIUI - YAML-driven website generator" />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<script type="application/ld+json">{"@context": "https://schema.org", "@type": "TechArticle", "headline": "Api", "description": "Api - Documentation for PraisonAIUI - YAML-driven website generator", "url": "https://ui.praison.ai/docs/api", "isPartOf": {"@type": "WebSite", "name": "PraisonAIUI Docs", "url": "https://ui.praison.ai/"}}</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"><noscript><nav aria-label="Documentation"><ul><li><a href="https://ui.praison.ai/docs/health-endpoints">Health Endpoints Guide</a></li><li><a href="https://ui.praison.ai/docs/index">PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/testing">Testing</a></li><li><a href="https://ui.praison.ai/docs/adr">Adr</a></li><li><a href="https://ui.praison.ai/docs/adr/replay-view-clean-room">ADR 0001: PraisonAI Replay view, a clean-room design</a></li><li><a href="https://ui.praison.ai/docs/api">Api</a></li><li><a href="https://ui.praison.ai/docs/api/cli">CLI API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/components">Component API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/features-api">Features REST API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/health">Health API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/python">Python SDK API</a></li><li><a href="https://ui.praison.ai/docs/api/sessions">Sessions API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/testing">API Testing Guide</a></li><li><a href="https://ui.praison.ai/docs/api/typescript">TypeScript SDK Reference</a></li><li><a href="https://ui.praison.ai/docs/concepts">Concepts</a></li><li><a href="https://ui.praison.ai/docs/concepts/architecture">Architecture: AG-UI Protocol vs Gateway Integration</a></li><li><a href="https://ui.praison.ai/docs/concepts/configuration">YAML Configuration</a></li><li><a href="https://ui.praison.ai/docs/concepts/providers">Providers</a></li><li><a href="https://ui.praison.ai/docs/concepts/slots">Slots & Components</a></li><li><a href="https://ui.praison.ai/docs/concepts/templates">Templates & Layouts</a></li><li><a href="https://ui.praison.ai/docs/examples">Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/advanced">Advanced Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/basic">Basic Examples</a></li><li><a href="https://ui.praison.ai/docs/features">Features</a></li><li><a href="https://ui.praison.ai/docs/features/a2ui-canvas">A2UI canvas — agent-driven UI</a></li><li><a href="https://ui.praison.ai/docs/features/agent-ui-host">Agent UI host — modular dashboard shell</a></li><li><a href="https://ui.praison.ai/docs/features/attachments">Chat Attachments</a></li><li><a href="https://ui.praison.ai/docs/features/backend-integration">Backend Integration Contract</a></li><li><a href="https://ui.praison.ai/docs/features/beautifului-integration">BeautifulUI Integration Strategy</a></li><li><a href="https://ui.praison.ai/docs/features/browser-automation">Browser Automation</a></li><li><a href="https://ui.praison.ai/docs/features/channel-chat-bridge">Channel-to-Chat Bridge</a></li><li><a href="https://ui.praison.ai/docs/features/code-execution">Code Execution</a></li><li><a href="https://ui.praison.ai/docs/features/comparison-openclaw">Feature Comparison: PraisonAIUI vs OpenClaw</a></li><li><a href="https://ui.praison.ai/docs/features/config-hot-reload">Config Hot-Reload</a></li><li><a href="https://ui.praison.ai/docs/features/content-sources">Content Sources</a></li><li><a href="https://ui.praison.ai/docs/features/css-architecture">How the UI Looks Are Built</a></li><li><a href="https://ui.praison.ai/docs/features/dark-mode">Dark Mode</a></li><li><a href="https://ui.praison.ai/docs/features/dashboard">Dashboard</a></li><li><a href="https://ui.praison.ai/docs/features/deployment">Deployment Guide</a></li><li><a href="https://ui.praison.ai/docs/features/device-pairing">Device Pairing</a></li><li><a href="https://ui.praison.ai/docs/features/differentiation">What Makes PraisonAIUI Different</a></li><li><a href="https://ui.praison.ai/docs/features/feature-inventory">Feature Inventory</a></li><li><a href="https://ui.praison.ai/docs/features/gap-analysis">Gap Analysis — Validated Against praisonai SDK</a></li><li><a href="https://ui.praison.ai/docs/features/gateway-chat">Gateway Chat</a></li><li><a href="https://ui.praison.ai/docs/features/hot-reload">Hot Reload</a></li><li><a href="https://ui.praison.ai/docs/features/how-to-add-a-feature">How to Add a Feature to PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/features/i18n">Internationalization (i18n)</a></li><li><a href="https://ui.praison.ai/docs/features/image-preview-chat">Image Preview in Chat</a></li><li><a href="https://ui.praison.ai/docs/features/integration-analysis">AIUI Integration — Critical Review & Architecture Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/knowledge-embeddings">Knowledge Embedding Model Configuration</a></li><li><a href="https://ui.praison.ai/docs/features/marketplace">Plugin Marketplace</a></li><li><a href="https://ui.praison.ai/docs/features/media-analysis">Media Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/message-elements">Message Elements</a></li><li><a href="https://ui.praison.ai/docs/features/model-fallback">Model Fallback</a></li><li><a href=Line truncated
|
||||
<script src="/plugins/plugin-loader.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,81 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
|
||||
<script id="aiui-canonical-url">(function(){var p=location.pathname.replace(/\/+$/, '')||'/';if(p!==location.pathname){history.replaceState(null,'',p+location.search+location.hash);}})();</script>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="Complete reference for the aiui Python CLI." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:locale" content="en_US" />
|
||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
||||
<title>CLI API Reference | PraisonAIUI Docs</title>
|
||||
<script>
|
||||
(function(){try{var t=localStorage.getItem('aiui-theme-preference');var d=true;if(t==='dark'||(t==='system'&&matchMedia('(prefers-color-scheme: dark)').matches)||(!t&&d))document.documentElement.classList.add('dark');else if(t==='light')document.documentElement.classList.remove('dark');}catch(e){}})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="/assets/theme.css">
|
||||
<script type="module" crossorigin src="/assets/index.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index.css">
|
||||
<link rel="canonical" href="https://ui.praison.ai/docs/api/cli" />
|
||||
<meta property="og:title" content="CLI API Reference | PraisonAIUI Docs" />
|
||||
<meta property="og:description" content="Complete reference for the aiui Python CLI." />
|
||||
<meta property="og:url" content="https://ui.praison.ai/docs/api/cli" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:image" content="https://ui.praison.ai/icon.svg" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="CLI API Reference | PraisonAIUI Docs" />
|
||||
<meta name="twitter:description" content="Complete reference for the aiui Python CLI." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<script type="application/ld+json">{"@context": "https://schema.org", "@type": "TechArticle", "headline": "CLI API Reference", "description": "Complete reference for the aiui Python CLI.", "url": "https://ui.praison.ai/docs/api/cli", "isPartOf": {"@type": "WebSite", "name": "PraisonAIUI Docs", "url": "https://ui.praison.ai/"}}</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"><noscript><nav aria-label="Documentation"><ul><li><a href="https://ui.praison.ai/docs/health-endpoints">Health Endpoints Guide</a></li><li><a href="https://ui.praison.ai/docs/index">PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/testing">Testing</a></li><li><a href="https://ui.praison.ai/docs/adr">Adr</a></li><li><a href="https://ui.praison.ai/docs/adr/replay-view-clean-room">ADR 0001: PraisonAI Replay view, a clean-room design</a></li><li><a href="https://ui.praison.ai/docs/api">Api</a></li><li><a href="https://ui.praison.ai/docs/api/cli">CLI API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/components">Component API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/features-api">Features REST API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/health">Health API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/python">Python SDK API</a></li><li><a href="https://ui.praison.ai/docs/api/sessions">Sessions API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/testing">API Testing Guide</a></li><li><a href="https://ui.praison.ai/docs/api/typescript">TypeScript SDK Reference</a></li><li><a href="https://ui.praison.ai/docs/concepts">Concepts</a></li><li><a href="https://ui.praison.ai/docs/concepts/architecture">Architecture: AG-UI Protocol vs Gateway Integration</a></li><li><a href="https://ui.praison.ai/docs/concepts/configuration">YAML Configuration</a></li><li><a href="https://ui.praison.ai/docs/concepts/providers">Providers</a></li><li><a href="https://ui.praison.ai/docs/concepts/slots">Slots & Components</a></li><li><a href="https://ui.praison.ai/docs/concepts/templates">Templates & Layouts</a></li><li><a href="https://ui.praison.ai/docs/examples">Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/advanced">Advanced Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/basic">Basic Examples</a></li><li><a href="https://ui.praison.ai/docs/features">Features</a></li><li><a href="https://ui.praison.ai/docs/features/a2ui-canvas">A2UI canvas — agent-driven UI</a></li><li><a href="https://ui.praison.ai/docs/features/agent-ui-host">Agent UI host — modular dashboard shell</a></li><li><a href="https://ui.praison.ai/docs/features/attachments">Chat Attachments</a></li><li><a href="https://ui.praison.ai/docs/features/backend-integration">Backend Integration Contract</a></li><li><a href="https://ui.praison.ai/docs/features/beautifului-integration">BeautifulUI Integration Strategy</a></li><li><a href="https://ui.praison.ai/docs/features/browser-automation">Browser Automation</a></li><li><a href="https://ui.praison.ai/docs/features/channel-chat-bridge">Channel-to-Chat Bridge</a></li><li><a href="https://ui.praison.ai/docs/features/code-execution">Code Execution</a></li><li><a href="https://ui.praison.ai/docs/features/comparison-openclaw">Feature Comparison: PraisonAIUI vs OpenClaw</a></li><li><a href="https://ui.praison.ai/docs/features/config-hot-reload">Config Hot-Reload</a></li><li><a href="https://ui.praison.ai/docs/features/content-sources">Content Sources</a></li><li><a href="https://ui.praison.ai/docs/features/css-architecture">How the UI Looks Are Built</a></li><li><a href="https://ui.praison.ai/docs/features/dark-mode">Dark Mode</a></li><li><a href="https://ui.praison.ai/docs/features/dashboard">Dashboard</a></li><li><a href="https://ui.praison.ai/docs/features/deployment">Deployment Guide</a></li><li><a href="https://ui.praison.ai/docs/features/device-pairing">Device Pairing</a></li><li><a href="https://ui.praison.ai/docs/features/differentiation">What Makes PraisonAIUI Different</a></li><li><a href="https://ui.praison.ai/docs/features/feature-inventory">Feature Inventory</a></li><li><a href="https://ui.praison.ai/docs/features/gap-analysis">Gap Analysis — Validated Against praisonai SDK</a></li><li><a href="https://ui.praison.ai/docs/features/gateway-chat">Gateway Chat</a></li><li><a href="https://ui.praison.ai/docs/features/hot-reload">Hot Reload</a></li><li><a href="https://ui.praison.ai/docs/features/how-to-add-a-feature">How to Add a Feature to PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/features/i18n">Internationalization (i18n)</a></li><li><a href="https://ui.praison.ai/docs/features/image-preview-chat">Image Preview in Chat</a></li><li><a href="https://ui.praison.ai/docs/features/integration-analysis">AIUI Integration — Critical Review & Architecture Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/knowledge-embeddings">Knowledge Embedding Model Configuration</a></li><li><a href="https://ui.praison.ai/docs/features/marketplace">Plugin Marketplace</a></li><li><a href="https://ui.praison.ai/docs/features/media-analysis">Media Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/message-elements">Message Elements</a></li><li><a href="https://ui.praison.ai/docs/features/model-fallback">Model Fallback</a></li><li><a href=Line truncated
|
||||
<p>Complete reference for the <code>aiui</code> Python CLI.</p>
|
||||
<h2>Commands</h2>
|
||||
<h3>init</h3>
|
||||
<p>Initialize a new project.</p>
|
||||
<p>| Option | Type | Default | Description |</p>
|
||||
<p>|--------|------|---------|-------------|</p>
|
||||
<p>| <code>--template, -t</code> | string | <code>minimal</code> | Template: minimal, docs, marketing |</p>
|
||||
<p>| <code>--force, -f</code> | flag | <code>false</code> | Overwrite existing files |</p>
|
||||
<h3>validate</h3>
|
||||
<p>Validate configuration file.</p>
|
||||
<p>| Option | Type | Default | Description |</p>
|
||||
<p>|--------|------|---------|-------------|</p>
|
||||
<p>| <code>--config, -c</code> | path | <code>aiui.template.yaml</code> | Config file path |</p>
|
||||
<p>| <code>--strict</code> | flag | <code>false</code> | Strict validation mode |</p>
|
||||
<h3>build</h3>
|
||||
<p>Build manifests from configuration.</p>
|
||||
<p>| Option | Type | Default | Description |</p>
|
||||
<p>|--------|------|---------|-------------|</p>
|
||||
<p>| <code>--config, -c</code> | path | <code>aiui.template.yaml</code> | Config file path |</p>
|
||||
<p>| <code>--output, -o</code> | path | <code>aiui</code> | Output directory |</p>
|
||||
<p>| <code>--minify</code> | flag | <code>false</code> | Minify JSON output |</p>
|
||||
<h3>dev</h3>
|
||||
<p>Start development mode with file watching.</p>
|
||||
<p>| Option | Type | Default | Description |</p>
|
||||
<p>|--------|------|---------|-------------|</p>
|
||||
<p>| <code>--config, -c</code> | path | <code>aiui.template.yaml</code> | Config file path |</p>
|
||||
<p>| <code>--port, -p</code> | int | <code>3000</code> | Dev server port |</p>
|
||||
<h3>run</h3>
|
||||
<p>Run the AI chat server with your app or config.</p>
|
||||
<p>| Option | Type | Default | Description |</p>
|
||||
<p>|--------|------|---------|-------------|</p>
|
||||
<p>| <code>--port, -p</code> | int | <code>8000</code> | Server port |</p>
|
||||
<p>| <code>--host</code> | string | <code>127.0.0.1</code> | Host to bind to |</p>
|
||||
<p>| <code>--reload, -r</code> | flag | <code>false</code> | Auto-reload on file changes |</p>
|
||||
<p>| <code>--style, -s</code> | string | <code>chat</code> | UI style: <code>chat</code>, <code>docs</code>, <code>agents</code>, <code>playground</code>, <code>dashboard</code>, <code>custom</code> |</p>
|
||||
<p>| <code>--backend, -b</code> | string | <code>standalone</code> | Backend: <code>standalone</code> or <code>praisonai</code> |</p>
|
||||
<p>| <code>--datastore, -d</code> | string | <code>memory</code> | Data persistence: <code>memory</code>, <code>json</code>, <code>json:/path</code> |</p>
|
||||
<p>| <code>--output, -o</code> | path | <code>aiui</code> | Output directory for static files |</p>
|
||||
<p><strong>Style auto-detection:</strong> When <code>--style</code> is not provided, the style is automatically detected from your code. See Styles for details.</p>
|
||||
<h2>Python API</h2>
|
||||
<h3>Direct Usage</h3>
|
||||
<h3>Schema Models</h3></noscript></div>
|
||||
<script src="/plugins/plugin-loader.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
+279
@@ -0,0 +1,279 @@
|
||||
# CLI API Reference
|
||||
|
||||
Complete reference for the `aiui` Python CLI.
|
||||
|
||||
## Commands
|
||||
|
||||
### init
|
||||
|
||||
Initialize a new project.
|
||||
|
||||
```bash
|
||||
aiui init [OPTIONS]
|
||||
```
|
||||
|
||||
| Option | Type | Default | Description |
|
||||
|--------|------|---------|-------------|
|
||||
| `--template, -t` | string | `minimal` | Template: minimal, docs, marketing |
|
||||
| `--force, -f` | flag | `false` | Overwrite existing files |
|
||||
|
||||
### validate
|
||||
|
||||
Validate configuration file.
|
||||
|
||||
```bash
|
||||
aiui validate [OPTIONS]
|
||||
```
|
||||
|
||||
| Option | Type | Default | Description |
|
||||
|--------|------|---------|-------------|
|
||||
| `--config, -c` | path | `aiui.template.yaml` | Config file path |
|
||||
| `--strict` | flag | `false` | Strict validation mode |
|
||||
|
||||
### build
|
||||
|
||||
Build manifests from configuration.
|
||||
|
||||
```bash
|
||||
aiui build [OPTIONS]
|
||||
```
|
||||
|
||||
| Option | Type | Default | Description |
|
||||
|--------|------|---------|-------------|
|
||||
| `--config, -c` | path | `aiui.template.yaml` | Config file path |
|
||||
| `--output, -o` | path | `aiui` | Output directory |
|
||||
| `--minify` | flag | `false` | Minify JSON output |
|
||||
|
||||
### dev
|
||||
|
||||
Start development mode with file watching.
|
||||
|
||||
```bash
|
||||
aiui dev [OPTIONS]
|
||||
```
|
||||
|
||||
| Option | Type | Default | Description |
|
||||
|--------|------|---------|-------------|
|
||||
| `--config, -c` | path | `aiui.template.yaml` | Config file path |
|
||||
| `--port, -p` | int | `3000` | Dev server port |
|
||||
|
||||
### run
|
||||
|
||||
Run the AI chat server with your app or config.
|
||||
|
||||
```bash
|
||||
aiui run <APP_FILE> [OPTIONS]
|
||||
```
|
||||
|
||||
| Option | Type | Default | Description |
|
||||
|--------|------|---------|-------------|
|
||||
| `--port, -p` | int | `8000` | Server port |
|
||||
| `--host` | string | `127.0.0.1` | Host to bind to |
|
||||
| `--reload, -r` | flag | `false` | Auto-reload on file changes |
|
||||
| `--style, -s` | string | `chat` | UI style: `chat`, `docs`, `agents`, `playground`, `dashboard`, `custom` |
|
||||
| `--backend, -b` | string | `standalone` | Backend: `standalone` or `praisonai` |
|
||||
| `--datastore, -d` | string | `memory` | Data persistence: `memory`, `json`, `json:/path` |
|
||||
| `--output, -o` | path | `aiui` | Output directory for static files |
|
||||
|
||||
**Style auto-detection:** When `--style` is not provided, the style is automatically detected from your code. See [Styles](../features/styles.md) for details.
|
||||
|
||||
```bash
|
||||
# Auto-detects style from code
|
||||
aiui run app.py
|
||||
|
||||
# Explicit style
|
||||
aiui run app.py --style agents
|
||||
|
||||
# With persistence
|
||||
aiui run app.py --datastore json
|
||||
|
||||
# YAML config
|
||||
aiui run chat.yaml
|
||||
```
|
||||
|
||||
## Python API
|
||||
|
||||
### Direct Usage
|
||||
|
||||
```python
|
||||
from praisonaiui import Config
|
||||
from praisonaiui.compiler import Compiler
|
||||
|
||||
# Load and validate config
|
||||
config = Config.from_yaml("aiui.template.yaml")
|
||||
|
||||
# Build manifests
|
||||
compiler = Compiler(config)
|
||||
result = compiler.compile()
|
||||
|
||||
# Access outputs
|
||||
print(result.ui_config)
|
||||
print(result.docs_nav)
|
||||
print(result.route_manifest)
|
||||
```
|
||||
|
||||
### Schema Models
|
||||
|
||||
```python
|
||||
from praisonaiui.schema import (
|
||||
Config,
|
||||
SiteConfig,
|
||||
ContentConfig,
|
||||
TemplateConfig,
|
||||
RouteConfig,
|
||||
)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Feature Commands
|
||||
|
||||
All feature commands talk to a running PraisonAIUI server (default: `http://127.0.0.1:8000`). Use `--server` / `-s` to override.
|
||||
|
||||
### features
|
||||
|
||||
```bash
|
||||
aiui features list # List all registered protocol features
|
||||
```
|
||||
|
||||
### approval
|
||||
|
||||
```bash
|
||||
aiui approval list [--status pending|resolved|all] # List approvals
|
||||
aiui approval pending # Show pending count
|
||||
aiui approval resolve <ID> [--approved/--denied] [--reason TEXT]
|
||||
```
|
||||
|
||||
### schedule
|
||||
|
||||
```bash
|
||||
aiui schedule list # List all jobs (shows delivery + agent info)
|
||||
aiui schedule add <NAME> <MESSAGE> [OPTIONS] # Add a scheduled job
|
||||
aiui schedule remove <JOB_ID> # Remove job
|
||||
aiui schedule status # Show scheduler status
|
||||
```
|
||||
|
||||
**Schedule add options:**
|
||||
|
||||
| Option | Type | Default | Description |
|
||||
|--------|------|---------|-------------|
|
||||
| `--every` | int | `60` | Interval in seconds |
|
||||
| `--cron` | string | | Cron expression (e.g. `*/5 * * * *`) |
|
||||
| `--channel` | string | | Delivery channel (e.g. `telegram`, `slack`) |
|
||||
| `--channel-id` | string | | Delivery channel/room ID |
|
||||
| `--agent-id` | string | | Agent to handle the job |
|
||||
| `--session-target` | string | `isolated` | Session: `isolated` or `main` |
|
||||
|
||||
```bash
|
||||
# Simple interval job
|
||||
aiui schedule add "Daily Report" "Generate summary" --every 86400
|
||||
|
||||
# Cron job with delivery
|
||||
aiui schedule add "Slack Update" "Post metrics" \
|
||||
--cron "0 9 * * 1-5" \
|
||||
--channel slack --channel-id C123456 \
|
||||
--agent-id analyst
|
||||
```
|
||||
|
||||
### guardrails
|
||||
|
||||
```bash
|
||||
aiui guardrails list # List all registered guardrails
|
||||
aiui guardrails add --description "Block profanity" [OPTIONS] # Register guardrail
|
||||
aiui guardrails remove <GUARDRAIL_ID> # Remove a guardrail
|
||||
aiui guardrails status # Show system status
|
||||
aiui guardrails violations [--limit 20] # Show recent violations
|
||||
```
|
||||
|
||||
**Guardrails add options:**
|
||||
|
||||
| Option | Type | Default | Description |
|
||||
|--------|------|---------|-------------|
|
||||
| `--description` | string | *required* | Natural language validation criteria |
|
||||
| `--type` | string | `llm` | Guardrail type: `llm` or `custom` |
|
||||
| `--agent-name` | string | | Target agent (all agents if empty) |
|
||||
| `--llm-model` | string | `gpt-4o-mini` | LLM model for evaluation |
|
||||
|
||||
### knowledge
|
||||
|
||||
```bash
|
||||
aiui knowledge list # List all knowledge entries
|
||||
aiui knowledge add <TEXT> [--agent-id ID] [--user-id ID] # Store entry
|
||||
aiui knowledge search <QUERY> [--limit 10] # Search knowledge base
|
||||
aiui knowledge remove <ENTRY_ID> # Delete an entry
|
||||
aiui knowledge status # Show backend info + stats
|
||||
```
|
||||
|
||||
### security
|
||||
|
||||
```bash
|
||||
aiui security status # Show security posture
|
||||
aiui security audit [--limit 20] # Show audit log entries
|
||||
aiui security config # Show security configuration
|
||||
```
|
||||
|
||||
### telemetry
|
||||
|
||||
```bash
|
||||
aiui telemetry status # Show telemetry status
|
||||
aiui telemetry metrics [--limit 20] [--agent-id ID] # Show recent metrics
|
||||
aiui telemetry overview # Aggregate stats with per-agent breakdown
|
||||
```
|
||||
|
||||
### memory
|
||||
|
||||
```bash
|
||||
aiui memory list [--type short|long|entity|all] # List memories
|
||||
aiui memory add <TEXT> [--type long] # Add memory
|
||||
aiui memory search <QUERY> [--limit 10] # Search
|
||||
aiui memory clear [--type all] # Clear memories
|
||||
aiui memory status # Memory stats
|
||||
```
|
||||
|
||||
### skills
|
||||
|
||||
```bash
|
||||
aiui skills list # List all skills
|
||||
aiui skills status # Show skills count
|
||||
aiui skills discover # Discover available skills
|
||||
```
|
||||
|
||||
### hooks
|
||||
|
||||
```bash
|
||||
aiui hooks list # List all hooks
|
||||
aiui hooks trigger <HOOK_ID> # Trigger a hook
|
||||
aiui hooks log [--limit 20] # View execution log
|
||||
```
|
||||
|
||||
### workflows
|
||||
|
||||
```bash
|
||||
aiui workflows list # List all workflows
|
||||
aiui workflows run <WORKFLOW_ID> # Run a workflow
|
||||
aiui workflows status # Show workflow count
|
||||
aiui workflows runs # List run history
|
||||
```
|
||||
|
||||
### config
|
||||
|
||||
```bash
|
||||
aiui config get [KEY] # Get config (all or single key)
|
||||
aiui config set <KEY> <VALUE> # Set a config value
|
||||
aiui config list # List all config keys
|
||||
aiui config history [--limit 20] # Show change history
|
||||
```
|
||||
|
||||
### provider
|
||||
|
||||
```bash
|
||||
aiui provider status # Show provider info + health
|
||||
aiui provider health # Check provider health
|
||||
aiui provider agents # List agents
|
||||
```
|
||||
|
||||
### health-check
|
||||
|
||||
```bash
|
||||
aiui health-check [--server URL] # Check server health
|
||||
```
|
||||
@@ -0,0 +1,386 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
|
||||
<script id="aiui-canonical-url">(function(){var p=location.pathname.replace(/\/+$/, '')||'/';if(p!==location.pathname){history.replaceState(null,'',p+location.search+location.hash);}})();</script>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="Python functions for building dashboard UIs. Each function returns a dict that the frontend renders as a real UI element — 36 components organized into tiers." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:locale" content="en_US" />
|
||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
||||
<title>Component API Reference | PraisonAIUI Docs</title>
|
||||
<script>
|
||||
(function(){try{var t=localStorage.getItem('aiui-theme-preference');var d=true;if(t==='dark'||(t==='system'&&matchMedia('(prefers-color-scheme: dark)').matches)||(!t&&d))document.documentElement.classList.add('dark');else if(t==='light')document.documentElement.classList.remove('dark');}catch(e){}})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="/assets/theme.css">
|
||||
<script type="module" crossorigin src="/assets/index.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index.css">
|
||||
<link rel="canonical" href="https://ui.praison.ai/docs/api/components" />
|
||||
<meta property="og:title" content="Component API Reference | PraisonAIUI Docs" />
|
||||
<meta property="og:description" content="Python functions for building dashboard UIs. Each function returns a dict that the frontend renders as a real UI element — 36 components organized into tiers." />
|
||||
<meta property="og:url" content="https://ui.praison.ai/docs/api/components" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:image" content="https://ui.praison.ai/icon.svg" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="Component API Reference | PraisonAIUI Docs" />
|
||||
<meta name="twitter:description" content="Python functions for building dashboard UIs. Each function returns a dict that the frontend renders as a real UI element — 36 components organized into tiers." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<script type="application/ld+json">{"@context": "https://schema.org", "@type": "TechArticle", "headline": "Component API Reference", "description": "Python functions for building dashboard UIs. Each function returns a dict that the frontend renders as a real UI element — 36 components organized into tiers.", "url": "https://ui.praison.ai/docs/api/components", "isPartOf": {"@type": "WebSite", "name": "PraisonAIUI Docs", "url": "https://ui.praison.ai/"}}</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"><noscript><nav aria-label="Documentation"><ul><li><a href="https://ui.praison.ai/docs/health-endpoints">Health Endpoints Guide</a></li><li><a href="https://ui.praison.ai/docs/index">PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/testing">Testing</a></li><li><a href="https://ui.praison.ai/docs/adr">Adr</a></li><li><a href="https://ui.praison.ai/docs/adr/replay-view-clean-room">ADR 0001: PraisonAI Replay view, a clean-room design</a></li><li><a href="https://ui.praison.ai/docs/api">Api</a></li><li><a href="https://ui.praison.ai/docs/api/cli">CLI API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/components">Component API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/features-api">Features REST API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/health">Health API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/python">Python SDK API</a></li><li><a href="https://ui.praison.ai/docs/api/sessions">Sessions API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/testing">API Testing Guide</a></li><li><a href="https://ui.praison.ai/docs/api/typescript">TypeScript SDK Reference</a></li><li><a href="https://ui.praison.ai/docs/concepts">Concepts</a></li><li><a href="https://ui.praison.ai/docs/concepts/architecture">Architecture: AG-UI Protocol vs Gateway Integration</a></li><li><a href="https://ui.praison.ai/docs/concepts/configuration">YAML Configuration</a></li><li><a href="https://ui.praison.ai/docs/concepts/providers">Providers</a></li><li><a href="https://ui.praison.ai/docs/concepts/slots">Slots & Components</a></li><li><a href="https://ui.praison.ai/docs/concepts/templates">Templates & Layouts</a></li><li><a href="https://ui.praison.ai/docs/examples">Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/advanced">Advanced Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/basic">Basic Examples</a></li><li><a href="https://ui.praison.ai/docs/features">Features</a></li><li><a href="https://ui.praison.ai/docs/features/a2ui-canvas">A2UI canvas — agent-driven UI</a></li><li><a href="https://ui.praison.ai/docs/features/agent-ui-host">Agent UI host — modular dashboard shell</a></li><li><a href="https://ui.praison.ai/docs/features/attachments">Chat Attachments</a></li><li><a href="https://ui.praison.ai/docs/features/backend-integration">Backend Integration Contract</a></li><li><a href="https://ui.praison.ai/docs/features/beautifului-integration">BeautifulUI Integration Strategy</a></li><li><a href="https://ui.praison.ai/docs/features/browser-automation">Browser Automation</a></li><li><a href="https://ui.praison.ai/docs/features/channel-chat-bridge">Channel-to-Chat Bridge</a></li><li><a href="https://ui.praison.ai/docs/features/code-execution">Code Execution</a></li><li><a href="https://ui.praison.ai/docs/features/comparison-openclaw">Feature Comparison: PraisonAIUI vs OpenClaw</a></li><li><a href="https://ui.praison.ai/docs/features/config-hot-reload">Config Hot-Reload</a></li><li><a href="https://ui.praison.ai/docs/features/content-sources">Content Sources</a></li><li><a href="https://ui.praison.ai/docs/features/css-architecture">How the UI Looks Are Built</a></li><li><a href="https://ui.praison.ai/docs/features/dark-mode">Dark Mode</a></li><li><a href="https://ui.praison.ai/docs/features/dashboard">Dashboard</a></li><li><a href="https://ui.praison.ai/docs/features/deployment">Deployment Guide</a></li><li><a href="https://ui.praison.ai/docs/features/device-pairing">Device Pairing</a></li><li><a href="https://ui.praison.ai/docs/features/differentiation">What Makes PraisonAIUI Different</a></li><li><a href="https://ui.praison.ai/docs/features/feature-inventory">Feature Inventory</a></li><li><a href="https://ui.praison.ai/docs/features/gap-analysis">Gap Analysis — Validated Against praisonai SDK</a></li><li><a href="https://ui.praison.ai/docs/features/gateway-chat">Gateway Chat</a></li><li><a href="https://ui.praison.ai/docs/features/hot-reload">Hot Reload</a></li><li><a href="https://ui.praison.ai/docs/features/how-to-add-a-feature">How to Add a Feature to PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/features/i18n">Internationalization (i18n)</a></li><li><a href="https://ui.praison.ai/docs/features/image-preview-chat">Image Preview in Chat</a></li><li><a href="https://ui.praison.ai/docs/features/integration-analysis">AIUI Integration — Critical Review & Architecture Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/knowledge-embeddings">Knowledge Embedding Model Configuration</a></li><li><a href="https://ui.praison.ai/docs/features/marketplace">Plugin Marketplace</a></li><li><a href="https://ui.praison.ai/docs/features/media-analysis">Media Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/message-elements">Message Elements</a></li><li><a href="https://ui.praison.ai/docs/features/model-fallback">Model Fallback</a></li><li><a href=Line truncated
|
||||
<p>Python functions for building dashboard UIs. Each function returns a dict that the frontend renders as a real UI element — <strong>36 components</strong> organized into tiers.</p>
|
||||
<h2>Essential Components</h2>
|
||||
<h3>`aiui.metric(label, *, value, delta, delta_color)`</h3>
|
||||
<p>A metric card with optional delta indicator.</p>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>label</code> | <code>str</code> | ✅ | — | Metric label |</p>
|
||||
<p>| <code>value</code> | <code>Any</code> | ✅ | — | Main metric value |</p>
|
||||
<p>| <code>delta</code> | <code>str</code> | ❌ | <code>None</code> | Change indicator (e.g. "+5%") |</p>
|
||||
<p>| <code>delta_color</code> | <code>str</code> | ❌ | <code>"normal"</code> | <code>"normal"</code>, <code>"inverse"</code>, or <code>"off"</code> |</p>
|
||||
<h3>`aiui.progress_bar(label, *, value, max_value)`</h3>
|
||||
<p>A progress bar.</p>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>label</code> | <code>str</code> | ✅ | — | Label above the bar |</p>
|
||||
<p>| <code>value</code> | <code>int\|float</code> | ✅ | — | Current value |</p>
|
||||
<p>| <code>max_value</code> | <code>int\|float</code> | ❌ | <code>100</code> | Maximum value |</p>
|
||||
<h3>`aiui.alert(message, *, variant, title)`</h3>
|
||||
<p>An alert/notification box.</p>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>message</code> | <code>str</code> | ✅ | — | Alert body text |</p>
|
||||
<p>| <code>variant</code> | <code>str</code> | ❌ | <code>"info"</code> | <code>"info"</code>, <code>"success"</code>, <code>"warning"</code>, <code>"error"</code> |</p>
|
||||
<p>| <code>title</code> | <code>str</code> | ❌ | <code>None</code> | Optional bold title |</p>
|
||||
<h3>`aiui.badge(text, *, variant)`</h3>
|
||||
<p>An inline badge/tag.</p>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>text</code> | <code>str</code> | ✅ | — | Badge label |</p>
|
||||
<p>| <code>variant</code> | <code>str</code> | ❌ | <code>"default"</code> | <code>"default"</code>, <code>"secondary"</code>, <code>"destructive"</code>, <code>"outline"</code> |</p>
|
||||
<h3>`aiui.separator()`</h3>
|
||||
<p>A horizontal separator line. No parameters.</p>
|
||||
<h3>`aiui.tabs(items)`</h3>
|
||||
<p>A tabbed container.</p>
|
||||
<p>| Parameter | Type | Required | Description |</p>
|
||||
<p>|-----------|------|----------|-------------|</p>
|
||||
<p>| <code>items</code> | <code>Sequence[dict]</code> | ✅ | List of <code>{"label": str, "children": [comp_dicts]}</code> |</p>
|
||||
<h3>`aiui.accordion(items)`</h3>
|
||||
<p>A collapsible accordion.</p>
|
||||
<p>| Parameter | Type | Required | Description |</p>
|
||||
<p>|-----------|------|----------|-------------|</p>
|
||||
<p>| <code>items</code> | <code>Sequence[dict]</code> | ✅ | List of <code>{"title": str, "content": str_or_comp}</code> |</p>
|
||||
<h3>`aiui.image_display(src, *, alt, caption, width)`</h3>
|
||||
<p>An image with optional caption.</p>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>src</code> | <code>str</code> | ✅ | — | Image URL or path |</p>
|
||||
<p>| <code>alt</code> | <code>str</code> | ❌ | <code>""</code> | Alt text |</p>
|
||||
<p>| <code>caption</code> | <code>str</code> | ❌ | <code>None</code> | Caption below image |</p>
|
||||
<p>| <code>width</code> | <code>str</code> | ❌ | <code>None</code> | CSS width (e.g. <code>"300px"</code>, <code>"50%"</code>) |</p>
|
||||
<h3>`aiui.code_block(code, *, language)`</h3>
|
||||
<p>A code block with syntax highlighting.</p>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>code</code> | <code>str</code> | ✅ | — | Source code text |</p>
|
||||
<p>| <code>language</code> | <code>str</code> | ❌ | <code>"text"</code> | Language for highlighting |</p>
|
||||
<h3>`aiui.json_view(data)`</h3>
|
||||
<p>A formatted JSON viewer.</p>
|
||||
<p>| Parameter | Type | Required | Description |</p>
|
||||
<p>|-----------|------|----------|-------------|</p>
|
||||
<p>| <code>data</code> | <code>Any</code> | ✅ | Any JSON-serializable data |</p>
|
||||
<p>---</p>
|
||||
<h2>Form Input Components</h2>
|
||||
<h3>`aiui.text_input(label, *, value, placeholder)`</h3>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>label</code> | <code>str</code> | ✅ | — | Input label |</p>
|
||||
<p>| <code>value</code> | <code>str</code> | ❌ | <code>""</code> | Default value |</p>
|
||||
<p>| <code>placeholder</code> | <code>str</code> | ❌ | <code>""</code> | Placeholder text |</p>
|
||||
<h3>`aiui.number_input(label, *, value, min_val, max_val, step)`</h3>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>label</code> | <code>str</code> | ✅ | — | Input label |</p>
|
||||
<p>| <code>value</code> | <code>int\|float</code> | ❌ | <code>0</code> | Default value |</p>
|
||||
<p>| <code>min_val</code> | <code>int\|float</code> | ❌ | <code>None</code> | Minimum allowed |</p>
|
||||
<p>| <code>max_val</code> | <code>int\|float</code> | ❌ | <code>None</code> | Maximum allowed |</p>
|
||||
<p>| <code>step</code> | <code>int\|float</code> | ❌ | <code>1</code> | Increment step |</p>
|
||||
<h3>`aiui.select_input(label, *, options, value)`</h3>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>label</code> | <code>str</code> | ✅ | — | Input label |</p>
|
||||
<p>| <code>options</code> | <code>Sequence[str]</code> | ✅ | — | Option strings |</p>
|
||||
<p>| <code>value</code> | <code>str</code> | ❌ | <code>""</code> | Default selected |</p>
|
||||
<h3>`aiui.slider_input(label, *, value, min_val, max_val, step)`</h3>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>label</code> | <code>str</code> | ✅ | — | Input label |</p>
|
||||
<p>| <code>value</code> | <code>int\|float</code> | ❌ | <code>0</code> | Default value |</p>
|
||||
<p>| <code>min_val</code> | <code>int\|float</code> | ❌ | <code>0</code> | Minimum |</p>
|
||||
<p>| <code>max_val</code> | <code>int\|float</code> | ❌ | <code>100</code> | Maximum |</p>
|
||||
<p>| <code>step</code> | <code>int\|float</code> | ❌ | <code>1</code> | Increment step |</p>
|
||||
<h3>`aiui.checkbox_input(label, *, checked)`</h3>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>label</code> | <code>str</code> | ✅ | — | Checkbox label |</p>
|
||||
<p>| <code>checked</code> | <code>bool</code> | ❌ | <code>False</code> | Default state |</p>
|
||||
<h3>`aiui.switch_input(label, *, checked)`</h3>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>label</code> | <code>str</code> | ✅ | — | Switch label |</p>
|
||||
<p>| <code>checked</code> | <code>bool</code> | ❌ | <code>False</code> | Default state |</p>
|
||||
<h3>`aiui.radio_input(label, *, options, value)`</h3>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>label</code> | <code>str</code> | ✅ | — | Group label |</p>
|
||||
<p>| <code>options</code> | <code>Sequence[str]</code> | ✅ | — | Option strings |</p>
|
||||
<p>| <code>value</code> | <code>str</code> | ❌ | <code>""</code> | Default selected |</p>
|
||||
<h3>`aiui.textarea_input(label, *, value, placeholder, rows)`</h3>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>label</code> | <code>str</code> | ✅ | — | Input label |</p>
|
||||
<p>| <code>value</code> | <code>str</code> | ❌ | <code>""</code> | Default value |</p>
|
||||
<p>| <code>placeholder</code> | <code>str</code> | ❌ | <code>""</code> | Placeholder text |</p>
|
||||
<p>| <code>rows</code> | <code>int</code> | ❌ | <code>4</code> | Visible rows |</p>
|
||||
<h3>`aiui.multiselect_input(label, *, options, value)`</h3>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>label</code> | <code>str</code> | ✅ | — | Input label |</p>
|
||||
<p>| <code>options</code> | <code>Sequence[str]</code> | ✅ | — | Available choices |</p>
|
||||
<p>| <code>value</code> | <code>Sequence[str]</code> | ❌ | <code>()</code> | Default selections |</p>
|
||||
<h3>`aiui.date_input(label, *, value)`</h3>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>label</code> | <code>str</code> | ✅ | — | Input label |</p>
|
||||
<p>| <code>value</code> | <code>str</code> | ❌ | <code>None</code> | ISO date string |</p>
|
||||
<h3>`aiui.time_input(label, *, value)`</h3>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>label</code> | <code>str</code> | ✅ | — | Input label |</p>
|
||||
<p>| <code>value</code> | <code>str</code> | ❌ | <code>None</code> | <code>"HH:MM"</code> string |</p>
|
||||
<h3>`aiui.color_picker_input(label, *, value)`</h3>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>label</code> | <code>str</code> | ✅ | — | Input label |</p>
|
||||
<p>| <code>value</code> | <code>str</code> | ❌ | <code>"#000000"</code> | Default hex color |</p>
|
||||
<p>---</p>
|
||||
<h2>Layout & Advanced Components</h2>
|
||||
<h3>`aiui.container(children, *, title)`</h3>
|
||||
<p>A container wrapper with optional title.</p>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>children</code> | <code>Sequence[dict]</code> | ✅ | — | Child component dicts |</p>
|
||||
<p>| <code>title</code> | <code>str</code> | ❌ | <code>None</code> | Optional heading |</p>
|
||||
<h3>`aiui.expander(title, *, children, expanded)`</h3>
|
||||
<p>A collapsible section.</p>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>title</code> | <code>str</code> | ✅ | — | Section heading |</p>
|
||||
<p>| <code>children</code> | <code>Sequence[dict]</code> | ✅ | — | Content components |</p>
|
||||
<p>| <code>expanded</code> | <code>bool</code> | ❌ | <code>False</code> | Initially expanded? |</p>
|
||||
<h3>`aiui.divider(text)`</h3>
|
||||
<p>A horizontal divider with optional center text.</p>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>text</code> | <code>str</code> | ❌ | <code>None</code> | Label in the middle of the line |</p>
|
||||
<h3>`aiui.header(text, *, level)`</h3>
|
||||
<p>A heading element.</p>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>text</code> | <code>str</code> | ✅ | — | Heading text |</p>
|
||||
<p>| <code>level</code> | <code>int</code> | ❌ | <code>1</code> | Heading level 1–6 |</p>
|
||||
<h3>`aiui.markdown_text(content)`</h3>
|
||||
<p>A markdown-rendered text block.</p>
|
||||
<p>| Parameter | Type | Required | Description |</p>
|
||||
<p>|-----------|------|----------|-------------|</p>
|
||||
<p>| <code>content</code> | <code>str</code> | ✅ | Markdown content string |</p>
|
||||
<h3>`aiui.link(text, *, href, external)`</h3>
|
||||
<p>A hyperlink.</p>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>text</code> | <code>str</code> | ✅ | — | Link text |</p>
|
||||
<p>| <code>href</code> | <code>str</code> | ✅ | — | URL |</p>
|
||||
<p>| <code>external</code> | <code>bool</code> | ❌ | <code>False</code> | Open in new tab? |</p>
|
||||
<h3>`aiui.button_group(buttons)`</h3>
|
||||
<p>A row of buttons.</p>
|
||||
<p>| Parameter | Type | Required | Description |</p>
|
||||
<p>|-----------|------|----------|-------------|</p>
|
||||
<p>| <code>buttons</code> | <code>Sequence[dict]</code> | ✅ | List of <code>{"label": str, "variant": str}</code> |</p>
|
||||
<h3>`aiui.stat_group(stats)`</h3>
|
||||
<p>A grid of stat/metric cards.</p>
|
||||
<p>| Parameter | Type | Required | Description |</p>
|
||||
<p>|-----------|------|----------|-------------|</p>
|
||||
<p>| <code>stats</code> | <code>Sequence[dict]</code> | ✅ | List of <code>{"label": str, "value": Any, "delta": str}</code> |</p>
|
||||
<h3>`aiui.avatar(*, src, name, fallback)`</h3>
|
||||
<p>An avatar image or initials.</p>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>src</code> | <code>str</code> | ❌ | <code>None</code> | Image URL |</p>
|
||||
<p>| <code>name</code> | <code>str</code> | ❌ | <code>None</code> | Display name |</p>
|
||||
<p>| <code>fallback</code> | <code>str</code> | ❌ | <code>None</code> | Fallback text (e.g. initials) |</p>
|
||||
<h3>`aiui.callout(content, *, variant, title)`</h3>
|
||||
<p>A callout/highlight box.</p>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>content</code> | <code>str</code> | ✅ | — | Callout body text |</p>
|
||||
<p>| <code>variant</code> | <code>str</code> | ❌ | <code>"info"</code> | <code>"info"</code>, <code>"success"</code>, <code>"warning"</code>, <code>"error"</code> |</p>
|
||||
<p>| <code>title</code> | <code>str</code> | ❌ | <code>None</code> | Optional bold title |</p>
|
||||
<h3>`aiui.empty(text)`</h3>
|
||||
<p>An empty state placeholder.</p>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>text</code> | <code>str</code> | ❌ | <code>"No data"</code> | Placeholder message |</p>
|
||||
<h3>`aiui.spinner(text)`</h3>
|
||||
<p>A loading spinner with text.</p>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>text</code> | <code>str</code> | ❌ | <code>"Loading..."</code> | Loading message |</p>
|
||||
<p>---</p>
|
||||
<h2>Media Components</h2>
|
||||
<h3>`aiui.audio_player(src, *, autoplay)`</h3>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>src</code> | <code>str</code> | ✅ | — | Audio file URL |</p>
|
||||
<p>| <code>autoplay</code> | <code>bool</code> | ❌ | <code>False</code> | Auto-play? |</p>
|
||||
<h3>`aiui.video_player(src, *, autoplay, poster)`</h3>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>src</code> | <code>str</code> | ✅ | — | Video file URL |</p>
|
||||
<p>| <code>autoplay</code> | <code>bool</code> | ❌ | <code>False</code> | Auto-play? |</p>
|
||||
<p>| <code>poster</code> | <code>str</code> | ❌ | <code>None</code> | Poster image URL |</p>
|
||||
<h3>`aiui.file_download(label, *, href, filename)`</h3>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>label</code> | <code>str</code> | ✅ | — | Button label |</p>
|
||||
<p>| <code>href</code> | <code>str</code> | ✅ | — | File URL |</p>
|
||||
<p>| <code>filename</code> | <code>str</code> | ❌ | <code>None</code> | Suggested filename |</p>
|
||||
<h3>`aiui.gallery(items)`</h3>
|
||||
<p>An image/media gallery grid.</p>
|
||||
<p>| Parameter | Type | Required | Description |</p>
|
||||
<p>|-----------|------|----------|-------------|</p>
|
||||
<p>| <code>items</code> | <code>Sequence[dict]</code> | ✅ | List of <code>{"src": str, "alt": str, "caption": str}</code> |</p>
|
||||
<p>---</p>
|
||||
<h2>Dashboard Components</h2>
|
||||
<h3>`aiui.toast(message, *, variant, duration)`</h3>
|
||||
<p>A toast notification.</p>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>message</code> | <code>str</code> | ✅ | — | Notification text |</p>
|
||||
<p>| <code>variant</code> | <code>str</code> | ❌ | <code>"info"</code> | <code>"info"</code>, <code>"success"</code>, <code>"warning"</code>, <code>"error"</code> |</p>
|
||||
<p>| <code>duration</code> | <code>int</code> | ❌ | <code>3000</code> | Auto-dismiss ms |</p>
|
||||
<h3>`aiui.dialog(title, *, children, description)`</h3>
|
||||
<p>A modal dialog.</p>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>title</code> | <code>str</code> | ✅ | — | Dialog heading |</p>
|
||||
<p>| <code>children</code> | <code>Sequence[dict]</code> | ✅ | — | Content components |</p>
|
||||
<p>| <code>description</code> | <code>str</code> | ❌ | <code>None</code> | Subtitle |</p>
|
||||
<h3>`aiui.caption(text)`</h3>
|
||||
<p>Small muted caption text.</p>
|
||||
<p>| Parameter | Type | Required | Description |</p>
|
||||
<p>|-----------|------|----------|-------------|</p>
|
||||
<p>| <code>text</code> | <code>str</code> | ✅ | Caption content |</p>
|
||||
<h3>`aiui.html_embed(content)`</h3>
|
||||
<p>Raw HTML embed (trusted content only).</p>
|
||||
<p>| Parameter | Type | Required | Description |</p>
|
||||
<p>|-----------|------|----------|-------------|</p>
|
||||
<p>| <code>content</code> | <code>str</code> | ✅ | HTML string |</p>
|
||||
<h3>`aiui.skeleton(*, width, height, variant)`</h3>
|
||||
<p>A skeleton loading placeholder.</p>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>width</code> | <code>str</code> | ❌ | <code>None</code> | CSS width |</p>
|
||||
<p>| <code>height</code> | <code>str</code> | ❌ | <code>None</code> | CSS height |</p>
|
||||
<p>| <code>variant</code> | <code>str</code> | ❌ | <code>"text"</code> | <code>"text"</code>, <code>"card"</code>, or <code>"avatar"</code> |</p>
|
||||
<h3>`aiui.tooltip_wrap(child, *, content)`</h3>
|
||||
<p>Wrap a component with a hover tooltip.</p>
|
||||
<p>| Parameter | Type | Required | Description |</p>
|
||||
<p>|-----------|------|----------|-------------|</p>
|
||||
<p>| <code>child</code> | <code>dict</code> | ✅ | Component to wrap |</p>
|
||||
<p>| <code>content</code> | <code>str</code> | ✅ | Tooltip text |</p>
|
||||
<p>---</p>
|
||||
<h2>Navigation Components</h2>
|
||||
<h3>`aiui.breadcrumb(items)`</h3>
|
||||
<p>A breadcrumb navigation trail.</p>
|
||||
<p>| Parameter | Type | Required | Description |</p>
|
||||
<p>|-----------|------|----------|-------------|</p>
|
||||
<p>| <code>items</code> | <code>Sequence[dict]</code> | ✅ | List of <code>{"label": str, "href": str\|None}</code> |</p>
|
||||
<h3>`aiui.pagination(*, total, page, per_page)`</h3>
|
||||
<p>Pagination controls.</p>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>total</code> | <code>int</code> | ✅ | — | Total items |</p>
|
||||
<p>| <code>page</code> | <code>int</code> | ❌ | <code>1</code> | Current page (1-based) |</p>
|
||||
<p>| <code>per_page</code> | <code>int</code> | ❌ | <code>10</code> | Items per page |</p>
|
||||
<h3>`aiui.key_value_list(items, *, title)`</h3>
|
||||
<p>A key-value display list.</p>
|
||||
<p>| Parameter | Type | Required | Default | Description |</p>
|
||||
<p>|-----------|------|----------|---------|-------------|</p>
|
||||
<p>| <code>items</code> | <code>Sequence[dict]</code> | ✅ | — | List of <code>{"label": str, "value": Any}</code> |</p>
|
||||
<p>| <code>title</code> | <code>str</code> | ❌ | <code>None</code> | Optional heading |</p>
|
||||
<h3>`aiui.popover(trigger, *, children)`</h3>
|
||||
<p>A popover overlay triggered by a component.</p>
|
||||
<p>| Parameter | Type | Required | Description |</p>
|
||||
<p>|-----------|------|----------|-------------|</p>
|
||||
<p>| <code>trigger</code> | <code>dict</code> | ✅ | Component that triggers the popover |</p>
|
||||
<p>| <code>children</code> | <code>Sequence[dict]</code> | ✅ | Content inside the popover |</p>
|
||||
<p>---</p>
|
||||
<h2>Composition</h2>
|
||||
<p>Components are designed to compose. Use <code>columns()</code> for horizontal layout within a <code>layout()</code>:</p>
|
||||
<h2>Component Count Summary</h2>
|
||||
<p>| Category | Components | Count |</p>
|
||||
<p>|----------|-----------|-------|</p>
|
||||
<p>| Core | <code>layout</code>, <code>card</code>, <code>columns</code>, <code>table</code>, <code>text</code>, <code>chart</code> | 6 |</p>
|
||||
<p>| Essential | <code>metric</code>, <code>progress_bar</code>, <code>alert</code>, <code>badge</code>, <code>separator</code>, <code>tabs</code>, <code>accordion</code>, <code>image_display</code>, <code>code_block</code>, <code>json_view</code> | 10 |</p>
|
||||
<p>| Form Inputs | <code>text_input</code>, <code>number_input</code>, <code>select_input</code>, <code>slider_input</code>, <code>checkbox_input</code>, <code>switch_input</code>, <code>radio_input</code>, <code>textarea_input</code>, <code>multiselect_input</code>, <code>date_input</code>, <code>time_input</code>, <code>color_picker_input</code> | 12 |</p>
|
||||
<p>| Layout & Advanced | <code>container</code>, <code>expander</code>, <code>divider</code>, <code>header</code>, <code>markdown_text</code>, <code>link</code>, <code>button_group</code>, <code>stat_group</code>, <code>avatar</code>, <code>callout</code>, <code>empty</code>, <code>spinner</code> | 12 |</p>
|
||||
<p>| Media | <code>audio_player</code>, <code>video_player</code>, <code>file_download</code>, <code>gallery</code> | 4 |</p>
|
||||
<p>| Dashboard | <code>toast</code>, <code>dialog</code>, <code>caption</code>, <code>html_embed</code>, <code>skeleton</code>, <code>tooltip_wrap</code> | 6 |</p>
|
||||
<p>| Navigation | <code>breadcrumb</code>, <code>pagination</code>, <code>key_value_list</code>, <code>popover</code> | 4 |</p>
|
||||
<p>| <strong>Total</strong> | | <strong>54</strong> |</p>
|
||||
<h2>Custom Component Types</h2>
|
||||
<p>The <code>dashboard.js</code> renderer supports any dict with a <code>type</code> key. Unknown types render as formatted JSON, making it safe to experiment:</p>
|
||||
<p>---</p>
|
||||
<h2>Component Render Protocol</h2>
|
||||
<p>Understanding how components flow from Python to the browser.</p>
|
||||
<h3>Data Flow</h3>
|
||||
<h3>Step-by-Step</h3>
|
||||
<p>1. <strong>Python</strong>: Call <code>aiui.card("Revenue", value="$1,500")</code> — returns a dict:</p>
|
||||
<p>2. <strong>Server</strong>: <code>@aiui.page()</code> handler returns <code>aiui.layout([...])</code>:</p>
|
||||
<p>3. <strong>API</strong>: <code>GET /api/pages/{id}/data</code> returns the JSON</p>
|
||||
<p>4. <strong>Frontend</strong>: <code>dashboard.js</code> detects <code>_components</code> key and calls <code>renderComponents()</code>:</p>
|
||||
<p>5. <strong>Renderer</strong>: <code>renderComponent(comp)</code> dispatches on <code>comp.type</code>:</p>
|
||||
<p>6. <strong>DOM</strong>: Each renderer creates HTML elements with <code>db-*</code> CSS classes</p>
|
||||
<h3>The `_components` Key</h3>
|
||||
<p>The magic key that triggers structured rendering:</p>
|
||||
<p><code>aiui.layout(children)</code> automatically wraps children in <code>{"_components": [...]}</code>.</p>
|
||||
<h3>Component Dict Protocol</h3>
|
||||
<p>Every component function returns a dict with:</p>
|
||||
<p>| Key | Required | Description |</p>
|
||||
<p>|-----|----------|-------------|</p>
|
||||
<p>| <code>type</code> | ✅ | Component type name (e.g. <code>"card"</code>, <code>"table"</code>) |</p>
|
||||
<p>| Other keys | Varies | Component-specific properties |</p>
|
||||
<h3>CSS Classes</h3>
|
||||
<p>All components use <code>db-*</code> prefixed CSS classes:</p>
|
||||
<p>| Component | CSS Class |</p>
|
||||
<p>|-----------|-----------|</p>
|
||||
<p>| Card | <code>.db-card</code>, <code>.db-card-title</code>, <code>.db-card-value</code>, <code>.db-card-footer</code> |</p>
|
||||
<p>| Table | <code>.db-viewer table</code> |</p>
|
||||
<p>| Alert | <code>.db-alert</code>, <code>.db-alert-info</code>, <code>.db-alert-success</code>, etc. |</p>
|
||||
<p>| Badge | <code>.db-badge</code>, <code>.db-badge-secondary</code>, <code>.db-badge-destructive</code> |</p>
|
||||
<p>| Tabs | <code>.db-tabs</code>, <code>.db-tab-list</code>, <code>.db-tab-btn</code>, <code>.db-tab-panel</code> |</p>
|
||||
<h3>Extending with Custom Components</h3>
|
||||
<p>To add a new component type:</p>
|
||||
<p>1. <strong>Python</strong>: Add function to <code>ui.py</code>:</p>
|
||||
<p>2. <strong>Frontend</strong>: Add renderer to <code>dashboard.js</code>:</p>
|
||||
<p>3. <strong>CSS</strong>: Add styles for <code>.db-timeline</code></p>
|
||||
<p>Until the frontend renderer is added, unknown types render as formatted JSON.</p></noscript></div>
|
||||
<script src="/plugins/plugin-loader.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,937 @@
|
||||
# Component API Reference
|
||||
|
||||
Python functions for building dashboard UIs. Each function returns a dict that the frontend renders as a real UI element — **36 components** organized into tiers.
|
||||
|
||||
```python
|
||||
import praisonaiui as aiui
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Core Components
|
||||
|
||||
### `aiui.layout(children)`
|
||||
|
||||
Wrap components in a renderable container.
|
||||
|
||||
```python
|
||||
aiui.layout([
|
||||
aiui.card("Users", value=42),
|
||||
aiui.table(headers=["A"], rows=[["x"]]),
|
||||
])
|
||||
# Returns: {"_components": [...]}
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `children` | `Sequence[dict]` | ✅ | List of component dicts |
|
||||
|
||||
**Returns:** `dict` with `_components` key — triggers structured rendering in the frontend.
|
||||
|
||||
### `aiui.card(title, *, value, footer)`
|
||||
|
||||
A metric/stat card.
|
||||
|
||||
```python
|
||||
aiui.card("Revenue", value="$1,500", footer="+8% this month")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `title` | `str` | ✅ | Card header label |
|
||||
| `value` | `Any` | ❌ | Main display value |
|
||||
| `footer` | `str` | ❌ | Small text below the value |
|
||||
|
||||
### `aiui.columns(children)`
|
||||
|
||||
Arrange components in a responsive grid row.
|
||||
|
||||
```python
|
||||
aiui.columns([
|
||||
aiui.card("A", value=1),
|
||||
aiui.card("B", value=2),
|
||||
aiui.card("C", value=3),
|
||||
])
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `children` | `Sequence[dict]` | ✅ | Component dicts to lay out side-by-side |
|
||||
|
||||
### `aiui.table(*, headers, rows)`
|
||||
|
||||
A data table.
|
||||
|
||||
```python
|
||||
aiui.table(
|
||||
headers=["Name", "Role"],
|
||||
rows=[["Alice", "Engineer"], ["Bob", "Designer"]],
|
||||
)
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `headers` | `Sequence[str]` | ✅ | Column header labels |
|
||||
| `rows` | `Sequence[Sequence[Any]]` | ✅ | Row data arrays |
|
||||
|
||||
### `aiui.text(content)`
|
||||
|
||||
A text block.
|
||||
|
||||
```python
|
||||
aiui.text("Last updated 30 seconds ago.")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `content` | `str` | ✅ | Text content |
|
||||
|
||||
### `aiui.chart(title, *, data, chart_type)`
|
||||
|
||||
A chart.
|
||||
|
||||
```python
|
||||
aiui.chart("Revenue", data=[{"month": "Jan", "value": 100}], chart_type="line")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `title` | `str` | ✅ | — | Chart title |
|
||||
| `data` | `Sequence[dict]` | ❌ | `[]` | Data points |
|
||||
| `chart_type` | `str` | ❌ | `"bar"` | `bar`, `line`, or `pie` |
|
||||
|
||||
---
|
||||
|
||||
## Essential Components
|
||||
|
||||
### `aiui.metric(label, *, value, delta, delta_color)`
|
||||
|
||||
A metric card with optional delta indicator.
|
||||
|
||||
```python
|
||||
aiui.metric("Requests", value="12.3k", delta="+15%")
|
||||
aiui.metric("Errors", value=23, delta="+3", delta_color="inverse")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `label` | `str` | ✅ | — | Metric label |
|
||||
| `value` | `Any` | ✅ | — | Main metric value |
|
||||
| `delta` | `str` | ❌ | `None` | Change indicator (e.g. "+5%") |
|
||||
| `delta_color` | `str` | ❌ | `"normal"` | `"normal"`, `"inverse"`, or `"off"` |
|
||||
|
||||
### `aiui.progress_bar(label, *, value, max_value)`
|
||||
|
||||
A progress bar.
|
||||
|
||||
```python
|
||||
aiui.progress_bar("Upload", value=73, max_value=100)
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `label` | `str` | ✅ | — | Label above the bar |
|
||||
| `value` | `int\|float` | ✅ | — | Current value |
|
||||
| `max_value` | `int\|float` | ❌ | `100` | Maximum value |
|
||||
|
||||
### `aiui.alert(message, *, variant, title)`
|
||||
|
||||
An alert/notification box.
|
||||
|
||||
```python
|
||||
aiui.alert("Deploy successful!", variant="success", title="Done")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `message` | `str` | ✅ | — | Alert body text |
|
||||
| `variant` | `str` | ❌ | `"info"` | `"info"`, `"success"`, `"warning"`, `"error"` |
|
||||
| `title` | `str` | ❌ | `None` | Optional bold title |
|
||||
|
||||
### `aiui.badge(text, *, variant)`
|
||||
|
||||
An inline badge/tag.
|
||||
|
||||
```python
|
||||
aiui.badge("New")
|
||||
aiui.badge("Deprecated", variant="destructive")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `text` | `str` | ✅ | — | Badge label |
|
||||
| `variant` | `str` | ❌ | `"default"` | `"default"`, `"secondary"`, `"destructive"`, `"outline"` |
|
||||
|
||||
### `aiui.separator()`
|
||||
|
||||
A horizontal separator line. No parameters.
|
||||
|
||||
### `aiui.tabs(items)`
|
||||
|
||||
A tabbed container.
|
||||
|
||||
```python
|
||||
aiui.tabs([
|
||||
{"label": "Overview", "children": [aiui.text("Tab 1 content")]},
|
||||
{"label": "Details", "children": [aiui.table(headers=["K","V"], rows=[["a","b"]])]},
|
||||
])
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `items` | `Sequence[dict]` | ✅ | List of `{"label": str, "children": [comp_dicts]}` |
|
||||
|
||||
### `aiui.accordion(items)`
|
||||
|
||||
A collapsible accordion.
|
||||
|
||||
```python
|
||||
aiui.accordion([
|
||||
{"title": "FAQ 1", "content": "Answer 1"},
|
||||
{"title": "FAQ 2", "content": "Answer 2"},
|
||||
])
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `items` | `Sequence[dict]` | ✅ | List of `{"title": str, "content": str_or_comp}` |
|
||||
|
||||
### `aiui.image_display(src, *, alt, caption, width)`
|
||||
|
||||
An image with optional caption.
|
||||
|
||||
```python
|
||||
aiui.image_display("https://example.com/logo.png", alt="Logo", caption="Our logo", width="300px")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `src` | `str` | ✅ | — | Image URL or path |
|
||||
| `alt` | `str` | ❌ | `""` | Alt text |
|
||||
| `caption` | `str` | ❌ | `None` | Caption below image |
|
||||
| `width` | `str` | ❌ | `None` | CSS width (e.g. `"300px"`, `"50%"`) |
|
||||
|
||||
### `aiui.code_block(code, *, language)`
|
||||
|
||||
A code block with syntax highlighting.
|
||||
|
||||
```python
|
||||
aiui.code_block("def hello():\n print('Hi!')", language="python")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `code` | `str` | ✅ | — | Source code text |
|
||||
| `language` | `str` | ❌ | `"text"` | Language for highlighting |
|
||||
|
||||
### `aiui.json_view(data)`
|
||||
|
||||
A formatted JSON viewer.
|
||||
|
||||
```python
|
||||
aiui.json_view({"status": "ok", "items": [1, 2, 3]})
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `data` | `Any` | ✅ | Any JSON-serializable data |
|
||||
|
||||
---
|
||||
|
||||
## Form Input Components
|
||||
|
||||
### `aiui.text_input(label, *, value, placeholder)`
|
||||
|
||||
```python
|
||||
aiui.text_input("Name", value="Alice", placeholder="Enter name")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `label` | `str` | ✅ | — | Input label |
|
||||
| `value` | `str` | ❌ | `""` | Default value |
|
||||
| `placeholder` | `str` | ❌ | `""` | Placeholder text |
|
||||
|
||||
### `aiui.number_input(label, *, value, min_val, max_val, step)`
|
||||
|
||||
```python
|
||||
aiui.number_input("Age", value=28, min_val=0, max_val=150, step=1)
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `label` | `str` | ✅ | — | Input label |
|
||||
| `value` | `int\|float` | ❌ | `0` | Default value |
|
||||
| `min_val` | `int\|float` | ❌ | `None` | Minimum allowed |
|
||||
| `max_val` | `int\|float` | ❌ | `None` | Maximum allowed |
|
||||
| `step` | `int\|float` | ❌ | `1` | Increment step |
|
||||
|
||||
### `aiui.select_input(label, *, options, value)`
|
||||
|
||||
```python
|
||||
aiui.select_input("Country", options=["USA", "UK", "Canada"], value="USA")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `label` | `str` | ✅ | — | Input label |
|
||||
| `options` | `Sequence[str]` | ✅ | — | Option strings |
|
||||
| `value` | `str` | ❌ | `""` | Default selected |
|
||||
|
||||
### `aiui.slider_input(label, *, value, min_val, max_val, step)`
|
||||
|
||||
```python
|
||||
aiui.slider_input("Volume", value=65, min_val=0, max_val=100, step=5)
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `label` | `str` | ✅ | — | Input label |
|
||||
| `value` | `int\|float` | ❌ | `0` | Default value |
|
||||
| `min_val` | `int\|float` | ❌ | `0` | Minimum |
|
||||
| `max_val` | `int\|float` | ❌ | `100` | Maximum |
|
||||
| `step` | `int\|float` | ❌ | `1` | Increment step |
|
||||
|
||||
### `aiui.checkbox_input(label, *, checked)`
|
||||
|
||||
```python
|
||||
aiui.checkbox_input("I agree to the terms", checked=True)
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `label` | `str` | ✅ | — | Checkbox label |
|
||||
| `checked` | `bool` | ❌ | `False` | Default state |
|
||||
|
||||
### `aiui.switch_input(label, *, checked)`
|
||||
|
||||
```python
|
||||
aiui.switch_input("Enable notifications", checked=False)
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `label` | `str` | ✅ | — | Switch label |
|
||||
| `checked` | `bool` | ❌ | `False` | Default state |
|
||||
|
||||
### `aiui.radio_input(label, *, options, value)`
|
||||
|
||||
```python
|
||||
aiui.radio_input("Language", options=["Python", "JavaScript", "Go"], value="Python")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `label` | `str` | ✅ | — | Group label |
|
||||
| `options` | `Sequence[str]` | ✅ | — | Option strings |
|
||||
| `value` | `str` | ❌ | `""` | Default selected |
|
||||
|
||||
### `aiui.textarea_input(label, *, value, placeholder, rows)`
|
||||
|
||||
```python
|
||||
aiui.textarea_input("Bio", value="Developer", placeholder="About you...", rows=3)
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `label` | `str` | ✅ | — | Input label |
|
||||
| `value` | `str` | ❌ | `""` | Default value |
|
||||
| `placeholder` | `str` | ❌ | `""` | Placeholder text |
|
||||
| `rows` | `int` | ❌ | `4` | Visible rows |
|
||||
|
||||
### `aiui.multiselect_input(label, *, options, value)`
|
||||
|
||||
```python
|
||||
aiui.multiselect_input("Tags", options=["AI", "ML", "NLP"], value=["AI"])
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `label` | `str` | ✅ | — | Input label |
|
||||
| `options` | `Sequence[str]` | ✅ | — | Available choices |
|
||||
| `value` | `Sequence[str]` | ❌ | `()` | Default selections |
|
||||
|
||||
### `aiui.date_input(label, *, value)`
|
||||
|
||||
```python
|
||||
aiui.date_input("Start Date", value="2026-01-15")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `label` | `str` | ✅ | — | Input label |
|
||||
| `value` | `str` | ❌ | `None` | ISO date string |
|
||||
|
||||
### `aiui.time_input(label, *, value)`
|
||||
|
||||
```python
|
||||
aiui.time_input("Alarm", value="08:30")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `label` | `str` | ✅ | — | Input label |
|
||||
| `value` | `str` | ❌ | `None` | `"HH:MM"` string |
|
||||
|
||||
### `aiui.color_picker_input(label, *, value)`
|
||||
|
||||
```python
|
||||
aiui.color_picker_input("Brand Color", value="#6366f1")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `label` | `str` | ✅ | — | Input label |
|
||||
| `value` | `str` | ❌ | `"#000000"` | Default hex color |
|
||||
|
||||
---
|
||||
|
||||
## Layout & Advanced Components
|
||||
|
||||
### `aiui.container(children, *, title)`
|
||||
|
||||
A container wrapper with optional title.
|
||||
|
||||
```python
|
||||
aiui.container([aiui.text("Inside"), aiui.badge("Tag")], title="Section")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `children` | `Sequence[dict]` | ✅ | — | Child component dicts |
|
||||
| `title` | `str` | ❌ | `None` | Optional heading |
|
||||
|
||||
### `aiui.expander(title, *, children, expanded)`
|
||||
|
||||
A collapsible section.
|
||||
|
||||
```python
|
||||
aiui.expander("Advanced Settings", children=[aiui.text("Hidden content")], expanded=False)
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `title` | `str` | ✅ | — | Section heading |
|
||||
| `children` | `Sequence[dict]` | ✅ | — | Content components |
|
||||
| `expanded` | `bool` | ❌ | `False` | Initially expanded? |
|
||||
|
||||
### `aiui.divider(text)`
|
||||
|
||||
A horizontal divider with optional center text.
|
||||
|
||||
```python
|
||||
aiui.divider("OR")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `text` | `str` | ❌ | `None` | Label in the middle of the line |
|
||||
|
||||
### `aiui.header(text, *, level)`
|
||||
|
||||
A heading element.
|
||||
|
||||
```python
|
||||
aiui.header("Dashboard", level=1)
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `text` | `str` | ✅ | — | Heading text |
|
||||
| `level` | `int` | ❌ | `1` | Heading level 1–6 |
|
||||
|
||||
### `aiui.markdown_text(content)`
|
||||
|
||||
A markdown-rendered text block.
|
||||
|
||||
```python
|
||||
aiui.markdown_text("**Bold**, *italic*, and `code`.")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `content` | `str` | ✅ | Markdown content string |
|
||||
|
||||
### `aiui.link(text, *, href, external)`
|
||||
|
||||
A hyperlink.
|
||||
|
||||
```python
|
||||
aiui.link("Docs", href="https://docs.praison.ai", external=True)
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `text` | `str` | ✅ | — | Link text |
|
||||
| `href` | `str` | ✅ | — | URL |
|
||||
| `external` | `bool` | ❌ | `False` | Open in new tab? |
|
||||
|
||||
### `aiui.button_group(buttons)`
|
||||
|
||||
A row of buttons.
|
||||
|
||||
```python
|
||||
aiui.button_group([
|
||||
{"label": "Save", "variant": "default"},
|
||||
{"label": "Cancel", "variant": "outline"},
|
||||
])
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `buttons` | `Sequence[dict]` | ✅ | List of `{"label": str, "variant": str}` |
|
||||
|
||||
### `aiui.stat_group(stats)`
|
||||
|
||||
A grid of stat/metric cards.
|
||||
|
||||
```python
|
||||
aiui.stat_group([
|
||||
{"label": "CPU", "value": "72%", "delta": "+5%"},
|
||||
{"label": "Memory", "value": "4.2 GB"},
|
||||
])
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `stats` | `Sequence[dict]` | ✅ | List of `{"label": str, "value": Any, "delta": str}` |
|
||||
|
||||
### `aiui.avatar(*, src, name, fallback)`
|
||||
|
||||
An avatar image or initials.
|
||||
|
||||
```python
|
||||
aiui.avatar(name="Alice Smith", fallback="AS")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `src` | `str` | ❌ | `None` | Image URL |
|
||||
| `name` | `str` | ❌ | `None` | Display name |
|
||||
| `fallback` | `str` | ❌ | `None` | Fallback text (e.g. initials) |
|
||||
|
||||
### `aiui.callout(content, *, variant, title)`
|
||||
|
||||
A callout/highlight box.
|
||||
|
||||
```python
|
||||
aiui.callout("Use GPU for faster training.", variant="info", title="Tip")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `content` | `str` | ✅ | — | Callout body text |
|
||||
| `variant` | `str` | ❌ | `"info"` | `"info"`, `"success"`, `"warning"`, `"error"` |
|
||||
| `title` | `str` | ❌ | `None` | Optional bold title |
|
||||
|
||||
### `aiui.empty(text)`
|
||||
|
||||
An empty state placeholder.
|
||||
|
||||
```python
|
||||
aiui.empty("No results found")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `text` | `str` | ❌ | `"No data"` | Placeholder message |
|
||||
|
||||
### `aiui.spinner(text)`
|
||||
|
||||
A loading spinner with text.
|
||||
|
||||
```python
|
||||
aiui.spinner("Loading data...")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `text` | `str` | ❌ | `"Loading..."` | Loading message |
|
||||
|
||||
---
|
||||
|
||||
## Media Components
|
||||
|
||||
### `aiui.audio_player(src, *, autoplay)`
|
||||
|
||||
```python
|
||||
aiui.audio_player("/audio/clip.mp3", autoplay=False)
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `src` | `str` | ✅ | — | Audio file URL |
|
||||
| `autoplay` | `bool` | ❌ | `False` | Auto-play? |
|
||||
|
||||
### `aiui.video_player(src, *, autoplay, poster)`
|
||||
|
||||
```python
|
||||
aiui.video_player("/video/demo.mp4", poster="/img/thumb.jpg")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `src` | `str` | ✅ | — | Video file URL |
|
||||
| `autoplay` | `bool` | ❌ | `False` | Auto-play? |
|
||||
| `poster` | `str` | ❌ | `None` | Poster image URL |
|
||||
|
||||
### `aiui.file_download(label, *, href, filename)`
|
||||
|
||||
```python
|
||||
aiui.file_download("Download Report", href="/files/report.pdf", filename="report.pdf")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `label` | `str` | ✅ | — | Button label |
|
||||
| `href` | `str` | ✅ | — | File URL |
|
||||
| `filename` | `str` | ❌ | `None` | Suggested filename |
|
||||
|
||||
### `aiui.gallery(items)`
|
||||
|
||||
An image/media gallery grid.
|
||||
|
||||
```python
|
||||
aiui.gallery([
|
||||
{"src": "/img/1.jpg", "alt": "Photo 1", "caption": "Sunset"},
|
||||
{"src": "/img/2.jpg", "alt": "Photo 2"},
|
||||
])
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `items` | `Sequence[dict]` | ✅ | List of `{"src": str, "alt": str, "caption": str}` |
|
||||
|
||||
---
|
||||
|
||||
## Dashboard Components
|
||||
|
||||
### `aiui.toast(message, *, variant, duration)`
|
||||
|
||||
A toast notification.
|
||||
|
||||
```python
|
||||
aiui.toast("Saved!", variant="success", duration=3000)
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `message` | `str` | ✅ | — | Notification text |
|
||||
| `variant` | `str` | ❌ | `"info"` | `"info"`, `"success"`, `"warning"`, `"error"` |
|
||||
| `duration` | `int` | ❌ | `3000` | Auto-dismiss ms |
|
||||
|
||||
### `aiui.dialog(title, *, children, description)`
|
||||
|
||||
A modal dialog.
|
||||
|
||||
```python
|
||||
aiui.dialog("Confirm", children=[aiui.text("Are you sure?")], description="This action cannot be undone.")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `title` | `str` | ✅ | — | Dialog heading |
|
||||
| `children` | `Sequence[dict]` | ✅ | — | Content components |
|
||||
| `description` | `str` | ❌ | `None` | Subtitle |
|
||||
|
||||
### `aiui.caption(text)`
|
||||
|
||||
Small muted caption text.
|
||||
|
||||
```python
|
||||
aiui.caption("Figure 1: System architecture")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `text` | `str` | ✅ | Caption content |
|
||||
|
||||
### `aiui.html_embed(content)`
|
||||
|
||||
Raw HTML embed (trusted content only).
|
||||
|
||||
```python
|
||||
aiui.html_embed('<iframe src="https://example.com" width="100%"></iframe>')
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `content` | `str` | ✅ | HTML string |
|
||||
|
||||
### `aiui.skeleton(*, width, height, variant)`
|
||||
|
||||
A skeleton loading placeholder.
|
||||
|
||||
```python
|
||||
aiui.skeleton(width="200px", height="20px", variant="text")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `width` | `str` | ❌ | `None` | CSS width |
|
||||
| `height` | `str` | ❌ | `None` | CSS height |
|
||||
| `variant` | `str` | ❌ | `"text"` | `"text"`, `"card"`, or `"avatar"` |
|
||||
|
||||
### `aiui.tooltip_wrap(child, *, content)`
|
||||
|
||||
Wrap a component with a hover tooltip.
|
||||
|
||||
```python
|
||||
aiui.tooltip_wrap(aiui.badge("Beta"), content="This feature is in beta")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `child` | `dict` | ✅ | Component to wrap |
|
||||
| `content` | `str` | ✅ | Tooltip text |
|
||||
|
||||
---
|
||||
|
||||
## Navigation Components
|
||||
|
||||
### `aiui.breadcrumb(items)`
|
||||
|
||||
A breadcrumb navigation trail.
|
||||
|
||||
```python
|
||||
aiui.breadcrumb([
|
||||
{"label": "Home", "href": "/"},
|
||||
{"label": "Settings", "href": "/settings"},
|
||||
{"label": "Profile", "href": None},
|
||||
])
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `items` | `Sequence[dict]` | ✅ | List of `{"label": str, "href": str\|None}` |
|
||||
|
||||
### `aiui.pagination(*, total, page, per_page)`
|
||||
|
||||
Pagination controls.
|
||||
|
||||
```python
|
||||
aiui.pagination(total=250, page=3, per_page=25)
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `total` | `int` | ✅ | — | Total items |
|
||||
| `page` | `int` | ❌ | `1` | Current page (1-based) |
|
||||
| `per_page` | `int` | ❌ | `10` | Items per page |
|
||||
|
||||
### `aiui.key_value_list(items, *, title)`
|
||||
|
||||
A key-value display list.
|
||||
|
||||
```python
|
||||
aiui.key_value_list([
|
||||
{"label": "Model", "value": "gpt-4o-mini"},
|
||||
{"label": "Temperature", "value": 0.7},
|
||||
], title="Config")
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Default | Description |
|
||||
|-----------|------|----------|---------|-------------|
|
||||
| `items` | `Sequence[dict]` | ✅ | — | List of `{"label": str, "value": Any}` |
|
||||
| `title` | `str` | ❌ | `None` | Optional heading |
|
||||
|
||||
### `aiui.popover(trigger, *, children)`
|
||||
|
||||
A popover overlay triggered by a component.
|
||||
|
||||
```python
|
||||
aiui.popover(aiui.badge("Info"), children=[aiui.text("More details here.")])
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `trigger` | `dict` | ✅ | Component that triggers the popover |
|
||||
| `children` | `Sequence[dict]` | ✅ | Content inside the popover |
|
||||
|
||||
---
|
||||
|
||||
## Composition
|
||||
|
||||
Components are designed to compose. Use `columns()` for horizontal layout within a `layout()`:
|
||||
|
||||
```python
|
||||
@aiui.page("overview", title="Overview", icon="📊")
|
||||
async def overview():
|
||||
return aiui.layout([
|
||||
# Row of KPI cards
|
||||
aiui.columns([
|
||||
aiui.metric("Users", value=142, delta="+12%"),
|
||||
aiui.metric("Revenue", value="$1.5k", delta="+8%"),
|
||||
aiui.metric("Uptime", value="99.9%"),
|
||||
]),
|
||||
# Tabbed data
|
||||
aiui.tabs([
|
||||
{"label": "Table", "children": [
|
||||
aiui.table(
|
||||
headers=["Agent", "Tasks", "Status"],
|
||||
rows=[["Researcher", 15, "Active"]],
|
||||
),
|
||||
]},
|
||||
{"label": "Chart", "children": [
|
||||
aiui.chart("Tasks", data=[{"name": "Researcher", "value": 15}]),
|
||||
]},
|
||||
]),
|
||||
# Footer
|
||||
aiui.text("Data refreshes every 30 seconds."),
|
||||
])
|
||||
```
|
||||
|
||||
## Component Count Summary
|
||||
|
||||
| Category | Components | Count |
|
||||
|----------|-----------|-------|
|
||||
| Core | `layout`, `card`, `columns`, `table`, `text`, `chart` | 6 |
|
||||
| Essential | `metric`, `progress_bar`, `alert`, `badge`, `separator`, `tabs`, `accordion`, `image_display`, `code_block`, `json_view` | 10 |
|
||||
| Form Inputs | `text_input`, `number_input`, `select_input`, `slider_input`, `checkbox_input`, `switch_input`, `radio_input`, `textarea_input`, `multiselect_input`, `date_input`, `time_input`, `color_picker_input` | 12 |
|
||||
| Layout & Advanced | `container`, `expander`, `divider`, `header`, `markdown_text`, `link`, `button_group`, `stat_group`, `avatar`, `callout`, `empty`, `spinner` | 12 |
|
||||
| Media | `audio_player`, `video_player`, `file_download`, `gallery` | 4 |
|
||||
| Dashboard | `toast`, `dialog`, `caption`, `html_embed`, `skeleton`, `tooltip_wrap` | 6 |
|
||||
| Navigation | `breadcrumb`, `pagination`, `key_value_list`, `popover` | 4 |
|
||||
| **Total** | | **54** |
|
||||
|
||||
## Custom Component Types
|
||||
|
||||
The `dashboard.js` renderer supports any dict with a `type` key. Unknown types render as formatted JSON, making it safe to experiment:
|
||||
|
||||
```python
|
||||
# Custom component — renders as JSON until frontend support is added
|
||||
{"type": "timeline", "events": [{"time": "10:00", "label": "Deploy"}]}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Component Render Protocol
|
||||
|
||||
Understanding how components flow from Python to the browser.
|
||||
|
||||
### Data Flow
|
||||
|
||||
```
|
||||
Python Server Frontend
|
||||
────── ────── ────────
|
||||
aiui.card("X", value=42) → {"type":"card",...} → renderComponent()
|
||||
↓ ↓
|
||||
@aiui.page() handler → /api/pages/{id}/data → renderCard()
|
||||
↓ ↓
|
||||
aiui.layout([...]) → {"_components":[...]} → DOM elements
|
||||
```
|
||||
|
||||
### Step-by-Step
|
||||
|
||||
1. **Python**: Call `aiui.card("Revenue", value="$1,500")` — returns a dict:
|
||||
```python
|
||||
{"type": "card", "title": "Revenue", "value": "$1,500"}
|
||||
```
|
||||
|
||||
2. **Server**: `@aiui.page()` handler returns `aiui.layout([...])`:
|
||||
```python
|
||||
{"_components": [{"type": "card", ...}, {"type": "table", ...}]}
|
||||
```
|
||||
|
||||
3. **API**: `GET /api/pages/{id}/data` returns the JSON
|
||||
|
||||
4. **Frontend**: `dashboard.js` detects `_components` key and calls `renderComponents()`:
|
||||
```javascript
|
||||
function renderComponents(data, container) {
|
||||
if (data && data._components) {
|
||||
data._components.forEach(comp => {
|
||||
container.appendChild(renderComponent(comp));
|
||||
});
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
5. **Renderer**: `renderComponent(comp)` dispatches on `comp.type`:
|
||||
```javascript
|
||||
function renderComponent(comp) {
|
||||
switch (comp.type) {
|
||||
case 'card': return renderCard(comp);
|
||||
case 'table': return renderTable(comp);
|
||||
// ... 48 component types
|
||||
default: return renderAsJSON(comp);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
6. **DOM**: Each renderer creates HTML elements with `db-*` CSS classes
|
||||
|
||||
### The `_components` Key
|
||||
|
||||
The magic key that triggers structured rendering:
|
||||
|
||||
```python
|
||||
# With _components — renders as UI elements
|
||||
return {"_components": [aiui.card("X"), aiui.table(...)]}
|
||||
|
||||
# Without _components — renders as raw JSON
|
||||
return {"status": "ok", "data": [...]}
|
||||
```
|
||||
|
||||
`aiui.layout(children)` automatically wraps children in `{"_components": [...]}`.
|
||||
|
||||
### Component Dict Protocol
|
||||
|
||||
Every component function returns a dict with:
|
||||
|
||||
| Key | Required | Description |
|
||||
|-----|----------|-------------|
|
||||
| `type` | ✅ | Component type name (e.g. `"card"`, `"table"`) |
|
||||
| Other keys | Varies | Component-specific properties |
|
||||
|
||||
```python
|
||||
# Card component
|
||||
{"type": "card", "title": "Revenue", "value": "$1,500", "footer": "+8%"}
|
||||
|
||||
# Table component
|
||||
{"type": "table", "headers": ["A", "B"], "rows": [["x", "y"]]}
|
||||
|
||||
# Nested components
|
||||
{"type": "columns", "children": [
|
||||
{"type": "card", "title": "A"},
|
||||
{"type": "card", "title": "B"},
|
||||
]}
|
||||
```
|
||||
|
||||
### CSS Classes
|
||||
|
||||
All components use `db-*` prefixed CSS classes:
|
||||
|
||||
| Component | CSS Class |
|
||||
|-----------|-----------|
|
||||
| Card | `.db-card`, `.db-card-title`, `.db-card-value`, `.db-card-footer` |
|
||||
| Table | `.db-viewer table` |
|
||||
| Alert | `.db-alert`, `.db-alert-info`, `.db-alert-success`, etc. |
|
||||
| Badge | `.db-badge`, `.db-badge-secondary`, `.db-badge-destructive` |
|
||||
| Tabs | `.db-tabs`, `.db-tab-list`, `.db-tab-btn`, `.db-tab-panel` |
|
||||
|
||||
### Extending with Custom Components
|
||||
|
||||
To add a new component type:
|
||||
|
||||
1. **Python**: Add function to `ui.py`:
|
||||
```python
|
||||
def timeline(events: list[dict]) -> dict:
|
||||
return {"type": "timeline", "events": events}
|
||||
```
|
||||
|
||||
2. **Frontend**: Add renderer to `dashboard.js`:
|
||||
```javascript
|
||||
function renderTimeline(comp) {
|
||||
const el = document.createElement('div');
|
||||
el.className = 'db-timeline';
|
||||
// ... render events
|
||||
return el;
|
||||
}
|
||||
|
||||
// Add to switch statement in renderComponent()
|
||||
case 'timeline': return renderTimeline(comp);
|
||||
```
|
||||
|
||||
3. **CSS**: Add styles for `.db-timeline`
|
||||
|
||||
Until the frontend renderer is added, unknown types render as formatted JSON.
|
||||
@@ -0,0 +1,445 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
|
||||
<script id="aiui-canonical-url">(function(){var p=location.pathname.replace(/\/+$/, '')||'/';if(p!==location.pathname){history.replaceState(null,'',p+location.search+location.hash);}})();</script>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="Complete API reference for all 36 PraisonAIUI feature protocol endpoints." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:locale" content="en_US" />
|
||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
||||
<title>Features REST API Reference | PraisonAIUI Docs</title>
|
||||
<script>
|
||||
(function(){try{var t=localStorage.getItem('aiui-theme-preference');var d=true;if(t==='dark'||(t==='system'&&matchMedia('(prefers-color-scheme: dark)').matches)||(!t&&d))document.documentElement.classList.add('dark');else if(t==='light')document.documentElement.classList.remove('dark');}catch(e){}})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="/assets/theme.css">
|
||||
<script type="module" crossorigin src="/assets/index.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index.css">
|
||||
<link rel="canonical" href="https://ui.praison.ai/docs/api/features-api" />
|
||||
<meta property="og:title" content="Features REST API Reference | PraisonAIUI Docs" />
|
||||
<meta property="og:description" content="Complete API reference for all 36 PraisonAIUI feature protocol endpoints." />
|
||||
<meta property="og:url" content="https://ui.praison.ai/docs/api/features-api" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:image" content="https://ui.praison.ai/icon.svg" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="Features REST API Reference | PraisonAIUI Docs" />
|
||||
<meta name="twitter:description" content="Complete API reference for all 36 PraisonAIUI feature protocol endpoints." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<script type="application/ld+json">{"@context": "https://schema.org", "@type": "TechArticle", "headline": "Features REST API Reference", "description": "Complete API reference for all 36 PraisonAIUI feature protocol endpoints.", "url": "https://ui.praison.ai/docs/api/features-api", "isPartOf": {"@type": "WebSite", "name": "PraisonAIUI Docs", "url": "https://ui.praison.ai/"}}</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"><noscript><nav aria-label="Documentation"><ul><li><a href="https://ui.praison.ai/docs/health-endpoints">Health Endpoints Guide</a></li><li><a href="https://ui.praison.ai/docs/index">PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/testing">Testing</a></li><li><a href="https://ui.praison.ai/docs/adr">Adr</a></li><li><a href="https://ui.praison.ai/docs/adr/replay-view-clean-room">ADR 0001: PraisonAI Replay view, a clean-room design</a></li><li><a href="https://ui.praison.ai/docs/api">Api</a></li><li><a href="https://ui.praison.ai/docs/api/cli">CLI API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/components">Component API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/features-api">Features REST API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/health">Health API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/python">Python SDK API</a></li><li><a href="https://ui.praison.ai/docs/api/sessions">Sessions API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/testing">API Testing Guide</a></li><li><a href="https://ui.praison.ai/docs/api/typescript">TypeScript SDK Reference</a></li><li><a href="https://ui.praison.ai/docs/concepts">Concepts</a></li><li><a href="https://ui.praison.ai/docs/concepts/architecture">Architecture: AG-UI Protocol vs Gateway Integration</a></li><li><a href="https://ui.praison.ai/docs/concepts/configuration">YAML Configuration</a></li><li><a href="https://ui.praison.ai/docs/concepts/providers">Providers</a></li><li><a href="https://ui.praison.ai/docs/concepts/slots">Slots & Components</a></li><li><a href="https://ui.praison.ai/docs/concepts/templates">Templates & Layouts</a></li><li><a href="https://ui.praison.ai/docs/examples">Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/advanced">Advanced Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/basic">Basic Examples</a></li><li><a href="https://ui.praison.ai/docs/features">Features</a></li><li><a href="https://ui.praison.ai/docs/features/a2ui-canvas">A2UI canvas — agent-driven UI</a></li><li><a href="https://ui.praison.ai/docs/features/agent-ui-host">Agent UI host — modular dashboard shell</a></li><li><a href="https://ui.praison.ai/docs/features/attachments">Chat Attachments</a></li><li><a href="https://ui.praison.ai/docs/features/backend-integration">Backend Integration Contract</a></li><li><a href="https://ui.praison.ai/docs/features/beautifului-integration">BeautifulUI Integration Strategy</a></li><li><a href="https://ui.praison.ai/docs/features/browser-automation">Browser Automation</a></li><li><a href="https://ui.praison.ai/docs/features/channel-chat-bridge">Channel-to-Chat Bridge</a></li><li><a href="https://ui.praison.ai/docs/features/code-execution">Code Execution</a></li><li><a href="https://ui.praison.ai/docs/features/comparison-openclaw">Feature Comparison: PraisonAIUI vs OpenClaw</a></li><li><a href="https://ui.praison.ai/docs/features/config-hot-reload">Config Hot-Reload</a></li><li><a href="https://ui.praison.ai/docs/features/content-sources">Content Sources</a></li><li><a href="https://ui.praison.ai/docs/features/css-architecture">How the UI Looks Are Built</a></li><li><a href="https://ui.praison.ai/docs/features/dark-mode">Dark Mode</a></li><li><a href="https://ui.praison.ai/docs/features/dashboard">Dashboard</a></li><li><a href="https://ui.praison.ai/docs/features/deployment">Deployment Guide</a></li><li><a href="https://ui.praison.ai/docs/features/device-pairing">Device Pairing</a></li><li><a href="https://ui.praison.ai/docs/features/differentiation">What Makes PraisonAIUI Different</a></li><li><a href="https://ui.praison.ai/docs/features/feature-inventory">Feature Inventory</a></li><li><a href="https://ui.praison.ai/docs/features/gap-analysis">Gap Analysis — Validated Against praisonai SDK</a></li><li><a href="https://ui.praison.ai/docs/features/gateway-chat">Gateway Chat</a></li><li><a href="https://ui.praison.ai/docs/features/hot-reload">Hot Reload</a></li><li><a href="https://ui.praison.ai/docs/features/how-to-add-a-feature">How to Add a Feature to PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/features/i18n">Internationalization (i18n)</a></li><li><a href="https://ui.praison.ai/docs/features/image-preview-chat">Image Preview in Chat</a></li><li><a href="https://ui.praison.ai/docs/features/integration-analysis">AIUI Integration — Critical Review & Architecture Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/knowledge-embeddings">Knowledge Embedding Model Configuration</a></li><li><a href="https://ui.praison.ai/docs/features/marketplace">Plugin Marketplace</a></li><li><a href="https://ui.praison.ai/docs/features/media-analysis">Media Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/message-elements">Message Elements</a></li><li><a href="https://ui.praison.ai/docs/features/model-fallback">Model Fallback</a></li><li><a href=Line truncated
|
||||
<p>Complete API reference for all <strong>36</strong> PraisonAIUI feature protocol endpoints.</p>
|
||||
<h2>Feature Registry</h2>
|
||||
<h3>GET /api/features</h3>
|
||||
<p>List all registered features with health status.</p>
|
||||
<p><strong>Response:</strong></p>
|
||||
<h2>Channels</h2>
|
||||
<h3>GET /api/channels</h3>
|
||||
<p>List all configured channels with live gateway status.</p>
|
||||
<h3>POST /api/channels</h3>
|
||||
<p>Add a channel.</p>
|
||||
<h3>GET /api/channels/platforms</h3>
|
||||
<p>List supported platforms.</p>
|
||||
<h3>GET /api/channels/{id}</h3>
|
||||
<p>Get channel details.</p>
|
||||
<h3>PUT /api/channels/{id}</h3>
|
||||
<p>Update channel configuration. Body fields: <code>name</code>, <code>platform</code>, <code>enabled</code>, <code>config</code>.</p>
|
||||
<h3>DELETE /api/channels/{id}</h3>
|
||||
<p>Remove a channel.</p>
|
||||
<h3>POST /api/channels/{id}/toggle</h3>
|
||||
<p>Toggle channel enabled/disabled.</p>
|
||||
<h3>GET /api/channels/{id}/status</h3>
|
||||
<p>Get live channel status (enriched via gateway).</p>
|
||||
<h3>POST /api/channels/{id}/restart</h3>
|
||||
<p>Restart a channel bot via the gateway. Returns status of restart attempt.</p>
|
||||
<p>---</p>
|
||||
<h2>Schedules</h2>
|
||||
<h3>POST /api/schedules</h3>
|
||||
<p>Add a scheduled job.</p>
|
||||
<h3>GET /api/schedules</h3>
|
||||
<p>List all scheduled jobs.</p>
|
||||
<h3>GET /api/schedules/{id}</h3>
|
||||
<p>Get job details.</p>
|
||||
<h3>PUT /api/schedules/{id}</h3>
|
||||
<p>Update schedule configuration. Body fields: <code>name</code>, <code>message</code>, <code>schedule</code>, <code>enabled</code>.</p>
|
||||
<h3>DELETE /api/schedules/{id}</h3>
|
||||
<p>Remove a job.</p>
|
||||
<h3>POST /api/schedules/{id}/toggle</h3>
|
||||
<p>Toggle job enabled/disabled.</p>
|
||||
<h3>POST /api/schedules/{id}/run</h3>
|
||||
<p>Trigger job immediately.</p>
|
||||
<h3>POST /api/schedules/{id}/stop</h3>
|
||||
<p>Stop a running scheduled job. Attempts to cancel via <code>AgentScheduler</code> if available.</p>
|
||||
<h3>GET /api/schedules/{id}/stats</h3>
|
||||
<p>Get execution statistics for a schedule.</p>
|
||||
<p>---</p>
|
||||
<h2>Jobs</h2>
|
||||
<h3>POST /api/jobs</h3>
|
||||
<p>Submit a new async job. Returns 202 Accepted.</p>
|
||||
<h3>GET /api/jobs</h3>
|
||||
<p>List jobs with optional filters. Query: <code>?status=running</code>, <code>?limit=50</code>, <code>?offset=0</code></p>
|
||||
<h3>GET /api/jobs/stats</h3>
|
||||
<p>Get executor statistics.</p>
|
||||
<h3>GET /api/jobs/{id}</h3>
|
||||
<p>Get full job details.</p>
|
||||
<h3>GET /api/jobs/{id}/status</h3>
|
||||
<p>Get job status with progress info.</p>
|
||||
<h3>GET /api/jobs/{id}/result</h3>
|
||||
<p>Get job result. Returns 409 if not yet complete.</p>
|
||||
<h3>POST /api/jobs/{id}/cancel</h3>
|
||||
<p>Cancel a running or queued job. Returns 409 if already complete.</p>
|
||||
<h3>DELETE /api/jobs/{id}</h3>
|
||||
<p>Delete a completed job. Returns 409 if still running.</p>
|
||||
<h3>GET /api/jobs/{id}/stream</h3>
|
||||
<p>SSE stream for real-time job updates. Events: <code>status</code>, <code>progress</code>, <code>result</code>, <code>error</code>, <code>done</code>.</p>
|
||||
<p>---</p>
|
||||
<h2>Usage</h2>
|
||||
<h3>GET /api/usage</h3>
|
||||
<p>Usage summary with totals and averages.</p>
|
||||
<h3>POST /api/usage/track</h3>
|
||||
<p>Track a usage event.</p>
|
||||
<h3>GET /api/usage/details</h3>
|
||||
<p>Detailed usage records. Query: <code>?limit=100</code>, <code>?offset=0</code></p>
|
||||
<h3>GET /api/usage/models</h3>
|
||||
<p>Per-model breakdown (tokens, cost, request count).</p>
|
||||
<h3>GET /api/usage/sessions</h3>
|
||||
<p>Per-session breakdown.</p>
|
||||
<h3>GET /api/usage/agents</h3>
|
||||
<p>Per-agent breakdown.</p>
|
||||
<h3>GET /api/usage/timeseries</h3>
|
||||
<p>Time-series data for charts. Query: <code>?hours=24</code>, <code>?bucket_minutes=60</code></p>
|
||||
<h3>GET /api/usage/costs</h3>
|
||||
<p>Get the model cost table (per-1K token rates for 21 models).</p>
|
||||
<p>---</p>
|
||||
<h2>Memory</h2>
|
||||
<h3>POST /api/memory</h3>
|
||||
<p>Add a memory entry.</p>
|
||||
<h3>POST /api/memory/search</h3>
|
||||
<p>Search memories.</p>
|
||||
<h3>GET /api/memory</h3>
|
||||
<p>List all memories. Query: <code>?type=short|long|entity|all</code></p>
|
||||
<h3>GET /api/memory/{id}</h3>
|
||||
<p>Get single memory.</p>
|
||||
<h3>DELETE /api/memory/{id}</h3>
|
||||
<p>Delete single memory.</p>
|
||||
<h3>DELETE /api/memory</h3>
|
||||
<p>Clear memories. Query: <code>?type=all</code></p>
|
||||
<h3>POST /api/memory/context</h3>
|
||||
<p>Get memory context for prompt injection.</p>
|
||||
<p>---</p>
|
||||
<h2>Extended Sessions</h2>
|
||||
<h3>GET /api/sessions/{session_id}/state</h3>
|
||||
<p>Get session state.</p>
|
||||
<h3>POST /api/sessions/{session_id}/state</h3>
|
||||
<p>Save session state.</p>
|
||||
<h3>POST /api/sessions/{session_id}/context</h3>
|
||||
<p>Build context from session state + memory.</p>
|
||||
<h3>POST /api/sessions/{session_id}/compact</h3>
|
||||
<p>Compact session data. Returns before/after stats.</p>
|
||||
<h3>POST /api/sessions/{session_id}/reset</h3>
|
||||
<p>Reset session. Body: <code>{"mode": "clear"}</code></p>
|
||||
<h3>GET /api/sessions/{session_id}/preview</h3>
|
||||
<p>Formatted session preview without full history.</p>
|
||||
<h3>GET/POST /api/sessions/{session_id}/labels</h3>
|
||||
<p>Get or set session labels.</p>
|
||||
<h3>GET /api/sessions/{session_id}/usage</h3>
|
||||
<p>Get session usage statistics.</p>
|
||||
<p>---</p>
|
||||
<h2>Skills</h2>
|
||||
<p>Tool catalog with 18 built-in tools across 7 categories (search, crawl, file, code, shell, skills, schedule).</p>
|
||||
<h3>GET /api/skills</h3>
|
||||
<p>List all tools. Query: <code>?category=search</code>, <code>?enabled=true</code>, <code>?search=web</code></p>
|
||||
<h3>GET /api/skills/categories</h3>
|
||||
<p>List tool categories.</p>
|
||||
<h3>POST /api/skills</h3>
|
||||
<p>Register a custom skill.</p>
|
||||
<h3>GET /api/skills/{id}</h3>
|
||||
<p>Get tool details including required API keys.</p>
|
||||
<h3>PUT /api/skills/{id}</h3>
|
||||
<p>Update a custom skill.</p>
|
||||
<h3>DELETE /api/skills/{id}</h3>
|
||||
<p>Remove a custom skill (builtin tools cannot be deleted).</p>
|
||||
<h3>POST /api/skills/{id}/toggle</h3>
|
||||
<p>Toggle tool enabled/disabled.</p>
|
||||
<h3>PUT /api/skills/{id}/config</h3>
|
||||
<p>Set tool configuration or API keys.</p>
|
||||
<p>---</p>
|
||||
<h2>Hooks</h2>
|
||||
<h3>POST /api/hooks</h3>
|
||||
<p>Register a hook.</p>
|
||||
<h3>GET /api/hooks</h3>
|
||||
<p>List all hooks.</p>
|
||||
<h3>GET /api/hooks/log</h3>
|
||||
<p>View hook execution log. Query: <code>?limit=20</code></p>
|
||||
<h3>GET /api/hooks/{id}</h3>
|
||||
<p>Get hook details.</p>
|
||||
<h3>POST /api/hooks/{id}/trigger</h3>
|
||||
<p>Trigger a hook manually.</p>
|
||||
<h3>DELETE /api/hooks/{id}</h3>
|
||||
<p>Remove hook.</p>
|
||||
<p>---</p>
|
||||
<h2>Workflows</h2>
|
||||
<h3>POST /api/workflows</h3>
|
||||
<p>Create a workflow.</p>
|
||||
<h3>GET /api/workflows</h3>
|
||||
<p>List all workflows.</p>
|
||||
<h3>GET /api/workflows/runs</h3>
|
||||
<p>List all workflow runs.</p>
|
||||
<h3>GET /api/workflows/runs/{run_id}</h3>
|
||||
<p>Get run details.</p>
|
||||
<h3>GET /api/workflows/{id}</h3>
|
||||
<p>Get workflow details.</p>
|
||||
<h3>POST /api/workflows/{id}/run</h3>
|
||||
<p>Execute a workflow.</p>
|
||||
<h3>GET /api/workflows/{id}/status</h3>
|
||||
<p>Get workflow status (total runs, last run).</p>
|
||||
<h3>DELETE /api/workflows/{id}</h3>
|
||||
<p>Delete workflow.</p>
|
||||
<p>---</p>
|
||||
<h2>Config Runtime</h2>
|
||||
<h3>GET /api/config/runtime</h3>
|
||||
<p>Get all runtime config.</p>
|
||||
<h3>PATCH /api/config/runtime</h3>
|
||||
<p>Merge config values.</p>
|
||||
<h3>PUT /api/config/runtime</h3>
|
||||
<p>Replace entire config.</p>
|
||||
<h3>GET /api/config/runtime/history</h3>
|
||||
<p>Config change history. Query: <code>?limit=50</code></p>
|
||||
<h3>GET /api/config/runtime/{key}</h3>
|
||||
<p>Get single config key.</p>
|
||||
<h3>PUT /api/config/runtime/{key}</h3>
|
||||
<p>Set single config key.</p>
|
||||
<h3>DELETE /api/config/runtime/{key}</h3>
|
||||
<p>Delete config key.</p>
|
||||
<h3>GET /api/config/schema</h3>
|
||||
<p>JSON Schema for schema-driven form rendering.</p>
|
||||
<h3>POST /api/config/validate</h3>
|
||||
<p>Validate config without applying.</p>
|
||||
<h3>POST /api/config/apply</h3>
|
||||
<p>Validate and apply config changes.</p>
|
||||
<h3>GET /api/config/defaults</h3>
|
||||
<p>Get default values from schema.</p>
|
||||
<p>---</p>
|
||||
<h2>Agents</h2>
|
||||
<p>Agent definition CRUD with model selection, system prompts, and duplication.</p>
|
||||
<h3>GET /api/agents/definitions</h3>
|
||||
<p>List all agent definitions.</p>
|
||||
<h3>POST /api/agents/definitions</h3>
|
||||
<p>Create a new agent.</p>
|
||||
<h3>GET /api/agents/definitions/{id}</h3>
|
||||
<p>Get agent details.</p>
|
||||
<h3>PUT /api/agents/definitions/{id}</h3>
|
||||
<p>Update agent. Body fields: <code>name</code>, <code>description</code>, <code>model</code>, <code>temperature</code>, <code>system_prompt</code>, <code>instructions</code>, <code>tools</code>, <code>icon</code>.</p>
|
||||
<h3>DELETE /api/agents/definitions/{id}</h3>
|
||||
<p>Delete agent.</p>
|
||||
<h3>GET /api/agents/models</h3>
|
||||
<p>List available models (13 models across OpenAI, Anthropic, Google).</p>
|
||||
<h3>POST /api/agents/run/{id}</h3>
|
||||
<p>Execute an agent via <code>praisonaiagents.Agent.start()</code>.</p>
|
||||
<h3>POST /api/agents/duplicate/{id}</h3>
|
||||
<p>Duplicate an existing agent.</p>
|
||||
<p>---</p>
|
||||
<h2>OpenAI-Compatible API</h2>
|
||||
<p>Drop-in replacement for OpenAI SDK. Use <code>base_url="http://localhost:8000/v1"</code>.</p>
|
||||
<h3>GET /v1</h3>
|
||||
<p>API info with available endpoint list.</p>
|
||||
<h3>POST /v1/chat/completions</h3>
|
||||
<p>Chat completions (OpenAI-compatible).</p>
|
||||
<h3>POST /v1/completions</h3>
|
||||
<p>Legacy text completions.</p>
|
||||
<h3>POST /v1/embeddings</h3>
|
||||
<p>Create embeddings.</p>
|
||||
<h3>POST /v1/images/generations</h3>
|
||||
<p>Generate images (DALL-E).</p>
|
||||
<h3>POST /v1/audio/transcriptions</h3>
|
||||
<p>Transcribe audio (Whisper).</p>
|
||||
<h3>POST /v1/audio/speech</h3>
|
||||
<p>Text to speech.</p>
|
||||
<h3>POST /v1/moderations</h3>
|
||||
<p>Content moderation.</p>
|
||||
<h3>GET /v1/models</h3>
|
||||
<p>List available models (13 models).</p>
|
||||
<h3>GET /v1/models/{id}</h3>
|
||||
<p>Get model info.</p>
|
||||
<h3>POST /v1/responses</h3>
|
||||
<p>OpenAI Responses API.</p>
|
||||
<h3>GET/POST /v1/files</h3>
|
||||
<p>File management.</p>
|
||||
<h3>GET/DELETE /v1/files/{id}</h3>
|
||||
<p>File operations.</p>
|
||||
<h3>GET/POST /v1/assistants</h3>
|
||||
<p>Assistants API.</p>
|
||||
<p>---</p>
|
||||
<h2>Logs</h2>
|
||||
<p>Real-time log streaming via WebSocket.</p>
|
||||
<h3>WS /api/logs/stream</h3>
|
||||
<p>WebSocket for real-time log streaming. Query: <code>?level=INFO</code>, <code>?search=agent</code></p>
|
||||
<h3>GET /api/logs/levels</h3>
|
||||
<p>Available log levels with colors.</p>
|
||||
<h3>GET /api/logs/stats</h3>
|
||||
<p>Log buffer statistics.</p>
|
||||
<h3>POST /api/logs/clear</h3>
|
||||
<p>Clear the log buffer.</p>
|
||||
<p>---</p>
|
||||
<h2>Auth</h2>
|
||||
<p>Multi-mode authentication (none, api_key, session, password).</p>
|
||||
<h3>GET /api/auth/status</h3>
|
||||
<p>Check current auth status.</p>
|
||||
<h3>GET /api/auth/config</h3>
|
||||
<p>Get auth configuration.</p>
|
||||
<h3>PUT /api/auth/config</h3>
|
||||
<p>Set auth configuration. Body: <code>{"mode": "session", "session_timeout_hours": 48}</code></p>
|
||||
<h3>GET /api/auth/keys</h3>
|
||||
<p>List API keys.</p>
|
||||
<h3>POST /api/auth/keys</h3>
|
||||
<p>Create API key.</p>
|
||||
<h3>DELETE /api/auth/keys/{id}</h3>
|
||||
<p>Revoke API key.</p>
|
||||
<h3>POST /api/auth/login</h3>
|
||||
<p>Login with password.</p>
|
||||
<h3>POST /api/auth/logout</h3>
|
||||
<p>Logout current session.</p>
|
||||
<h3>GET /api/auth/sessions</h3>
|
||||
<p>List active sessions.</p>
|
||||
<h3>POST /api/auth/password</h3>
|
||||
<p>Set or change password.</p>
|
||||
<p>---</p>
|
||||
<h2>TTS (Text-to-Speech)</h2>
|
||||
<h3>GET /api/tts/voices</h3>
|
||||
<p>List available voices.</p>
|
||||
<h3>POST /api/tts/synthesize</h3>
|
||||
<p>Synthesize speech from text.</p>
|
||||
<p>---</p>
|
||||
<h2>Marketplace</h2>
|
||||
<p>Plugin discovery, search, install, and management.</p>
|
||||
<h3>GET /api/marketplace/plugins</h3>
|
||||
<p>List all available plugins.</p>
|
||||
<h3>POST /api/marketplace/search</h3>
|
||||
<p>Search plugins by query.</p>
|
||||
<h3>POST /api/marketplace/install</h3>
|
||||
<p>Install a plugin.</p>
|
||||
<h3>POST /api/marketplace/uninstall</h3>
|
||||
<p>Uninstall a plugin.</p>
|
||||
<h3>GET /api/marketplace/plugins/{id}</h3>
|
||||
<p>Get plugin details.</p>
|
||||
<p>---</p>
|
||||
<h2>Code Execution</h2>
|
||||
<p>Sandboxed code execution with language allowlists.</p>
|
||||
<h3>GET /api/code/languages</h3>
|
||||
<p>List supported languages.</p>
|
||||
<h3>POST /api/code/execute</h3>
|
||||
<p>Execute code in sandbox.</p>
|
||||
<p>---</p>
|
||||
<h2>PWA</h2>
|
||||
<p>Progressive Web App support — manifest, service worker, and installability.</p>
|
||||
<h3>GET /manifest.json</h3>
|
||||
<p>Web Application Manifest for installability.</p>
|
||||
<h3>GET /sw.js</h3>
|
||||
<p>Service Worker JavaScript with cache-first strategy.</p>
|
||||
<h3>GET /api/pwa/config</h3>
|
||||
<p>PWA configuration details.</p>
|
||||
<p>---</p>
|
||||
<h2>i18n</h2>
|
||||
<p>Internationalization with locale switching and string lookup.</p>
|
||||
<h3>GET /api/i18n/locales</h3>
|
||||
<p>List available locales.</p>
|
||||
<h3>GET /api/i18n/strings/{locale}</h3>
|
||||
<p>Get all strings for a locale.</p>
|
||||
<h3>POST /api/i18n/translate</h3>
|
||||
<p>Translate a key with optional variables.</p>
|
||||
<h3>GET /api/i18n/locale</h3>
|
||||
<p>Get current default locale.</p>
|
||||
<h3>POST /api/i18n/locale</h3>
|
||||
<p>Set default locale.</p>
|
||||
<p>---</p>
|
||||
<h2>Device Pairing</h2>
|
||||
<p>Pair devices to sessions using short hex codes.</p>
|
||||
<h3>POST /api/pairing/create</h3>
|
||||
<p>Generate a pairing code.</p>
|
||||
<h3>POST /api/pairing/validate</h3>
|
||||
<p>Validate and consume a pairing code.</p>
|
||||
<h3>GET /api/pairing/devices</h3>
|
||||
<p>List paired devices. Query: <code>?session_id=my-session</code></p>
|
||||
<h3>DELETE /api/pairing/devices/{id}</h3>
|
||||
<p>Remove a paired device.</p>
|
||||
<p>---</p>
|
||||
<h2>Media Analysis</h2>
|
||||
<p>Image understanding, OCR, and object detection via VisionAgent.</p>
|
||||
<h3>GET /api/media/capabilities</h3>
|
||||
<p>List analysis capabilities.</p>
|
||||
<h3>POST /api/media/analyze</h3>
|
||||
<p>Analyze an image.</p>
|
||||
<h3>POST /api/media/ocr</h3>
|
||||
<p>Extract text from an image.</p>
|
||||
<p>---</p>
|
||||
<h2>Guardrails</h2>
|
||||
<p>Input/output safety guardrails — validation rules, violation tracking, and registration.</p>
|
||||
<h3>GET /api/guardrails</h3>
|
||||
<p>List all registered guardrails.</p>
|
||||
<h3>GET /api/guardrails/status</h3>
|
||||
<p>Guardrails feature health.</p>
|
||||
<h3>GET /api/guardrails/violations</h3>
|
||||
<p>List guardrail violations.</p>
|
||||
<h3>POST /api/guardrails/register</h3>
|
||||
<p>Register a guardrail rule.</p>
|
||||
<p>---</p>
|
||||
<h2>Eval</h2>
|
||||
<p>Agent evaluation — accuracy scoring, judge models, and evaluation runs.</p>
|
||||
<h3>GET /api/eval</h3>
|
||||
<p>Overview of evaluation state.</p>
|
||||
<h3>GET /api/eval/status</h3>
|
||||
<p>Eval feature health.</p>
|
||||
<h3>GET /api/eval/scores</h3>
|
||||
<p>Get evaluation scores.</p>
|
||||
<h3>GET /api/eval/judges</h3>
|
||||
<p>List configured judge models.</p>
|
||||
<h3>POST /api/eval/run</h3>
|
||||
<p>Run an evaluation.</p>
|
||||
<p>---</p>
|
||||
<h2>Telemetry</h2>
|
||||
<p>Performance monitoring — metrics collection, performance stats, and profiling.</p>
|
||||
<h3>GET /api/telemetry</h3>
|
||||
<p>Telemetry overview.</p>
|
||||
<h3>GET /api/telemetry/status</h3>
|
||||
<p>Telemetry feature health.</p>
|
||||
<h3>GET /api/telemetry/metrics</h3>
|
||||
<p>Get collected metrics.</p>
|
||||
<h3>GET /api/telemetry/performance</h3>
|
||||
<p>Get performance statistics.</p>
|
||||
<h3>GET /api/telemetry/profiling</h3>
|
||||
<p>Get profiling data.</p>
|
||||
<h3>POST /api/telemetry/record</h3>
|
||||
<p>Record a telemetry event.</p>
|
||||
<p>---</p>
|
||||
<h2>Traces</h2>
|
||||
<p>Distributed tracing and observability — span recording, trace lookup, and span details.</p>
|
||||
<h3>GET /api/traces</h3>
|
||||
<p>List recent traces.</p>
|
||||
<h3>GET /api/traces/status</h3>
|
||||
<p>Tracing feature health.</p>
|
||||
<h3>GET /api/traces/spans</h3>
|
||||
<p>List trace spans.</p>
|
||||
<h3>POST /api/traces/record</h3>
|
||||
<p>Record a trace span.</p>
|
||||
<h3>GET /api/traces/{trace_id}</h3>
|
||||
<p>Get full trace details.</p>
|
||||
<p>---</p>
|
||||
<h2>Security</h2>
|
||||
<p>Security monitoring — audit logging, configuration review, and access control.</p>
|
||||
<h3>GET /api/security</h3>
|
||||
<p>Security overview.</p>
|
||||
<h3>GET /api/security/status</h3>
|
||||
<p>Security feature health.</p>
|
||||
<h3>GET /api/security/audit</h3>
|
||||
<p>Get audit log entries.</p>
|
||||
<h3>GET /api/security/config</h3>
|
||||
<p>Get security configuration.</p></noscript></div>
|
||||
<script src="/plugins/plugin-loader.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,92 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
|
||||
<script id="aiui-canonical-url">(function(){var p=location.pathname.replace(/\/+$/, '')||'/';if(p!==location.pathname){history.replaceState(null,'',p+location.search+location.hash);}})();</script>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="The AIUI health API provides endpoints to monitor server and provider health status." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:locale" content="en_US" />
|
||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
||||
<title>Health API Reference | PraisonAIUI Docs</title>
|
||||
<script>
|
||||
(function(){try{var t=localStorage.getItem('aiui-theme-preference');var d=true;if(t==='dark'||(t==='system'&&matchMedia('(prefers-color-scheme: dark)').matches)||(!t&&d))document.documentElement.classList.add('dark');else if(t==='light')document.documentElement.classList.remove('dark');}catch(e){}})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="/assets/theme.css">
|
||||
<script type="module" crossorigin src="/assets/index.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index.css">
|
||||
<link rel="canonical" href="https://ui.praison.ai/docs/api/health" />
|
||||
<meta property="og:title" content="Health API Reference | PraisonAIUI Docs" />
|
||||
<meta property="og:description" content="The AIUI health API provides endpoints to monitor server and provider health status." />
|
||||
<meta property="og:url" content="https://ui.praison.ai/docs/api/health" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:image" content="https://ui.praison.ai/icon.svg" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="Health API Reference | PraisonAIUI Docs" />
|
||||
<meta name="twitter:description" content="The AIUI health API provides endpoints to monitor server and provider health status." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<script type="application/ld+json">{"@context": "https://schema.org", "@type": "TechArticle", "headline": "Health API Reference", "description": "The AIUI health API provides endpoints to monitor server and provider health status.", "url": "https://ui.praison.ai/docs/api/health", "isPartOf": {"@type": "WebSite", "name": "PraisonAIUI Docs", "url": "https://ui.praison.ai/"}}</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"><noscript><nav aria-label="Documentation"><ul><li><a href="https://ui.praison.ai/docs/health-endpoints">Health Endpoints Guide</a></li><li><a href="https://ui.praison.ai/docs/index">PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/testing">Testing</a></li><li><a href="https://ui.praison.ai/docs/adr">Adr</a></li><li><a href="https://ui.praison.ai/docs/adr/replay-view-clean-room">ADR 0001: PraisonAI Replay view, a clean-room design</a></li><li><a href="https://ui.praison.ai/docs/api">Api</a></li><li><a href="https://ui.praison.ai/docs/api/cli">CLI API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/components">Component API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/features-api">Features REST API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/health">Health API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/python">Python SDK API</a></li><li><a href="https://ui.praison.ai/docs/api/sessions">Sessions API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/testing">API Testing Guide</a></li><li><a href="https://ui.praison.ai/docs/api/typescript">TypeScript SDK Reference</a></li><li><a href="https://ui.praison.ai/docs/concepts">Concepts</a></li><li><a href="https://ui.praison.ai/docs/concepts/architecture">Architecture: AG-UI Protocol vs Gateway Integration</a></li><li><a href="https://ui.praison.ai/docs/concepts/configuration">YAML Configuration</a></li><li><a href="https://ui.praison.ai/docs/concepts/providers">Providers</a></li><li><a href="https://ui.praison.ai/docs/concepts/slots">Slots & Components</a></li><li><a href="https://ui.praison.ai/docs/concepts/templates">Templates & Layouts</a></li><li><a href="https://ui.praison.ai/docs/examples">Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/advanced">Advanced Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/basic">Basic Examples</a></li><li><a href="https://ui.praison.ai/docs/features">Features</a></li><li><a href="https://ui.praison.ai/docs/features/a2ui-canvas">A2UI canvas — agent-driven UI</a></li><li><a href="https://ui.praison.ai/docs/features/agent-ui-host">Agent UI host — modular dashboard shell</a></li><li><a href="https://ui.praison.ai/docs/features/attachments">Chat Attachments</a></li><li><a href="https://ui.praison.ai/docs/features/backend-integration">Backend Integration Contract</a></li><li><a href="https://ui.praison.ai/docs/features/beautifului-integration">BeautifulUI Integration Strategy</a></li><li><a href="https://ui.praison.ai/docs/features/browser-automation">Browser Automation</a></li><li><a href="https://ui.praison.ai/docs/features/channel-chat-bridge">Channel-to-Chat Bridge</a></li><li><a href="https://ui.praison.ai/docs/features/code-execution">Code Execution</a></li><li><a href="https://ui.praison.ai/docs/features/comparison-openclaw">Feature Comparison: PraisonAIUI vs OpenClaw</a></li><li><a href="https://ui.praison.ai/docs/features/config-hot-reload">Config Hot-Reload</a></li><li><a href="https://ui.praison.ai/docs/features/content-sources">Content Sources</a></li><li><a href="https://ui.praison.ai/docs/features/css-architecture">How the UI Looks Are Built</a></li><li><a href="https://ui.praison.ai/docs/features/dark-mode">Dark Mode</a></li><li><a href="https://ui.praison.ai/docs/features/dashboard">Dashboard</a></li><li><a href="https://ui.praison.ai/docs/features/deployment">Deployment Guide</a></li><li><a href="https://ui.praison.ai/docs/features/device-pairing">Device Pairing</a></li><li><a href="https://ui.praison.ai/docs/features/differentiation">What Makes PraisonAIUI Different</a></li><li><a href="https://ui.praison.ai/docs/features/feature-inventory">Feature Inventory</a></li><li><a href="https://ui.praison.ai/docs/features/gap-analysis">Gap Analysis — Validated Against praisonai SDK</a></li><li><a href="https://ui.praison.ai/docs/features/gateway-chat">Gateway Chat</a></li><li><a href="https://ui.praison.ai/docs/features/hot-reload">Hot Reload</a></li><li><a href="https://ui.praison.ai/docs/features/how-to-add-a-feature">How to Add a Feature to PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/features/i18n">Internationalization (i18n)</a></li><li><a href="https://ui.praison.ai/docs/features/image-preview-chat">Image Preview in Chat</a></li><li><a href="https://ui.praison.ai/docs/features/integration-analysis">AIUI Integration — Critical Review & Architecture Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/knowledge-embeddings">Knowledge Embedding Model Configuration</a></li><li><a href="https://ui.praison.ai/docs/features/marketplace">Plugin Marketplace</a></li><li><a href="https://ui.praison.ai/docs/features/media-analysis">Media Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/message-elements">Message Elements</a></li><li><a href="https://ui.praison.ai/docs/features/model-fallback">Model Fallback</a></li><li><a href=Line truncated
|
||||
<p>The AIUI health API provides endpoints to monitor server and provider health status.</p>
|
||||
<h2>Health Status Values</h2>
|
||||
<p>The following status values are used throughout the health API:</p>
|
||||
<p>| Status | Meaning | Color Code |</p>
|
||||
<p>|--------|---------|------------|</p>
|
||||
<p>| <code>"ok"</code> | Service is functioning normally | Green |</p>
|
||||
<p>| <code>"healthy"</code> | Service is functioning normally (legacy) | Green |</p>
|
||||
<p>| <code>"degraded"</code> | Service is partially functional | Yellow |</p>
|
||||
<p>| <code>"error"</code> | Service has errors | Red |</p>
|
||||
<p>| <code>"unknown"</code> | Status cannot be determined | Yellow |</p>
|
||||
<p>> <strong>Note:</strong> Both <code>"ok"</code> and <code>"healthy"</code> indicate successful operation. The system accepts either value for backward compatibility.</p>
|
||||
<h2>Endpoints</h2>
|
||||
<h3>GET /health</h3>
|
||||
<p>Returns the overall server health status.</p>
|
||||
<p><strong>Response:</strong></p>
|
||||
<h3>GET /api/provider</h3>
|
||||
<p>Returns information about the active AI provider.</p>
|
||||
<p><strong>Response:</strong></p>
|
||||
<h3>GET /api/provider/health</h3>
|
||||
<p>Returns detailed JSON health information from the provider gateway. Always</p>
|
||||
<p>responds with <code>Content-Type: application/json</code>. The base fields from the</p>
|
||||
<p>provider's <code>health()</code> payload are merged with the normalised fields below.</p>
|
||||
<p><strong>Response:</strong></p>
|
||||
<p>| Field | Type | Description |</p>
|
||||
<p>|-------|------|-------------|</p>
|
||||
<p>| <code>status</code> | string | One of the health status values above. |</p>
|
||||
<p>| <code>type</code> | string | Provider type (from <code>provider</code> field, falls back to class name). |</p>
|
||||
<p>| <code>agents</code> | integer | Count of agents reported by the provider. |</p>
|
||||
<p>| <code>detail</code> | string | Human-readable detail; <code>"ok"</code> for healthy providers. |</p>
|
||||
<p>> <strong>Note:</strong> Any unmatched <code>/api/*</code> path returns a JSON <code>404</code> (never the SPA</p>
|
||||
<p>> HTML shell), so API clients can rely on parsing the response body.</p>
|
||||
<h2>CLI Commands</h2>
|
||||
<h3>health-check</h3>
|
||||
<p>Check server health status:</p>
|
||||
<p>The command displays:</p>
|
||||
<li>Green panel for <code>"ok"</code> or <code>"healthy"</code> status</li>
|
||||
<li>Yellow panel for other statuses</li>
|
||||
<li>Red error message if server is unreachable</li>
|
||||
<h3>doctor</h3>
|
||||
<p>Run comprehensive diagnostics:</p>
|
||||
<p>The doctor command checks:</p>
|
||||
<p>1. Server Health</p>
|
||||
<p>2. Provider Status</p>
|
||||
<p>3. Gateway Status</p>
|
||||
<p>4. Features Loaded</p>
|
||||
<p>5. Config Store</p>
|
||||
<p>6. Datastore</p>
|
||||
<p>7. Channels</p>
|
||||
<h3>provider status</h3>
|
||||
<p>Check provider health:</p>
|
||||
<h2>Python API</h2>
|
||||
<h2>JavaScript/Dashboard</h2>
|
||||
<p>The dashboard automatically accepts both <code>"ok"</code> and <code>"healthy"</code> as success statuses:</p></noscript></div>
|
||||
<script src="/plugins/plugin-loader.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,136 @@
|
||||
# Health API Reference
|
||||
|
||||
The AIUI health API provides endpoints to monitor server and provider health status.
|
||||
|
||||
## Health Status Values
|
||||
|
||||
The following status values are used throughout the health API:
|
||||
|
||||
| Status | Meaning | Color Code |
|
||||
|--------|---------|------------|
|
||||
| `"ok"` | Service is functioning normally | Green |
|
||||
| `"healthy"` | Service is functioning normally (legacy) | Green |
|
||||
| `"degraded"` | Service is partially functional | Yellow |
|
||||
| `"error"` | Service has errors | Red |
|
||||
| `"unknown"` | Status cannot be determined | Yellow |
|
||||
|
||||
> **Note:** Both `"ok"` and `"healthy"` indicate successful operation. The system accepts either value for backward compatibility.
|
||||
|
||||
## Endpoints
|
||||
|
||||
### GET /health
|
||||
|
||||
Returns the overall server health status.
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"status": "ok",
|
||||
"timestamp": "2026-06-23T10:00:00Z",
|
||||
"integrated": true,
|
||||
"sdk_gaps": []
|
||||
}
|
||||
```
|
||||
|
||||
### GET /api/provider
|
||||
|
||||
Returns information about the active AI provider.
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"name": "PraisonAIProvider",
|
||||
"module": "praisonaiui.providers",
|
||||
"status": "ok",
|
||||
"agents": []
|
||||
}
|
||||
```
|
||||
|
||||
### GET /api/provider/health
|
||||
|
||||
Returns detailed JSON health information from the provider gateway. Always
|
||||
responds with `Content-Type: application/json`. The base fields from the
|
||||
provider's `health()` payload are merged with the normalised fields below.
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"status": "ok",
|
||||
"provider": "PraisonAIProvider",
|
||||
"type": "PraisonAIProvider",
|
||||
"agents": 5,
|
||||
"detail": "ok"
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Type | Description |
|
||||
|-------|------|-------------|
|
||||
| `status` | string | One of the health status values above. |
|
||||
| `type` | string | Provider type (from `provider` field, falls back to class name). |
|
||||
| `agents` | integer | Count of agents reported by the provider. |
|
||||
| `detail` | string | Human-readable detail; `"ok"` for healthy providers. |
|
||||
|
||||
> **Note:** Any unmatched `/api/*` path returns a JSON `404` (never the SPA
|
||||
> HTML shell), so API clients can rely on parsing the response body.
|
||||
|
||||
## CLI Commands
|
||||
|
||||
### health-check
|
||||
|
||||
Check server health status:
|
||||
|
||||
```bash
|
||||
aiui health-check --server http://127.0.0.1:8000
|
||||
```
|
||||
|
||||
The command displays:
|
||||
- Green panel for `"ok"` or `"healthy"` status
|
||||
- Yellow panel for other statuses
|
||||
- Red error message if server is unreachable
|
||||
|
||||
### doctor
|
||||
|
||||
Run comprehensive diagnostics:
|
||||
|
||||
```bash
|
||||
aiui doctor --server http://127.0.0.1:8000
|
||||
```
|
||||
|
||||
The doctor command checks:
|
||||
1. Server Health
|
||||
2. Provider Status
|
||||
3. Gateway Status
|
||||
4. Features Loaded
|
||||
5. Config Store
|
||||
6. Datastore
|
||||
7. Channels
|
||||
|
||||
### provider status
|
||||
|
||||
Check provider health:
|
||||
|
||||
```bash
|
||||
aiui provider status --server http://127.0.0.1:8000
|
||||
```
|
||||
|
||||
## Python API
|
||||
|
||||
```python
|
||||
from praisonaiui.health_utils import is_success_status
|
||||
|
||||
# Check if a status indicates success
|
||||
if is_success_status("ok"):
|
||||
print("Service is healthy")
|
||||
|
||||
# Available success statuses
|
||||
from praisonaiui.health_utils import SUCCESS_STATUSES
|
||||
# frozenset({'ok', 'healthy'})
|
||||
```
|
||||
|
||||
## JavaScript/Dashboard
|
||||
|
||||
The dashboard automatically accepts both `"ok"` and `"healthy"` as success statuses:
|
||||
|
||||
```javascript
|
||||
const ok = d && (d.status === 'ok' || d.status === 'healthy');
|
||||
```
|
||||
@@ -0,0 +1,273 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
|
||||
<script id="aiui-canonical-url">(function(){var p=location.pathname.replace(/\/+$/, '')||'/';if(p!==location.pathname){history.replaceState(null,'',p+location.search+location.hash);}})();</script>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="Reference for import praisonaiui as aiui." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:locale" content="en_US" />
|
||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
||||
<title>Python SDK API | PraisonAIUI Docs</title>
|
||||
<script>
|
||||
(function(){try{var t=localStorage.getItem('aiui-theme-preference');var d=true;if(t==='dark'||(t==='system'&&matchMedia('(prefers-color-scheme: dark)').matches)||(!t&&d))document.documentElement.classList.add('dark');else if(t==='light')document.documentElement.classList.remove('dark');}catch(e){}})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="/assets/theme.css">
|
||||
<script type="module" crossorigin src="/assets/index.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index.css">
|
||||
<link rel="canonical" href="https://ui.praison.ai/docs/api/python" />
|
||||
<meta property="og:title" content="Python SDK API | PraisonAIUI Docs" />
|
||||
<meta property="og:description" content="Reference for import praisonaiui as aiui." />
|
||||
<meta property="og:url" content="https://ui.praison.ai/docs/api/python" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:image" content="https://ui.praison.ai/icon.svg" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="Python SDK API | PraisonAIUI Docs" />
|
||||
<meta name="twitter:description" content="Reference for import praisonaiui as aiui." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<script type="application/ld+json">{"@context": "https://schema.org", "@type": "TechArticle", "headline": "Python SDK API", "description": "Reference for import praisonaiui as aiui.", "url": "https://ui.praison.ai/docs/api/python", "isPartOf": {"@type": "WebSite", "name": "PraisonAIUI Docs", "url": "https://ui.praison.ai/"}}</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"><noscript><nav aria-label="Documentation"><ul><li><a href="https://ui.praison.ai/docs/health-endpoints">Health Endpoints Guide</a></li><li><a href="https://ui.praison.ai/docs/index">PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/testing">Testing</a></li><li><a href="https://ui.praison.ai/docs/adr">Adr</a></li><li><a href="https://ui.praison.ai/docs/adr/replay-view-clean-room">ADR 0001: PraisonAI Replay view, a clean-room design</a></li><li><a href="https://ui.praison.ai/docs/api">Api</a></li><li><a href="https://ui.praison.ai/docs/api/cli">CLI API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/components">Component API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/features-api">Features REST API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/health">Health API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/python">Python SDK API</a></li><li><a href="https://ui.praison.ai/docs/api/sessions">Sessions API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/testing">API Testing Guide</a></li><li><a href="https://ui.praison.ai/docs/api/typescript">TypeScript SDK Reference</a></li><li><a href="https://ui.praison.ai/docs/concepts">Concepts</a></li><li><a href="https://ui.praison.ai/docs/concepts/architecture">Architecture: AG-UI Protocol vs Gateway Integration</a></li><li><a href="https://ui.praison.ai/docs/concepts/configuration">YAML Configuration</a></li><li><a href="https://ui.praison.ai/docs/concepts/providers">Providers</a></li><li><a href="https://ui.praison.ai/docs/concepts/slots">Slots & Components</a></li><li><a href="https://ui.praison.ai/docs/concepts/templates">Templates & Layouts</a></li><li><a href="https://ui.praison.ai/docs/examples">Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/advanced">Advanced Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/basic">Basic Examples</a></li><li><a href="https://ui.praison.ai/docs/features">Features</a></li><li><a href="https://ui.praison.ai/docs/features/a2ui-canvas">A2UI canvas — agent-driven UI</a></li><li><a href="https://ui.praison.ai/docs/features/agent-ui-host">Agent UI host — modular dashboard shell</a></li><li><a href="https://ui.praison.ai/docs/features/attachments">Chat Attachments</a></li><li><a href="https://ui.praison.ai/docs/features/backend-integration">Backend Integration Contract</a></li><li><a href="https://ui.praison.ai/docs/features/beautifului-integration">BeautifulUI Integration Strategy</a></li><li><a href="https://ui.praison.ai/docs/features/browser-automation">Browser Automation</a></li><li><a href="https://ui.praison.ai/docs/features/channel-chat-bridge">Channel-to-Chat Bridge</a></li><li><a href="https://ui.praison.ai/docs/features/code-execution">Code Execution</a></li><li><a href="https://ui.praison.ai/docs/features/comparison-openclaw">Feature Comparison: PraisonAIUI vs OpenClaw</a></li><li><a href="https://ui.praison.ai/docs/features/config-hot-reload">Config Hot-Reload</a></li><li><a href="https://ui.praison.ai/docs/features/content-sources">Content Sources</a></li><li><a href="https://ui.praison.ai/docs/features/css-architecture">How the UI Looks Are Built</a></li><li><a href="https://ui.praison.ai/docs/features/dark-mode">Dark Mode</a></li><li><a href="https://ui.praison.ai/docs/features/dashboard">Dashboard</a></li><li><a href="https://ui.praison.ai/docs/features/deployment">Deployment Guide</a></li><li><a href="https://ui.praison.ai/docs/features/device-pairing">Device Pairing</a></li><li><a href="https://ui.praison.ai/docs/features/differentiation">What Makes PraisonAIUI Different</a></li><li><a href="https://ui.praison.ai/docs/features/feature-inventory">Feature Inventory</a></li><li><a href="https://ui.praison.ai/docs/features/gap-analysis">Gap Analysis — Validated Against praisonai SDK</a></li><li><a href="https://ui.praison.ai/docs/features/gateway-chat">Gateway Chat</a></li><li><a href="https://ui.praison.ai/docs/features/hot-reload">Hot Reload</a></li><li><a href="https://ui.praison.ai/docs/features/how-to-add-a-feature">How to Add a Feature to PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/features/i18n">Internationalization (i18n)</a></li><li><a href="https://ui.praison.ai/docs/features/image-preview-chat">Image Preview in Chat</a></li><li><a href="https://ui.praison.ai/docs/features/integration-analysis">AIUI Integration — Critical Review & Architecture Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/knowledge-embeddings">Knowledge Embedding Model Configuration</a></li><li><a href="https://ui.praison.ai/docs/features/marketplace">Plugin Marketplace</a></li><li><a href="https://ui.praison.ai/docs/features/media-analysis">Media Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/message-elements">Message Elements</a></li><li><a href="https://ui.praison.ai/docs/features/model-fallback">Model Fallback</a></li><li><a href=Line truncated
|
||||
<p>Reference for <code>import praisonaiui as aiui</code>.</p>
|
||||
<h2>Server Configuration</h2>
|
||||
<p>These functions configure the server. Call them at module level in your <code>app.py</code>, before the server starts.</p>
|
||||
<h3>`aiui.set_style(style)`</h3>
|
||||
<p>Set the UI style.</p>
|
||||
<p>| Parameter | Type | Values |</p>
|
||||
<p>|-----------|------|--------|</p>
|
||||
<p>| <code>style</code> | <code>str</code> | <code>"chat"</code>, <code>"dashboard"</code>, <code>"agents"</code>, <code>"playground"</code>, <code>"docs"</code>, <code>"custom"</code> |</p>
|
||||
<p>Priority: <code>set_style()</code> → CLI <code>--style</code> flag → auto-detection.</p>
|
||||
<h3>`aiui.set_branding(title, logo)`</h3>
|
||||
<p>Configure the sidebar branding (title text and logo emoji).</p>
|
||||
<p>| Parameter | Type | Default |</p>
|
||||
<p>|-----------|------|---------|</p>
|
||||
<p>| <code>title</code> | <code>str</code> | <code>"PraisonAI"</code> |</p>
|
||||
<p>| <code>logo</code> | <code>str</code> | <code>"🦞"</code> |</p>
|
||||
<p>Also configurable via <code>config.yaml</code>:</p>
|
||||
<p>---</p>
|
||||
<h3>`aiui.set_datastore(store)`</h3>
|
||||
<p>Set the persistence backend for sessions and messages.</p>
|
||||
<p>---</p>
|
||||
<h3>`aiui.set_provider(provider)`</h3>
|
||||
<p>Set the AI provider for chat completions.</p>
|
||||
<p>---</p>
|
||||
<h3>`aiui.register_agent(config)`</h3>
|
||||
<p>Register an AI agent for the dashboard. Agents appear in the sidebar and can be selected for chat.</p>
|
||||
<p>---</p>
|
||||
<h3>`aiui.remove_page(page_id)`</h3>
|
||||
<p>Remove a page from the sidebar.</p>
|
||||
<p>---</p>
|
||||
<h3>`aiui.set_chat_mode(mode, *, position, size, resizable, minimized)`</h3>
|
||||
<p>Configure chat window display mode — full page, floating window, or sidebar panel.</p>
|
||||
<p>| Parameter | Type | Default | Description |</p>
|
||||
<p>|-----------|------|---------|-------------|</p>
|
||||
<p>| <code>mode</code> | <code>str</code> | <code>"fullpage"</code> | <code>"fullpage"</code>, <code>"floating"</code>, or <code>"sidebar"</code> |</p>
|
||||
<p>| <code>position</code> | <code>tuple[int, int]</code> | <code>(20, 20)</code> | (bottom, right) pixel offset for floating mode |</p>
|
||||
<p>| <code>size</code> | <code>tuple[int, int]</code> | <code>(400, 500)</code> | (width, height) initial size for floating mode |</p>
|
||||
<p>| <code>resizable</code> | <code>bool</code> | <code>True</code> | Allow resizing the floating window |</p>
|
||||
<p>| <code>minimized</code> | <code>bool</code> | <code>False</code> | Start minimized (floating mode only) |</p>
|
||||
<p>---</p>
|
||||
<h3>`aiui.set_sidebar_config(*, collapsible, default_collapsed, width, min_width, max_width)`</h3>
|
||||
<p>Configure sidebar behavior and dimensions.</p>
|
||||
<p>| Parameter | Type | Default | Description |</p>
|
||||
<p>|-----------|------|---------|-------------|</p>
|
||||
<p>| <code>collapsible</code> | <code>bool</code> | <code>True</code> | Allow sidebar to be collapsed |</p>
|
||||
<p>| <code>default_collapsed</code> | <code>bool</code> | <code>False</code> | Start with sidebar collapsed |</p>
|
||||
<p>| <code>width</code> | <code>int</code> | <code>260</code> | Default sidebar width in pixels |</p>
|
||||
<p>| <code>min_width</code> | <code>int</code> | <code>200</code> | Minimum width when resizing |</p>
|
||||
<p>| <code>max_width</code> | <code>int</code> | <code>360</code> | Maximum width when resizing |</p>
|
||||
<p>---</p>
|
||||
<h3>`aiui.set_brand_color(color)`</h3>
|
||||
<p>Set the brand/primary accent color. Overrides the theme's default accent.</p>
|
||||
<p>| Parameter | Type | Description |</p>
|
||||
<p>|-----------|------|-------------|</p>
|
||||
<p>| <code>color</code> | <code>str</code> | Hex color (e.g. <code>"#6366f1"</code>) or CSS color value |</p>
|
||||
<p>---</p>
|
||||
<h3>`aiui.set_chat_features(*, history, streaming, file_upload, audio, reasoning, tools, multimedia, feedback)`</h3>
|
||||
<p>Configure which chat features are enabled in the UI.</p>
|
||||
<p>| Parameter | Type | Default | Description |</p>
|
||||
<p>|-----------|------|---------|-------------|</p>
|
||||
<p>| <code>history</code> | <code>bool</code> | <code>True</code> | Show session history sidebar |</p>
|
||||
<p>| <code>streaming</code> | <code>bool</code> | <code>True</code> | Enable streaming responses |</p>
|
||||
<p>| <code>file_upload</code> | <code>bool</code> | <code>False</code> | Show file upload button |</p>
|
||||
<p>| <code>audio</code> | <code>bool</code> | <code>False</code> | Show audio input button |</p>
|
||||
<p>| <code>reasoning</code> | <code>bool</code> | <code>True</code> | Show reasoning/thinking steps |</p>
|
||||
<p>| <code>tools</code> | <code>bool</code> | <code>True</code> | Show tool call displays |</p>
|
||||
<p>| <code>multimedia</code> | <code>bool</code> | <code>True</code> | Enable multimedia rendering |</p>
|
||||
<p>| <code>feedback</code> | <code>bool</code> | <code>False</code> | Show feedback buttons |</p>
|
||||
<p>---</p>
|
||||
<h3>`aiui.set_dashboard(*, sidebar, page_header)`</h3>
|
||||
<p>Configure dashboard layout options.</p>
|
||||
<p>| Parameter | Type | Default | Description |</p>
|
||||
<p>|-----------|------|---------|-------------|</p>
|
||||
<p>| <code>sidebar</code> | <code>bool</code> | <code>True</code> | Show the left sidebar navigation |</p>
|
||||
<p>| <code>page_header</code> | <code>bool</code> | <code>True</code> | Show the page title/description header |</p>
|
||||
<p>---</p>
|
||||
<h3>`aiui.set_chat_preview(enabled, *, surface_id, width)`</h3>
|
||||
<p>Configure the <strong>chat + canvas</strong> split preview (<code>chat-canvas</code> page). The vanilla <code>chat</code> page is unchanged.</p>
|
||||
<p>| Parameter | Type | Default | Description |</p>
|
||||
<p>|-----------|------|---------|-------------|</p>
|
||||
<p>| <code>enabled</code> | <code>bool</code> | <code>True</code> | Expose preview settings in <code>/ui-config.json</code> |</p>
|
||||
<p>| <code>surface_id</code> | <code>str</code> | <code>"main"</code> | Default A2UI surface id for the preview panel |</p>
|
||||
<p>| <code>width</code> | <code>str</code> | <code>"40%"</code> | CSS width of the preview column (e.g. <code>"38%"</code>, <code>"420px"</code>) |</p>
|
||||
<p>See A2UI canvas.</p>
|
||||
<p>---</p>
|
||||
<h3>`aiui.register_theme(name, variables)`</h3>
|
||||
<p>Register a custom theme preset. The theme becomes available in the theme picker UI and via <code>/api/theme</code>.</p>
|
||||
<p>| Parameter | Type | Description |</p>
|
||||
<p>|-----------|------|-------------|</p>
|
||||
<p>| <code>name</code> | <code>str</code> | Unique theme name (e.g. <code>"ocean"</code>, <code>"sunset"</code>) |</p>
|
||||
<p>| <code>variables</code> | <code>dict[str, str]</code> | Dict with at least <code>{"accent": "#hexcolor"}</code> |</p>
|
||||
<p>See CSS Architecture for all available CSS variables.</p>
|
||||
<p>---</p>
|
||||
<h3>`aiui.set_custom_js(path)`</h3>
|
||||
<p>Inject a local JavaScript file into the UI. Reads the file at <code>path</code> and</p>
|
||||
<p>serves it at <code>/custom.js</code>. A <code><script src="/custom.js"></code> tag is injected</p>
|
||||
<p>into the host HTML <strong>after</strong> the plugin loader, so <code>window.aiui</code> and all</p>
|
||||
<p>registry APIs (<code>registerView</code>, <code>registerComponent</code>) are ready when your</p>
|
||||
<p>code runs.</p>
|
||||
<p>| Parameter | Type | Description |</p>
|
||||
<p>|-----------|------|-------------|</p>
|
||||
<p>| <code>path</code> | <code>str \| Path</code> | Local filesystem path to a <code>.js</code> file |</p>
|
||||
<p>Raises <code>FileNotFoundError</code> if the path does not exist.</p>
|
||||
<p>Where <code>plugin.js</code> uses the client-side extension APIs:</p>
|
||||
<p>---</p>
|
||||
<h3>`aiui.register_component_schema(component_type, schema)`</h3>
|
||||
<p>Register a JSON Schema contract for a component dict. Built-in schemas</p>
|
||||
<p>are auto-derived from every <code>aiui.ui.*</code> builder at startup; user schemas</p>
|
||||
<p>take priority and are merged on top.</p>
|
||||
<p>| Parameter | Type | Description |</p>
|
||||
<p>|-----------|------|-------------|</p>
|
||||
<p>| <code>component_type</code> | <code>str</code> | Component type string (e.g. <code>"timeline"</code>) |</p>
|
||||
<p>| <code>schema</code> | <code>dict</code> | JSON Schema dict (Draft 2020-12 compatible) |</p>
|
||||
<h3>`aiui.get_component_schemas()`</h3>
|
||||
<p>Returns the merged registry as a <code>dict[str, dict]</code>. Also available as a</p>
|
||||
<p>JSON endpoint: <code>GET /api/components/schemas</code>.</p>
|
||||
<p>---</p>
|
||||
<h3>`aiui.prompt(question, *, options=None, timeout=300.0)`</h3>
|
||||
<p>Pause the agent and wait for the user to answer. Preferred entry point</p>
|
||||
<p>for interactive agent flows — supersedes the legacy <code>AskUserMessage</code></p>
|
||||
<p>class.</p>
|
||||
<p>| Parameter | Type | Description |</p>
|
||||
<p>|-----------|------|-------------|</p>
|
||||
<p>| <code>question</code> | <code>str</code> | Text shown to the user. |</p>
|
||||
<p>| <code>options</code> | <code>list[str] \| None</code> | Optional list of choices. When given, the user picks one; otherwise they type free text. |</p>
|
||||
<p>| <code>timeout</code> | <code>float</code> | Seconds to wait before giving up. Default 300 (5 min). |</p>
|
||||
<p>Returns a <code>PromptResult</code> dataclass (<code>text</code>, <code>choice</code>, <code>message_id</code>).</p>
|
||||
<p>The result is truthy when the user answered, falsy on timeout.</p>
|
||||
<p>---</p>
|
||||
<h3>`aiui.error(content, *, details=None)`</h3>
|
||||
<p>Emit an error message to the chat. A thin helper around <code>Message</code> with</p>
|
||||
<p><code>metadata={"kind": "error"}</code> — keeps the public surface small.</p>
|
||||
<p>---</p>
|
||||
<h3>`aiui.configure(*, datastore=None, branding=None, theme=None, chat=None, custom_css=None, custom_js=None, style=None)`</h3>
|
||||
<p>One-stop configuration function. Every keyword is optional, so you only</p>
|
||||
<p>set what you need. Replaces the dozen individual <code>set_*</code> setters for</p>
|
||||
<p>most common cases (the <code>set_*</code> functions remain for advanced control).</p>
|
||||
<p>| Parameter | Type | Description |</p>
|
||||
<p>|-----------|------|-------------|</p>
|
||||
<p>| <code>datastore</code> | <code>str</code> | Storage backend: <code>"memory"</code>, <code>"json"</code>, <code>"json:/path"</code>, <code>"sdk"</code>, <code>"sdk:/path"</code>. |</p>
|
||||
<p>| <code>branding</code> | <code>dict</code> | Forwarded to <code>set_branding(...)</code>. Keys: <code>title</code>, <code>logo</code>, <code>subtitle</code>. |</p>
|
||||
<p>| <code>theme</code> | <code>dict</code> | Forwarded to <code>set_theme(...)</code>. Keys: <code>preset</code>, <code>dark</code>/<code>dark_mode</code>, <code>radius</code>, <code>brand_color</code>. |</p>
|
||||
<p>| <code>chat</code> | <code>dict</code> | Forwarded to <code>set_chat_features(...)</code>. Keys: <code>feedback</code>, <code>mode</code>, plus any chat-feature flag. |</p>
|
||||
<p>| <code>custom_css</code>| <code>str \| Path</code> | Path to a CSS file; same as <code>set_custom_css</code>. |</p>
|
||||
<p>| <code>custom_js</code> | <code>str \| Path</code> | Path to a JS file; same as <code>set_custom_js</code>. |</p>
|
||||
<p>| <code>style</code> | <code>str</code> | UI style — <code>"chat"</code>, <code>"dashboard"</code>, etc. |</p>
|
||||
<p>---</p>
|
||||
<h2>Callback Decorators</h2>
|
||||
<h3>`@aiui.reply`</h3>
|
||||
<p>Handle incoming chat messages. This is the core callback.</p>
|
||||
<p>The <code>message</code> object has:</p>
|
||||
<li><code>message.content</code> — user's text</li>
|
||||
<li><code>message.session_id</code> — session identifier</li>
|
||||
<li><code>message.images</code> — attached images (if any)</li>
|
||||
<p>---</p>
|
||||
<h3>`@aiui.welcome`</h3>
|
||||
<p>Send a welcome message when a user connects.</p>
|
||||
<p>---</p>
|
||||
<h3>`@aiui.goodbye`</h3>
|
||||
<p>Cleanup when a user disconnects.</p>
|
||||
<p>---</p>
|
||||
<h3>`@aiui.starters`</h3>
|
||||
<p>Define conversation starters shown to new users.</p>
|
||||
<p>---</p>
|
||||
<h3>`@aiui.profiles`</h3>
|
||||
<p>Define chat profiles (agent personas users can choose).</p>
|
||||
<p>---</p>
|
||||
<h3>`@aiui.page(slug, title, icon, group, order)`</h3>
|
||||
<p>Register a custom dashboard page.</p>
|
||||
<p>---</p>
|
||||
<h3>`@aiui.on(event)`</h3>
|
||||
<p>Listen for server events.</p>
|
||||
<p>---</p>
|
||||
<h3>`@aiui.login`</h3>
|
||||
<p>Handle authentication.</p>
|
||||
<p>---</p>
|
||||
<h3>`@aiui.settings`</h3>
|
||||
<p>Provide user settings.</p>
|
||||
<p>---</p>
|
||||
<h3>`@aiui.resume`</h3>
|
||||
<p>Resume interrupted sessions.</p>
|
||||
<p>---</p>
|
||||
<h3>`@aiui.surface_action(surface_id)`</h3>
|
||||
<p>Handle user actions from an A2UI surface (button clicks, form submits).</p>
|
||||
<p>---</p>
|
||||
<h2>Message Functions</h2>
|
||||
<p>Async functions for sending messages to the user. Call inside callback handlers.</p>
|
||||
<p>| Function | Purpose |</p>
|
||||
<p>|----------|---------|</p>
|
||||
<p>| <code>await aiui.say(text)</code> | Send a complete message |</p>
|
||||
<p>| <code>await aiui.stream(text)</code> | Stream a response progressively |</p>
|
||||
<p>| <code>await aiui.stream_token(token)</code> | Stream token-by-token |</p>
|
||||
<p>| <code>await aiui.think(text)</code> | Show a thinking indicator |</p>
|
||||
<p>| <code>await aiui.ask(question)</code> | Ask user a question (returns answer) |</p>
|
||||
<p>| <code>await aiui.image(url)</code> | Send an image |</p>
|
||||
<p>| <code>await aiui.audio(url)</code> | Send audio |</p>
|
||||
<p>| <code>await aiui.video(url)</code> | Send video |</p>
|
||||
<p>| <code>await aiui.file(url)</code> | Send a file |</p>
|
||||
<p>| <code>await aiui.action_buttons(buttons)</code> | Show action buttons |</p>
|
||||
<p>| <code>await aiui.tool(name, data)</code> | Show tool call result |</p>
|
||||
<p>---</p>
|
||||
<h2>UI Components</h2>
|
||||
<p>Build custom page layouts with UI components.</p>
|
||||
<p>| Component | Usage |</p>
|
||||
<p>|-----------|-------|</p>
|
||||
<p>| <code>aiui.layout(children)</code> | Root container for a page |</p>
|
||||
<p>| <code>aiui.card(title, *, value, footer)</code> | Metric/stat card with title, value, and optional footer |</p>
|
||||
<p>| <code>aiui.columns(children)</code> | Horizontal column layout |</p>
|
||||
<p>| <code>aiui.chart(data, type)</code> | Chart (line, bar, pie) |</p>
|
||||
<p>| <code>aiui.table(headers, rows)</code> | Data table |</p>
|
||||
<p>| <code>aiui.text(content)</code> | Text block |</p>
|
||||
<p>See Component API Reference for all 48 components.</p>
|
||||
<p>---</p>
|
||||
<h2>Data Classes</h2>
|
||||
<p>| Class | Purpose |</p>
|
||||
<p>|-------|---------|</p>
|
||||
<p>| <code>aiui.Message</code> | Incoming/outgoing message |</p>
|
||||
<p>| <code>aiui.AskUserMessage</code> | User response to <code>ask()</code> |</p>
|
||||
<p>| <code>aiui.Step</code> | Processing step indicator |</p>
|
||||
<p>| <code>aiui.BaseDataStore</code> | Abstract datastore interface |</p>
|
||||
<p>| <code>aiui.MemoryDataStore</code> | In-memory store |</p>
|
||||
<p>| <code>aiui.JSONFileDataStore</code> | Persistent JSON file store |</p>
|
||||
<p>| <code>aiui.BaseProvider</code> | Abstract AI provider interface |</p>
|
||||
<p>| <code>aiui.PraisonAIProvider</code> | PraisonAI provider implementation |</p>
|
||||
<p>| <code>aiui.RunEvent</code> | Streaming event |</p>
|
||||
<p>| <code>aiui.RunEventType</code> | Event type enum |</p>
|
||||
<p>---</p>
|
||||
<h2>Feature Protocol</h2>
|
||||
<p>Register custom features that appear in the dashboard.</p>
|
||||
<p>| Function | Purpose |</p>
|
||||
<p>|----------|---------|</p>
|
||||
<p>| <code>aiui.register_feature(feature)</code> | Register a feature |</p>
|
||||
<p>| <code>aiui.get_features()</code> | List all features |</p>
|
||||
<p>| <code>aiui.get_feature(name)</code> | Get a specific feature |</p>
|
||||
<p>| <code>aiui.auto_register_defaults()</code> | Auto-register built-in features |</p></noscript></div>
|
||||
<script src="/plugins/plugin-loader.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,686 @@
|
||||
# Python SDK API
|
||||
|
||||
Reference for `import praisonaiui as aiui`.
|
||||
|
||||
## Server Configuration
|
||||
|
||||
These functions configure the server. Call them at module level in your `app.py`, before the server starts.
|
||||
|
||||
### `aiui.set_style(style)`
|
||||
|
||||
Set the UI style.
|
||||
|
||||
| Parameter | Type | Values |
|
||||
|-----------|------|--------|
|
||||
| `style` | `str` | `"chat"`, `"dashboard"`, `"agents"`, `"playground"`, `"docs"`, `"custom"` |
|
||||
|
||||
```python
|
||||
aiui.set_style("dashboard")
|
||||
```
|
||||
|
||||
Priority: `set_style()` → CLI `--style` flag → auto-detection.
|
||||
|
||||
---
|
||||
|
||||
### `aiui.set_pages(page_ids)`
|
||||
|
||||
Whitelist which built-in sidebar pages to show (dashboard mode). Custom pages registered via `@aiui.page()` always appear.
|
||||
|
||||
```python
|
||||
aiui.set_pages([
|
||||
"chat", "agents", "memory", "knowledge",
|
||||
"skills", "sessions", "usage", "config", "logs",
|
||||
])
|
||||
```
|
||||
|
||||
Use `aiui pages ids` to see all available page IDs.
|
||||
|
||||
---
|
||||
|
||||
### `aiui.set_branding(title, logo)`
|
||||
|
||||
Configure the sidebar branding (title text and logo emoji).
|
||||
|
||||
| Parameter | Type | Default |
|
||||
|-----------|------|---------|
|
||||
| `title` | `str` | `"PraisonAI"` |
|
||||
| `logo` | `str` | `"🦞"` |
|
||||
|
||||
```python
|
||||
aiui.set_branding(title="MyApp", logo="🚀")
|
||||
```
|
||||
|
||||
Also configurable via `config.yaml`:
|
||||
```yaml
|
||||
site:
|
||||
title: MyApp
|
||||
logo: 🚀
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `aiui.set_datastore(store)`
|
||||
|
||||
Set the persistence backend for sessions and messages.
|
||||
|
||||
```python
|
||||
# JSON file store (default)
|
||||
aiui.set_datastore(aiui.JSONFileDataStore())
|
||||
|
||||
# In-memory (no persistence)
|
||||
aiui.set_datastore(aiui.MemoryDataStore())
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `aiui.set_provider(provider)`
|
||||
|
||||
Set the AI provider for chat completions.
|
||||
|
||||
```python
|
||||
aiui.set_provider(aiui.PraisonAIProvider())
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `aiui.register_agent(config)`
|
||||
|
||||
Register an AI agent for the dashboard. Agents appear in the sidebar and can be selected for chat.
|
||||
|
||||
```python
|
||||
aiui.register_agent({
|
||||
"agent_id": "researcher",
|
||||
"name": "Researcher",
|
||||
"description": "Research assistant",
|
||||
"instructions": "You are a research assistant.",
|
||||
"model": "gpt-4o-mini",
|
||||
"icon": "🔬",
|
||||
})
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `aiui.remove_page(page_id)`
|
||||
|
||||
Remove a page from the sidebar.
|
||||
|
||||
```python
|
||||
aiui.remove_page("debug")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `aiui.set_chat_mode(mode, *, position, size, resizable, minimized)`
|
||||
|
||||
Configure chat window display mode — full page, floating window, or sidebar panel.
|
||||
|
||||
| Parameter | Type | Default | Description |
|
||||
|-----------|------|---------|-------------|
|
||||
| `mode` | `str` | `"fullpage"` | `"fullpage"`, `"floating"`, or `"sidebar"` |
|
||||
| `position` | `tuple[int, int]` | `(20, 20)` | (bottom, right) pixel offset for floating mode |
|
||||
| `size` | `tuple[int, int]` | `(400, 500)` | (width, height) initial size for floating mode |
|
||||
| `resizable` | `bool` | `True` | Allow resizing the floating window |
|
||||
| `minimized` | `bool` | `False` | Start minimized (floating mode only) |
|
||||
|
||||
```python
|
||||
import praisonaiui as aiui
|
||||
|
||||
# Full page chat (default)
|
||||
aiui.set_chat_mode("fullpage")
|
||||
|
||||
# Floating chat window
|
||||
aiui.set_chat_mode("floating", position=(20, 20), size=(420, 550))
|
||||
|
||||
# Sidebar panel
|
||||
aiui.set_chat_mode("sidebar")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `aiui.set_sidebar_config(*, collapsible, default_collapsed, width, min_width, max_width)`
|
||||
|
||||
Configure sidebar behavior and dimensions.
|
||||
|
||||
| Parameter | Type | Default | Description |
|
||||
|-----------|------|---------|-------------|
|
||||
| `collapsible` | `bool` | `True` | Allow sidebar to be collapsed |
|
||||
| `default_collapsed` | `bool` | `False` | Start with sidebar collapsed |
|
||||
| `width` | `int` | `260` | Default sidebar width in pixels |
|
||||
| `min_width` | `int` | `200` | Minimum width when resizing |
|
||||
| `max_width` | `int` | `360` | Maximum width when resizing |
|
||||
|
||||
```python
|
||||
import praisonaiui as aiui
|
||||
|
||||
aiui.set_sidebar_config(collapsible=True, width=280)
|
||||
aiui.set_sidebar_config(default_collapsed=True) # Start collapsed
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `aiui.set_brand_color(color)`
|
||||
|
||||
Set the brand/primary accent color. Overrides the theme's default accent.
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|------|-------------|
|
||||
| `color` | `str` | Hex color (e.g. `"#6366f1"`) or CSS color value |
|
||||
|
||||
```python
|
||||
import praisonaiui as aiui
|
||||
|
||||
aiui.set_brand_color("#818cf8") # Indigo-400
|
||||
aiui.set_brand_color("#22c55e") # Green-500
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `aiui.set_chat_features(*, history, streaming, file_upload, audio, reasoning, tools, multimedia, feedback)`
|
||||
|
||||
Configure which chat features are enabled in the UI.
|
||||
|
||||
| Parameter | Type | Default | Description |
|
||||
|-----------|------|---------|-------------|
|
||||
| `history` | `bool` | `True` | Show session history sidebar |
|
||||
| `streaming` | `bool` | `True` | Enable streaming responses |
|
||||
| `file_upload` | `bool` | `False` | Show file upload button |
|
||||
| `audio` | `bool` | `False` | Show audio input button |
|
||||
| `reasoning` | `bool` | `True` | Show reasoning/thinking steps |
|
||||
| `tools` | `bool` | `True` | Show tool call displays |
|
||||
| `multimedia` | `bool` | `True` | Enable multimedia rendering |
|
||||
| `feedback` | `bool` | `False` | Show feedback buttons |
|
||||
|
||||
```python
|
||||
import praisonaiui as aiui
|
||||
|
||||
# Minimal chat — no history sidebar, no file upload
|
||||
aiui.set_chat_features(history=False, file_upload=False)
|
||||
|
||||
# Full-featured chat
|
||||
aiui.set_chat_features(
|
||||
history=True,
|
||||
streaming=True,
|
||||
file_upload=True,
|
||||
audio=True,
|
||||
feedback=True,
|
||||
)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `aiui.set_dashboard(*, sidebar, page_header)`
|
||||
|
||||
Configure dashboard layout options.
|
||||
|
||||
| Parameter | Type | Default | Description |
|
||||
|-----------|------|---------|-------------|
|
||||
| `sidebar` | `bool` | `True` | Show the left sidebar navigation |
|
||||
| `page_header` | `bool` | `True` | Show the page title/description header |
|
||||
|
||||
```python
|
||||
import praisonaiui as aiui
|
||||
|
||||
aiui.set_style("dashboard")
|
||||
aiui.set_dashboard(sidebar=False) # Chat-only dashboard, no sidebar
|
||||
aiui.set_dashboard(page_header=False) # Hide page titles
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `aiui.set_chat_preview(enabled, *, surface_id, width)`
|
||||
|
||||
Configure the **chat + canvas** split preview (`chat-canvas` page). The vanilla `chat` page is unchanged.
|
||||
|
||||
| Parameter | Type | Default | Description |
|
||||
|-----------|------|---------|-------------|
|
||||
| `enabled` | `bool` | `True` | Expose preview settings in `/ui-config.json` |
|
||||
| `surface_id` | `str` | `"main"` | Default A2UI surface id for the preview panel |
|
||||
| `width` | `str` | `"40%"` | CSS width of the preview column (e.g. `"38%"`, `"420px"`) |
|
||||
|
||||
```python
|
||||
aiui.set_chat_preview(enabled=True, surface_id="main", width="38%")
|
||||
aiui.set_pages(["chat-canvas", "chat", "canvas"])
|
||||
```
|
||||
|
||||
See [A2UI canvas](../features/a2ui-canvas.md).
|
||||
|
||||
---
|
||||
|
||||
### `aiui.register_theme(name, variables)`
|
||||
|
||||
Register a custom theme preset. The theme becomes available in the theme picker UI and via `/api/theme`.
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|------|-------------|
|
||||
| `name` | `str` | Unique theme name (e.g. `"ocean"`, `"sunset"`) |
|
||||
| `variables` | `dict[str, str]` | Dict with at least `{"accent": "#hexcolor"}` |
|
||||
|
||||
```python
|
||||
import praisonaiui as aiui
|
||||
|
||||
# Register a custom theme
|
||||
aiui.register_theme("ocean", {"accent": "#0077b6"})
|
||||
|
||||
# With explicit RGB (auto-derived if omitted)
|
||||
aiui.register_theme("sunset", {
|
||||
"accent": "#ff6b35",
|
||||
"accentRgb": "255,107,53",
|
||||
})
|
||||
|
||||
# Apply the custom theme
|
||||
aiui.set_theme(preset="ocean")
|
||||
```
|
||||
|
||||
See [CSS Architecture](../features/css-architecture.md) for all available CSS variables.
|
||||
|
||||
---
|
||||
|
||||
### `aiui.set_custom_js(path)`
|
||||
|
||||
Inject a local JavaScript file into the UI. Reads the file at `path` and
|
||||
serves it at `/custom.js`. A `<script src="/custom.js">` tag is injected
|
||||
into the host HTML **after** the plugin loader, so `window.aiui` and all
|
||||
registry APIs (`registerView`, `registerComponent`) are ready when your
|
||||
code runs.
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|------|-------------|
|
||||
| `path` | `str \| Path` | Local filesystem path to a `.js` file |
|
||||
|
||||
Raises `FileNotFoundError` if the path does not exist.
|
||||
|
||||
```python
|
||||
import praisonaiui as aiui
|
||||
|
||||
aiui.set_custom_js("plugin.js")
|
||||
```
|
||||
|
||||
Where `plugin.js` uses the client-side extension APIs:
|
||||
|
||||
```javascript
|
||||
// plugin.js
|
||||
window.aiui.registerComponent('timeline', function(comp) {
|
||||
const el = document.createElement('div');
|
||||
(comp.events || []).forEach(ev => {
|
||||
const row = document.createElement('div');
|
||||
row.textContent = `${ev.time} — ${ev.label}`;
|
||||
el.appendChild(row);
|
||||
});
|
||||
return el;
|
||||
});
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `aiui.register_component_schema(component_type, schema)`
|
||||
|
||||
Register a JSON Schema contract for a component dict. Built-in schemas
|
||||
are auto-derived from every `aiui.ui.*` builder at startup; user schemas
|
||||
take priority and are merged on top.
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|------|-------------|
|
||||
| `component_type` | `str` | Component type string (e.g. `"timeline"`) |
|
||||
| `schema` | `dict` | JSON Schema dict (Draft 2020-12 compatible) |
|
||||
|
||||
```python
|
||||
import praisonaiui as aiui
|
||||
|
||||
aiui.register_component_schema("timeline", {
|
||||
"type": "object",
|
||||
"required": ["type", "events"],
|
||||
"properties": {
|
||||
"type": {"const": "timeline"},
|
||||
"events": {"type": "array"},
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
### `aiui.get_component_schemas()`
|
||||
|
||||
Returns the merged registry as a `dict[str, dict]`. Also available as a
|
||||
JSON endpoint: `GET /api/components/schemas`.
|
||||
|
||||
```python
|
||||
schemas = aiui.get_component_schemas()
|
||||
print(sorted(schemas)) # ['accordion', 'alert', ..., 'timeline', ...]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `aiui.prompt(question, *, options=None, timeout=300.0)`
|
||||
|
||||
Pause the agent and wait for the user to answer. Preferred entry point
|
||||
for interactive agent flows — supersedes the legacy `AskUserMessage`
|
||||
class.
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|------|-------------|
|
||||
| `question` | `str` | Text shown to the user. |
|
||||
| `options` | `list[str] \| None` | Optional list of choices. When given, the user picks one; otherwise they type free text. |
|
||||
| `timeout` | `float` | Seconds to wait before giving up. Default 300 (5 min). |
|
||||
|
||||
Returns a `PromptResult` dataclass (`text`, `choice`, `message_id`).
|
||||
The result is truthy when the user answered, falsy on timeout.
|
||||
|
||||
```python
|
||||
import praisonaiui as aiui
|
||||
|
||||
@aiui.reply
|
||||
async def on_message(msg: str):
|
||||
name = await aiui.prompt("What's your name?")
|
||||
if name:
|
||||
await aiui.say(f"Hi {name.text}!")
|
||||
|
||||
pick = await aiui.prompt("Pick a colour", options=["red", "blue"])
|
||||
if pick:
|
||||
await aiui.say(f"You picked {pick.choice}")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `aiui.error(content, *, details=None)`
|
||||
|
||||
Emit an error message to the chat. A thin helper around `Message` with
|
||||
`metadata={"kind": "error"}` — keeps the public surface small.
|
||||
|
||||
```python
|
||||
try:
|
||||
data = await fetch()
|
||||
except Exception as exc:
|
||||
await aiui.error("Couldn't load data", details=str(exc))
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `aiui.configure(*, datastore=None, branding=None, theme=None, chat=None, custom_css=None, custom_js=None, style=None)`
|
||||
|
||||
One-stop configuration function. Every keyword is optional, so you only
|
||||
set what you need. Replaces the dozen individual `set_*` setters for
|
||||
most common cases (the `set_*` functions remain for advanced control).
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|------|-------------|
|
||||
| `datastore` | `str` | Storage backend: `"memory"`, `"json"`, `"json:/path"`, `"sdk"`, `"sdk:/path"`. |
|
||||
| `branding` | `dict` | Forwarded to `set_branding(...)`. Keys: `title`, `logo`, `subtitle`. |
|
||||
| `theme` | `dict` | Forwarded to `set_theme(...)`. Keys: `preset`, `dark`/`dark_mode`, `radius`, `brand_color`. |
|
||||
| `chat` | `dict` | Forwarded to `set_chat_features(...)`. Keys: `feedback`, `mode`, plus any chat-feature flag. |
|
||||
| `custom_css`| `str \| Path` | Path to a CSS file; same as `set_custom_css`. |
|
||||
| `custom_js` | `str \| Path` | Path to a JS file; same as `set_custom_js`. |
|
||||
| `style` | `str` | UI style — `"chat"`, `"dashboard"`, etc. |
|
||||
|
||||
```python
|
||||
import praisonaiui as aiui
|
||||
|
||||
aiui.configure(
|
||||
branding={"title": "My App", "logo": "🎨"},
|
||||
theme={"preset": "ocean", "dark": True, "radius": "md"},
|
||||
chat={"feedback": True, "mode": "single"},
|
||||
datastore="json",
|
||||
custom_css="styles.css",
|
||||
custom_js="plugin.js",
|
||||
)
|
||||
```
|
||||
|
||||
```python
|
||||
import praisonaiui as aiui
|
||||
|
||||
# In-memory (default, volatile)
|
||||
aiui.configure(datastore="memory")
|
||||
|
||||
# JSON files at ~/.praisonaiui/sessions/
|
||||
aiui.configure(datastore="json")
|
||||
|
||||
# JSON files at custom path
|
||||
aiui.configure(datastore="json:/tmp/my-sessions")
|
||||
|
||||
# SDK-backed store (unifies with praisonai-agents)
|
||||
aiui.configure(datastore="sdk")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Callback Decorators
|
||||
|
||||
### `@aiui.reply`
|
||||
|
||||
Handle incoming chat messages. This is the core callback.
|
||||
|
||||
```python
|
||||
@aiui.reply
|
||||
async def on_reply(message):
|
||||
await aiui.stream("Thinking...")
|
||||
# Process message.content
|
||||
await aiui.say("Here's the answer!")
|
||||
```
|
||||
|
||||
The `message` object has:
|
||||
- `message.content` — user's text
|
||||
- `message.session_id` — session identifier
|
||||
- `message.images` — attached images (if any)
|
||||
|
||||
---
|
||||
|
||||
### `@aiui.welcome`
|
||||
|
||||
Send a welcome message when a user connects.
|
||||
|
||||
```python
|
||||
@aiui.welcome
|
||||
async def on_welcome():
|
||||
await aiui.say("Welcome! How can I help you today?")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `@aiui.goodbye`
|
||||
|
||||
Cleanup when a user disconnects.
|
||||
|
||||
```python
|
||||
@aiui.goodbye
|
||||
async def on_goodbye():
|
||||
await aiui.say("Goodbye! Your session has been saved.")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `@aiui.starters`
|
||||
|
||||
Define conversation starters shown to new users.
|
||||
|
||||
```python
|
||||
@aiui.starters
|
||||
async def on_starters():
|
||||
return [
|
||||
{"label": "What can you do?", "message": "Tell me about your capabilities"},
|
||||
{"label": "Help me write", "message": "Help me draft an email"},
|
||||
]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `@aiui.profiles`
|
||||
|
||||
Define chat profiles (agent personas users can choose).
|
||||
|
||||
```python
|
||||
@aiui.profiles
|
||||
async def on_profiles():
|
||||
return [
|
||||
{"name": "Expert", "description": "Expert mode", "icon": "🎓"},
|
||||
{"name": "Creative", "description": "Creative writer", "icon": "✍️"},
|
||||
]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `@aiui.page(slug, title, icon, group, order)`
|
||||
|
||||
Register a custom dashboard page.
|
||||
|
||||
```python
|
||||
@aiui.page("analytics", title="Analytics", icon="📊", group="Control", order=60)
|
||||
async def analytics_page():
|
||||
return aiui.layout([
|
||||
aiui.card("Revenue", aiui.chart(data, "line")),
|
||||
aiui.card("Users", aiui.table(headers, rows)),
|
||||
])
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `@aiui.on(event)`
|
||||
|
||||
Listen for server events.
|
||||
|
||||
```python
|
||||
@aiui.on("session_created")
|
||||
async def on_session(session):
|
||||
print(f"New session: {session.id}")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `@aiui.login`
|
||||
|
||||
Handle authentication.
|
||||
|
||||
```python
|
||||
@aiui.login
|
||||
async def on_login(credentials):
|
||||
return {"user_id": "123", "name": "Admin"}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `@aiui.settings`
|
||||
|
||||
Provide user settings.
|
||||
|
||||
```python
|
||||
@aiui.settings
|
||||
async def on_settings():
|
||||
return {"theme": "dark", "language": "en"}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `@aiui.resume`
|
||||
|
||||
Resume interrupted sessions.
|
||||
|
||||
```python
|
||||
@aiui.resume
|
||||
async def on_resume(session_id):
|
||||
await aiui.say("Welcome back! Resuming your session.")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `@aiui.surface_action(surface_id)`
|
||||
|
||||
Handle user actions from an A2UI surface (button clicks, form submits).
|
||||
|
||||
```python
|
||||
@aiui.surface_action("main")
|
||||
async def on_surface_action(action: dict):
|
||||
# action includes component_id, action name, data, session_id
|
||||
return {"status": "ok"}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Message Functions
|
||||
|
||||
Async functions for sending messages to the user. Call inside callback handlers.
|
||||
|
||||
| Function | Purpose |
|
||||
|----------|---------|
|
||||
| `await aiui.say(text)` | Send a complete message |
|
||||
| `await aiui.stream(text)` | Stream a response progressively |
|
||||
| `await aiui.stream_token(token)` | Stream token-by-token |
|
||||
| `await aiui.think(text)` | Show a thinking indicator |
|
||||
| `await aiui.ask(question)` | Ask user a question (returns answer) |
|
||||
| `await aiui.image(url)` | Send an image |
|
||||
| `await aiui.audio(url)` | Send audio |
|
||||
| `await aiui.video(url)` | Send video |
|
||||
| `await aiui.file(url)` | Send a file |
|
||||
| `await aiui.action_buttons(buttons)` | Show action buttons |
|
||||
| `await aiui.tool(name, data)` | Show tool call result |
|
||||
|
||||
---
|
||||
|
||||
## UI Components
|
||||
|
||||
Build custom page layouts with UI components.
|
||||
|
||||
```python
|
||||
@aiui.page("dashboard", title="My Dashboard", icon="📊")
|
||||
async def my_dashboard():
|
||||
return aiui.layout([
|
||||
aiui.columns([
|
||||
aiui.card("Metric A", value="42"),
|
||||
aiui.card("Metric B", value="98%", footer="+5% this week"),
|
||||
]),
|
||||
aiui.card("Data", aiui.table(
|
||||
headers=["Name", "Value"],
|
||||
rows=[["Alpha", "100"], ["Beta", "200"]],
|
||||
)),
|
||||
aiui.card("Trend", aiui.chart(
|
||||
data=[10, 20, 30, 40],
|
||||
type="line",
|
||||
)),
|
||||
])
|
||||
```
|
||||
|
||||
| Component | Usage |
|
||||
|-----------|-------|
|
||||
| `aiui.layout(children)` | Root container for a page |
|
||||
| `aiui.card(title, *, value, footer)` | Metric/stat card with title, value, and optional footer |
|
||||
| `aiui.columns(children)` | Horizontal column layout |
|
||||
| `aiui.chart(data, type)` | Chart (line, bar, pie) |
|
||||
| `aiui.table(headers, rows)` | Data table |
|
||||
| `aiui.text(content)` | Text block |
|
||||
|
||||
See [Component API Reference](components.md) for all 48 components.
|
||||
|
||||
---
|
||||
|
||||
## Data Classes
|
||||
|
||||
| Class | Purpose |
|
||||
|-------|---------|
|
||||
| `aiui.Message` | Incoming/outgoing message |
|
||||
| `aiui.AskUserMessage` | User response to `ask()` |
|
||||
| `aiui.Step` | Processing step indicator |
|
||||
| `aiui.BaseDataStore` | Abstract datastore interface |
|
||||
| `aiui.MemoryDataStore` | In-memory store |
|
||||
| `aiui.JSONFileDataStore` | Persistent JSON file store |
|
||||
| `aiui.BaseProvider` | Abstract AI provider interface |
|
||||
| `aiui.PraisonAIProvider` | PraisonAI provider implementation |
|
||||
| `aiui.RunEvent` | Streaming event |
|
||||
| `aiui.RunEventType` | Event type enum |
|
||||
|
||||
---
|
||||
|
||||
## Feature Protocol
|
||||
|
||||
Register custom features that appear in the dashboard.
|
||||
|
||||
```python
|
||||
from praisonaiui import BaseFeatureProtocol, register_feature
|
||||
|
||||
class MyFeature(BaseFeatureProtocol):
|
||||
name = "my_feature"
|
||||
# ... implement protocol methods
|
||||
|
||||
register_feature(MyFeature())
|
||||
```
|
||||
|
||||
| Function | Purpose |
|
||||
|----------|---------|
|
||||
| `aiui.register_feature(feature)` | Register a feature |
|
||||
| `aiui.get_features()` | List all features |
|
||||
| `aiui.get_feature(name)` | Get a specific feature |
|
||||
| `aiui.auto_register_defaults()` | Auto-register built-in features |
|
||||
@@ -0,0 +1,74 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
|
||||
<script id="aiui-canonical-url">(function(){var p=location.pathname.replace(/\/+$/, '')||'/';if(p!==location.pathname){history.replaceState(null,'',p+location.search+location.hash);}})();</script>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="Create a new session." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:locale" content="en_US" />
|
||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
||||
<title>Sessions API Reference | PraisonAIUI Docs</title>
|
||||
<script>
|
||||
(function(){try{var t=localStorage.getItem('aiui-theme-preference');var d=true;if(t==='dark'||(t==='system'&&matchMedia('(prefers-color-scheme: dark)').matches)||(!t&&d))document.documentElement.classList.add('dark');else if(t==='light')document.documentElement.classList.remove('dark');}catch(e){}})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="/assets/theme.css">
|
||||
<script type="module" crossorigin src="/assets/index.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index.css">
|
||||
<link rel="canonical" href="https://ui.praison.ai/docs/api/sessions" />
|
||||
<meta property="og:title" content="Sessions API Reference | PraisonAIUI Docs" />
|
||||
<meta property="og:description" content="Create a new session." />
|
||||
<meta property="og:url" content="https://ui.praison.ai/docs/api/sessions" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:image" content="https://ui.praison.ai/icon.svg" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="Sessions API Reference | PraisonAIUI Docs" />
|
||||
<meta name="twitter:description" content="Create a new session." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<script type="application/ld+json">{"@context": "https://schema.org", "@type": "TechArticle", "headline": "Sessions API Reference", "description": "Create a new session.", "url": "https://ui.praison.ai/docs/api/sessions", "isPartOf": {"@type": "WebSite", "name": "PraisonAIUI Docs", "url": "https://ui.praison.ai/"}}</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"><noscript><nav aria-label="Documentation"><ul><li><a href="https://ui.praison.ai/docs/health-endpoints">Health Endpoints Guide</a></li><li><a href="https://ui.praison.ai/docs/index">PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/testing">Testing</a></li><li><a href="https://ui.praison.ai/docs/adr">Adr</a></li><li><a href="https://ui.praison.ai/docs/adr/replay-view-clean-room">ADR 0001: PraisonAI Replay view, a clean-room design</a></li><li><a href="https://ui.praison.ai/docs/api">Api</a></li><li><a href="https://ui.praison.ai/docs/api/cli">CLI API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/components">Component API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/features-api">Features REST API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/health">Health API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/python">Python SDK API</a></li><li><a href="https://ui.praison.ai/docs/api/sessions">Sessions API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/testing">API Testing Guide</a></li><li><a href="https://ui.praison.ai/docs/api/typescript">TypeScript SDK Reference</a></li><li><a href="https://ui.praison.ai/docs/concepts">Concepts</a></li><li><a href="https://ui.praison.ai/docs/concepts/architecture">Architecture: AG-UI Protocol vs Gateway Integration</a></li><li><a href="https://ui.praison.ai/docs/concepts/configuration">YAML Configuration</a></li><li><a href="https://ui.praison.ai/docs/concepts/providers">Providers</a></li><li><a href="https://ui.praison.ai/docs/concepts/slots">Slots & Components</a></li><li><a href="https://ui.praison.ai/docs/concepts/templates">Templates & Layouts</a></li><li><a href="https://ui.praison.ai/docs/examples">Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/advanced">Advanced Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/basic">Basic Examples</a></li><li><a href="https://ui.praison.ai/docs/features">Features</a></li><li><a href="https://ui.praison.ai/docs/features/a2ui-canvas">A2UI canvas — agent-driven UI</a></li><li><a href="https://ui.praison.ai/docs/features/agent-ui-host">Agent UI host — modular dashboard shell</a></li><li><a href="https://ui.praison.ai/docs/features/attachments">Chat Attachments</a></li><li><a href="https://ui.praison.ai/docs/features/backend-integration">Backend Integration Contract</a></li><li><a href="https://ui.praison.ai/docs/features/beautifului-integration">BeautifulUI Integration Strategy</a></li><li><a href="https://ui.praison.ai/docs/features/browser-automation">Browser Automation</a></li><li><a href="https://ui.praison.ai/docs/features/channel-chat-bridge">Channel-to-Chat Bridge</a></li><li><a href="https://ui.praison.ai/docs/features/code-execution">Code Execution</a></li><li><a href="https://ui.praison.ai/docs/features/comparison-openclaw">Feature Comparison: PraisonAIUI vs OpenClaw</a></li><li><a href="https://ui.praison.ai/docs/features/config-hot-reload">Config Hot-Reload</a></li><li><a href="https://ui.praison.ai/docs/features/content-sources">Content Sources</a></li><li><a href="https://ui.praison.ai/docs/features/css-architecture">How the UI Looks Are Built</a></li><li><a href="https://ui.praison.ai/docs/features/dark-mode">Dark Mode</a></li><li><a href="https://ui.praison.ai/docs/features/dashboard">Dashboard</a></li><li><a href="https://ui.praison.ai/docs/features/deployment">Deployment Guide</a></li><li><a href="https://ui.praison.ai/docs/features/device-pairing">Device Pairing</a></li><li><a href="https://ui.praison.ai/docs/features/differentiation">What Makes PraisonAIUI Different</a></li><li><a href="https://ui.praison.ai/docs/features/feature-inventory">Feature Inventory</a></li><li><a href="https://ui.praison.ai/docs/features/gap-analysis">Gap Analysis — Validated Against praisonai SDK</a></li><li><a href="https://ui.praison.ai/docs/features/gateway-chat">Gateway Chat</a></li><li><a href="https://ui.praison.ai/docs/features/hot-reload">Hot Reload</a></li><li><a href="https://ui.praison.ai/docs/features/how-to-add-a-feature">How to Add a Feature to PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/features/i18n">Internationalization (i18n)</a></li><li><a href="https://ui.praison.ai/docs/features/image-preview-chat">Image Preview in Chat</a></li><li><a href="https://ui.praison.ai/docs/features/integration-analysis">AIUI Integration — Critical Review & Architecture Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/knowledge-embeddings">Knowledge Embedding Model Configuration</a></li><li><a href="https://ui.praison.ai/docs/features/marketplace">Plugin Marketplace</a></li><li><a href="https://ui.praison.ai/docs/features/media-analysis">Media Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/message-elements">Message Elements</a></li><li><a href="https://ui.praison.ai/docs/features/model-fallback">Model Fallback</a></li><li><a href=Line truncated
|
||||
<h2>Endpoints</h2>
|
||||
<h3>`GET /sessions`</h3>
|
||||
<p>List all sessions.</p>
|
||||
<p><strong>Response:</strong></p>
|
||||
<h3>`GET /sessions/{session_id}`</h3>
|
||||
<p>Get full session data including messages.</p>
|
||||
<p><strong>Response:</strong></p>
|
||||
<p>---</p>
|
||||
<h3>`GET /sessions/{session_id}/runs`</h3>
|
||||
<p>Get message history for a session.</p>
|
||||
<p><strong>Response:</strong></p>
|
||||
<p>---</p>
|
||||
<h3>`DELETE /sessions/{session_id}`</h3>
|
||||
<p>Delete a session.</p>
|
||||
<p><strong>Response:</strong></p>
|
||||
<p>---</p>
|
||||
<h3>`POST /run`</h3>
|
||||
<p>Send a message and receive streaming response via SSE.</p>
|
||||
<p><strong>Request:</strong></p>
|
||||
<p>If <code>session_id</code> is omitted or <code>null</code>, a new session is created automatically.</p>
|
||||
<p><strong>Response:</strong> Server-Sent Events stream:</p>
|
||||
<p>---</p>
|
||||
<h3>`POST /cancel`</h3>
|
||||
<p>Cancel an active run.</p>
|
||||
<p><strong>Request:</strong></p>
|
||||
<p>---</p>
|
||||
<h3>`GET /health`</h3>
|
||||
<p>Server health check.</p>
|
||||
<p><strong>Response:</strong></p>
|
||||
<p>---</p>
|
||||
<h3>`GET /agents`</h3>
|
||||
<p>List registered agents.</p>
|
||||
<p><strong>Response:</strong></p>
|
||||
<h2>Error Responses</h2>
|
||||
<p>All endpoints return <code>404</code> when a session is not found:</p></noscript></div>
|
||||
<script src="/plugins/plugin-loader.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,149 @@
|
||||
# Sessions API Reference
|
||||
|
||||
## Endpoints
|
||||
|
||||
### `GET /sessions`
|
||||
List all sessions.
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"sessions": [
|
||||
{
|
||||
"id": "abc-123",
|
||||
"created_at": "2026-03-04T07:00:00+00:00",
|
||||
"updated_at": "2026-03-04T07:05:00+00:00",
|
||||
"message_count": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `POST /sessions`
|
||||
Create a new session.
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"session_id": "abc-123-new"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `GET /sessions/{session_id}`
|
||||
Get full session data including messages.
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "abc-123",
|
||||
"created_at": "2026-03-04T07:00:00+00:00",
|
||||
"updated_at": "2026-03-04T07:05:00+00:00",
|
||||
"messages": [
|
||||
{"role": "user", "content": "Hello", "timestamp": "..."},
|
||||
{"role": "assistant", "content": "Hi there!", "timestamp": "..."}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `GET /sessions/{session_id}/runs`
|
||||
Get message history for a session.
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"runs": [
|
||||
{"role": "user", "content": "Hello", "timestamp": "..."},
|
||||
{"role": "assistant", "content": "Hi there!", "timestamp": "..."}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `DELETE /sessions/{session_id}`
|
||||
Delete a session.
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"status": "deleted"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `POST /run`
|
||||
Send a message and receive streaming response via SSE.
|
||||
|
||||
**Request:**
|
||||
```json
|
||||
{
|
||||
"message": "Hello, how are you?",
|
||||
"session_id": "abc-123",
|
||||
"agent": "assistant"
|
||||
}
|
||||
```
|
||||
|
||||
If `session_id` is omitted or `null`, a new session is created automatically.
|
||||
|
||||
**Response:** Server-Sent Events stream:
|
||||
```
|
||||
data: {"type": "session", "session_id": "abc-123"}
|
||||
data: {"type": "token", "token": "Hello"}
|
||||
data: {"type": "token", "token": " there!"}
|
||||
data: {"type": "end"}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `POST /cancel`
|
||||
Cancel an active run.
|
||||
|
||||
**Request:**
|
||||
```json
|
||||
{
|
||||
"session_id": "abc-123"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `GET /health`
|
||||
Server health check.
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"status": "ok",
|
||||
"timestamp": "2026-03-04T07:00:00"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `GET /agents`
|
||||
List registered agents.
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"agents": [
|
||||
{"name": "assistant", "created_at": "..."}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Error Responses
|
||||
|
||||
All endpoints return `404` when a session is not found:
|
||||
```json
|
||||
{
|
||||
"error": "Session not found"
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,99 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
|
||||
<script id="aiui-canonical-url">(function(){var p=location.pathname.replace(/\/+$/, '')||'/';if(p!==location.pathname){history.replaceState(null,'',p+location.search+location.hash);}})();</script>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="Test all 16 PraisonAIUI feature APIs using curl. Each example creates real data and verifies backend processing." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:locale" content="en_US" />
|
||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
||||
<title>API Testing Guide | PraisonAIUI Docs</title>
|
||||
<script>
|
||||
(function(){try{var t=localStorage.getItem('aiui-theme-preference');var d=true;if(t==='dark'||(t==='system'&&matchMedia('(prefers-color-scheme: dark)').matches)||(!t&&d))document.documentElement.classList.add('dark');else if(t==='light')document.documentElement.classList.remove('dark');}catch(e){}})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="/assets/theme.css">
|
||||
<script type="module" crossorigin src="/assets/index.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index.css">
|
||||
<link rel="canonical" href="https://ui.praison.ai/docs/api/testing" />
|
||||
<meta property="og:title" content="API Testing Guide | PraisonAIUI Docs" />
|
||||
<meta property="og:description" content="Test all 16 PraisonAIUI feature APIs using curl. Each example creates real data and verifies backend processing." />
|
||||
<meta property="og:url" content="https://ui.praison.ai/docs/api/testing" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:image" content="https://ui.praison.ai/icon.svg" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="API Testing Guide | PraisonAIUI Docs" />
|
||||
<meta name="twitter:description" content="Test all 16 PraisonAIUI feature APIs using curl. Each example creates real data and verifies backend processing." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<script type="application/ld+json">{"@context": "https://schema.org", "@type": "TechArticle", "headline": "API Testing Guide", "description": "Test all 16 PraisonAIUI feature APIs using curl. Each example creates real data and verifies backend processing.", "url": "https://ui.praison.ai/docs/api/testing", "isPartOf": {"@type": "WebSite", "name": "PraisonAIUI Docs", "url": "https://ui.praison.ai/"}}</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"><noscript><nav aria-label="Documentation"><ul><li><a href="https://ui.praison.ai/docs/health-endpoints">Health Endpoints Guide</a></li><li><a href="https://ui.praison.ai/docs/index">PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/testing">Testing</a></li><li><a href="https://ui.praison.ai/docs/adr">Adr</a></li><li><a href="https://ui.praison.ai/docs/adr/replay-view-clean-room">ADR 0001: PraisonAI Replay view, a clean-room design</a></li><li><a href="https://ui.praison.ai/docs/api">Api</a></li><li><a href="https://ui.praison.ai/docs/api/cli">CLI API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/components">Component API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/features-api">Features REST API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/health">Health API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/python">Python SDK API</a></li><li><a href="https://ui.praison.ai/docs/api/sessions">Sessions API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/testing">API Testing Guide</a></li><li><a href="https://ui.praison.ai/docs/api/typescript">TypeScript SDK Reference</a></li><li><a href="https://ui.praison.ai/docs/concepts">Concepts</a></li><li><a href="https://ui.praison.ai/docs/concepts/architecture">Architecture: AG-UI Protocol vs Gateway Integration</a></li><li><a href="https://ui.praison.ai/docs/concepts/configuration">YAML Configuration</a></li><li><a href="https://ui.praison.ai/docs/concepts/providers">Providers</a></li><li><a href="https://ui.praison.ai/docs/concepts/slots">Slots & Components</a></li><li><a href="https://ui.praison.ai/docs/concepts/templates">Templates & Layouts</a></li><li><a href="https://ui.praison.ai/docs/examples">Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/advanced">Advanced Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/basic">Basic Examples</a></li><li><a href="https://ui.praison.ai/docs/features">Features</a></li><li><a href="https://ui.praison.ai/docs/features/a2ui-canvas">A2UI canvas — agent-driven UI</a></li><li><a href="https://ui.praison.ai/docs/features/agent-ui-host">Agent UI host — modular dashboard shell</a></li><li><a href="https://ui.praison.ai/docs/features/attachments">Chat Attachments</a></li><li><a href="https://ui.praison.ai/docs/features/backend-integration">Backend Integration Contract</a></li><li><a href="https://ui.praison.ai/docs/features/beautifului-integration">BeautifulUI Integration Strategy</a></li><li><a href="https://ui.praison.ai/docs/features/browser-automation">Browser Automation</a></li><li><a href="https://ui.praison.ai/docs/features/channel-chat-bridge">Channel-to-Chat Bridge</a></li><li><a href="https://ui.praison.ai/docs/features/code-execution">Code Execution</a></li><li><a href="https://ui.praison.ai/docs/features/comparison-openclaw">Feature Comparison: PraisonAIUI vs OpenClaw</a></li><li><a href="https://ui.praison.ai/docs/features/config-hot-reload">Config Hot-Reload</a></li><li><a href="https://ui.praison.ai/docs/features/content-sources">Content Sources</a></li><li><a href="https://ui.praison.ai/docs/features/css-architecture">How the UI Looks Are Built</a></li><li><a href="https://ui.praison.ai/docs/features/dark-mode">Dark Mode</a></li><li><a href="https://ui.praison.ai/docs/features/dashboard">Dashboard</a></li><li><a href="https://ui.praison.ai/docs/features/deployment">Deployment Guide</a></li><li><a href="https://ui.praison.ai/docs/features/device-pairing">Device Pairing</a></li><li><a href="https://ui.praison.ai/docs/features/differentiation">What Makes PraisonAIUI Different</a></li><li><a href="https://ui.praison.ai/docs/features/feature-inventory">Feature Inventory</a></li><li><a href="https://ui.praison.ai/docs/features/gap-analysis">Gap Analysis — Validated Against praisonai SDK</a></li><li><a href="https://ui.praison.ai/docs/features/gateway-chat">Gateway Chat</a></li><li><a href="https://ui.praison.ai/docs/features/hot-reload">Hot Reload</a></li><li><a href="https://ui.praison.ai/docs/features/how-to-add-a-feature">How to Add a Feature to PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/features/i18n">Internationalization (i18n)</a></li><li><a href="https://ui.praison.ai/docs/features/image-preview-chat">Image Preview in Chat</a></li><li><a href="https://ui.praison.ai/docs/features/integration-analysis">AIUI Integration — Critical Review & Architecture Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/knowledge-embeddings">Knowledge Embedding Model Configuration</a></li><li><a href="https://ui.praison.ai/docs/features/marketplace">Plugin Marketplace</a></li><li><a href="https://ui.praison.ai/docs/features/media-analysis">Media Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/message-elements">Message Elements</a></li><li><a href="https://ui.praison.ai/docs/features/model-fallback">Model Fallback</a></li><li><a href=Line truncated
|
||||
<p>Test all 16 PraisonAIUI feature APIs using curl. Each example creates real data and verifies backend processing.</p>
|
||||
<h2>Quick Start</h2>
|
||||
<h2>CLI Integration Tests (`aiui test`)</h2>
|
||||
<p>PraisonAIUI includes built-in integration tests via</p>
|
||||
<p><code>aiui test</code>. These run against a live server and verify chat, memory, sessions,</p>
|
||||
<p>and API endpoint health.</p>
|
||||
<h3>Quick Start</h3>
|
||||
<h3>Available Subcommands</h3>
|
||||
<p>| Command | What It Tests |</p>
|
||||
<p>|---------|---------------|</p>
|
||||
<p>| <code>aiui test endpoints</code> | API endpoint availability (/health, /api/features, /api/sessions, /api/chat) |</p>
|
||||
<p>| <code>aiui test chat</code> | Message sending, session history isolation, context recall |</p>
|
||||
<p>| <code>aiui test memory</code> | Cross-session persistent memory (store + recall facts) |</p>
|
||||
<p>| <code>aiui test sessions</code> | Session file persistence (survives server restarts) |</p>
|
||||
<p>| <code>aiui test all</code> | Runs all of the above in sequence |</p>
|
||||
<h3>Options</h3>
|
||||
<li><code>--server</code> / <code>-s</code> — Server URL (default: <code>http://127.0.0.1:8082</code>)</li>
|
||||
<li><code>--timeout</code> / <code>-t</code> — Response timeout in seconds (default: <code>30</code>)</li>
|
||||
<h3>Example Output</h3>
|
||||
<h3>Test Details</h3>
|
||||
<p><strong>Endpoints</strong> (6 checks, 2 optional skips):</p>
|
||||
<li><code>GET /api/features</code> — Feature registry health</li>
|
||||
<li><code>GET /api/sessions</code> — Session listing</li>
|
||||
<li><code>GET /api/chat/history</code> — Empty session history</li>
|
||||
<li><code>POST /api/chat/send</code> — Chat message dispatch</li>
|
||||
<li><code>GET /api/provider/health</code> — _(optional, skipped if no provider)_</li>
|
||||
<li><code>GET /api/provider/agents</code> — _(optional, skipped if no provider)_</li>
|
||||
<li><code>GET /health</code> — Server health check</li>
|
||||
<p><strong>Chat</strong> (8 checks):</p>
|
||||
<li>Sends a message to Session A, verifies response in history</li>
|
||||
<li>Creates Session B, verifies history isolation (no cross-session leakage)</li>
|
||||
<li>Verifies Session A retains context from earlier messages</li>
|
||||
<p><strong>Memory</strong> (2 checks):</p>
|
||||
<li>Sends a fact to Session 1 ("remember my name")</li>
|
||||
<li>Asks a recall question in Session 2, verifies cross-session memory</li>
|
||||
<p><strong>Sessions</strong> (4 checks):</p>
|
||||
<li>Sends a message and verifies session file is created on disk</li>
|
||||
<li>Verifies history API returns persisted messages</li>
|
||||
<p>---</p>
|
||||
<h2>Running the Full API Test Suite</h2>
|
||||
<p>Use the example at <code>examples/python/14-all-features/app.py</code> which tests all 16 features programmatically:</p>
|
||||
<h2>Expected Results</h2>
|
||||
<p>| Feature | Endpoints | Expected |</p>
|
||||
<p>|---------|-----------|----------|</p>
|
||||
<p>| Channels | 4 | All 200/201 |</p>
|
||||
<p>| Agents | 3+ | 201 create, 200 list, 501 run (no praisonaiagents) |</p>
|
||||
<p>| Approvals | 6 | Auto-approve low-risk, manual approve high-risk |</p>
|
||||
<p>| Jobs | 3 | 202 submit, 200 list/stats |</p>
|
||||
<p>| Schedules | 2 | 201 create, 200 list |</p>
|
||||
<p>| Usage | 4+ | 201 track, 200 summary with by_model breakdown |</p>
|
||||
<p>| Skills | 2 | 18 skills, 7 categories |</p>
|
||||
<p>| Config | 5 | Schema, defaults, validate, runtime set/get |</p>
|
||||
<p>| Auth | 4 | API key generation, multi-mode auth |</p>
|
||||
<p>| OpenAI API | 2 | 11 endpoints, 13 models |</p>
|
||||
<p>| Logs | 2 | 5 log levels |</p>
|
||||
<p>| Sessions | 3 | State save/get/preview |</p>
|
||||
<p>| Memory | 6 | List, add, search, context, session-scoped, status |</p>
|
||||
<p>| Hooks | 1 | 200 (empty until registered) |</p>
|
||||
<p>| Workflows | 1 | 200 (empty until created) |</p>
|
||||
<p>| Features | 1 | 16 features registered |</p></noscript></div>
|
||||
<script src="/plugins/plugin-loader.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,410 @@
|
||||
# API Testing Guide
|
||||
|
||||
Test all 16 PraisonAIUI feature APIs using curl. Each example creates real data and verifies backend processing.
|
||||
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
# Start the server
|
||||
cd /path/to/PraisonAIUI
|
||||
PYTHONPATH=src python3 -c "
|
||||
import uvicorn
|
||||
from praisonaiui.server import create_app
|
||||
app = create_app()
|
||||
uvicorn.run(app, host='0.0.0.0', port=8082)
|
||||
"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 1. Channels
|
||||
|
||||
```bash
|
||||
# Create a channel
|
||||
curl -X POST http://localhost:8082/api/channels \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"name":"Discord #general","platform":"discord","config":{"guild":"123"}}'
|
||||
# → 201 Created, returns {"id":"...","name":"Discord #general",...}
|
||||
|
||||
# List channels
|
||||
curl http://localhost:8082/api/channels
|
||||
# → 200 OK, returns {"channels":[...],"count":1}
|
||||
|
||||
# Get single channel
|
||||
curl http://localhost:8082/api/channels/{id}
|
||||
|
||||
# Update channel
|
||||
curl -X PUT http://localhost:8082/api/channels/{id} \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"enabled":false}'
|
||||
```
|
||||
|
||||
## 2. Agents
|
||||
|
||||
```bash
|
||||
# Define an agent
|
||||
curl -X POST http://localhost:8082/api/agents/definitions \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"name":"Research Agent","instructions":"You research topics","model":"gpt-4o-mini"}'
|
||||
# → 201 Created
|
||||
|
||||
# List agents
|
||||
curl http://localhost:8082/api/agents/definitions
|
||||
|
||||
# List available models
|
||||
curl http://localhost:8082/api/agents/models
|
||||
# → 200 OK, returns {"models":[...]} with 13 models (GPT, Claude, Gemini, O1/O3)
|
||||
|
||||
# Run an agent (requires praisonaiagents installed)
|
||||
curl -X POST http://localhost:8082/api/agents/run/{agent_id} \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"prompt":"Say hello in 3 words"}'
|
||||
```
|
||||
|
||||
## 3. Approvals
|
||||
|
||||
```bash
|
||||
# Create a high-risk approval request
|
||||
curl -X POST http://localhost:8082/api/approvals \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"tool_name":"execute_command","arguments":{"cmd":"ls"},"risk_level":"high","agent_name":"SysAgent"}'
|
||||
# → 201 Created, status: "pending"
|
||||
|
||||
# Create a low-risk request (auto-approved)
|
||||
curl -X POST http://localhost:8082/api/approvals \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"tool_name":"web_search","arguments":{"q":"AI"},"risk_level":"low","agent_name":"SearchBot"}'
|
||||
# → 201 Created, status: "approved" (auto)
|
||||
|
||||
# Check pending approvals
|
||||
curl http://localhost:8082/api/approvals/pending
|
||||
|
||||
# Approve a request
|
||||
curl -X POST http://localhost:8082/api/approvals/{id}/approve \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"reason":"Reviewed safe"}'
|
||||
|
||||
# View approval policies and history
|
||||
curl http://localhost:8082/api/approvals/policies
|
||||
curl http://localhost:8082/api/approvals/history
|
||||
```
|
||||
|
||||
## 4. Jobs
|
||||
|
||||
```bash
|
||||
# Submit a job
|
||||
curl -X POST http://localhost:8082/api/jobs \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"prompt":"Analyze AI trends","config":{"model":"gpt-4o-mini"}}'
|
||||
# → 202 Accepted, returns {"job_id":"run_...","status":"running"}
|
||||
|
||||
# List jobs
|
||||
curl http://localhost:8082/api/jobs
|
||||
|
||||
# Get job statistics
|
||||
curl http://localhost:8082/api/jobs/stats
|
||||
# → {"total_jobs":1,"status_counts":{"running":1}}
|
||||
```
|
||||
|
||||
## 5. Schedules
|
||||
|
||||
```bash
|
||||
# Create a schedule
|
||||
curl -X POST http://localhost:8082/api/schedules \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"name":"Daily Report","schedule":{"kind":"every","every_seconds":86400},"message":"Generate report"}'
|
||||
# → 201 Created
|
||||
|
||||
# List schedules
|
||||
curl http://localhost:8082/api/schedules
|
||||
```
|
||||
|
||||
## 6. Usage
|
||||
|
||||
```bash
|
||||
# Track usage
|
||||
curl -X POST http://localhost:8082/api/usage/track \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"model":"gpt-4o-mini","input_tokens":500,"output_tokens":200}'
|
||||
# → 201 Created
|
||||
|
||||
# Get summary (includes by_model breakdown)
|
||||
curl http://localhost:8082/api/usage
|
||||
# → {"total_requests":1,"usage":{"by_model":{"gpt-4o-mini":{...}}},...}
|
||||
|
||||
# Cost table
|
||||
curl http://localhost:8082/api/usage/costs
|
||||
# → {"cost_table":{...},"currency":"USD","unit":"per 1K tokens"}
|
||||
|
||||
# Additional endpoints
|
||||
curl http://localhost:8082/api/usage/models # Per-model breakdown
|
||||
curl http://localhost:8082/api/usage/sessions # Per-session breakdown
|
||||
curl http://localhost:8082/api/usage/timeseries # Time-series chart data
|
||||
```
|
||||
|
||||
## 7. Skills
|
||||
|
||||
```bash
|
||||
# List all skills
|
||||
curl http://localhost:8082/api/skills
|
||||
# → {"skills":[...],"count":18}
|
||||
|
||||
# List by category
|
||||
curl http://localhost:8082/api/skills/categories
|
||||
# → {"categories":[{"name":"code","count":3},{"name":"search","count":4},...]}
|
||||
```
|
||||
|
||||
## 8. Config
|
||||
|
||||
```bash
|
||||
# Get schema
|
||||
curl http://localhost:8082/api/config/schema
|
||||
|
||||
# Get defaults
|
||||
curl http://localhost:8082/api/config/defaults
|
||||
# → {"defaults":{"provider":{"name":"openai"},"model":{"name":"gpt-4o-mini"},...}}
|
||||
|
||||
# Validate config
|
||||
curl -X POST http://localhost:8082/api/config/validate \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"provider":"openai","model":"gpt-4o"}'
|
||||
# → {"valid":true,...}
|
||||
|
||||
# Set runtime config
|
||||
curl -X PATCH http://localhost:8082/api/config/runtime \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"model":"gpt-4o-mini","temperature":"0.9"}'
|
||||
|
||||
# Get runtime config
|
||||
curl http://localhost:8082/api/config/runtime
|
||||
|
||||
# All config changes are persisted to ~/.praisonaiui/config.yaml
|
||||
# and survive server restarts. See: concepts/configuration.md
|
||||
```
|
||||
|
||||
## 9. Auth
|
||||
|
||||
```bash
|
||||
# Check auth status
|
||||
curl http://localhost:8082/api/auth/status
|
||||
# → {"mode":"none","authenticated":true,...}
|
||||
|
||||
# Get auth config
|
||||
curl http://localhost:8082/api/auth/config
|
||||
|
||||
# Create API key
|
||||
curl -X POST http://localhost:8082/api/auth/keys \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"name":"CI/CD Pipeline","expires_days":90}'
|
||||
# → {"key":"pk_...","name":"CI/CD Pipeline",...}
|
||||
|
||||
# List API keys
|
||||
curl http://localhost:8082/api/auth/keys
|
||||
```
|
||||
|
||||
## 10. OpenAI-Compatible API
|
||||
|
||||
```bash
|
||||
# API info
|
||||
curl http://localhost:8082/v1
|
||||
# → {"endpoints":[...],"version":"..."}
|
||||
|
||||
# List models
|
||||
curl http://localhost:8082/v1/models
|
||||
# → {"data":[{"id":"gpt-4o","object":"model",...},...],"object":"list"}
|
||||
```
|
||||
|
||||
## 11. Logs
|
||||
|
||||
```bash
|
||||
# Get log levels
|
||||
curl http://localhost:8082/api/logs/levels
|
||||
# → {"levels":[{"name":"DEBUG"},{"name":"INFO"},...]}
|
||||
|
||||
# Get log stats
|
||||
curl http://localhost:8082/api/logs/stats
|
||||
```
|
||||
|
||||
## 12. Sessions
|
||||
|
||||
```bash
|
||||
# Save session state
|
||||
curl -X POST http://localhost:8082/api/sessions/test-session/state \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"state":{"mood":"productive","topic":"AI","level":7}}'
|
||||
|
||||
# Retrieve session state
|
||||
curl http://localhost:8082/api/sessions/test-session/state
|
||||
# → {"state":{"mood":"productive","topic":"AI","level":7}}
|
||||
|
||||
# Preview session
|
||||
curl http://localhost:8082/api/sessions/test-session/preview
|
||||
```
|
||||
|
||||
## 13. Memory
|
||||
|
||||
```bash
|
||||
# List all memories
|
||||
curl http://localhost:8082/api/memory
|
||||
# → {"memories":[],"count":0}
|
||||
|
||||
# Add a memory
|
||||
curl -X POST http://localhost:8082/api/memory \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"text":"User prefers dark mode","memory_type":"preference"}'
|
||||
|
||||
# Search memories
|
||||
curl -X POST http://localhost:8082/api/memory/search \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"query":"dark mode"}'
|
||||
|
||||
# Get memory context for a prompt
|
||||
curl -X POST http://localhost:8082/api/memory/context \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"query":"what theme does user prefer?"}'
|
||||
|
||||
# List memories for a specific session
|
||||
curl http://localhost:8082/api/memory/session/{session_id}
|
||||
# → {"memories":[...],"count":0,"session_id":"..."}
|
||||
|
||||
# Memory backend status and health
|
||||
curl http://localhost:8082/api/memory/status
|
||||
# → {"total":0,"by_type":{},"backend":"...","status":"ok"}
|
||||
|
||||
# Get a specific memory
|
||||
curl http://localhost:8082/api/memory/{memory_id}
|
||||
|
||||
# Delete a specific memory
|
||||
curl -X DELETE http://localhost:8082/api/memory/{memory_id}
|
||||
|
||||
# Clear all memories
|
||||
curl -X DELETE http://localhost:8082/api/memory
|
||||
```
|
||||
|
||||
## 14–15. Hooks, Workflows
|
||||
|
||||
```bash
|
||||
# These return empty lists until data is created through agent execution
|
||||
curl http://localhost:8082/api/hooks
|
||||
curl http://localhost:8082/api/workflows
|
||||
```
|
||||
|
||||
## 16. Features (Meta)
|
||||
|
||||
```bash
|
||||
# List all registered features
|
||||
curl http://localhost:8082/api/features
|
||||
# → {"features":[...],"count":16}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## CLI Integration Tests (`aiui test`)
|
||||
|
||||
PraisonAIUI includes built-in integration tests via
|
||||
`aiui test`. These run against a live server and verify chat, memory, sessions,
|
||||
and API endpoint health.
|
||||
|
||||
### Quick Start
|
||||
|
||||
```bash
|
||||
# Start the server
|
||||
aiui run app.py --port 8082
|
||||
|
||||
# In another terminal, run all tests
|
||||
aiui test all --server http://127.0.0.1:8082
|
||||
```
|
||||
|
||||
### Available Subcommands
|
||||
|
||||
| Command | What It Tests |
|
||||
|---------|---------------|
|
||||
| `aiui test endpoints` | API endpoint availability (/health, /api/features, /api/sessions, /api/chat) |
|
||||
| `aiui test chat` | Message sending, session history isolation, context recall |
|
||||
| `aiui test memory` | Cross-session persistent memory (store + recall facts) |
|
||||
| `aiui test sessions` | Session file persistence (survives server restarts) |
|
||||
| `aiui test all` | Runs all of the above in sequence |
|
||||
|
||||
### Options
|
||||
|
||||
- `--server` / `-s` — Server URL (default: `http://127.0.0.1:8082`)
|
||||
- `--timeout` / `-t` — Response timeout in seconds (default: `30`)
|
||||
|
||||
### Example Output
|
||||
|
||||
```
|
||||
╭───────────────────── Endpoint Tests ──────────────────────╮
|
||||
│ 6 passed, 0 failed, 2 skipped │
|
||||
╰───────────────────────────────────────────────────────────╯
|
||||
|
||||
╭──────────────────────── Chat Tests ───────────────────────╮
|
||||
│ 8 passed, 0 failed │
|
||||
╰───────────────────────────────────────────────────────────╯
|
||||
|
||||
╭─────────────────────── Memory Tests ──────────────────────╮
|
||||
│ 2 passed, 0 failed │
|
||||
╰───────────────────────────────────────────────────────────╯
|
||||
|
||||
╭──────────────────── Sessions Tests ───────────────────────╮
|
||||
│ 4 passed, 0 failed │
|
||||
╰───────────────────────────────────────────────────────────╯
|
||||
|
||||
All tests passed! ✓
|
||||
```
|
||||
|
||||
### Test Details
|
||||
|
||||
**Endpoints** (6 checks, 2 optional skips):
|
||||
- `GET /api/features` — Feature registry health
|
||||
- `GET /api/sessions` — Session listing
|
||||
- `GET /api/chat/history` — Empty session history
|
||||
- `POST /api/chat/send` — Chat message dispatch
|
||||
- `GET /api/provider/health` — _(optional, skipped if no provider)_
|
||||
- `GET /api/provider/agents` — _(optional, skipped if no provider)_
|
||||
- `GET /health` — Server health check
|
||||
|
||||
**Chat** (8 checks):
|
||||
- Sends a message to Session A, verifies response in history
|
||||
- Creates Session B, verifies history isolation (no cross-session leakage)
|
||||
- Verifies Session A retains context from earlier messages
|
||||
|
||||
**Memory** (2 checks):
|
||||
- Sends a fact to Session 1 ("remember my name")
|
||||
- Asks a recall question in Session 2, verifies cross-session memory
|
||||
|
||||
**Sessions** (4 checks):
|
||||
- Sends a message and verifies session file is created on disk
|
||||
- Verifies history API returns persisted messages
|
||||
|
||||
---
|
||||
|
||||
## Running the Full API Test Suite
|
||||
|
||||
Use the example at `examples/python/14-all-features/app.py` which tests all 16 features programmatically:
|
||||
|
||||
```bash
|
||||
cd examples/python/14-all-features
|
||||
pip install httpx # if not installed
|
||||
python app.py
|
||||
```
|
||||
|
||||
## Expected Results
|
||||
|
||||
| Feature | Endpoints | Expected |
|
||||
|---------|-----------|----------|
|
||||
| Channels | 4 | All 200/201 |
|
||||
| Agents | 3+ | 201 create, 200 list, 501 run (no praisonaiagents) |
|
||||
| Approvals | 6 | Auto-approve low-risk, manual approve high-risk |
|
||||
| Jobs | 3 | 202 submit, 200 list/stats |
|
||||
| Schedules | 2 | 201 create, 200 list |
|
||||
| Usage | 4+ | 201 track, 200 summary with by_model breakdown |
|
||||
| Skills | 2 | 18 skills, 7 categories |
|
||||
| Config | 5 | Schema, defaults, validate, runtime set/get |
|
||||
| Auth | 4 | API key generation, multi-mode auth |
|
||||
| OpenAI API | 2 | 11 endpoints, 13 models |
|
||||
| Logs | 2 | 5 log levels |
|
||||
| Sessions | 3 | State save/get/preview |
|
||||
| Memory | 6 | List, add, search, context, session-scoped, status |
|
||||
| Hooks | 1 | 200 (empty until registered) |
|
||||
| Workflows | 1 | 200 (empty until created) |
|
||||
| Features | 1 | 16 features registered |
|
||||
@@ -0,0 +1,54 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
|
||||
<script id="aiui-canonical-url">(function(){var p=location.pathname.replace(/\/+$/, '')||'/';if(p!==location.pathname){history.replaceState(null,'',p+location.search+location.hash);}})();</script>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="Complete API reference for the TypeScript/React runtime." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:locale" content="en_US" />
|
||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
||||
<title>TypeScript SDK Reference | PraisonAIUI Docs</title>
|
||||
<script>
|
||||
(function(){try{var t=localStorage.getItem('aiui-theme-preference');var d=true;if(t==='dark'||(t==='system'&&matchMedia('(prefers-color-scheme: dark)').matches)||(!t&&d))document.documentElement.classList.add('dark');else if(t==='light')document.documentElement.classList.remove('dark');}catch(e){}})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="/assets/theme.css">
|
||||
<script type="module" crossorigin src="/assets/index.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index.css">
|
||||
<link rel="canonical" href="https://ui.praison.ai/docs/api/typescript" />
|
||||
<meta property="og:title" content="TypeScript SDK Reference | PraisonAIUI Docs" />
|
||||
<meta property="og:description" content="Complete API reference for the TypeScript/React runtime." />
|
||||
<meta property="og:url" content="https://ui.praison.ai/docs/api/typescript" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:image" content="https://ui.praison.ai/icon.svg" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="TypeScript SDK Reference | PraisonAIUI Docs" />
|
||||
<meta name="twitter:description" content="Complete API reference for the TypeScript/React runtime." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<script type="application/ld+json">{"@context": "https://schema.org", "@type": "TechArticle", "headline": "TypeScript SDK Reference", "description": "Complete API reference for the TypeScript/React runtime.", "url": "https://ui.praison.ai/docs/api/typescript", "isPartOf": {"@type": "WebSite", "name": "PraisonAIUI Docs", "url": "https://ui.praison.ai/"}}</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"><noscript><nav aria-label="Documentation"><ul><li><a href="https://ui.praison.ai/docs/health-endpoints">Health Endpoints Guide</a></li><li><a href="https://ui.praison.ai/docs/index">PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/testing">Testing</a></li><li><a href="https://ui.praison.ai/docs/adr">Adr</a></li><li><a href="https://ui.praison.ai/docs/adr/replay-view-clean-room">ADR 0001: PraisonAI Replay view, a clean-room design</a></li><li><a href="https://ui.praison.ai/docs/api">Api</a></li><li><a href="https://ui.praison.ai/docs/api/cli">CLI API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/components">Component API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/features-api">Features REST API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/health">Health API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/python">Python SDK API</a></li><li><a href="https://ui.praison.ai/docs/api/sessions">Sessions API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/testing">API Testing Guide</a></li><li><a href="https://ui.praison.ai/docs/api/typescript">TypeScript SDK Reference</a></li><li><a href="https://ui.praison.ai/docs/concepts">Concepts</a></li><li><a href="https://ui.praison.ai/docs/concepts/architecture">Architecture: AG-UI Protocol vs Gateway Integration</a></li><li><a href="https://ui.praison.ai/docs/concepts/configuration">YAML Configuration</a></li><li><a href="https://ui.praison.ai/docs/concepts/providers">Providers</a></li><li><a href="https://ui.praison.ai/docs/concepts/slots">Slots & Components</a></li><li><a href="https://ui.praison.ai/docs/concepts/templates">Templates & Layouts</a></li><li><a href="https://ui.praison.ai/docs/examples">Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/advanced">Advanced Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/basic">Basic Examples</a></li><li><a href="https://ui.praison.ai/docs/features">Features</a></li><li><a href="https://ui.praison.ai/docs/features/a2ui-canvas">A2UI canvas — agent-driven UI</a></li><li><a href="https://ui.praison.ai/docs/features/agent-ui-host">Agent UI host — modular dashboard shell</a></li><li><a href="https://ui.praison.ai/docs/features/attachments">Chat Attachments</a></li><li><a href="https://ui.praison.ai/docs/features/backend-integration">Backend Integration Contract</a></li><li><a href="https://ui.praison.ai/docs/features/beautifului-integration">BeautifulUI Integration Strategy</a></li><li><a href="https://ui.praison.ai/docs/features/browser-automation">Browser Automation</a></li><li><a href="https://ui.praison.ai/docs/features/channel-chat-bridge">Channel-to-Chat Bridge</a></li><li><a href="https://ui.praison.ai/docs/features/code-execution">Code Execution</a></li><li><a href="https://ui.praison.ai/docs/features/comparison-openclaw">Feature Comparison: PraisonAIUI vs OpenClaw</a></li><li><a href="https://ui.praison.ai/docs/features/config-hot-reload">Config Hot-Reload</a></li><li><a href="https://ui.praison.ai/docs/features/content-sources">Content Sources</a></li><li><a href="https://ui.praison.ai/docs/features/css-architecture">How the UI Looks Are Built</a></li><li><a href="https://ui.praison.ai/docs/features/dark-mode">Dark Mode</a></li><li><a href="https://ui.praison.ai/docs/features/dashboard">Dashboard</a></li><li><a href="https://ui.praison.ai/docs/features/deployment">Deployment Guide</a></li><li><a href="https://ui.praison.ai/docs/features/device-pairing">Device Pairing</a></li><li><a href="https://ui.praison.ai/docs/features/differentiation">What Makes PraisonAIUI Different</a></li><li><a href="https://ui.praison.ai/docs/features/feature-inventory">Feature Inventory</a></li><li><a href="https://ui.praison.ai/docs/features/gap-analysis">Gap Analysis — Validated Against praisonai SDK</a></li><li><a href="https://ui.praison.ai/docs/features/gateway-chat">Gateway Chat</a></li><li><a href="https://ui.praison.ai/docs/features/hot-reload">Hot Reload</a></li><li><a href="https://ui.praison.ai/docs/features/how-to-add-a-feature">How to Add a Feature to PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/features/i18n">Internationalization (i18n)</a></li><li><a href="https://ui.praison.ai/docs/features/image-preview-chat">Image Preview in Chat</a></li><li><a href="https://ui.praison.ai/docs/features/integration-analysis">AIUI Integration — Critical Review & Architecture Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/knowledge-embeddings">Knowledge Embedding Model Configuration</a></li><li><a href="https://ui.praison.ai/docs/features/marketplace">Plugin Marketplace</a></li><li><a href="https://ui.praison.ai/docs/features/media-analysis">Media Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/message-elements">Message Elements</a></li><li><a href="https://ui.praison.ai/docs/features/model-fallback">Model Fallback</a></li><li><a href=Line truncated
|
||||
<p>Complete API reference for the TypeScript/React runtime.</p>
|
||||
<h2>Installation</h2>
|
||||
<h2>Core Functions</h2>
|
||||
<h3>createAIUI</h3>
|
||||
<p>Initialize the runtime with manifests.</p>
|
||||
<h3>resolveTemplate</h3>
|
||||
<p>Match a route to a template.</p>
|
||||
<h2>SlotRegistry</h2>
|
||||
<p>Register custom components for slots.</p>
|
||||
<h2>Next.js Adapter</h2>
|
||||
<h3>withAIUI</h3>
|
||||
<p>Wrap your Next.js config:</p>
|
||||
<h3>getDocsPageProps</h3>
|
||||
<p>Get props for docs pages:</p>
|
||||
<h2>Types</h2></noscript></div>
|
||||
<script src="/plugins/plugin-loader.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,89 @@
|
||||
# TypeScript SDK Reference
|
||||
|
||||
Complete API reference for the TypeScript/React runtime.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install praisonaiui
|
||||
```
|
||||
|
||||
## Core Functions
|
||||
|
||||
### createAIUI
|
||||
|
||||
Initialize the runtime with manifests.
|
||||
|
||||
```typescript
|
||||
import { createAIUI } from 'praisonaiui/runtime';
|
||||
|
||||
const aiui = createAIUI({
|
||||
manifestPath: './aiui',
|
||||
basePath: '/docs'
|
||||
});
|
||||
```
|
||||
|
||||
### resolveTemplate
|
||||
|
||||
Match a route to a template.
|
||||
|
||||
```typescript
|
||||
import { resolveTemplate } from 'praisonaiui/runtime';
|
||||
|
||||
const template = resolveTemplate('/docs/getting-started', routeManifest);
|
||||
// { layout: "ThreeColumnLayout", slots: {...} }
|
||||
```
|
||||
|
||||
## SlotRegistry
|
||||
|
||||
Register custom components for slots.
|
||||
|
||||
```typescript
|
||||
import { SlotRegistry } from 'praisonaiui/runtime';
|
||||
|
||||
// Register a custom header
|
||||
SlotRegistry.register('Header', MyCustomHeader);
|
||||
|
||||
// Get registered component
|
||||
const Header = SlotRegistry.get('Header');
|
||||
```
|
||||
|
||||
## Next.js Adapter
|
||||
|
||||
### withAIUI
|
||||
|
||||
Wrap your Next.js config:
|
||||
|
||||
```typescript
|
||||
// next.config.ts
|
||||
import { withAIUI } from 'praisonaiui/next';
|
||||
|
||||
export default withAIUI({
|
||||
// your Next.js config
|
||||
});
|
||||
```
|
||||
|
||||
### getDocsPageProps
|
||||
|
||||
Get props for docs pages:
|
||||
|
||||
```typescript
|
||||
import { getDocsPageProps } from 'praisonaiui/next';
|
||||
|
||||
export async function getStaticProps({ params }) {
|
||||
return getDocsPageProps(params.slug);
|
||||
}
|
||||
```
|
||||
|
||||
## Types
|
||||
|
||||
```typescript
|
||||
import type {
|
||||
Config,
|
||||
SiteConfig,
|
||||
TemplateConfig,
|
||||
RouteConfig,
|
||||
NavItem,
|
||||
DocPage,
|
||||
} from 'praisonaiui';
|
||||
```
|
||||
@@ -0,0 +1,39 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
|
||||
<script id="aiui-canonical-url">(function(){var p=location.pathname.replace(/\/+$/, '')||'/';if(p!==location.pathname){history.replaceState(null,'',p+location.search+location.hash);}})();</script>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="Concepts - Documentation for PraisonAIUI - YAML-driven website generator" />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:locale" content="en_US" />
|
||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
||||
<title>Concepts | PraisonAIUI Docs</title>
|
||||
<script>
|
||||
(function(){try{var t=localStorage.getItem('aiui-theme-preference');var d=true;if(t==='dark'||(t==='system'&&matchMedia('(prefers-color-scheme: dark)').matches)||(!t&&d))document.documentElement.classList.add('dark');else if(t==='light')document.documentElement.classList.remove('dark');}catch(e){}})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="/assets/theme.css">
|
||||
<script type="module" crossorigin src="/assets/index.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index.css">
|
||||
<link rel="canonical" href="https://ui.praison.ai/docs/concepts" />
|
||||
<meta property="og:title" content="Concepts | PraisonAIUI Docs" />
|
||||
<meta property="og:description" content="Concepts - Documentation for PraisonAIUI - YAML-driven website generator" />
|
||||
<meta property="og:url" content="https://ui.praison.ai/docs/concepts" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:image" content="https://ui.praison.ai/icon.svg" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="Concepts | PraisonAIUI Docs" />
|
||||
<meta name="twitter:description" content="Concepts - Documentation for PraisonAIUI - YAML-driven website generator" />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<script type="application/ld+json">{"@context": "https://schema.org", "@type": "TechArticle", "headline": "Concepts", "description": "Concepts - Documentation for PraisonAIUI - YAML-driven website generator", "url": "https://ui.praison.ai/docs/concepts", "isPartOf": {"@type": "WebSite", "name": "PraisonAIUI Docs", "url": "https://ui.praison.ai/"}}</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"><noscript><nav aria-label="Documentation"><ul><li><a href="https://ui.praison.ai/docs/health-endpoints">Health Endpoints Guide</a></li><li><a href="https://ui.praison.ai/docs/index">PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/testing">Testing</a></li><li><a href="https://ui.praison.ai/docs/adr">Adr</a></li><li><a href="https://ui.praison.ai/docs/adr/replay-view-clean-room">ADR 0001: PraisonAI Replay view, a clean-room design</a></li><li><a href="https://ui.praison.ai/docs/api">Api</a></li><li><a href="https://ui.praison.ai/docs/api/cli">CLI API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/components">Component API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/features-api">Features REST API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/health">Health API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/python">Python SDK API</a></li><li><a href="https://ui.praison.ai/docs/api/sessions">Sessions API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/testing">API Testing Guide</a></li><li><a href="https://ui.praison.ai/docs/api/typescript">TypeScript SDK Reference</a></li><li><a href="https://ui.praison.ai/docs/concepts">Concepts</a></li><li><a href="https://ui.praison.ai/docs/concepts/architecture">Architecture: AG-UI Protocol vs Gateway Integration</a></li><li><a href="https://ui.praison.ai/docs/concepts/configuration">YAML Configuration</a></li><li><a href="https://ui.praison.ai/docs/concepts/providers">Providers</a></li><li><a href="https://ui.praison.ai/docs/concepts/slots">Slots & Components</a></li><li><a href="https://ui.praison.ai/docs/concepts/templates">Templates & Layouts</a></li><li><a href="https://ui.praison.ai/docs/examples">Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/advanced">Advanced Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/basic">Basic Examples</a></li><li><a href="https://ui.praison.ai/docs/features">Features</a></li><li><a href="https://ui.praison.ai/docs/features/a2ui-canvas">A2UI canvas — agent-driven UI</a></li><li><a href="https://ui.praison.ai/docs/features/agent-ui-host">Agent UI host — modular dashboard shell</a></li><li><a href="https://ui.praison.ai/docs/features/attachments">Chat Attachments</a></li><li><a href="https://ui.praison.ai/docs/features/backend-integration">Backend Integration Contract</a></li><li><a href="https://ui.praison.ai/docs/features/beautifului-integration">BeautifulUI Integration Strategy</a></li><li><a href="https://ui.praison.ai/docs/features/browser-automation">Browser Automation</a></li><li><a href="https://ui.praison.ai/docs/features/channel-chat-bridge">Channel-to-Chat Bridge</a></li><li><a href="https://ui.praison.ai/docs/features/code-execution">Code Execution</a></li><li><a href="https://ui.praison.ai/docs/features/comparison-openclaw">Feature Comparison: PraisonAIUI vs OpenClaw</a></li><li><a href="https://ui.praison.ai/docs/features/config-hot-reload">Config Hot-Reload</a></li><li><a href="https://ui.praison.ai/docs/features/content-sources">Content Sources</a></li><li><a href="https://ui.praison.ai/docs/features/css-architecture">How the UI Looks Are Built</a></li><li><a href="https://ui.praison.ai/docs/features/dark-mode">Dark Mode</a></li><li><a href="https://ui.praison.ai/docs/features/dashboard">Dashboard</a></li><li><a href="https://ui.praison.ai/docs/features/deployment">Deployment Guide</a></li><li><a href="https://ui.praison.ai/docs/features/device-pairing">Device Pairing</a></li><li><a href="https://ui.praison.ai/docs/features/differentiation">What Makes PraisonAIUI Different</a></li><li><a href="https://ui.praison.ai/docs/features/feature-inventory">Feature Inventory</a></li><li><a href="https://ui.praison.ai/docs/features/gap-analysis">Gap Analysis — Validated Against praisonai SDK</a></li><li><a href="https://ui.praison.ai/docs/features/gateway-chat">Gateway Chat</a></li><li><a href="https://ui.praison.ai/docs/features/hot-reload">Hot Reload</a></li><li><a href="https://ui.praison.ai/docs/features/how-to-add-a-feature">How to Add a Feature to PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/features/i18n">Internationalization (i18n)</a></li><li><a href="https://ui.praison.ai/docs/features/image-preview-chat">Image Preview in Chat</a></li><li><a href="https://ui.praison.ai/docs/features/integration-analysis">AIUI Integration — Critical Review & Architecture Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/knowledge-embeddings">Knowledge Embedding Model Configuration</a></li><li><a href="https://ui.praison.ai/docs/features/marketplace">Plugin Marketplace</a></li><li><a href="https://ui.praison.ai/docs/features/media-analysis">Media Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/message-elements">Message Elements</a></li><li><a href="https://ui.praison.ai/docs/features/model-fallback">Model Fallback</a></li><li><a href=Line truncated
|
||||
<script src="/plugins/plugin-loader.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,90 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
|
||||
<script id="aiui-canonical-url">(function(){var p=location.pathname.replace(/\/+$/, '')||'/';if(p!==location.pathname){history.replaceState(null,'',p+location.search+location.hash);}})();</script>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="PraisonAIUI has two complementary integration layers with the praisonai backend. They solve different problems and run side-by-side." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:locale" content="en_US" />
|
||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
||||
<title>Architecture: AG-UI Protocol vs Gateway Integration | PraisonAIUI Docs</title>
|
||||
<script>
|
||||
(function(){try{var t=localStorage.getItem('aiui-theme-preference');var d=true;if(t==='dark'||(t==='system'&&matchMedia('(prefers-color-scheme: dark)').matches)||(!t&&d))document.documentElement.classList.add('dark');else if(t==='light')document.documentElement.classList.remove('dark');}catch(e){}})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="/assets/theme.css">
|
||||
<script type="module" crossorigin src="/assets/index.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index.css">
|
||||
<link rel="canonical" href="https://ui.praison.ai/docs/concepts/architecture" />
|
||||
<meta property="og:title" content="Architecture: AG-UI Protocol vs Gateway Integration | PraisonAIUI Docs" />
|
||||
<meta property="og:description" content="PraisonAIUI has two complementary integration layers with the praisonai backend. They solve different problems and run side-by-side." />
|
||||
<meta property="og:url" content="https://ui.praison.ai/docs/concepts/architecture" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:image" content="https://ui.praison.ai/icon.svg" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="Architecture: AG-UI Protocol vs Gateway Integration | PraisonAIUI Docs" />
|
||||
<meta name="twitter:description" content="PraisonAIUI has two complementary integration layers with the praisonai backend. They solve different problems and run side-by-side." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<script type="application/ld+json">{"@context": "https://schema.org", "@type": "TechArticle", "headline": "Architecture: AG-UI Protocol vs Gateway Integration", "description": "PraisonAIUI has two complementary integration layers with the praisonai backend. They solve different problems and run side-by-side.", "url": "https://ui.praison.ai/docs/concepts/architecture", "isPartOf": {"@type": "WebSite", "name": "PraisonAIUI Docs", "url": "https://ui.praison.ai/"}}</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"><noscript><nav aria-label="Documentation"><ul><li><a href="https://ui.praison.ai/docs/health-endpoints">Health Endpoints Guide</a></li><li><a href="https://ui.praison.ai/docs/index">PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/testing">Testing</a></li><li><a href="https://ui.praison.ai/docs/adr">Adr</a></li><li><a href="https://ui.praison.ai/docs/adr/replay-view-clean-room">ADR 0001: PraisonAI Replay view, a clean-room design</a></li><li><a href="https://ui.praison.ai/docs/api">Api</a></li><li><a href="https://ui.praison.ai/docs/api/cli">CLI API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/components">Component API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/features-api">Features REST API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/health">Health API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/python">Python SDK API</a></li><li><a href="https://ui.praison.ai/docs/api/sessions">Sessions API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/testing">API Testing Guide</a></li><li><a href="https://ui.praison.ai/docs/api/typescript">TypeScript SDK Reference</a></li><li><a href="https://ui.praison.ai/docs/concepts">Concepts</a></li><li><a href="https://ui.praison.ai/docs/concepts/architecture">Architecture: AG-UI Protocol vs Gateway Integration</a></li><li><a href="https://ui.praison.ai/docs/concepts/configuration">YAML Configuration</a></li><li><a href="https://ui.praison.ai/docs/concepts/providers">Providers</a></li><li><a href="https://ui.praison.ai/docs/concepts/slots">Slots & Components</a></li><li><a href="https://ui.praison.ai/docs/concepts/templates">Templates & Layouts</a></li><li><a href="https://ui.praison.ai/docs/examples">Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/advanced">Advanced Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/basic">Basic Examples</a></li><li><a href="https://ui.praison.ai/docs/features">Features</a></li><li><a href="https://ui.praison.ai/docs/features/a2ui-canvas">A2UI canvas — agent-driven UI</a></li><li><a href="https://ui.praison.ai/docs/features/agent-ui-host">Agent UI host — modular dashboard shell</a></li><li><a href="https://ui.praison.ai/docs/features/attachments">Chat Attachments</a></li><li><a href="https://ui.praison.ai/docs/features/backend-integration">Backend Integration Contract</a></li><li><a href="https://ui.praison.ai/docs/features/beautifului-integration">BeautifulUI Integration Strategy</a></li><li><a href="https://ui.praison.ai/docs/features/browser-automation">Browser Automation</a></li><li><a href="https://ui.praison.ai/docs/features/channel-chat-bridge">Channel-to-Chat Bridge</a></li><li><a href="https://ui.praison.ai/docs/features/code-execution">Code Execution</a></li><li><a href="https://ui.praison.ai/docs/features/comparison-openclaw">Feature Comparison: PraisonAIUI vs OpenClaw</a></li><li><a href="https://ui.praison.ai/docs/features/config-hot-reload">Config Hot-Reload</a></li><li><a href="https://ui.praison.ai/docs/features/content-sources">Content Sources</a></li><li><a href="https://ui.praison.ai/docs/features/css-architecture">How the UI Looks Are Built</a></li><li><a href="https://ui.praison.ai/docs/features/dark-mode">Dark Mode</a></li><li><a href="https://ui.praison.ai/docs/features/dashboard">Dashboard</a></li><li><a href="https://ui.praison.ai/docs/features/deployment">Deployment Guide</a></li><li><a href="https://ui.praison.ai/docs/features/device-pairing">Device Pairing</a></li><li><a href="https://ui.praison.ai/docs/features/differentiation">What Makes PraisonAIUI Different</a></li><li><a href="https://ui.praison.ai/docs/features/feature-inventory">Feature Inventory</a></li><li><a href="https://ui.praison.ai/docs/features/gap-analysis">Gap Analysis — Validated Against praisonai SDK</a></li><li><a href="https://ui.praison.ai/docs/features/gateway-chat">Gateway Chat</a></li><li><a href="https://ui.praison.ai/docs/features/hot-reload">Hot Reload</a></li><li><a href="https://ui.praison.ai/docs/features/how-to-add-a-feature">How to Add a Feature to PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/features/i18n">Internationalization (i18n)</a></li><li><a href="https://ui.praison.ai/docs/features/image-preview-chat">Image Preview in Chat</a></li><li><a href="https://ui.praison.ai/docs/features/integration-analysis">AIUI Integration — Critical Review & Architecture Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/knowledge-embeddings">Knowledge Embedding Model Configuration</a></li><li><a href="https://ui.praison.ai/docs/features/marketplace">Plugin Marketplace</a></li><li><a href="https://ui.praison.ai/docs/features/media-analysis">Media Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/message-elements">Message Elements</a></li><li><a href="https://ui.praison.ai/docs/features/model-fallback">Model Fallback</a></li><li><a href=Line truncated
|
||||
<p>PraisonAIUI has <strong>two complementary integration layers</strong> with the praisonai backend. They solve different problems and run side-by-side.</p>
|
||||
<h2>Protocol Stack</h2>
|
||||
<p>AG-UI sits alongside MCP and A2A in the agentic protocol stack:</p>
|
||||
<p>| Protocol | Purpose |</p>
|
||||
<p>|----------|---------|</p>
|
||||
<p>| <strong>MCP</strong> | Gives agents tools |</p>
|
||||
<p>| <strong>A2A</strong> | Agent-to-agent communication |</p>
|
||||
<p>| <strong>AG-UI</strong> | Agent-to-user-interface (streaming) |</p>
|
||||
<p>| <strong>Gateway</strong> | Infrastructure management (channels, nodes, instances) |</p>
|
||||
<h2>AG-UI — The Conversation Layer</h2>
|
||||
<p><a href="https://ag-ui.com/">AG-UI</a> is an <strong>open, event-based protocol</strong> by CopilotKit that standardizes how agent backends stream events to frontends. PraisonAI implements it at <code>praisonaiagents/ui/agui/</code>.</p>
|
||||
<p><strong>What it does:</strong> Streams ~16 standard event types (text deltas, tool calls, state sync, generative UI) over SSE.</p>
|
||||
<p><strong>Who uses it:</strong> LangGraph, CrewAI, Google ADK, Microsoft Agent Framework, AWS Strands, Mastra, Pydantic AI, LlamaIndex, AG2, and PraisonAI.</p>
|
||||
<h3>Usage</h3>
|
||||
<p><strong>Frontend compatibility:</strong> CopilotKit, or any AG-UI-compatible client.</p>
|
||||
<h2>Gateway Integration — The Operations Layer</h2>
|
||||
<p>The gateway integration connects PraisonAIUI's dashboard features to the live <code>WebSocketGateway</code> backend for infrastructure management.</p>
|
||||
<p><strong>What it does:</strong> CRUD for channels, nodes, instances; live bot status; heartbeat monitoring.</p>
|
||||
<h3>How It Works</h3>
|
||||
<h3>Key Files</h3>
|
||||
<p>| File | Purpose |</p>
|
||||
<p>|------|---------|</p>
|
||||
<p>| <code>features/_gateway_ref.py</code> | Thread-safe singleton holding reference to the live gateway |</p>
|
||||
<p>| <code>features/channels.py</code> | Channel CRUD + live status enrichment from gateway |</p>
|
||||
<p>| <code>features/nodes.py</code> | Node CRUD + gateway health enrichment |</p>
|
||||
<p>| <code>integration.py</code> | Calls <code>set_gateway()</code> on start, clears on stop |</p>
|
||||
<p>| <code>config_store.py</code> | Unified <code>~/.praisonaiui/config.yaml</code> — single source of truth for all feature state |</p>
|
||||
<h3>API Endpoints</h3>
|
||||
<p>| Endpoint | Methods | Description |</p>
|
||||
<p>|----------|---------|-------------|</p>
|
||||
<p>| <code>/api/channels</code> | GET, POST | List/create channels |</p>
|
||||
<p>| <code>/api/channels/{id}</code> | GET, PUT, DELETE | Channel CRUD |</p>
|
||||
<p>| <code>/api/channels/{id}/toggle</code> | POST | Enable/disable |</p>
|
||||
<p>| <code>/api/channels/{id}/status</code> | GET | Live running status |</p>
|
||||
<p>| <code>/api/channels/platforms</code> | GET | Supported platforms |</p>
|
||||
<p>| <code>/api/nodes</code> | GET, POST | List/register nodes |</p>
|
||||
<p>| <code>/api/nodes/{id}</code> | GET, PUT, DELETE | Node CRUD |</p>
|
||||
<p>| <code>/api/nodes/{id}/status</code> | GET | Node status + gateway enrichment |</p>
|
||||
<p>| <code>/api/nodes/{id}/agents</code> | GET, PUT | Agent bindings |</p>
|
||||
<p>| <code>/api/instances</code> | GET | Connected instances |</p>
|
||||
<p>| <code>/api/instances/heartbeat</code> | POST | Presence heartbeat |</p>
|
||||
<h2>Using Both Together</h2>
|
||||
<p><code>AIUIGateway.start()</code> in <code>integration.py</code> mounts the gateway and dashboard REST API on one server. Chat uses the built-in WebSocket/SSE <code>RunEvent</code> protocol; AG-UI is mounted separately via <code>AguiFeature</code> when enabled:</p>
|
||||
<h2>Summary</h2>
|
||||
<p>| | AG-UI (<code>/agui</code>) | Gateway (<code>/api/*</code>) |</p>
|
||||
<p>|---|---|---|</p>
|
||||
<p>| <strong>Layer</strong> | Conversation | Operations |</p>
|
||||
<p>| <strong>Transport</strong> | SSE (server-sent events) | REST + WebSocket |</p>
|
||||
<p>| <strong>Purpose</strong> | Stream agent responses to users | Manage channels, nodes, instances |</p>
|
||||
<p>| <strong>Frontend</strong> | CopilotKit / AG-UI clients | PraisonAIUI React dashboard |</p>
|
||||
<p>| <strong>Protocol</strong> | Open standard (~16 event types) | Internal REST API |</p></noscript></div>
|
||||
<script src="/plugins/plugin-loader.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,141 @@
|
||||
# Architecture: AG-UI Protocol vs Gateway Integration
|
||||
|
||||
PraisonAIUI has **two complementary integration layers** with the praisonai backend. They solve different problems and run side-by-side.
|
||||
|
||||
## Protocol Stack
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
subgraph "PraisonAIUI Frontend (React SPA)"
|
||||
CHAT["Chat Panel"]
|
||||
DASH["Admin Dashboard"]
|
||||
end
|
||||
|
||||
subgraph "praisonai-package Backend"
|
||||
AGUI["AGUI Class<br/>POST /agui<br/>SSE streaming"]
|
||||
GW["WebSocketGateway<br/>REST + WebSocket<br/>Bot management"]
|
||||
end
|
||||
|
||||
CHAT -->|"WebSocket / SSE<br/>(RunEvent protocol)"| GW
|
||||
CHAT -.->|"AG-UI (optional)<br/>POST /agui"| AGUI
|
||||
DASH -->|"REST API<br/>(/api/channels, /api/nodes)"| GW
|
||||
```
|
||||
|
||||
AG-UI sits alongside MCP and A2A in the agentic protocol stack:
|
||||
|
||||
| Protocol | Purpose |
|
||||
|----------|---------|
|
||||
| **MCP** | Gives agents tools |
|
||||
| **A2A** | Agent-to-agent communication |
|
||||
| **AG-UI** | Agent-to-user-interface (streaming) |
|
||||
| **Gateway** | Infrastructure management (channels, nodes, instances) |
|
||||
|
||||
## AG-UI — The Conversation Layer
|
||||
|
||||
[AG-UI](https://ag-ui.com/) is an **open, event-based protocol** by CopilotKit that standardizes how agent backends stream events to frontends. PraisonAI implements it at `praisonaiagents/ui/agui/`.
|
||||
|
||||
**What it does:** Streams ~16 standard event types (text deltas, tool calls, state sync, generative UI) over SSE.
|
||||
|
||||
**Who uses it:** LangGraph, CrewAI, Google ADK, Microsoft Agent Framework, AWS Strands, Mastra, Pydantic AI, LlamaIndex, AG2, and PraisonAI.
|
||||
|
||||
### Usage
|
||||
|
||||
```python
|
||||
from praisonaiagents import Agent
|
||||
from praisonaiagents.ui.agui import AGUI
|
||||
from fastapi import FastAPI
|
||||
|
||||
agent = Agent(name="Assistant", role="Helper", goal="Help users")
|
||||
agui = AGUI(agent=agent)
|
||||
|
||||
app = FastAPI()
|
||||
app.include_router(agui.get_router())
|
||||
# → POST /agui (SSE streaming, AG-UI protocol)
|
||||
# → GET /status (agent availability)
|
||||
```
|
||||
|
||||
**Frontend compatibility:** CopilotKit, or any AG-UI-compatible client.
|
||||
|
||||
## Gateway Integration — The Operations Layer
|
||||
|
||||
The gateway integration connects PraisonAIUI's dashboard features to the live `WebSocketGateway` backend for infrastructure management.
|
||||
|
||||
**What it does:** CRUD for channels, nodes, instances; live bot status; heartbeat monitoring.
|
||||
|
||||
### How It Works
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant S as AIUIGateway.start()
|
||||
participant R as _gateway_ref singleton
|
||||
participant C as channels.py
|
||||
participant N as nodes.py
|
||||
participant G as WebSocketGateway
|
||||
|
||||
S->>R: set_gateway(ws_gateway)
|
||||
C->>R: get_gateway()
|
||||
R-->>C: returns WebSocketGateway
|
||||
C->>G: health()
|
||||
G-->>C: Live bot status
|
||||
N->>R: get_gateway()
|
||||
R-->>N: returns WebSocketGateway
|
||||
N->>G: health()
|
||||
G-->>N: Agent/session counts
|
||||
```
|
||||
|
||||
### Key Files
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `features/_gateway_ref.py` | Thread-safe singleton holding reference to the live gateway |
|
||||
| `features/channels.py` | Channel CRUD + live status enrichment from gateway |
|
||||
| `features/nodes.py` | Node CRUD + gateway health enrichment |
|
||||
| `integration.py` | Calls `set_gateway()` on start, clears on stop |
|
||||
| `config_store.py` | Unified `~/.praisonaiui/config.yaml` — single source of truth for all feature state |
|
||||
|
||||
### API Endpoints
|
||||
|
||||
| Endpoint | Methods | Description |
|
||||
|----------|---------|-------------|
|
||||
| `/api/channels` | GET, POST | List/create channels |
|
||||
| `/api/channels/{id}` | GET, PUT, DELETE | Channel CRUD |
|
||||
| `/api/channels/{id}/toggle` | POST | Enable/disable |
|
||||
| `/api/channels/{id}/status` | GET | Live running status |
|
||||
| `/api/channels/platforms` | GET | Supported platforms |
|
||||
| `/api/nodes` | GET, POST | List/register nodes |
|
||||
| `/api/nodes/{id}` | GET, PUT, DELETE | Node CRUD |
|
||||
| `/api/nodes/{id}/status` | GET | Node status + gateway enrichment |
|
||||
| `/api/nodes/{id}/agents` | GET, PUT | Agent bindings |
|
||||
| `/api/instances` | GET | Connected instances |
|
||||
| `/api/instances/heartbeat` | POST | Presence heartbeat |
|
||||
|
||||
## Using Both Together
|
||||
|
||||
`AIUIGateway.start()` in `integration.py` mounts the gateway and dashboard REST API on one server. Chat uses the built-in WebSocket/SSE `RunEvent` protocol; AG-UI is mounted separately via `AguiFeature` when enabled:
|
||||
|
||||
```python
|
||||
from praisonaiui.integration import AIUIGateway
|
||||
from praisonaiagents import Agent
|
||||
|
||||
gateway = AIUIGateway(port=8080, static_dir="./dist")
|
||||
agent = Agent(name="assistant", instructions="You are helpful.")
|
||||
gateway.register_agent(agent)
|
||||
|
||||
await gateway.start()
|
||||
# Chat: POST /run, WS /api/chat/ws → RunEvent streaming (built-in)
|
||||
# AG-UI: POST /agui, GET /agui/status → CopilotKit-compatible SSE (AguiFeature)
|
||||
# Admin: GET /api/channels → Gateway REST API
|
||||
# Admin: GET /api/nodes → Gateway REST API
|
||||
# WS: /ws → Legacy gateway WebSocket
|
||||
# A2UI: GET/POST /api/surfaces/* → Agent-driven surfaces (SurfaceFeature)
|
||||
```
|
||||
|
||||
## Summary
|
||||
|
||||
| | AG-UI (`/agui`) | Gateway (`/api/*`) |
|
||||
|---|---|---|
|
||||
| **Layer** | Conversation | Operations |
|
||||
| **Transport** | SSE (server-sent events) | REST + WebSocket |
|
||||
| **Purpose** | Stream agent responses to users | Manage channels, nodes, instances |
|
||||
| **Frontend** | CopilotKit / AG-UI clients | PraisonAIUI React dashboard |
|
||||
| **Protocol** | Open standard (~16 event types) | Internal REST API |
|
||||
@@ -0,0 +1,104 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
|
||||
<script id="aiui-canonical-url">(function(){var p=location.pathname.replace(/\/+$/, '')||'/';if(p!==location.pathname){history.replaceState(null,'',p+location.search+location.hash);}})();</script>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="Complete guide to the aiui.template.yaml configuration schema." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:locale" content="en_US" />
|
||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
||||
<title>YAML Configuration | PraisonAIUI Docs</title>
|
||||
<script>
|
||||
(function(){try{var t=localStorage.getItem('aiui-theme-preference');var d=true;if(t==='dark'||(t==='system'&&matchMedia('(prefers-color-scheme: dark)').matches)||(!t&&d))document.documentElement.classList.add('dark');else if(t==='light')document.documentElement.classList.remove('dark');}catch(e){}})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="/assets/theme.css">
|
||||
<script type="module" crossorigin src="/assets/index.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index.css">
|
||||
<link rel="canonical" href="https://ui.praison.ai/docs/concepts/configuration" />
|
||||
<meta property="og:title" content="YAML Configuration | PraisonAIUI Docs" />
|
||||
<meta property="og:description" content="Complete guide to the aiui.template.yaml configuration schema." />
|
||||
<meta property="og:url" content="https://ui.praison.ai/docs/concepts/configuration" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:image" content="https://ui.praison.ai/icon.svg" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="YAML Configuration | PraisonAIUI Docs" />
|
||||
<meta name="twitter:description" content="Complete guide to the aiui.template.yaml configuration schema." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<script type="application/ld+json">{"@context": "https://schema.org", "@type": "TechArticle", "headline": "YAML Configuration", "description": "Complete guide to the aiui.template.yaml configuration schema.", "url": "https://ui.praison.ai/docs/concepts/configuration", "isPartOf": {"@type": "WebSite", "name": "PraisonAIUI Docs", "url": "https://ui.praison.ai/"}}</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"><noscript><nav aria-label="Documentation"><ul><li><a href="https://ui.praison.ai/docs/health-endpoints">Health Endpoints Guide</a></li><li><a href="https://ui.praison.ai/docs/index">PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/testing">Testing</a></li><li><a href="https://ui.praison.ai/docs/adr">Adr</a></li><li><a href="https://ui.praison.ai/docs/adr/replay-view-clean-room">ADR 0001: PraisonAI Replay view, a clean-room design</a></li><li><a href="https://ui.praison.ai/docs/api">Api</a></li><li><a href="https://ui.praison.ai/docs/api/cli">CLI API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/components">Component API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/features-api">Features REST API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/health">Health API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/python">Python SDK API</a></li><li><a href="https://ui.praison.ai/docs/api/sessions">Sessions API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/testing">API Testing Guide</a></li><li><a href="https://ui.praison.ai/docs/api/typescript">TypeScript SDK Reference</a></li><li><a href="https://ui.praison.ai/docs/concepts">Concepts</a></li><li><a href="https://ui.praison.ai/docs/concepts/architecture">Architecture: AG-UI Protocol vs Gateway Integration</a></li><li><a href="https://ui.praison.ai/docs/concepts/configuration">YAML Configuration</a></li><li><a href="https://ui.praison.ai/docs/concepts/providers">Providers</a></li><li><a href="https://ui.praison.ai/docs/concepts/slots">Slots & Components</a></li><li><a href="https://ui.praison.ai/docs/concepts/templates">Templates & Layouts</a></li><li><a href="https://ui.praison.ai/docs/examples">Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/advanced">Advanced Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/basic">Basic Examples</a></li><li><a href="https://ui.praison.ai/docs/features">Features</a></li><li><a href="https://ui.praison.ai/docs/features/a2ui-canvas">A2UI canvas — agent-driven UI</a></li><li><a href="https://ui.praison.ai/docs/features/agent-ui-host">Agent UI host — modular dashboard shell</a></li><li><a href="https://ui.praison.ai/docs/features/attachments">Chat Attachments</a></li><li><a href="https://ui.praison.ai/docs/features/backend-integration">Backend Integration Contract</a></li><li><a href="https://ui.praison.ai/docs/features/beautifului-integration">BeautifulUI Integration Strategy</a></li><li><a href="https://ui.praison.ai/docs/features/browser-automation">Browser Automation</a></li><li><a href="https://ui.praison.ai/docs/features/channel-chat-bridge">Channel-to-Chat Bridge</a></li><li><a href="https://ui.praison.ai/docs/features/code-execution">Code Execution</a></li><li><a href="https://ui.praison.ai/docs/features/comparison-openclaw">Feature Comparison: PraisonAIUI vs OpenClaw</a></li><li><a href="https://ui.praison.ai/docs/features/config-hot-reload">Config Hot-Reload</a></li><li><a href="https://ui.praison.ai/docs/features/content-sources">Content Sources</a></li><li><a href="https://ui.praison.ai/docs/features/css-architecture">How the UI Looks Are Built</a></li><li><a href="https://ui.praison.ai/docs/features/dark-mode">Dark Mode</a></li><li><a href="https://ui.praison.ai/docs/features/dashboard">Dashboard</a></li><li><a href="https://ui.praison.ai/docs/features/deployment">Deployment Guide</a></li><li><a href="https://ui.praison.ai/docs/features/device-pairing">Device Pairing</a></li><li><a href="https://ui.praison.ai/docs/features/differentiation">What Makes PraisonAIUI Different</a></li><li><a href="https://ui.praison.ai/docs/features/feature-inventory">Feature Inventory</a></li><li><a href="https://ui.praison.ai/docs/features/gap-analysis">Gap Analysis — Validated Against praisonai SDK</a></li><li><a href="https://ui.praison.ai/docs/features/gateway-chat">Gateway Chat</a></li><li><a href="https://ui.praison.ai/docs/features/hot-reload">Hot Reload</a></li><li><a href="https://ui.praison.ai/docs/features/how-to-add-a-feature">How to Add a Feature to PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/features/i18n">Internationalization (i18n)</a></li><li><a href="https://ui.praison.ai/docs/features/image-preview-chat">Image Preview in Chat</a></li><li><a href="https://ui.praison.ai/docs/features/integration-analysis">AIUI Integration — Critical Review & Architecture Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/knowledge-embeddings">Knowledge Embedding Model Configuration</a></li><li><a href="https://ui.praison.ai/docs/features/marketplace">Plugin Marketplace</a></li><li><a href="https://ui.praison.ai/docs/features/media-analysis">Media Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/message-elements">Message Elements</a></li><li><a href="https://ui.praison.ai/docs/features/model-fallback">Model Fallback</a></li><li><a href=Line truncated
|
||||
<p>Complete guide to the <code>aiui.template.yaml</code> configuration schema.</p>
|
||||
<h2>Overview</h2>
|
||||
<p>PraisonAIUI uses a single YAML file to configure your entire site. This file defines:</p>
|
||||
<li><strong>Site metadata</strong> - Title, description, theme</li>
|
||||
<li><strong>Content sources</strong> - Where to find your docs</li>
|
||||
<li><strong>Components</strong> - Reusable UI elements</li>
|
||||
<li><strong>Templates</strong> - Page layouts with slots</li>
|
||||
<li><strong>Routes</strong> - URL patterns to template mappings</li>
|
||||
<h2>Schema Version</h2>
|
||||
<p>Always specify the schema version:</p>
|
||||
<h2>Site Configuration</h2>
|
||||
<p>> <strong>Note</strong>: The <code>ui</code> field is a theming hint. Components are UI-agnostic and use CSS classes you can style with any framework.</p>
|
||||
<h2>Component Dependencies</h2>
|
||||
<p>Auto-install shadcn components at build time:</p>
|
||||
<p>When you run <code>aiui build</code>, any missing components are automatically installed via <code>npx shadcn add</code>.</p>
|
||||
<h2>Content Sources</h2>
|
||||
<h2>Components</h2>
|
||||
<p>Define reusable components:</p>
|
||||
<h3>Built-in Component Types</h3>
|
||||
<p>| Type | Description |</p>
|
||||
<p>|------|-------------|</p>
|
||||
<p>| <code>Header</code> | Site header with logo, nav, CTA |</p>
|
||||
<p>| <code>Footer</code> | Site footer |</p>
|
||||
<p>| <code>DocsSidebar</code> | Documentation sidebar navigation |</p>
|
||||
<p>| <code>Toc</code> | Table of contents |</p>
|
||||
<p>| <code>DocContent</code> | Rendered markdown content |</p>
|
||||
<h2>Templates</h2>
|
||||
<p>Templates combine a layout with slot assignments:</p>
|
||||
<h3>Layouts</h3>
|
||||
<p>| Layout | Description |</p>
|
||||
<p>|--------|-------------|</p>
|
||||
<p>| <code>ThreeColumnLayout</code> | Sidebar + Content + TOC |</p>
|
||||
<p>| <code>TwoColumnLayout</code> | Sidebar + Content |</p>
|
||||
<p>| <code>CenteredLayout</code> | Centered content, no sidebar |</p>
|
||||
<p>| <code>FullWidthLayout</code> | Full width content |</p>
|
||||
<p>| <code>FlexibleLayout</code> | WordPress-style widget zones |</p>
|
||||
<h2>Widget Zones</h2>
|
||||
<p>Place widgets in layout zones without modifying markdown:</p>
|
||||
<h3>Available Zones</h3>
|
||||
<p>| Zone | Description |</p>
|
||||
<p>|------|-------------|</p>
|
||||
<p>| <code>header</code> | Top header |</p>
|
||||
<p>| <code>topNav</code> | Below header nav |</p>
|
||||
<p>| <code>hero</code> | Hero banners |</p>
|
||||
<p>| <code>leftSidebar</code> | Left column |</p>
|
||||
<p>| <code>main</code> | Main content |</p>
|
||||
<p>| <code>rightSidebar</code> | Right column |</p>
|
||||
<p>| <code>bottomNav</code> | Pagination area |</p>
|
||||
<p>| <code>footer</code> | Footer widgets |</p>
|
||||
<h3>Built-in Widgets</h3>
|
||||
<p>| Widget | Description |</p>
|
||||
<p>|--------|-------------|</p>
|
||||
<p>| <code>StatsCard</code> | Metrics display |</p>
|
||||
<p>| <code>QuickLinks</code> | Navigation links |</p>
|
||||
<p>| <code>Newsletter</code> | Email signup |</p>
|
||||
<p>| <code>HeroBanner</code> | Hero section |</p>
|
||||
<p>| <code>SocialLinks</code> | Social icons |</p>
|
||||
<p>| <code>Copyright</code> | Copyright text |</p>
|
||||
<p>See Widget Zones for full documentation.</p>
|
||||
<h2>Routes</h2>
|
||||
<p>Map URL patterns to templates:</p>
|
||||
<p>Route matching uses glob patterns:</p>
|
||||
<li><code>*</code> - Single segment</li>
|
||||
<li><code>**</code> - Multiple segments</li>
|
||||
<h2>Complete Example</h2></noscript></div>
|
||||
<script src="/plugins/plugin-loader.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,345 @@
|
||||
# YAML Configuration
|
||||
|
||||
Complete guide to the `aiui.template.yaml` configuration schema.
|
||||
|
||||
## Overview
|
||||
|
||||
PraisonAIUI uses a single YAML file to configure your entire site. This file defines:
|
||||
|
||||
- **Site metadata** - Title, description, theme
|
||||
- **Content sources** - Where to find your docs
|
||||
- **Components** - Reusable UI elements
|
||||
- **Templates** - Page layouts with slots
|
||||
- **Routes** - URL patterns to template mappings
|
||||
|
||||
## Schema Version
|
||||
|
||||
Always specify the schema version:
|
||||
|
||||
```yaml
|
||||
schemaVersion: 1
|
||||
```
|
||||
|
||||
## Site Configuration
|
||||
|
||||
```yaml
|
||||
site:
|
||||
title: "My Documentation" # Required
|
||||
description: "Site description" # Optional
|
||||
routeBaseDocs: "/docs" # Default: /docs
|
||||
ui: "shadcn" # Theming hint (shadcn | mui | chakra)
|
||||
theme:
|
||||
preset: "zinc" # Any Tailwind color (22 options)
|
||||
radius: "md" # none | sm | md | lg | xl
|
||||
darkMode: true
|
||||
```
|
||||
|
||||
> **Note**: The `ui` field is a theming hint. Components are UI-agnostic and use CSS classes you can style with any framework.
|
||||
|
||||
## Component Dependencies
|
||||
|
||||
Auto-install shadcn components at build time:
|
||||
|
||||
```yaml
|
||||
dependencies:
|
||||
shadcn:
|
||||
- accordion
|
||||
- tabs
|
||||
- dialog
|
||||
```
|
||||
|
||||
When you run `aiui build`, any missing components are automatically installed via `npx shadcn add`.
|
||||
|
||||
## Content Sources
|
||||
|
||||
```yaml
|
||||
content:
|
||||
docs:
|
||||
dir: "./docs" # Path to docs folder
|
||||
include: # Glob patterns
|
||||
- "**/*.md"
|
||||
- "**/*.mdx"
|
||||
exclude: # Excluded patterns
|
||||
- "**/drafts/**"
|
||||
indexFiles:
|
||||
- "index.md"
|
||||
- "README.md"
|
||||
nav:
|
||||
mode: "auto" # auto | manual
|
||||
sort: "filesystem" # filesystem | alpha | date
|
||||
collapsible: true
|
||||
maxDepth: 4
|
||||
```
|
||||
|
||||
## Components
|
||||
|
||||
Define reusable components:
|
||||
|
||||
```yaml
|
||||
components:
|
||||
my_header:
|
||||
type: "Header"
|
||||
props:
|
||||
logoText: "My Site"
|
||||
cta:
|
||||
label: "Get Started"
|
||||
href: "/docs"
|
||||
|
||||
my_footer:
|
||||
type: "Footer"
|
||||
props:
|
||||
text: "© 2024"
|
||||
```
|
||||
|
||||
### Built-in Component Types
|
||||
|
||||
| Type | Description |
|
||||
|------|-------------|
|
||||
| `Header` | Site header with logo, nav, CTA |
|
||||
| `Footer` | Site footer |
|
||||
| `DocsSidebar` | Documentation sidebar navigation |
|
||||
| `Toc` | Table of contents |
|
||||
| `DocContent` | Rendered markdown content |
|
||||
|
||||
## Templates
|
||||
|
||||
Templates combine a layout with slot assignments:
|
||||
|
||||
```yaml
|
||||
templates:
|
||||
docs:
|
||||
layout: "ThreeColumnLayout"
|
||||
slots:
|
||||
header: { ref: "my_header" } # Reference a component
|
||||
left: { ref: "sidebar_docs" }
|
||||
main: { type: "DocContent" } # Direct type assignment
|
||||
right: { type: "Toc" }
|
||||
footer: { ref: "my_footer" }
|
||||
```
|
||||
|
||||
### Layouts
|
||||
|
||||
| Layout | Description |
|
||||
|--------|-------------|
|
||||
| `ThreeColumnLayout` | Sidebar + Content + TOC |
|
||||
| `TwoColumnLayout` | Sidebar + Content |
|
||||
| `CenteredLayout` | Centered content, no sidebar |
|
||||
| `FullWidthLayout` | Full width content |
|
||||
| `FlexibleLayout` | WordPress-style widget zones |
|
||||
|
||||
## Widget Zones
|
||||
|
||||
Place widgets in layout zones without modifying markdown:
|
||||
|
||||
```yaml
|
||||
templates:
|
||||
docs:
|
||||
layout: "FlexibleLayout"
|
||||
zones:
|
||||
rightSidebar:
|
||||
- type: "Toc"
|
||||
- type: "StatsCard"
|
||||
props:
|
||||
title: "Users"
|
||||
value: "15,231"
|
||||
change: "+20%"
|
||||
footer:
|
||||
- type: "Newsletter"
|
||||
- type: "Copyright"
|
||||
props:
|
||||
text: "© 2024"
|
||||
```
|
||||
|
||||
### Available Zones
|
||||
|
||||
| Zone | Description |
|
||||
|------|-------------|
|
||||
| `header` | Top header |
|
||||
| `topNav` | Below header nav |
|
||||
| `hero` | Hero banners |
|
||||
| `leftSidebar` | Left column |
|
||||
| `main` | Main content |
|
||||
| `rightSidebar` | Right column |
|
||||
| `bottomNav` | Pagination area |
|
||||
| `footer` | Footer widgets |
|
||||
|
||||
### Built-in Widgets
|
||||
|
||||
| Widget | Description |
|
||||
|--------|-------------|
|
||||
| `StatsCard` | Metrics display |
|
||||
| `QuickLinks` | Navigation links |
|
||||
| `Newsletter` | Email signup |
|
||||
| `HeroBanner` | Hero section |
|
||||
| `SocialLinks` | Social icons |
|
||||
| `Copyright` | Copyright text |
|
||||
|
||||
See [Widget Zones](../features/widget-zones.md) for full documentation.
|
||||
|
||||
## Routes
|
||||
|
||||
Map URL patterns to templates:
|
||||
|
||||
```yaml
|
||||
routes:
|
||||
- match: "/docs/**"
|
||||
template: "docs"
|
||||
|
||||
- match: "/docs/changelog"
|
||||
template: "docs"
|
||||
slots:
|
||||
right: null # Override: hide TOC
|
||||
```
|
||||
|
||||
Route matching uses glob patterns:
|
||||
- `*` - Single segment
|
||||
- `**` - Multiple segments
|
||||
|
||||
## Complete Example
|
||||
|
||||
```yaml
|
||||
schemaVersion: 1
|
||||
|
||||
site:
|
||||
title: "PraisonAI Docs"
|
||||
ui: "shadcn"
|
||||
theme:
|
||||
darkMode: true
|
||||
|
||||
content:
|
||||
docs:
|
||||
dir: "./docs"
|
||||
|
||||
components:
|
||||
header:
|
||||
type: "Header"
|
||||
props:
|
||||
logoText: "PraisonAI"
|
||||
|
||||
footer:
|
||||
type: "Footer"
|
||||
props:
|
||||
text: "© 2024 Praison Limited"
|
||||
|
||||
sidebar:
|
||||
type: "DocsSidebar"
|
||||
props:
|
||||
source: "docs-nav"
|
||||
|
||||
templates:
|
||||
docs:
|
||||
layout: "ThreeColumnLayout"
|
||||
slots:
|
||||
header: { ref: "header" }
|
||||
left: { ref: "sidebar" }
|
||||
main: { type: "DocContent" }
|
||||
right: { type: "Toc" }
|
||||
footer: { ref: "footer" }
|
||||
|
||||
routes:
|
||||
- match: "/docs/**"
|
||||
template: "docs"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Runtime Persistence (`config.yaml`)
|
||||
|
||||
> **Single source of truth** for all runtime feature state.
|
||||
|
||||
In addition to `aiui.template.yaml` (which drives static site generation), PraisonAIUI uses a **unified runtime config file** at `~/.praisonaiui/config.yaml`. This file stores all feature state — agents, channels, guardrails, schedules, and runtime settings — in a single YAML file that persists across server restarts.
|
||||
|
||||
This is compatible with the `gateway.yaml` schema used by `praisonai gateway start --config`.
|
||||
|
||||
### Schema
|
||||
|
||||
```yaml
|
||||
# ~/.praisonaiui/config.yaml (auto-generated)
|
||||
schemaVersion: 2
|
||||
|
||||
server:
|
||||
host: "127.0.0.1"
|
||||
port: 8003
|
||||
|
||||
provider:
|
||||
name: "openai"
|
||||
model: "gpt-4o-mini"
|
||||
|
||||
gateway:
|
||||
host: "127.0.0.1"
|
||||
port: 8765
|
||||
|
||||
# Agent definitions (same schema as gateway.yaml)
|
||||
agents:
|
||||
personal:
|
||||
name: "Personal Assistant"
|
||||
instructions: "You are a friendly personal assistant."
|
||||
model: "gpt-4o-mini"
|
||||
tools: ["internet_search"]
|
||||
|
||||
# Messaging channels
|
||||
channels:
|
||||
telegram_bot:
|
||||
name: "My Bot"
|
||||
platform: "telegram"
|
||||
config:
|
||||
bot_token: "${TELEGRAM_BOT_TOKEN}"
|
||||
|
||||
# Runtime configuration (set via /api/config/runtime)
|
||||
runtime_config:
|
||||
model: "gpt-4o"
|
||||
temperature: 0.7
|
||||
|
||||
# Guardrail definitions
|
||||
guardrails:
|
||||
registry:
|
||||
polite_check:
|
||||
description: "Output must be polite"
|
||||
|
||||
# Scheduled jobs
|
||||
schedules:
|
||||
jobs:
|
||||
daily_report:
|
||||
name: "Daily Report"
|
||||
schedule:
|
||||
kind: every
|
||||
every_seconds: 86400
|
||||
```
|
||||
|
||||
### How It Works
|
||||
|
||||
All CRUD operations (dashboard, REST API, CLI) **automatically write back** to this file:
|
||||
|
||||
| Feature | Section | Written On |
|
||||
|---------|---------|------------|
|
||||
| Config Runtime | `runtime_config` | PATCH, PUT, DELETE, apply |
|
||||
| Guardrails | `guardrails` | Register |
|
||||
| Channels | `channels` | Add, update, delete |
|
||||
| Schedules | `schedules` | Add, remove, update |
|
||||
| Agents | `agents` | Create, update, delete |
|
||||
|
||||
- **Atomic writes**: Uses `tempfile` + `os.rename()` to prevent corruption.
|
||||
- **Hot reload**: The [Config Hot-Reload](../features/config-hot-reload.md) feature watches this file for external changes.
|
||||
- **Environment variables**: Use `${ENV_VAR}` syntax for secrets (never stored in plaintext).
|
||||
|
||||
#### Environment Variable vs Config File
|
||||
|
||||
| | Env Variable | Config File |
|
||||
|---|---|---|
|
||||
| **Security** | ✅ Not in source control | ⚠️ Risk of committing secrets to git |
|
||||
| **12-Factor App** | ✅ Standard practice | ❌ Violates config-as-env principle |
|
||||
| **CI/CD** | ✅ Easy to inject per environment | ❌ Needs file management |
|
||||
| **Docker/K8s** | ✅ Native secret support | ❌ Requires volume mounts |
|
||||
| **Multiple envs** | ✅ Different key per env (dev/staging/prod) | ⚠️ Need separate config files |
|
||||
|
||||
**Rule of thumb**: Secrets (API keys, tokens) → environment variables. Preferences (model, theme, branding) → config file.
|
||||
|
||||
- **Custom path**: Set `PRAISONAIUI_CONFIG_PATH` to use a different file location.
|
||||
|
||||
### Relationship to `aiui.template.yaml`
|
||||
|
||||
| File | Purpose | Used By |
|
||||
|------|---------|---------|
|
||||
| `aiui.template.yaml` | Static site layout, components, routes | `aiui build`, `aiui dev` |
|
||||
| `~/.praisonaiui/config.yaml` | Runtime feature state (agents, channels, config) | `aiui run`, dashboard API |
|
||||
| `gateway.yaml` | Subset of `config.yaml` (legacy compatibility) | `praisonai gateway start` |
|
||||
@@ -0,0 +1,135 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
|
||||
<script id="aiui-canonical-url">(function(){var p=location.pathname.replace(/\/+$/, '')||'/';if(p!==location.pathname){history.replaceState(null,'',p+location.search+location.hash);}})();</script>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="PraisonAIUI uses a provider protocol — a simple abstraction that lets you plug in any AI backend." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:locale" content="en_US" />
|
||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
||||
<title>Providers | PraisonAIUI Docs</title>
|
||||
<script>
|
||||
(function(){try{var t=localStorage.getItem('aiui-theme-preference');var d=true;if(t==='dark'||(t==='system'&&matchMedia('(prefers-color-scheme: dark)').matches)||(!t&&d))document.documentElement.classList.add('dark');else if(t==='light')document.documentElement.classList.remove('dark');}catch(e){}})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="/assets/theme.css">
|
||||
<script type="module" crossorigin src="/assets/index.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index.css">
|
||||
<link rel="canonical" href="https://ui.praison.ai/docs/concepts/providers" />
|
||||
<meta property="og:title" content="Providers | PraisonAIUI Docs" />
|
||||
<meta property="og:description" content="PraisonAIUI uses a provider protocol — a simple abstraction that lets you plug in any AI backend." />
|
||||
<meta property="og:url" content="https://ui.praison.ai/docs/concepts/providers" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:image" content="https://ui.praison.ai/icon.svg" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="Providers | PraisonAIUI Docs" />
|
||||
<meta name="twitter:description" content="PraisonAIUI uses a provider protocol — a simple abstraction that lets you plug in any AI backend." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<script type="application/ld+json">{"@context": "https://schema.org", "@type": "TechArticle", "headline": "Providers", "description": "PraisonAIUI uses a provider protocol — a simple abstraction that lets you plug in any AI backend.", "url": "https://ui.praison.ai/docs/concepts/providers", "isPartOf": {"@type": "WebSite", "name": "PraisonAIUI Docs", "url": "https://ui.praison.ai/"}}</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"><noscript><nav aria-label="Documentation"><ul><li><a href="https://ui.praison.ai/docs/health-endpoints">Health Endpoints Guide</a></li><li><a href="https://ui.praison.ai/docs/index">PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/testing">Testing</a></li><li><a href="https://ui.praison.ai/docs/adr">Adr</a></li><li><a href="https://ui.praison.ai/docs/adr/replay-view-clean-room">ADR 0001: PraisonAI Replay view, a clean-room design</a></li><li><a href="https://ui.praison.ai/docs/api">Api</a></li><li><a href="https://ui.praison.ai/docs/api/cli">CLI API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/components">Component API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/features-api">Features REST API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/health">Health API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/python">Python SDK API</a></li><li><a href="https://ui.praison.ai/docs/api/sessions">Sessions API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/testing">API Testing Guide</a></li><li><a href="https://ui.praison.ai/docs/api/typescript">TypeScript SDK Reference</a></li><li><a href="https://ui.praison.ai/docs/concepts">Concepts</a></li><li><a href="https://ui.praison.ai/docs/concepts/architecture">Architecture: AG-UI Protocol vs Gateway Integration</a></li><li><a href="https://ui.praison.ai/docs/concepts/configuration">YAML Configuration</a></li><li><a href="https://ui.praison.ai/docs/concepts/providers">Providers</a></li><li><a href="https://ui.praison.ai/docs/concepts/slots">Slots & Components</a></li><li><a href="https://ui.praison.ai/docs/concepts/templates">Templates & Layouts</a></li><li><a href="https://ui.praison.ai/docs/examples">Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/advanced">Advanced Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/basic">Basic Examples</a></li><li><a href="https://ui.praison.ai/docs/features">Features</a></li><li><a href="https://ui.praison.ai/docs/features/a2ui-canvas">A2UI canvas — agent-driven UI</a></li><li><a href="https://ui.praison.ai/docs/features/agent-ui-host">Agent UI host — modular dashboard shell</a></li><li><a href="https://ui.praison.ai/docs/features/attachments">Chat Attachments</a></li><li><a href="https://ui.praison.ai/docs/features/backend-integration">Backend Integration Contract</a></li><li><a href="https://ui.praison.ai/docs/features/beautifului-integration">BeautifulUI Integration Strategy</a></li><li><a href="https://ui.praison.ai/docs/features/browser-automation">Browser Automation</a></li><li><a href="https://ui.praison.ai/docs/features/channel-chat-bridge">Channel-to-Chat Bridge</a></li><li><a href="https://ui.praison.ai/docs/features/code-execution">Code Execution</a></li><li><a href="https://ui.praison.ai/docs/features/comparison-openclaw">Feature Comparison: PraisonAIUI vs OpenClaw</a></li><li><a href="https://ui.praison.ai/docs/features/config-hot-reload">Config Hot-Reload</a></li><li><a href="https://ui.praison.ai/docs/features/content-sources">Content Sources</a></li><li><a href="https://ui.praison.ai/docs/features/css-architecture">How the UI Looks Are Built</a></li><li><a href="https://ui.praison.ai/docs/features/dark-mode">Dark Mode</a></li><li><a href="https://ui.praison.ai/docs/features/dashboard">Dashboard</a></li><li><a href="https://ui.praison.ai/docs/features/deployment">Deployment Guide</a></li><li><a href="https://ui.praison.ai/docs/features/device-pairing">Device Pairing</a></li><li><a href="https://ui.praison.ai/docs/features/differentiation">What Makes PraisonAIUI Different</a></li><li><a href="https://ui.praison.ai/docs/features/feature-inventory">Feature Inventory</a></li><li><a href="https://ui.praison.ai/docs/features/gap-analysis">Gap Analysis — Validated Against praisonai SDK</a></li><li><a href="https://ui.praison.ai/docs/features/gateway-chat">Gateway Chat</a></li><li><a href="https://ui.praison.ai/docs/features/hot-reload">Hot Reload</a></li><li><a href="https://ui.praison.ai/docs/features/how-to-add-a-feature">How to Add a Feature to PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/features/i18n">Internationalization (i18n)</a></li><li><a href="https://ui.praison.ai/docs/features/image-preview-chat">Image Preview in Chat</a></li><li><a href="https://ui.praison.ai/docs/features/integration-analysis">AIUI Integration — Critical Review & Architecture Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/knowledge-embeddings">Knowledge Embedding Model Configuration</a></li><li><a href="https://ui.praison.ai/docs/features/marketplace">Plugin Marketplace</a></li><li><a href="https://ui.praison.ai/docs/features/media-analysis">Media Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/message-elements">Message Elements</a></li><li><a href="https://ui.praison.ai/docs/features/model-fallback">Model Fallback</a></li><li><a href=Line truncated
|
||||
<p>PraisonAIUI uses a <strong>provider protocol</strong> — a simple abstraction that lets you plug in any AI backend.</p>
|
||||
<h2>Architecture</h2>
|
||||
<p>The provider protocol is the <strong>only contract</strong> between the frontend and any AI backend. All dashboard pages (<code>/api/overview</code>, <code>/api/config</code>, <code>/api/logs</code>, etc.) are provider-agnostic — they always work regardless of which backend is active. The provider only handles agent execution (<code>run()</code>), agent listing (<code>list_agents()</code>), and health checks (<code>health()</code>).</p>
|
||||
<h2>How It Works</h2>
|
||||
<p>1. User sends a message → <code>POST /run</code></p>
|
||||
<p>2. Server calls <code>provider.run(message)</code> on the active provider</p>
|
||||
<p>3. Provider yields <code>RunEvent</code> objects (start, content, tool calls, reasoning, completion)</p>
|
||||
<p>4. Server serialises each <code>RunEvent</code> to an SSE <code>data:</code> frame</p>
|
||||
<p>5. Frontend <code>useSSE.ts</code> parses events and renders components</p>
|
||||
<h2>Built-in Provider: PraisonAI</h2>
|
||||
<p>PraisonAI is the default provider. It wraps the <code>@aiui.reply</code> callback system:</p>
|
||||
<p>No extra config needed — <code>PraisonAIProvider</code> is used automatically.</p>
|
||||
<h3>Agent Tools and Reflection</h3>
|
||||
<p>The default provider resolves tools for agents using <code>ToolResolver</code> from the <code>praisonai</code> package. Agents created via the CRUD API or <code>~/.praisonaiui/config.yaml</code> get their tool names (strings) automatically resolved to callable Python functions:</p>
|
||||
<p>When no tools are configured, the provider gives agents sensible defaults (<code>internet_search</code>).</p>
|
||||
<p>Agents also support <code>reflection: true</code> (default) for self-reflection mode, where the agent evaluates its own response quality before returning.</p>
|
||||
<h2>Swapping Providers</h2>
|
||||
<h2>Writing a Custom Provider</h2>
|
||||
<p>Implement <code>BaseProvider.run()</code> — that's it:</p>
|
||||
<h3>Inline media (images, video, files)</h3>
|
||||
<p>Any provider can attach rich media to chat messages using `<code>MESSAGE_ELEMENT</code>`</p>
|
||||
<p>events. The UI renders them inline and persists them in session history.</p>
|
||||
<p>Tool results from PraisonAI agents are also detected automatically when they</p>
|
||||
<p>match OpenAI image shapes (`<code>{"data": [{"url": "..."}]}</code>`) or explicit element</p>
|
||||
<p>dicts — no provider code required.</p>
|
||||
<p>Callback handlers can use `<code>Message.add_image()</code><code> or </code><code>await aiui.image(url)</code>`</p>
|
||||
<p>and the default `<code>PraisonAIProvider</code><code> maps those to </code><code>MESSAGE_ELEMENT</code>` events.</p>
|
||||
<p>Full architecture, data flows, and tests: Image Preview in Chat.</p>
|
||||
<h3>With Tool Calls and Reasoning</h3>
|
||||
<h2>RunEvent Reference</h2>
|
||||
<p>Every event has a <code>type</code> field and optional payload fields:</p>
|
||||
<p>| Field | Type | Used By |</p>
|
||||
<p>|-------|------|---------|</p>
|
||||
<p>| <code>type</code> | <code>RunEventType</code> | All events |</p>
|
||||
<p>| <code>content</code> | <code>str</code> | <code>RUN_COMPLETED</code>, <code>RUN_CONTENT</code> |</p>
|
||||
<p>| <code>token</code> | <code>str</code> | <code>RUN_CONTENT</code> (streaming) |</p>
|
||||
<p>| <code>name</code> | <code>str</code> | <code>TOOL_CALL_*</code> |</p>
|
||||
<p>| <code>args</code> | <code>dict</code> | <code>TOOL_CALL_STARTED</code> |</p>
|
||||
<p>| <code>result</code> | <code>any</code> | <code>TOOL_CALL_COMPLETED</code> |</p>
|
||||
<p>| <code>step</code> | <code>str</code> | <code>REASONING_STEP</code> |</p>
|
||||
<p>| <code>error</code> | <code>str</code> | <code>RUN_ERROR</code> |</p>
|
||||
<p>| <code>agent_name</code> | <code>str</code> | Multi-agent events |</p>
|
||||
<p>| <code>extra_data</code> | <code>dict</code> | Custom payload (includes <code>element</code> for <code>message_element</code>) |</p>
|
||||
<h3>Event Types (27 total)</h3>
|
||||
<p>=== "Agent Events"</p>
|
||||
<p>| Type | Description |</p>
|
||||
<p>|------|-------------|</p>
|
||||
<p>| <code>run_started</code> | Agent run begins |</p>
|
||||
<p>| <code>run_content</code> | Streaming token or content chunk |</p>
|
||||
<p>| <code>run_completed</code> | Agent run finished |</p>
|
||||
<p>| <code>run_error</code> | Error occurred |</p>
|
||||
<p>| <code>run_cancelled</code> | User cancelled |</p>
|
||||
<p>| <code>tool_call_started</code> | Tool invocation started |</p>
|
||||
<p>| <code>tool_call_completed</code> | Tool returned result |</p>
|
||||
<p>| <code>reasoning_started</code> | Thinking begun |</p>
|
||||
<p>| <code>reasoning_step</code> | Individual reasoning step |</p>
|
||||
<p>| <code>reasoning_completed</code> | Thinking finished |</p>
|
||||
<p>| <code>memory_update_started</code> | Memory write begun |</p>
|
||||
<p>| <code>memory_update_completed</code> | Memory write done |</p>
|
||||
<p>| <code>updating_memory</code> | Memory being updated |</p>
|
||||
<p>| <code>run_paused</code> | Run paused (e.g. waiting for user) |</p>
|
||||
<p>| <code>run_continued</code> | Run resumed |</p>
|
||||
<p>| <code>message_element</code> | Inline media element (image, video, file, etc.) — see Image Preview in Chat |</p>
|
||||
<p>=== "Team Events"</p>
|
||||
<p>| Type | Description |</p>
|
||||
<p>|------|-------------|</p>
|
||||
<p>| <code>team_run_started</code> | Team run begins |</p>
|
||||
<p>| <code>team_run_content</code> | Team streaming content |</p>
|
||||
<p>| <code>team_run_completed</code> | Team run finished |</p>
|
||||
<p>| <code>team_run_error</code> | Team error |</p>
|
||||
<p>| <code>team_run_cancelled</code> | Team cancelled |</p>
|
||||
<p>| <code>team_tool_call_started</code> | Team tool call started |</p>
|
||||
<p>| <code>team_tool_call_completed</code> | Team tool call done |</p>
|
||||
<p>| <code>team_reasoning_started</code> | Team reasoning begun |</p>
|
||||
<p>| <code>team_reasoning_step</code> | Team reasoning step |</p>
|
||||
<p>| <code>team_reasoning_completed</code> | Team reasoning done |</p>
|
||||
<p>| <code>team_memory_update_started</code> | Team memory update started |</p>
|
||||
<p>| <code>team_memory_update_completed</code> | Team memory update done |</p>
|
||||
<h2>API Summary</h2>
|
||||
<h3>`BaseProvider` (abstract)</h3>
|
||||
<p>: Subclass and implement <code>run()</code> to create a custom provider.</p>
|
||||
<p>| Method | Description |</p>
|
||||
<p>|--------|-------------|</p>
|
||||
<p>| <code>run(message, *, session_id, agent_name, <strong>kw)</code> | </strong>Required.** Async generator yielding <code>RunEvent</code> objects |</p>
|
||||
<p>| <code>list_agents()</code> | Optional. Returns list of available agents |</p>
|
||||
<p>| <code>health()</code> | Optional. Returns health check dict |</p>
|
||||
<h3>`RunEvent` (dataclass)</h3>
|
||||
<p>: Structured event with <code>type: RunEventType</code> and optional payload fields (see table above).</p>
|
||||
<li><code>to_dict()</code> → serialise to JSON-compatible dict matching the frontend <code>SSEEvent</code> interface</li>
|
||||
<h3>`RunEventType` (enum)</h3>
|
||||
<p>: 27 string values matching the frontend <code>types.ts</code> — see Agent Events and Team Events tabs above.</p>
|
||||
<h3>Helper Functions</h3>
|
||||
<p>| Function | Description |</p>
|
||||
<p>|----------|-------------|</p>
|
||||
<p>| <code>praisonaiui.set_provider(provider)</code> | Set the active provider |</p>
|
||||
<p>| <code>praisonaiui.get_provider()</code> | Get the active provider (lazy-inits <code>PraisonAIProvider</code>) |</p></noscript></div>
|
||||
<script src="/plugins/plugin-loader.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,255 @@
|
||||
# Providers
|
||||
|
||||
PraisonAIUI uses a **provider protocol** — a simple abstraction that lets you plug in any AI backend.
|
||||
|
||||
## Architecture
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
subgraph "Frontend (React)"
|
||||
UI["Dashboard / Chat / Agents"]
|
||||
SSE["SSE Stream Consumer"]
|
||||
API["REST API Client"]
|
||||
end
|
||||
|
||||
subgraph "Server (server.py)"
|
||||
Routes["/run, /agents, /sessions, /api/*"]
|
||||
Provider["get_provider()"]
|
||||
end
|
||||
|
||||
subgraph "Provider Protocol (BaseProvider)"
|
||||
direction LR
|
||||
Run["run() → AsyncIterator[RunEvent]"]
|
||||
List["list_agents() → List[dict]"]
|
||||
Health["health() → dict"]
|
||||
end
|
||||
|
||||
subgraph "Pluggable Backends"
|
||||
P1["PraisonAIProvider (default)"]
|
||||
P2["OpenClawProvider"]
|
||||
P3["LangChainProvider"]
|
||||
P4["Custom Provider"]
|
||||
end
|
||||
|
||||
UI --> API --> Routes --> Provider
|
||||
SSE --> Routes
|
||||
Provider --> Run
|
||||
Provider --> List
|
||||
Provider --> Health
|
||||
Run --> P1 & P2 & P3 & P4
|
||||
```
|
||||
|
||||
The provider protocol is the **only contract** between the frontend and any AI backend. All dashboard pages (`/api/overview`, `/api/config`, `/api/logs`, etc.) are provider-agnostic — they always work regardless of which backend is active. The provider only handles agent execution (`run()`), agent listing (`list_agents()`), and health checks (`health()`).
|
||||
|
||||
## How It Works
|
||||
|
||||
1. User sends a message → `POST /run`
|
||||
2. Server calls `provider.run(message)` on the active provider
|
||||
3. Provider yields `RunEvent` objects (start, content, tool calls, reasoning, completion)
|
||||
4. Server serialises each `RunEvent` to an SSE `data:` frame
|
||||
5. Frontend `useSSE.ts` parses events and renders components
|
||||
|
||||
## Built-in Provider: PraisonAI
|
||||
|
||||
PraisonAI is the default provider. It wraps the `@aiui.reply` callback system:
|
||||
|
||||
```python
|
||||
import praisonaiui as aiui
|
||||
|
||||
@aiui.reply
|
||||
async def on_message(message: str):
|
||||
# Your AI logic here — PraisonAIProvider handles the rest
|
||||
await aiui.say("Hello!")
|
||||
```
|
||||
|
||||
No extra config needed — `PraisonAIProvider` is used automatically.
|
||||
|
||||
### Agent Tools and Reflection
|
||||
|
||||
The default provider resolves tools for agents using `ToolResolver` from the `praisonai` package. Agents created via the CRUD API or `~/.praisonaiui/config.yaml` get their tool names (strings) automatically resolved to callable Python functions:
|
||||
|
||||
```python
|
||||
# Agent definition with tools (via CRUD API or YAML):
|
||||
# tools: ["internet_search", "wikipedia_search"]
|
||||
#
|
||||
# ToolResolver resolves these names from 4 sources:
|
||||
# 1. Local tools.py file
|
||||
# 2. praisonaiagents.tools.TOOL_MAPPINGS (built-in)
|
||||
# 3. praisonai_tools package (community)
|
||||
# 4. Tool registry (programmatic)
|
||||
```
|
||||
|
||||
When no tools are configured, the provider gives agents sensible defaults (`internet_search`).
|
||||
|
||||
Agents also support `reflection: true` (default) for self-reflection mode, where the agent evaluates its own response quality before returning.
|
||||
|
||||
## Swapping Providers
|
||||
|
||||
```python
|
||||
import praisonaiui as aiui
|
||||
|
||||
# Use a custom provider:
|
||||
aiui.set_provider(MyCustomProvider())
|
||||
```
|
||||
|
||||
## Writing a Custom Provider
|
||||
|
||||
Implement `BaseProvider.run()` — that's it:
|
||||
|
||||
```python
|
||||
from praisonaiui.provider import BaseProvider, RunEvent, RunEventType
|
||||
|
||||
class EchoProvider(BaseProvider):
|
||||
"""Echoes messages back — minimal example."""
|
||||
|
||||
async def run(self, message, *, session_id=None, agent_name=None, **kw):
|
||||
yield RunEvent(type=RunEventType.RUN_STARTED)
|
||||
yield RunEvent(type=RunEventType.RUN_CONTENT, token=f"Echo: {message}")
|
||||
yield RunEvent(type=RunEventType.RUN_COMPLETED, content=f"Echo: {message}")
|
||||
```
|
||||
|
||||
### Inline media (images, video, files)
|
||||
|
||||
Any provider can attach rich media to chat messages using ``MESSAGE_ELEMENT``
|
||||
events. The UI renders them inline and persists them in session history.
|
||||
|
||||
```python
|
||||
class ImageProvider(BaseProvider):
|
||||
async def run(self, message, *, session_id=None, agent_name=None, **kw):
|
||||
yield RunEvent(type=RunEventType.RUN_STARTED)
|
||||
# ... call your image API (OpenAI, Stability, custom, etc.) ...
|
||||
image_url = "https://example.com/generated.png"
|
||||
yield BaseProvider.message_element_event({
|
||||
"type": "image",
|
||||
"url": image_url,
|
||||
"alt": "Generated image",
|
||||
})
|
||||
yield RunEvent(type=RunEventType.RUN_COMPLETED, content="Here is your image.")
|
||||
```
|
||||
|
||||
Tool results from PraisonAI agents are also detected automatically when they
|
||||
match OpenAI image shapes (``{"data": [{"url": "..."}]}``) or explicit element
|
||||
dicts — no provider code required.
|
||||
|
||||
Callback handlers can use ``Message.add_image()`` or ``await aiui.image(url)``
|
||||
and the default ``PraisonAIProvider`` maps those to ``MESSAGE_ELEMENT`` events.
|
||||
|
||||
Full architecture, data flows, and tests: [Image Preview in Chat](../features/image-preview-chat.md).
|
||||
|
||||
### With Tool Calls and Reasoning
|
||||
|
||||
```python
|
||||
class SmartProvider(BaseProvider):
|
||||
async def run(self, message, **kw):
|
||||
yield RunEvent(type=RunEventType.RUN_STARTED)
|
||||
|
||||
# Emit reasoning steps (shown in ThinkingSteps component)
|
||||
yield RunEvent(type=RunEventType.REASONING_STARTED)
|
||||
yield RunEvent(type=RunEventType.REASONING_STEP, step="Analyzing the question...")
|
||||
yield RunEvent(type=RunEventType.REASONING_STEP, step="Searching knowledge base...")
|
||||
yield RunEvent(type=RunEventType.REASONING_COMPLETED)
|
||||
|
||||
# Emit tool calls (shown in ToolCallDisplay component)
|
||||
yield RunEvent(
|
||||
type=RunEventType.TOOL_CALL_STARTED,
|
||||
name="web_search",
|
||||
args={"query": message},
|
||||
)
|
||||
yield RunEvent(
|
||||
type=RunEventType.TOOL_CALL_COMPLETED,
|
||||
name="web_search",
|
||||
result={"results": ["Found relevant info"]},
|
||||
)
|
||||
|
||||
# Stream the response token by token
|
||||
for word in "Here is the answer".split():
|
||||
yield RunEvent(type=RunEventType.RUN_CONTENT, token=word + " ")
|
||||
|
||||
yield RunEvent(type=RunEventType.RUN_COMPLETED, content="Here is the answer")
|
||||
```
|
||||
|
||||
## RunEvent Reference
|
||||
|
||||
Every event has a `type` field and optional payload fields:
|
||||
|
||||
| Field | Type | Used By |
|
||||
|-------|------|---------|
|
||||
| `type` | `RunEventType` | All events |
|
||||
| `content` | `str` | `RUN_COMPLETED`, `RUN_CONTENT` |
|
||||
| `token` | `str` | `RUN_CONTENT` (streaming) |
|
||||
| `name` | `str` | `TOOL_CALL_*` |
|
||||
| `args` | `dict` | `TOOL_CALL_STARTED` |
|
||||
| `result` | `any` | `TOOL_CALL_COMPLETED` |
|
||||
| `step` | `str` | `REASONING_STEP` |
|
||||
| `error` | `str` | `RUN_ERROR` |
|
||||
| `agent_name` | `str` | Multi-agent events |
|
||||
| `extra_data` | `dict` | Custom payload (includes `element` for `message_element`) |
|
||||
|
||||
### Event Types (27 total)
|
||||
|
||||
=== "Agent Events"
|
||||
|
||||
| Type | Description |
|
||||
|------|-------------|
|
||||
| `run_started` | Agent run begins |
|
||||
| `run_content` | Streaming token or content chunk |
|
||||
| `run_completed` | Agent run finished |
|
||||
| `run_error` | Error occurred |
|
||||
| `run_cancelled` | User cancelled |
|
||||
| `tool_call_started` | Tool invocation started |
|
||||
| `tool_call_completed` | Tool returned result |
|
||||
| `reasoning_started` | Thinking begun |
|
||||
| `reasoning_step` | Individual reasoning step |
|
||||
| `reasoning_completed` | Thinking finished |
|
||||
| `memory_update_started` | Memory write begun |
|
||||
| `memory_update_completed` | Memory write done |
|
||||
| `updating_memory` | Memory being updated |
|
||||
| `run_paused` | Run paused (e.g. waiting for user) |
|
||||
| `run_continued` | Run resumed |
|
||||
| `message_element` | Inline media element (image, video, file, etc.) — see [Image Preview in Chat](../features/image-preview-chat.md) |
|
||||
|
||||
=== "Team Events"
|
||||
|
||||
| Type | Description |
|
||||
|------|-------------|
|
||||
| `team_run_started` | Team run begins |
|
||||
| `team_run_content` | Team streaming content |
|
||||
| `team_run_completed` | Team run finished |
|
||||
| `team_run_error` | Team error |
|
||||
| `team_run_cancelled` | Team cancelled |
|
||||
| `team_tool_call_started` | Team tool call started |
|
||||
| `team_tool_call_completed` | Team tool call done |
|
||||
| `team_reasoning_started` | Team reasoning begun |
|
||||
| `team_reasoning_step` | Team reasoning step |
|
||||
| `team_reasoning_completed` | Team reasoning done |
|
||||
| `team_memory_update_started` | Team memory update started |
|
||||
| `team_memory_update_completed` | Team memory update done |
|
||||
|
||||
## API Summary
|
||||
|
||||
### `BaseProvider` (abstract)
|
||||
|
||||
: Subclass and implement `run()` to create a custom provider.
|
||||
|
||||
| Method | Description |
|
||||
|--------|-------------|
|
||||
| `run(message, *, session_id, agent_name, **kw)` | **Required.** Async generator yielding `RunEvent` objects |
|
||||
| `list_agents()` | Optional. Returns list of available agents |
|
||||
| `health()` | Optional. Returns health check dict |
|
||||
|
||||
### `RunEvent` (dataclass)
|
||||
|
||||
: Structured event with `type: RunEventType` and optional payload fields (see table above).
|
||||
|
||||
- `to_dict()` → serialise to JSON-compatible dict matching the frontend `SSEEvent` interface
|
||||
|
||||
### `RunEventType` (enum)
|
||||
|
||||
: 27 string values matching the frontend `types.ts` — see Agent Events and Team Events tabs above.
|
||||
|
||||
### Helper Functions
|
||||
|
||||
| Function | Description |
|
||||
|----------|-------------|
|
||||
| `praisonaiui.set_provider(provider)` | Set the active provider |
|
||||
| `praisonaiui.get_provider()` | Get the active provider (lazy-inits `PraisonAIProvider`) |
|
||||
@@ -0,0 +1,55 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
|
||||
<script id="aiui-canonical-url">(function(){var p=location.pathname.replace(/\/+$/, '')||'/';if(p!==location.pathname){history.replaceState(null,'',p+location.search+location.hash);}})();</script>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="Understanding the slot system and built-in components." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:locale" content="en_US" />
|
||||
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
|
||||
<title>Slots & Components | PraisonAIUI Docs</title>
|
||||
<script>
|
||||
(function(){try{var t=localStorage.getItem('aiui-theme-preference');var d=true;if(t==='dark'||(t==='system'&&matchMedia('(prefers-color-scheme: dark)').matches)||(!t&&d))document.documentElement.classList.add('dark');else if(t==='light')document.documentElement.classList.remove('dark');}catch(e){}})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="/assets/theme.css">
|
||||
<script type="module" crossorigin src="/assets/index.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index.css">
|
||||
<link rel="canonical" href="https://ui.praison.ai/docs/concepts/slots" />
|
||||
<meta property="og:title" content="Slots & Components | PraisonAIUI Docs" />
|
||||
<meta property="og:description" content="Understanding the slot system and built-in components." />
|
||||
<meta property="og:url" content="https://ui.praison.ai/docs/concepts/slots" />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:image" content="https://ui.praison.ai/icon.svg" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="Slots & Components | PraisonAIUI Docs" />
|
||||
<meta name="twitter:description" content="Understanding the slot system and built-in components." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<script type="application/ld+json">{"@context": "https://schema.org", "@type": "TechArticle", "headline": "Slots & Components", "description": "Understanding the slot system and built-in components.", "url": "https://ui.praison.ai/docs/concepts/slots", "isPartOf": {"@type": "WebSite", "name": "PraisonAIUI Docs", "url": "https://ui.praison.ai/"}}</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"><noscript><nav aria-label="Documentation"><ul><li><a href="https://ui.praison.ai/docs/health-endpoints">Health Endpoints Guide</a></li><li><a href="https://ui.praison.ai/docs/index">PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/testing">Testing</a></li><li><a href="https://ui.praison.ai/docs/adr">Adr</a></li><li><a href="https://ui.praison.ai/docs/adr/replay-view-clean-room">ADR 0001: PraisonAI Replay view, a clean-room design</a></li><li><a href="https://ui.praison.ai/docs/api">Api</a></li><li><a href="https://ui.praison.ai/docs/api/cli">CLI API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/components">Component API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/features-api">Features REST API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/health">Health API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/python">Python SDK API</a></li><li><a href="https://ui.praison.ai/docs/api/sessions">Sessions API Reference</a></li><li><a href="https://ui.praison.ai/docs/api/testing">API Testing Guide</a></li><li><a href="https://ui.praison.ai/docs/api/typescript">TypeScript SDK Reference</a></li><li><a href="https://ui.praison.ai/docs/concepts">Concepts</a></li><li><a href="https://ui.praison.ai/docs/concepts/architecture">Architecture: AG-UI Protocol vs Gateway Integration</a></li><li><a href="https://ui.praison.ai/docs/concepts/configuration">YAML Configuration</a></li><li><a href="https://ui.praison.ai/docs/concepts/providers">Providers</a></li><li><a href="https://ui.praison.ai/docs/concepts/slots">Slots & Components</a></li><li><a href="https://ui.praison.ai/docs/concepts/templates">Templates & Layouts</a></li><li><a href="https://ui.praison.ai/docs/examples">Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/advanced">Advanced Examples</a></li><li><a href="https://ui.praison.ai/docs/examples/basic">Basic Examples</a></li><li><a href="https://ui.praison.ai/docs/features">Features</a></li><li><a href="https://ui.praison.ai/docs/features/a2ui-canvas">A2UI canvas — agent-driven UI</a></li><li><a href="https://ui.praison.ai/docs/features/agent-ui-host">Agent UI host — modular dashboard shell</a></li><li><a href="https://ui.praison.ai/docs/features/attachments">Chat Attachments</a></li><li><a href="https://ui.praison.ai/docs/features/backend-integration">Backend Integration Contract</a></li><li><a href="https://ui.praison.ai/docs/features/beautifului-integration">BeautifulUI Integration Strategy</a></li><li><a href="https://ui.praison.ai/docs/features/browser-automation">Browser Automation</a></li><li><a href="https://ui.praison.ai/docs/features/channel-chat-bridge">Channel-to-Chat Bridge</a></li><li><a href="https://ui.praison.ai/docs/features/code-execution">Code Execution</a></li><li><a href="https://ui.praison.ai/docs/features/comparison-openclaw">Feature Comparison: PraisonAIUI vs OpenClaw</a></li><li><a href="https://ui.praison.ai/docs/features/config-hot-reload">Config Hot-Reload</a></li><li><a href="https://ui.praison.ai/docs/features/content-sources">Content Sources</a></li><li><a href="https://ui.praison.ai/docs/features/css-architecture">How the UI Looks Are Built</a></li><li><a href="https://ui.praison.ai/docs/features/dark-mode">Dark Mode</a></li><li><a href="https://ui.praison.ai/docs/features/dashboard">Dashboard</a></li><li><a href="https://ui.praison.ai/docs/features/deployment">Deployment Guide</a></li><li><a href="https://ui.praison.ai/docs/features/device-pairing">Device Pairing</a></li><li><a href="https://ui.praison.ai/docs/features/differentiation">What Makes PraisonAIUI Different</a></li><li><a href="https://ui.praison.ai/docs/features/feature-inventory">Feature Inventory</a></li><li><a href="https://ui.praison.ai/docs/features/gap-analysis">Gap Analysis — Validated Against praisonai SDK</a></li><li><a href="https://ui.praison.ai/docs/features/gateway-chat">Gateway Chat</a></li><li><a href="https://ui.praison.ai/docs/features/hot-reload">Hot Reload</a></li><li><a href="https://ui.praison.ai/docs/features/how-to-add-a-feature">How to Add a Feature to PraisonAIUI</a></li><li><a href="https://ui.praison.ai/docs/features/i18n">Internationalization (i18n)</a></li><li><a href="https://ui.praison.ai/docs/features/image-preview-chat">Image Preview in Chat</a></li><li><a href="https://ui.praison.ai/docs/features/integration-analysis">AIUI Integration — Critical Review & Architecture Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/knowledge-embeddings">Knowledge Embedding Model Configuration</a></li><li><a href="https://ui.praison.ai/docs/features/marketplace">Plugin Marketplace</a></li><li><a href="https://ui.praison.ai/docs/features/media-analysis">Media Analysis</a></li><li><a href="https://ui.praison.ai/docs/features/message-elements">Message Elements</a></li><li><a href="https://ui.praison.ai/docs/features/model-fallback">Model Fallback</a></li><li><a href=Line truncated
|
||||
<p>Understanding the slot system and built-in components.</p>
|
||||
<h2>Slot System</h2>
|
||||
<p>Slots are named insertion points in layouts. Each template assigns components to slots:</p>
|
||||
<h2>Built-in Components</h2>
|
||||
<h3>Header</h3>
|
||||
<p>Site header with logo, navigation, and CTA.</p>
|
||||
<h3>Footer</h3>
|
||||
<p>Site footer with links and copyright.</p>
|
||||
<h3>DocsSidebar</h3>
|
||||
<p>Documentation navigation sidebar.</p>
|
||||
<h3>Toc</h3>
|
||||
<p>Table of contents for the current page.</p>
|
||||
<h3>DocContent</h3>
|
||||
<p>Renders the markdown content for the current page.</p>
|
||||
<h2>Custom Components</h2>
|
||||
<p>Override built-in components using the TypeScript SDK:</p></noscript></div>
|
||||
<script src="/plugins/plugin-loader.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,99 @@
|
||||
# Slots & Components
|
||||
|
||||
Understanding the slot system and built-in components.
|
||||
|
||||
## Slot System
|
||||
|
||||
Slots are named insertion points in layouts. Each template assigns components to slots:
|
||||
|
||||
```yaml
|
||||
templates:
|
||||
docs:
|
||||
layout: "ThreeColumnLayout"
|
||||
slots:
|
||||
header: { ref: "main_header" }
|
||||
left: { type: "DocsSidebar" }
|
||||
main: { type: "DocContent" }
|
||||
right: { type: "Toc" }
|
||||
footer: { ref: "main_footer" }
|
||||
```
|
||||
|
||||
## Built-in Components
|
||||
|
||||
### Header
|
||||
|
||||
Site header with logo, navigation, and CTA.
|
||||
|
||||
```yaml
|
||||
components:
|
||||
my_header:
|
||||
type: "Header"
|
||||
props:
|
||||
logoText: "My Site"
|
||||
logoHref: "/"
|
||||
links:
|
||||
- label: "Docs"
|
||||
href: "/docs"
|
||||
- label: "Blog"
|
||||
href: "/blog"
|
||||
cta:
|
||||
label: "Get Started"
|
||||
href: "/docs/quickstart"
|
||||
```
|
||||
|
||||
### Footer
|
||||
|
||||
Site footer with links and copyright.
|
||||
|
||||
```yaml
|
||||
components:
|
||||
my_footer:
|
||||
type: "Footer"
|
||||
props:
|
||||
text: "© 2024 My Company"
|
||||
links:
|
||||
- label: "GitHub"
|
||||
href: "https://github.com"
|
||||
```
|
||||
|
||||
### DocsSidebar
|
||||
|
||||
Documentation navigation sidebar.
|
||||
|
||||
```yaml
|
||||
components:
|
||||
sidebar:
|
||||
type: "DocsSidebar"
|
||||
props:
|
||||
source: "docs-nav" # Uses generated navigation
|
||||
collapsible: true
|
||||
searchable: true
|
||||
```
|
||||
|
||||
### Toc
|
||||
|
||||
Table of contents for the current page.
|
||||
|
||||
```yaml
|
||||
slots:
|
||||
right: { type: "Toc" }
|
||||
```
|
||||
|
||||
### DocContent
|
||||
|
||||
Renders the markdown content for the current page.
|
||||
|
||||
```yaml
|
||||
slots:
|
||||
main: { type: "DocContent" }
|
||||
```
|
||||
|
||||
## Custom Components
|
||||
|
||||
Override built-in components using the TypeScript SDK:
|
||||
|
||||
```typescript
|
||||
import { SlotRegistry } from 'praisonaiui/runtime';
|
||||
|
||||
SlotRegistry.register('Header', MyCustomHeader);
|
||||
```
|
||||
Loaded 100 of 284 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user